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/svpvd.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/svpvd.cxx')
-rw-r--r-- | vcl/headless/svpvd.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/vcl/headless/svpvd.cxx b/vcl/headless/svpvd.cxx index e2f9042d9edb..84701eb6c459 100644 --- a/vcl/headless/svpvd.cxx +++ b/vcl/headless/svpvd.cxx @@ -69,19 +69,21 @@ bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY, SvpSalInstance* pInst = SvpSalInstance::s_pDefaultInstance; assert( pInst ); basebmp::Format nFormat = pInst->getFormatForBitCount( m_nBitCount ); + sal_Int32 nStride = basebmp::getBitmapDeviceStrideForWidth(nFormat, aDevSize.getX()); if ( m_nBitCount == 1 ) { std::vector< basebmp::Color > aDevPal(2); aDevPal.push_back( basebmp::Color( 0, 0, 0 ) ); aDevPal.push_back( basebmp::Color( 0xff, 0xff, 0xff ) ); - m_aDevice = createBitmapDevice( aDevSize, bTopDown, nFormat, PaletteMemorySharedVector( new std::vector< basebmp::Color >(aDevPal) ) ); + m_aDevice = createBitmapDevice( aDevSize, bTopDown, nFormat, nStride, + PaletteMemorySharedVector( new std::vector< basebmp::Color >(aDevPal) ) ); } else { m_aDevice = pBuffer ? - createBitmapDevice( aDevSize, bTopDown, nFormat, pBuffer, PaletteMemorySharedVector() ) - : createBitmapDevice( aDevSize, bTopDown, nFormat ); + createBitmapDevice( aDevSize, bTopDown, nFormat, nStride, pBuffer, PaletteMemorySharedVector() ) + : createBitmapDevice( aDevSize, bTopDown, nFormat, nStride ); } // update device in existing graphics |