summaryrefslogtreecommitdiff
path: root/vcl/headless
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-01-13 10:42:43 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-01-18 11:34:09 +0000
commit8e98c722e196801d7398c413f7156b5566b05161 (patch)
tree88d2210e6b651e46654a16decf89fb0f9f2f2b47 /vcl/headless
parente1d1f92eb90d4ed9f2c4123dc33e473a67497734 (diff)
svp: implement getBitmap via cairo
Change-Id: Ica3220c6932143726bb3fa813541e14f36b22e8d
Diffstat (limited to 'vcl/headless')
-rw-r--r--vcl/headless/svpgdi.cxx23
1 files changed, 11 insertions, 12 deletions
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 2ab29b142917..fbeea4e89d8d 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -1259,21 +1259,20 @@ void SvpSalGraphics::drawMask( const SalTwoRect& rPosAry,
SalBitmap* SvpSalGraphics::getBitmap( long nX, long nY, long nWidth, long nHeight )
{
- SvpSalBitmap* pBitmap = new SvpSalBitmap();
+ basegfx::B2IVector aSize(nWidth, nHeight);
+ basebmp::BitmapDeviceSharedPtr aCopy = createBitmapDevice(aSize, true, SVP_CAIRO_FORMAT);
- if (m_aOrigDevice)
- {
- basebmp::BitmapDeviceSharedPtr aCopy;
- aCopy = cloneBitmapDevice(basegfx::B2IVector(nWidth, nHeight),
- m_aOrigDevice);
- basegfx::B2IVector size = aCopy->getSize();
- basegfx::B2IBox aSrcRect( nX, nY, nX+nWidth, nY+nHeight );
- basegfx::B2IBox aDestRect( 0, 0, nWidth, nHeight );
+ cairo_t* cr = SvpSalGraphics::createCairoContext(aCopy);
+
+ cairo_surface_t *source = createCairoSurface(m_aOrigDevice);
+ SalTwoRect aTR(nX, nY, nWidth, nHeight, 0, 0, nWidth, nHeight);
+ renderSource(cr, aTR, source);
+ cairo_surface_destroy(source);
- aCopy->drawBitmap( m_aOrigDevice, aSrcRect, aDestRect, basebmp::DrawMode::Paint );
+ cairo_destroy(cr);
- pBitmap->setBitmap( aCopy );
- }
+ SvpSalBitmap* pBitmap = new SvpSalBitmap();
+ pBitmap->setBitmap(aCopy);
return pBitmap;
}