summaryrefslogtreecommitdiff
path: root/basebmp
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-03-25 09:22:38 +0200
committerTor Lillqvist <tml@iki.fi>2013-03-25 09:26:15 +0200
commit6d12b76b2c411a7ea00b44d6ce131f79a20a7319 (patch)
treef49f90b87203c90e69f7233ae27d32453917f823 /basebmp
parent1e50f7892705c64db0ffec06b651cd280e9a7f8f (diff)
Add some debugging printout
Change-Id: Iea0decde41be8b9325b19651433f1b3b79f851a9
Diffstat (limited to 'basebmp')
-rw-r--r--basebmp/inc/basebmp/scanlineformats.hxx2
-rw-r--r--basebmp/source/bitmapdevice.cxx34
-rw-r--r--basebmp/source/debug.cxx25
3 files changed, 46 insertions, 15 deletions
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 <osl/diagnose.h>
#include <basegfx/point/b2ipoint.hxx>
@@ -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 "<unknown>";
}
}
}
+#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: */