vcl/source/outdev/bitmap.cxx |   17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

New commits:
commit 0fa9920391ed3bb6aa6ef0f5220050f2c694f859
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Mon Oct 12 12:12:07 2020 +0200
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Mon Oct 12 15:53:48 2020 +0200

    don't disable the fast path in DrawDeviceAlphaBitmap() (tdf#137311)
    
    Only OpenGL and Skia implement the BlendBitmap*() calls, and so I
    disabled the direct path in an attempt to avoid forcing the mirroring
    if it takes place. But there's also the DrawAlphaBitmap() call
    that is implemented for other backends. So always do the mirroring
    already there if it takes place.
    
    Change-Id: I8c4c96ea18ac55ebad041e0d28c4228542d9b2e6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104206
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 2a013fe119b2..c584a1d82848 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -650,16 +650,8 @@ void OutputDevice::DrawDeviceAlphaBitmap( const Bitmap& 
rBmp, const AlphaMask& r
     if (aDstRect.Intersection(tools::Rectangle(aOutPt, aOutSz)).IsEmpty())
         return;
 
-    bool bTryDirectPaint = false;
-    if(SkiaHelper::isVCLSkiaEnabled())
-        bTryDirectPaint = true;
-#if HAVE_FEATURE_OPENGL
-    if(OpenGLHelper::isVCLOpenGLEnabled())
-        bTryDirectPaint = true;
-#endif
     static const char* pDisableNative = getenv( "SAL_DISABLE_NATIVE_ALPHA");
-    if(pDisableNative)
-        bTryDirectPaint = false;
+    bool bTryDirectPaint = !pDisableNative;
 
     if (bTryDirectPaint)
     {
@@ -701,7 +693,12 @@ void OutputDevice::DrawDeviceAlphaBitmap( const Bitmap& 
rBmp, const AlphaMask& r
             if (mpGraphics->DrawAlphaBitmap(aTR, *pSalSrcBmp, *pSalAlphaBmp, 
this))
                 return;
         }
-        assert(false);
+
+        // we need to make sure OpenGL never reaches this slow code path
+#if HAVE_FEATURE_OPENGL
+        assert(!OpenGLHelper::isVCLOpenGLEnabled());
+#endif
+        assert(!SkiaHelper::isVCLSkiaEnabled());
     }
 
     tools::Rectangle aBmpRect(Point(), rBmp.GetSizePixel());
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to