diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-01-11 11:55:21 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-01-18 11:34:07 +0000 |
commit | a70b2083c437cd041f650ad6d21612b49041b10b (patch) | |
tree | 9a4105db47566425257c43a1faa28e6b70f9b628 /vcl/headless | |
parent | 31a329e79aaea5d59e1bf23c9bd1c23a99d7b7ec (diff) |
svp: draw rectangles with cairo where possible
Change-Id: I34f09344e219723f87956a97db0a03023882ea7d
Diffstat (limited to 'vcl/headless')
-rw-r--r-- | vcl/headless/svpgdi.cxx | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 4d1e83ad0263..62352999ebd4 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -802,6 +802,38 @@ void SvpSalGraphics::drawLine( long nX1, long nY1, long nX2, long nY2 ) void SvpSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight ) { + if (m_ePaintMode != XOR) + { + // because of the -1 hack we have to do fill and draw separately + bool bOrigUseFillColor = m_bUseFillColor; + bool bOrigUseLineColor = m_bUseLineColor; + m_bUseFillColor = false; + m_bUseLineColor = false; + + if (bOrigUseFillColor) + { + basegfx::B2DPolygon aRect = basegfx::tools::createPolygonFromRect(basegfx::B2DRectangle(nX, nY, nX+nWidth, nY+nHeight)); + m_bUseFillColor = true; + drawPolyPolygon(basegfx::B2DPolyPolygon(aRect), 0); + m_bUseFillColor = false; + } + + if (bOrigUseLineColor) + { + // need same -1 hack as X11SalGraphicsImpl::drawRect + basegfx::B2DPolygon aRect = basegfx::tools::createPolygonFromRect(basegfx::B2DRectangle( nX, nY, nX+nWidth-1, nY+nHeight-1)); + m_bUseLineColor = true; + drawPolyPolygon(basegfx::B2DPolyPolygon(aRect), 0); + m_bUseLineColor = false; + } + + m_bUseFillColor = bOrigUseFillColor; + m_bUseLineColor = bOrigUseLineColor; + return; + } + + SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawRect case"); + if ((m_bUseLineColor || m_bUseFillColor) && m_aDevice) { ensureClip(); // FIXME: for ... |