[Libreoffice-commits] core.git: basebmp/inc basebmp/source sal/inc

Tor Lillqvist tml at iki.fi
Mon Mar 25 00:36:39 PDT 2013


 basebmp/inc/basebmp/scanlineformats.hxx |    2 +
 basebmp/source/bitmapdevice.cxx         |   34 +++++++++++++++++++++++++-------
 basebmp/source/debug.cxx                |   25 ++++++++++++++++-------
 sal/inc/sal/log-areas.dox               |    4 +++
 4 files changed, 50 insertions(+), 15 deletions(-)

New commits:
commit 6d12b76b2c411a7ea00b44d6ce131f79a20a7319
Author: Tor Lillqvist <tml at iki.fi>
Date:   Mon Mar 25 09:22:38 2013 +0200

    Add some debugging printout
    
    Change-Id: Iea0decde41be8b9325b19651433f1b3b79f851a9

diff --git a/basebmp/inc/basebmp/scanlineformats.hxx b/basebmp/inc/basebmp/scanlineformats.hxx
index 95fbd6f..a170898 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 5ed1796..24916f6 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 8ea42de..4fe26f8 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: */
diff --git a/sal/inc/sal/log-areas.dox b/sal/inc/sal/log-areas.dox
index 07c7399..d344e38 100644
--- a/sal/inc/sal/log-areas.dox
+++ b/sal/inc/sal/log-areas.dox
@@ -29,6 +29,10 @@ certain functionality.
 
 @li @c basctl.basicide
 
+ at section basebmp
+
+ at li @c basebmp.bitmapdevice
+
 @section basic
 
 @li @c basic


More information about the Libreoffice-commits mailing list