From e52566c36c2c57f067b5664c41f6941159d6e298 Mon Sep 17 00:00:00 2001 From: Ivo Hinkelmann Date: Mon, 15 Jun 2009 12:41:42 +0000 Subject: CWS-TOOLING: integrate CWS svp02_DEV300 2009-04-29 16:59:46 +0200 pl r271386 : #159621# defined palette for 1 bit VDevs --- vcl/unx/headless/svpvd.cxx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/vcl/unx/headless/svpvd.cxx b/vcl/unx/headless/svpvd.cxx index 2d7342093e47..3f48584036f6 100644 --- a/vcl/unx/headless/svpvd.cxx +++ b/vcl/unx/headless/svpvd.cxx @@ -65,9 +65,14 @@ BOOL SvpSalVirtualDevice::SetSize( long nNewDX, long nNewDY ) if( ! m_aDevice.get() || m_aDevice->getSize() != aDevSize ) { sal_uInt32 nFormat = SVP_DEFAULT_BITMAP_FORMAT; + std::vector< basebmp::Color > aDevPal; switch( m_nBitCount ) { - case 1: nFormat = Format::ONE_BIT_MSB_PAL; break; + case 1: nFormat = Format::ONE_BIT_MSB_PAL; + aDevPal.reserve(2); + aDevPal.push_back( basebmp::Color( 0, 0, 0 ) ); + aDevPal.push_back( basebmp::Color( 0xff, 0xff, 0xff ) ); + break; case 4: nFormat = Format::FOUR_BIT_MSB_PAL; break; case 8: nFormat = Format::EIGHT_BIT_PAL; break; #ifdef OSL_BIGENDIAN @@ -78,7 +83,9 @@ BOOL SvpSalVirtualDevice::SetSize( long nNewDX, long nNewDY ) case 24: nFormat = Format::TWENTYFOUR_BIT_TC_MASK; break; case 32: nFormat = Format::THIRTYTWO_BIT_TC_MASK; break; } - m_aDevice = createBitmapDevice( aDevSize, false, nFormat ); + m_aDevice = aDevPal.empty() + ? createBitmapDevice( aDevSize, false, nFormat ) + : createBitmapDevice( aDevSize, false, nFormat, PaletteMemorySharedVector( new std::vector< basebmp::Color >(aDevPal) ) ); // update device in existing graphics for( std::list< SvpSalGraphics* >::iterator it = m_aGraphics.begin(); it != m_aGraphics.end(); ++it ) -- cgit