[Libreoffice-commits] core.git: vcl/source

Luboš Luňák l.lunak at collabora.com
Thu Feb 12 04:57:07 PST 2015


 vcl/source/outdev/bitmap.cxx |   22 +++++++++-------------
 1 file changed, 9 insertions(+), 13 deletions(-)

New commits:
commit 4bf97acefcf88c1e5a7d7722d72a5b0d7995ee3d
Author: Luboš Luňák <l.lunak at collabora.com>
Date:   Thu Feb 12 13:55:24 2015 +0100

    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

diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 97a7fc5..ffac35c 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


More information about the Libreoffice-commits mailing list