From 6d12b76b2c411a7ea00b44d6ce131f79a20a7319 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 25 Mar 2013 09:22:38 +0200 Subject: Add some debugging printout Change-Id: Iea0decde41be8b9325b19651433f1b3b79f851a9 --- basebmp/inc/basebmp/scanlineformats.hxx | 2 ++ basebmp/source/bitmapdevice.cxx | 34 ++++++++++++++++++++++++++------- basebmp/source/debug.cxx | 25 ++++++++++++++++-------- 3 files changed, 46 insertions(+), 15 deletions(-) (limited to 'basebmp') diff --git a/basebmp/inc/basebmp/scanlineformats.hxx b/basebmp/inc/basebmp/scanlineformats.hxx index 95fbd6f4904b..a1708980b5ac 100644 --- a/basebmp/inc/basebmp/scanlineformats.hxx +++ b/basebmp/inc/basebmp/scanlineformats.hxx @@ -48,6 +48,8 @@ namespace basebmp { namespace Format static const sal_Int32 THIRTYTWO_BIT_TC_MASK_ABGR = (sal_Int32)0x10; static const sal_Int32 THIRTYTWO_BIT_TC_MASK_RGBA = (sal_Int32)0x11; static const sal_Int32 MAX = (sal_Int32)0x11; + + const char *formatName(sal_Int32 nScanlineFormat); } } #endif /* INCLUDED_BASEBMP_SCANLINEFORMATS_HXX */ diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx index 5ed17967df39..24916f677062 100644 --- a/basebmp/source/bitmapdevice.cxx +++ b/basebmp/source/bitmapdevice.cxx @@ -1824,13 +1824,13 @@ inline sal_uInt32 nextPow2( sal_uInt32 x ) namespace { -BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector& rSize, - bool bTopDown, - sal_Int32 nScanlineFormat, - boost::shared_array< sal_uInt8 > pMem, - PaletteMemorySharedVector pPal, - const basegfx::B2IBox* pSubset, - const IBitmapDeviceDamageTrackerSharedPtr& rDamage ) +BitmapDeviceSharedPtr createBitmapDeviceImplInner( const basegfx::B2IVector& rSize, + bool bTopDown, + sal_Int32 nScanlineFormat, + boost::shared_array< sal_uInt8 > pMem, + PaletteMemorySharedVector pPal, + const basegfx::B2IBox* pSubset, + const IBitmapDeviceDamageTrackerSharedPtr& rDamage ) { OSL_ASSERT(rSize.getX() > 0 && rSize.getY() > 0); @@ -2022,6 +2022,26 @@ BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector& // TODO(F3): other formats not yet implemented return BitmapDeviceSharedPtr(); } + +BitmapDeviceSharedPtr createBitmapDeviceImpl( const basegfx::B2IVector& rSize, + bool bTopDown, + sal_Int32 nScanlineFormat, + boost::shared_array< sal_uInt8 > pMem, + PaletteMemorySharedVector pPal, + const basegfx::B2IBox* pSubset, + const IBitmapDeviceDamageTrackerSharedPtr& rDamage ) +{ + BitmapDeviceSharedPtr result( createBitmapDeviceImplInner( rSize, bTopDown, nScanlineFormat, pMem, pPal, pSubset, rDamage ) ); + + SAL_INFO( "basebmp.bitmapdevice", + "createBitmapDevice: " + << rSize.getX() << "x" << rSize.getY() + << (bTopDown ? " top-down " : " bottom-up ") + << Format::formatName(nScanlineFormat) + << " = " << result ); + + return result; +} } // namespace diff --git a/basebmp/source/debug.cxx b/basebmp/source/debug.cxx index 8ea42de5b8b4..4fe26f84af9a 100644 --- a/basebmp/source/debug.cxx +++ b/basebmp/source/debug.cxx @@ -17,8 +17,6 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#if OSL_DEBUG_LEVEL > 2 - #include #include @@ -33,12 +31,14 @@ namespace basebmp { - namespace + namespace Format { - static const char* getFormatString( sal_Int32 nScanlineFormat ) + const char* formatName( sal_Int32 nScanlineFormat ) { switch( nScanlineFormat ) { + case Format::NONE: + return "NONE"; case Format::ONE_BIT_MSB_GREY: return "ONE_BIT_MSB_GREY"; case Format::ONE_BIT_LSB_GREY: @@ -65,14 +65,22 @@ namespace basebmp return "SIXTEEN_BIT_MSB_TC_MASK"; case Format::TWENTYFOUR_BIT_TC_MASK: return "TWENTYFOUR_BIT_TC_MASK"; - case Format::THIRTYTWO_BIT_TC_MASK: - return "THIRTYTWO_BIT_TC_MASK"; + case Format::THIRTYTWO_BIT_TC_MASK_BGRA: + return "THIRTYTWO_BIT_TC_MASK_BGRA"; + case Format::THIRTYTWO_BIT_TC_MASK_ARGB: + return "THIRTYTWO_BIT_TC_MASK_ARGB"; + case Format::THIRTYTWO_BIT_TC_MASK_ABGR: + return "THIRTYTWO_BIT_TC_MASK_ABGR"; + case Format::THIRTYTWO_BIT_TC_MASK_RGBA: + return "THIRTYTWO_BIT_TC_MASK_RGBA"; default: return ""; } } } +#if OSL_DEBUG_LEVEL > 2 + SAL_DLLPUBLIC_EXPORT void debugDump( const BitmapDeviceSharedPtr& rDevice, std::ostream& rOutputStream ) { @@ -85,7 +93,7 @@ namespace basebmp << "/* Width = " << aSize.getX() << " */" << std::endl << "/* Height = " << aSize.getY() << " */" << std::endl << "/* TopDown = " << bTopDown << " */" << std::endl - << "/* Format = " << getFormatString(nScanlineFormat) << " */" << std::endl + << "/* Format = " << formatName(nScanlineFormat) << " */" << std::endl << "/* (dumped entries are already mapped RGBA color values) */" << std::endl << std::endl; @@ -97,8 +105,9 @@ namespace basebmp rOutputStream << std::endl; } } -} #endif // OSL_DEBUG_LEVEL > 2 +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3