diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-07-12 12:25:39 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-07-12 14:41:35 +0200 |
commit | d8dbf1b5dbfa0db2d765063a1d848d031835398a (patch) | |
tree | 0afe6c5fed33be4f42d61c36e92afc697a2e3eba /vcl/headless | |
parent | b00a99e4af0cf47642a139778a230cc61d1347d9 (diff) |
Turn basebmp::Format into a proper enum
Change-Id: I4067c5039c7b5c74a1c144721dd7260de54dd2bf
Diffstat (limited to 'vcl/headless')
-rw-r--r-- | vcl/headless/svpbmp.cxx | 118 | ||||
-rw-r--r-- | vcl/headless/svpframe.cxx | 2 | ||||
-rw-r--r-- | vcl/headless/svpgdi.cxx | 28 | ||||
-rw-r--r-- | vcl/headless/svptext.cxx | 18 | ||||
-rw-r--r-- | vcl/headless/svpvd.cxx | 20 |
5 files changed, 93 insertions, 93 deletions
diff --git a/vcl/headless/svpbmp.cxx b/vcl/headless/svpbmp.cxx index dc4d5b8a3302..a310addb1ae0 100644 --- a/vcl/headless/svpbmp.cxx +++ b/vcl/headless/svpbmp.cxx @@ -38,23 +38,23 @@ bool SvpSalBitmap::Create( const Size& rSize, sal_uInt16 nBitCount, const BitmapPalette& rPalette ) { - sal_uInt32 nFormat = SVP_DEFAULT_BITMAP_FORMAT; + basebmp::Format nFormat = SVP_DEFAULT_BITMAP_FORMAT; SAL_INFO( "vcl.headless", "SvpSalBitmap::Create(" << rSize.Width() << "," << rSize.Height() << "," << nBitCount << ")" ); switch( nBitCount ) { - case 1: nFormat = Format::ONE_BIT_MSB_PAL; break; - case 4: nFormat = Format::FOUR_BIT_MSB_PAL; break; - case 8: nFormat = Format::EIGHT_BIT_PAL; break; + case 1: nFormat = FORMAT_ONE_BIT_MSB_PAL; break; + case 4: nFormat = FORMAT_FOUR_BIT_MSB_PAL; break; + case 8: nFormat = FORMAT_EIGHT_BIT_PAL; break; #ifdef OSL_BIGENDIAN - case 16: nFormat = Format::SIXTEEN_BIT_MSB_TC_MASK; break; + case 16: nFormat = FORMAT_SIXTEEN_BIT_MSB_TC_MASK; break; #else - case 16: nFormat = Format::SIXTEEN_BIT_LSB_TC_MASK; break; + case 16: nFormat = FORMAT_SIXTEEN_BIT_LSB_TC_MASK; break; #endif - case 24: nFormat = Format::TWENTYFOUR_BIT_TC_MASK; break; + case 24: nFormat = FORMAT_TWENTYFOUR_BIT_TC_MASK; break; #if defined(ANDROID) || defined(IOS) - case 32: nFormat = Format::THIRTYTWO_BIT_TC_MASK_RGBA; break; + case 32: nFormat = FORMAT_THIRTYTWO_BIT_TC_MASK_RGBA; break; #else - case 32: nFormat = Format::THIRTYTWO_BIT_TC_MASK_BGRA; break; + case 32: nFormat = FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA; break; #endif } B2IVector aSize( rSize.Width(), rSize.Height() ); @@ -152,49 +152,49 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( bool ) sal_uInt16 nBitCount = 1; switch( m_aBitmap->getScanlineFormat() ) { - case Format::ONE_BIT_MSB_GREY: - case Format::ONE_BIT_MSB_PAL: + case FORMAT_ONE_BIT_MSB_GREY: + case FORMAT_ONE_BIT_MSB_PAL: nBitCount = 1; pBuf->mnFormat = BMP_FORMAT_1BIT_MSB_PAL; break; - case Format::ONE_BIT_LSB_GREY: - case Format::ONE_BIT_LSB_PAL: + case FORMAT_ONE_BIT_LSB_GREY: + case FORMAT_ONE_BIT_LSB_PAL: nBitCount = 1; pBuf->mnFormat = BMP_FORMAT_1BIT_LSB_PAL; break; - case Format::FOUR_BIT_MSB_GREY: - case Format::FOUR_BIT_MSB_PAL: + case FORMAT_FOUR_BIT_MSB_GREY: + case FORMAT_FOUR_BIT_MSB_PAL: nBitCount = 4; pBuf->mnFormat = BMP_FORMAT_4BIT_MSN_PAL; break; - case Format::FOUR_BIT_LSB_GREY: - case Format::FOUR_BIT_LSB_PAL: + case FORMAT_FOUR_BIT_LSB_GREY: + case FORMAT_FOUR_BIT_LSB_PAL: nBitCount = 4; pBuf->mnFormat = BMP_FORMAT_4BIT_LSN_PAL; break; - case Format::EIGHT_BIT_PAL: + case FORMAT_EIGHT_BIT_PAL: nBitCount = 8; pBuf->mnFormat = BMP_FORMAT_8BIT_PAL; break; - case Format::EIGHT_BIT_GREY: + case FORMAT_EIGHT_BIT_GREY: nBitCount = 8; pBuf->mnFormat = BMP_FORMAT_8BIT_PAL; break; - case Format::SIXTEEN_BIT_LSB_TC_MASK: + case FORMAT_SIXTEEN_BIT_LSB_TC_MASK: nBitCount = 16; pBuf->mnFormat = BMP_FORMAT_16BIT_TC_LSB_MASK; pBuf->maColorMask = ColorMask( 0xf800, 0x07e0, 0x001f ); break; - case Format::SIXTEEN_BIT_MSB_TC_MASK: + case FORMAT_SIXTEEN_BIT_MSB_TC_MASK: nBitCount = 16; pBuf->mnFormat = BMP_FORMAT_16BIT_TC_MSB_MASK; pBuf->maColorMask = ColorMask( 0xf800, 0x07e0, 0x001f ); break; - case Format::TWENTYFOUR_BIT_TC_MASK: + case FORMAT_TWENTYFOUR_BIT_TC_MASK: nBitCount = 24; pBuf->mnFormat = BMP_FORMAT_24BIT_TC_BGR; break; - case Format::THIRTYTWO_BIT_TC_MASK_BGRA: + case FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA: nBitCount = 32; pBuf->mnFormat = BMP_FORMAT_32BIT_TC_MASK; #ifdef OSL_BIGENDIAN @@ -203,7 +203,7 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( bool ) pBuf->maColorMask = ColorMask( 0x00ff0000, 0x0000ff00, 0x000000ff ); #endif break; - case Format::THIRTYTWO_BIT_TC_MASK_ARGB: + case FORMAT_THIRTYTWO_BIT_TC_MASK_ARGB: nBitCount = 32; pBuf->mnFormat = BMP_FORMAT_32BIT_TC_MASK; #ifdef OSL_BIGENDIAN @@ -212,7 +212,7 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( bool ) pBuf->maColorMask = ColorMask( 0x0000ff00, 0x00ff0000, 0xff000000 ); #endif break; - case Format::THIRTYTWO_BIT_TC_MASK_ABGR: + case FORMAT_THIRTYTWO_BIT_TC_MASK_ABGR: nBitCount = 32; pBuf->mnFormat = BMP_FORMAT_32BIT_TC_MASK; #ifdef OSL_BIGENDIAN @@ -221,7 +221,7 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( bool ) pBuf->maColorMask = ColorMask( 0xff000000, 0x00ff0000, 0x0000ff00 ); #endif break; - case Format::THIRTYTWO_BIT_TC_MASK_RGBA: + case FORMAT_THIRTYTWO_BIT_TC_MASK_RGBA: nBitCount = 32; pBuf->mnFormat = BMP_FORMAT_32BIT_TC_MASK; #ifdef OSL_BIGENDIAN @@ -248,11 +248,11 @@ BitmapBuffer* SvpSalBitmap::AcquireBuffer( bool ) pBuf->mpBits = (sal_uInt8*)m_aBitmap->getBuffer().get(); if( nBitCount <= 8 ) { - if( m_aBitmap->getScanlineFormat() == Format::EIGHT_BIT_GREY || - m_aBitmap->getScanlineFormat() == Format::FOUR_BIT_LSB_GREY || - m_aBitmap->getScanlineFormat() == Format::FOUR_BIT_MSB_GREY || - m_aBitmap->getScanlineFormat() == Format::ONE_BIT_LSB_GREY || - m_aBitmap->getScanlineFormat() == Format::ONE_BIT_MSB_GREY + if( m_aBitmap->getScanlineFormat() == FORMAT_EIGHT_BIT_GREY || + m_aBitmap->getScanlineFormat() == FORMAT_FOUR_BIT_LSB_GREY || + m_aBitmap->getScanlineFormat() == FORMAT_FOUR_BIT_MSB_GREY || + m_aBitmap->getScanlineFormat() == FORMAT_ONE_BIT_LSB_GREY || + m_aBitmap->getScanlineFormat() == FORMAT_ONE_BIT_MSB_GREY ) pBuf->maPalette = Bitmap::GetGreyPalette( 1U << nBitCount ); else @@ -287,29 +287,29 @@ void SvpSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ) sal_uInt16 nBitCount = 0; switch( m_aBitmap->getScanlineFormat() ) { - case Format::ONE_BIT_MSB_GREY: + case FORMAT_ONE_BIT_MSB_GREY: // FALLTHROUGH intended - case Format::ONE_BIT_MSB_PAL: + case FORMAT_ONE_BIT_MSB_PAL: // FALLTHROUGH intended - case Format::ONE_BIT_LSB_GREY: + case FORMAT_ONE_BIT_LSB_GREY: // FALLTHROUGH intended - case Format::ONE_BIT_LSB_PAL: + case FORMAT_ONE_BIT_LSB_PAL: nBitCount = 1; break; - case Format::FOUR_BIT_MSB_GREY: + case FORMAT_FOUR_BIT_MSB_GREY: // FALLTHROUGH intended - case Format::FOUR_BIT_MSB_PAL: + case FORMAT_FOUR_BIT_MSB_PAL: // FALLTHROUGH intended - case Format::FOUR_BIT_LSB_GREY: + case FORMAT_FOUR_BIT_LSB_GREY: // FALLTHROUGH intended - case Format::FOUR_BIT_LSB_PAL: + case FORMAT_FOUR_BIT_LSB_PAL: nBitCount = 4; break; - case Format::EIGHT_BIT_PAL: + case FORMAT_EIGHT_BIT_PAL: // FALLTHROUGH intended - case Format::EIGHT_BIT_GREY: + case FORMAT_EIGHT_BIT_GREY: nBitCount = 8; break; @@ -349,38 +349,38 @@ bool SvpSalBitmap::GetSystemData( BitmapSystemData& ) return false; } -sal_uInt32 SvpSalBitmap::getBitCountFromScanlineFormat( sal_Int32 nFormat ) +sal_uInt32 SvpSalBitmap::getBitCountFromScanlineFormat( basebmp::Format nFormat ) { sal_uInt32 nBitCount = 1; switch( nFormat ) { - case Format::ONE_BIT_MSB_GREY: - case Format::ONE_BIT_LSB_GREY: - case Format::ONE_BIT_MSB_PAL: - case Format::ONE_BIT_LSB_PAL: + case FORMAT_ONE_BIT_MSB_GREY: + case FORMAT_ONE_BIT_LSB_GREY: + case FORMAT_ONE_BIT_MSB_PAL: + case FORMAT_ONE_BIT_LSB_PAL: nBitCount = 1; break; - case Format::FOUR_BIT_MSB_GREY: - case Format::FOUR_BIT_LSB_GREY: - case Format::FOUR_BIT_MSB_PAL: - case Format::FOUR_BIT_LSB_PAL: + case FORMAT_FOUR_BIT_MSB_GREY: + case FORMAT_FOUR_BIT_LSB_GREY: + case FORMAT_FOUR_BIT_MSB_PAL: + case FORMAT_FOUR_BIT_LSB_PAL: nBitCount = 4; break; - case Format::EIGHT_BIT_PAL: - case Format::EIGHT_BIT_GREY: + case FORMAT_EIGHT_BIT_PAL: + case FORMAT_EIGHT_BIT_GREY: nBitCount = 8; break; - case Format::SIXTEEN_BIT_LSB_TC_MASK: - case Format::SIXTEEN_BIT_MSB_TC_MASK: + case FORMAT_SIXTEEN_BIT_LSB_TC_MASK: + case FORMAT_SIXTEEN_BIT_MSB_TC_MASK: nBitCount = 16; break; - case Format::TWENTYFOUR_BIT_TC_MASK: + case FORMAT_TWENTYFOUR_BIT_TC_MASK: nBitCount = 24; break; - case Format::THIRTYTWO_BIT_TC_MASK_BGRA: - case Format::THIRTYTWO_BIT_TC_MASK_ARGB: - case Format::THIRTYTWO_BIT_TC_MASK_ABGR: - case Format::THIRTYTWO_BIT_TC_MASK_RGBA: + case FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA: + case FORMAT_THIRTYTWO_BIT_TC_MASK_ARGB: + case FORMAT_THIRTYTWO_BIT_TC_MASK_ABGR: + case FORMAT_THIRTYTWO_BIT_TC_MASK_RGBA: nBitCount = 32; break; default: diff --git a/vcl/headless/svpframe.cxx b/vcl/headless/svpframe.cxx index 18c84f3ef9e5..79b231ff3009 100644 --- a/vcl/headless/svpframe.cxx +++ b/vcl/headless/svpframe.cxx @@ -65,7 +65,7 @@ SvpSalFrame::SvpSalFrame( SvpSalInstance* pInstance, SalFrame* pParent, sal_uLong nSalFrameStyle, bool bTopDown, - sal_Int32 nScanlineFormat, + basebmp::Format nScanlineFormat, SystemParentData* ) : m_pInstance( pInstance ), m_pParent( static_cast<SvpSalFrame*>(pParent) ), diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index c7d75a0f67ab..d6bd0f170824 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -95,7 +95,7 @@ SvpSalGraphics::SvpSalGraphics() : m_aFillColor( COL_WHITE ), m_aDrawMode( basebmp::DrawMode_PAINT ), m_aTextColor( COL_BLACK ), - m_eTextFmt( basebmp::Format::EIGHT_BIT_GREY ), + m_eTextFmt( basebmp::FORMAT_EIGHT_BIT_GREY ), m_bClipSetup( false ) { for( int i = 0; i < MAX_FALLBACK; ++i ) @@ -115,22 +115,22 @@ void SvpSalGraphics::setDevice( basebmp::BitmapDeviceSharedPtr& rDevice ) #ifndef IOS // determine matching bitmap format for masks - sal_uInt32 nDeviceFmt = m_aDevice->getScanlineFormat(); - DBG_ASSERT( (nDeviceFmt <= (sal_uInt32)basebmp::Format::MAX), "SVP::setDevice() with invalid bitmap format" ); + basebmp::Format nDeviceFmt = m_aDevice->getScanlineFormat(); + DBG_ASSERT( (nDeviceFmt <= (sal_uInt32)basebmp::FORMAT_MAX), "SVP::setDevice() with invalid bitmap format" ); switch( nDeviceFmt ) { - case basebmp::Format::EIGHT_BIT_GREY: - case basebmp::Format::SIXTEEN_BIT_LSB_TC_MASK: - case basebmp::Format::SIXTEEN_BIT_MSB_TC_MASK: - case basebmp::Format::TWENTYFOUR_BIT_TC_MASK: - case basebmp::Format::THIRTYTWO_BIT_TC_MASK_BGRA: - case basebmp::Format::THIRTYTWO_BIT_TC_MASK_ARGB: - case basebmp::Format::THIRTYTWO_BIT_TC_MASK_ABGR: - case basebmp::Format::THIRTYTWO_BIT_TC_MASK_RGBA: - m_eTextFmt = basebmp::Format::EIGHT_BIT_GREY; + case basebmp::FORMAT_EIGHT_BIT_GREY: + case basebmp::FORMAT_SIXTEEN_BIT_LSB_TC_MASK: + case basebmp::FORMAT_SIXTEEN_BIT_MSB_TC_MASK: + case basebmp::FORMAT_TWENTYFOUR_BIT_TC_MASK: + case basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA: + case basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_ARGB: + case basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_ABGR: + case basebmp::FORMAT_THIRTYTWO_BIT_TC_MASK_RGBA: + m_eTextFmt = basebmp::FORMAT_EIGHT_BIT_GREY; break; default: - m_eTextFmt = basebmp::Format::ONE_BIT_LSB_GREY; + m_eTextFmt = basebmp::FORMAT_ONE_BIT_LSB_GREY; break; } #endif @@ -173,7 +173,7 @@ void SvpSalGraphics::ensureClip() m_aDevice = m_aOrigDevice; basegfx::B2IVector aSize = m_aDevice->getSize(); - m_aClipMap = basebmp::createBitmapDevice( aSize, false, basebmp::Format::ONE_BIT_MSB_GREY ); + m_aClipMap = basebmp::createBitmapDevice( aSize, false, basebmp::FORMAT_ONE_BIT_MSB_GREY ); m_aClipMap->clear( basebmp::Color(0xFFFFFFFF) ); RectangleVector aRectangles; diff --git a/vcl/headless/svptext.cxx b/vcl/headless/svptext.cxx index 2b657461036d..bbe38f465648 100644 --- a/vcl/headless/svptext.cxx +++ b/vcl/headless/svptext.cxx @@ -46,7 +46,7 @@ public: SvpGlyphPeer() {} BitmapDeviceSharedPtr GetGlyphBmp( ServerFont&, int nGlyphIndex, - sal_uInt32 nBmpFormat, B2IPoint& rTargetPos ); + basebmp::Format nBmpFormat, B2IPoint& rTargetPos ); protected: virtual void RemovingFont( ServerFont& ); @@ -110,15 +110,15 @@ SvpGlyphCache& SvpGlyphCache::GetInstance() BitmapDeviceSharedPtr SvpGlyphPeer::GetGlyphBmp( ServerFont& rServerFont, - int nGlyphIndex, sal_uInt32 nBmpFormat, B2IPoint& rTargetPos ) + int nGlyphIndex, basebmp::Format nBmpFormat, B2IPoint& rTargetPos ) { GlyphData& rGlyphData = rServerFont.GetGlyphData( nGlyphIndex ); SvpGcpHelper* pGcpHelper = (SvpGcpHelper*)rGlyphData.ExtDataRef().mpData; // nothing to do if the GlyphPeer hasn't allocated resources for the glyph - if( rGlyphData.ExtDataRef().meInfo != sal::static_int_cast<int>(nBmpFormat) ) + if( rGlyphData.ExtDataRef().meInfo != nBmpFormat ) { - if( rGlyphData.ExtDataRef().meInfo == Format::NONE ) + if( rGlyphData.ExtDataRef().meInfo == FORMAT_NONE ) pGcpHelper = new SvpGcpHelper; RawBitmap& rRawBitmap = pGcpHelper->maRawBitmap; @@ -126,16 +126,16 @@ BitmapDeviceSharedPtr SvpGlyphPeer::GetGlyphBmp( ServerFont& rServerFont, bool bFound = false; switch( nBmpFormat ) { - case Format::ONE_BIT_LSB_GREY: + case FORMAT_ONE_BIT_LSB_GREY: bFound = rServerFont.GetGlyphBitmap1( nGlyphIndex, pGcpHelper->maRawBitmap ); break; - case Format::EIGHT_BIT_GREY: + case FORMAT_EIGHT_BIT_GREY: bFound = rServerFont.GetGlyphBitmap8( nGlyphIndex, pGcpHelper->maRawBitmap ); break; default: OSL_FAIL( "SVP GCP::GetGlyphBmp(): illegal scanline format"); // fall back to black&white mask - nBmpFormat = Format::ONE_BIT_LSB_GREY; + nBmpFormat = FORMAT_ONE_BIT_LSB_GREY; bFound = false; break; } @@ -172,10 +172,10 @@ void SvpGlyphPeer::RemovingFont( ServerFont& ) void SvpGlyphPeer::RemovingGlyph( ServerFont&, GlyphData& rGlyphData, int /*nGlyphIndex*/ ) { - if( rGlyphData.ExtDataRef().mpData != Format::NONE ) + if( rGlyphData.ExtDataRef().mpData != 0 ) { // release the glyph related resources - DBG_ASSERT( (rGlyphData.ExtDataRef().meInfo <= Format::MAX), "SVP::RG() invalid alpha format" ); + DBG_ASSERT( (rGlyphData.ExtDataRef().meInfo <= FORMAT_MAX), "SVP::RG() invalid alpha format" ); SvpGcpHelper* pGcpHelper = (SvpGcpHelper*)rGlyphData.ExtDataRef().mpData; delete[] pGcpHelper->maRawBitmap.mpBits; delete pGcpHelper; diff --git a/vcl/headless/svpvd.cxx b/vcl/headless/svpvd.cxx index 82f34f432c50..56c7ed73e92b 100644 --- a/vcl/headless/svpvd.cxx +++ b/vcl/headless/svpvd.cxx @@ -61,28 +61,28 @@ sal_Bool SvpSalVirtualDevice::SetSizeUsingBuffer( long nNewDX, long nNewDY, cons aDevSize.setY( 1 ); if( ! m_aDevice.get() || m_aDevice->getSize() != aDevSize ) { - sal_uInt32 nFormat = SVP_DEFAULT_BITMAP_FORMAT; + basebmp::Format nFormat = SVP_DEFAULT_BITMAP_FORMAT; std::vector< basebmp::Color > aDevPal; switch( m_nBitCount ) { - case 1: nFormat = Format::ONE_BIT_MSB_PAL; + 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; + case 4: nFormat = FORMAT_FOUR_BIT_MSB_PAL; break; + case 8: nFormat = FORMAT_EIGHT_BIT_PAL; break; #ifdef OSL_BIGENDIAN - case 16: nFormat = Format::SIXTEEN_BIT_MSB_TC_MASK; break; + case 16: nFormat = FORMAT_SIXTEEN_BIT_MSB_TC_MASK; break; #else - case 16: nFormat = Format::SIXTEEN_BIT_LSB_TC_MASK; break; + case 16: nFormat = FORMAT_SIXTEEN_BIT_LSB_TC_MASK; break; #endif - case 24: nFormat = Format::TWENTYFOUR_BIT_TC_MASK; break; - case 32: nFormat = Format::THIRTYTWO_BIT_TC_MASK_BGRA; break; + case 24: nFormat = FORMAT_TWENTYFOUR_BIT_TC_MASK; break; + case 32: nFormat = FORMAT_THIRTYTWO_BIT_TC_MASK_BGRA; break; #if defined(ANDROID) || defined(IOS) - case 0: nFormat = Format::THIRTYTWO_BIT_TC_MASK_RGBA; break; + case 0: nFormat = FORMAT_THIRTYTWO_BIT_TC_MASK_RGBA; break; #else - case 0: nFormat = Format::TWENTYFOUR_BIT_TC_MASK; break; + case 0: nFormat = FORMAT_TWENTYFOUR_BIT_TC_MASK; break; #endif } m_aDevice = aDevPal.empty() |