diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2015-02-12 13:55:24 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2015-02-12 13:56:39 +0100 |
commit | 4bf97acefcf88c1e5a7d7722d72a5b0d7995ee3d (patch) | |
tree | c314a2830466947edc266b097279da2feff0fd8d /vcl | |
parent | 5e62dc99bfa59654166609fa57141e4303c734e3 (diff) |
do not silently fail if the optimized blend path doesn't do anything
Otherwise e.g. rotated images in Draw may show as empty. Broken in d53103dd83bf20ac.
Change-Id: I0b99b6c39b96f87a78ccb09c9db0a1bfac0f3296
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/outdev/bitmap.cxx | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 97a7fc550086..ffac35c35a04 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -733,7 +733,7 @@ private: } public: - void blendBitmap( + bool blendBitmap( const BitmapWriteAccess* pDestination, const BitmapReadAccess* pSource, const BitmapReadAccess* pSourceAlpha, @@ -754,10 +754,12 @@ public: || (nSourceFormat == BMP_FORMAT_24BIT_TC_RGB && nDestinationFormat == BMP_FORMAT_32BIT_TC_RGBA)) { blendBitmap24(pDestination, pSource, pSourceAlpha, nDstWidth, nDstHeight); + return true; } } } } + return false; } void blendBitmap24( @@ -915,10 +917,12 @@ void OutputDevice::DrawDeviceAlphaBitmapSlowPath(const Bitmap& rBitmap, const Al } else { - bool isBitmap24bitRGB = (pBitmapReadAccess->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB || - pBitmapReadAccess->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR); - - if (GetBitCount() <= 8 && !isBitmap24bitRGB) + if( aContext.blendBitmap( Bitmap::ScopedWriteAccess(aBmp).get(), pBitmapReadAccess.get(), pAlphaReadAccess.get(), + nDstWidth, nDstHeight)) + { + aNewBitmap = aBmp; + } + else { aNewBitmap = BlendBitmap( aBmp, pBitmapReadAccess.get(), pAlphaReadAccess.get(), @@ -928,14 +932,6 @@ void OutputDevice::DrawDeviceAlphaBitmapSlowPath(const Bitmap& rBitmap, const Al bHMirr, bVMirr, aContext.mpMapX.get(), aContext.mpMapY.get() ); } - else - { - Bitmap::ScopedWriteAccess pDestination(aBmp); - aContext.blendBitmap( - pDestination.get(), pBitmapReadAccess.get(), pAlphaReadAccess.get(), - nDstWidth, nDstHeight); - aNewBitmap = aBmp; - } } // #110958# Disable alpha VDev, we're doing the necessary |