summaryrefslogtreecommitdiff
path: root/vcl/quartz/salbmp.cxx
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2014-04-03 12:37:59 +0300
committerTor Lillqvist <tml@collabora.com>2014-04-03 12:45:16 +0300
commit0f6149593129c3d208f07d0d017dec0c71760778 (patch)
treecd36e4c8179f9a12e6905ba6cf8c25a4f6c955e7 /vcl/quartz/salbmp.cxx
parent077bdc73f2bcd625be1030fa8ff630c3dbd83657 (diff)
Make it easier to catch code that assumes SalBitmaps are created pre-cleared
In a DBG_UTIL build fill the maContextBuffer and maUserBuffer of a QuartzSalBitmap with an easily recognized pattern. Helps catch situations where by coincidence they appear pre-filled with zeros most of the time and almost everything usually looks fine. Or is the QuartzSalBitmap implementation wrong, and SalBitmaps *should* be created filled with zeros? Change-Id: Ib5207779f2a47b9b7e539d8646b4128fea0ec150
Diffstat (limited to 'vcl/quartz/salbmp.cxx')
-rw-r--r--vcl/quartz/salbmp.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index 5ecc507a6780..973a67511249 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -211,6 +211,10 @@ bool QuartzSalBitmap::CreateContext()
try
{
maContextBuffer.reset( new sal_uInt8[ mnHeight * nContextBytesPerRow ] );
+#ifdef DBG_UTIL
+ for (size_t i = 0; i < mnHeight * nContextBytesPerRow; i++)
+ maContextBuffer.get()[i] = (i & 0xFF);
+#endif
if( !bSkipConversion )
ConvertBitmapData( mnWidth, mnHeight,
@@ -261,6 +265,10 @@ bool QuartzSalBitmap::AllocateUserData()
{
if( mnBytesPerRow )
maUserBuffer.reset( new sal_uInt8[mnBytesPerRow * mnHeight] );
+#ifdef DBG_UTIL
+ for (size_t i = 0; i < mnBytesPerRow * mnHeight; i++)
+ maUserBuffer.get()[i] = (i & 0xFF);
+#endif
}
catch( const std::bad_alloc& )
{