summaryrefslogtreecommitdiff
path: root/vcl/headless
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-01-12 10:09:06 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-01-18 11:34:08 +0000
commitcc6562706f7284dac5d18d6509221674335fbe5d (patch)
treee929bd9f834bd083bd47117471e27a7d747400cc /vcl/headless
parent50c2d561981d99abad9978811655365ff9884c87 (diff)
svp: route copyBits through cairo
Change-Id: I9521f7fecc59197efb17526a365cf4c9b259975f
Diffstat (limited to 'vcl/headless')
-rw-r--r--vcl/headless/svpgdi.cxx61
1 files changed, 32 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 )