diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-02-24 17:19:43 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-02-24 18:38:11 +0000 |
commit | efe28833d484e6c59ce928e4218a07752262c5e9 (patch) | |
tree | f192cf333e674d8970ff739481f788f83b354f4c /vcl/headless/svpbmp.cxx | |
parent | 28f909df366d731ee0684d0608e5a00dcf70181c (diff) |
make ScanlineStride an argument to createBitmapDevice
so we could create bitmap devices that have the same stride that cairo expects,
provide getBitmapDeviceStrideForWidth to get a default value
Change-Id: I7ecc6f54a734b3f6bed59c699ac3b482c4ad7c47
Diffstat (limited to 'vcl/headless/svpbmp.cxx')
-rw-r--r-- | vcl/headless/svpbmp.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx index bc2b2b90d8b8..cedb9751a025 100644 --- a/vcl/headless/svpbmp.cxx +++ b/vcl/headless/svpbmp.cxx @@ -52,8 +52,9 @@ bool SvpSalBitmap::Create( const Size& rSize, aSize.setX( 1 ); if( aSize.getY() == 0 ) aSize.setY( 1 ); + sal_Int32 nStride = getBitmapDeviceStrideForWidth(nFormat, aSize.getX()); if( nBitCount > 8 ) - m_aBitmap = createBitmapDevice( aSize, false, nFormat ); + m_aBitmap = createBitmapDevice( aSize, false, nFormat, nStride ); else { // prepare palette @@ -66,7 +67,7 @@ bool SvpSalBitmap::Create( const Size& rSize, const BitmapColor& rCol = rPalette[i]; (*pPalette)[i] = basebmp::Color( rCol.GetRed(), rCol.GetGreen(), rCol.GetBlue() ); } - m_aBitmap = createBitmapDevice( aSize, false, nFormat, + m_aBitmap = createBitmapDevice( aSize, false, nFormat, nStride, basebmp::RawMemorySharedArray(), basebmp::PaletteMemorySharedVector( pPalette ) ); @@ -326,6 +327,7 @@ void SvpSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, BitmapAccessMode nMode m_aBitmap = basebmp::createBitmapDevice( m_aBitmap->getSize(), m_aBitmap->isTopDown(), m_aBitmap->getScanlineFormat(), + m_aBitmap->getScanlineStride(), m_aBitmap->getBuffer(), pPal ); } |