diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-01-12 10:09:06 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-01-18 11:34:08 +0000 |
commit | cc6562706f7284dac5d18d6509221674335fbe5d (patch) | |
tree | e929bd9f834bd083bd47117471e27a7d747400cc /vcl | |
parent | 50c2d561981d99abad9978811655365ff9884c87 (diff) |
svp: route copyBits through cairo
Change-Id: I9521f7fecc59197efb17526a365cf4c9b259975f
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/headless/svpgdi.cxx | 61 | ||||
-rw-r--r-- | vcl/inc/headless/svpgdi.hxx | 1 |
2 files changed, 33 insertions, 29 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 3a5bccb40a31..f9c5d7b9bc01 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -1090,36 +1090,9 @@ void SvpSalGraphics::copyArea( long nDestX, dbgOut( m_aDevice ); } -void SvpSalGraphics::copyBits( const SalTwoRect& rPosAry, - SalGraphics* pSrcGraphics ) +void SvpSalGraphics::copySource( const SalTwoRect& rTR, + cairo_surface_t* source ) { - if( !m_aDevice.get() ) - return; - - SvpSalGraphics* pSrc = pSrcGraphics ? - static_cast<SvpSalGraphics*>(pSrcGraphics) : this; - basegfx::B2IBox aSrcRect( rPosAry.mnSrcX, rPosAry.mnSrcY, - rPosAry.mnSrcX+rPosAry.mnSrcWidth, - rPosAry.mnSrcY+rPosAry.mnSrcHeight ); - basegfx::B2IBox aDestRect( rPosAry.mnDestX, rPosAry.mnDestY, - rPosAry.mnDestX+rPosAry.mnDestWidth, - rPosAry.mnDestY+rPosAry.mnDestHeight ); - - SvpSalGraphics::ClipUndoHandle aUndo( this ); - if( !isClippedSetup( aDestRect, aUndo ) ) - m_aDevice->drawBitmap( pSrc->m_aOrigDevice, aSrcRect, aDestRect, basebmp::DrawMode::Paint, m_aClipMap ); - dbgOut( m_aDevice ); -} - -void SvpSalGraphics::drawBitmap(const SalTwoRect& rTR, const SalBitmap& rSourceBitmap) -{ - SourceHelper aSurface(rSourceBitmap); - cairo_surface_t* source = aSurface.getSurface(); - if (!source) - { - SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawAlphaBitmap case"); - } - cairo_t* cr = getCairoContext(false); assert(cr && m_aDevice->isTopDown()); clipRegion(cr); @@ -1138,6 +1111,36 @@ void SvpSalGraphics::drawBitmap(const SalTwoRect& rTR, const SalBitmap& rSourceB releaseCairoContext(cr, false, extents); } +void SvpSalGraphics::copyBits( const SalTwoRect& rTR, + SalGraphics* pSrcGraphics ) +{ + SvpSalGraphics* pSrc = pSrcGraphics ? + static_cast<SvpSalGraphics*>(pSrcGraphics) : this; + + cairo_surface_t* source = SvpSalGraphics::createCairoSurface(pSrc->m_aOrigDevice); + if (!source) + { + SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawBitmap case"); + return; + } + + copySource(rTR, source); + + cairo_surface_destroy(source); +} + +void SvpSalGraphics::drawBitmap(const SalTwoRect& rTR, const SalBitmap& rSourceBitmap) +{ + SourceHelper aSurface(rSourceBitmap); + cairo_surface_t* source = aSurface.getSurface(); + if (!source) + { + SAL_WARN("vcl.gdi", "unsupported SvpSalGraphics::drawBitmap case"); + } + + copySource(rTR, source); +} + void SvpSalGraphics::drawBitmap( const SalTwoRect& rPosAry, const SalBitmap& rSalBitmap, const SalBitmap& rTransparentBitmap ) diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index ca9b5ba02bd2..391a6c483d34 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -82,6 +82,7 @@ private: bool isClippedSetup( const basegfx::B2IBox &aRange, ClipUndoHandle &rUndo ); void ensureClip(); void invert(const basegfx::B2DPolygon &rPoly, SalInvert nFlags); + void copySource(const SalTwoRect& rTR, cairo_surface_t* source); protected: vcl::Region m_aClipRegion; SvpCairoTextRender m_aTextRenderImpl; |