vcl/source/outdev/bitmap.cxx |   27 +++------------------------
 1 file changed, 3 insertions(+), 24 deletions(-)

New commits:
commit 7a0b7ef6d490e7ed7c35874b3feca75c79effdb7
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Wed Feb 10 17:15:19 2021 +0100
Commit:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
CommitDate: Wed Feb 24 15:24:15 2021 +0100

    always optimize bitmap transform to translate+scale if possible (tdf#138068)
    
    Commit 828504974d70111e make OutputDevice::DrawTransformedBitmapEx()
    always call DrawTransformBitmapExDirect() in preference to explicitly
    converting to DrawBitmapEx() if the transformation wanted was at most
    translate+scale, in the hopes that these days the backend implementations
    work well enough. But it turns out only the Skia backend handles that
    without loss of performance. So always do the conversion to DrawBitmapEx()
    if possible. It's so simple that it possibly makes sense to always do
    this, regardless of the backend.
    
    Change-Id: I6eba68e672334c38433f53980f49400499f5d8e7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110716
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>
    (cherry picked from commit 9d89d98d3349502b56da4bdd6ea287ac4cde9ce5)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110779
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    (cherry picked from commit b6d67d3d18d46daaabb3532d176759c234196da7)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110919
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
    Tested-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>

diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx
index 519f975a0f12..796b3b82f555 100644
--- a/vcl/source/outdev/bitmap.cxx
+++ b/vcl/source/outdev/bitmap.cxx
@@ -1261,28 +1261,6 @@ void OutputDevice::DrawTransformedBitmapEx(
         : nullptr);
 #endif
 
-    // MM02 reorganize order: Prefer DrawTransformBitmapExDirect due
-    // to this having evolved and is improved on quite some systems.
-    // Check for exclusion parameters that may prevent using it
-    static bool bAllowPreferDirectPaint(true);
-    const bool bInvert(RasterOp::Invert == meRasterOp);
-    const bool bBitmapChangedColor(mnDrawMode & (DrawModeFlags::BlackBitmap | 
DrawModeFlags::WhiteBitmap | DrawModeFlags::GrayBitmap ));
-    const bool bTryDirectPaint(!bInvert && !bBitmapChangedColor && !bMetafile);
-
-    if(bAllowPreferDirectPaint && bTryDirectPaint)
-    {
-        // tdf#130768 CAUTION(!) using GetViewTransformation() is *not* enough 
here, it may
-        // be that mnOutOffX/mnOutOffY is used - see AOO bug 75163, mentioned 
at
-        // ImplGetDeviceTransformation declaration
-        const basegfx::B2DHomMatrix 
aFullTransform(ImplGetDeviceTransformation() * rTransformation);
-
-        if(DrawTransformBitmapExDirect(aFullTransform, rBitmapEx))
-        {
-            // we are done
-            return;
-        }
-    }
-
     // decompose matrix to check rotation and shear
     basegfx::B2DVector aScale, aTranslate;
     double fRotate, fShearX;
@@ -1317,8 +1295,9 @@ void OutputDevice::DrawTransformedBitmapEx(
         return;
     }
 
-    // MM02 bAllowPreferDirectPaint may have been false to allow
-    // to specify order of executions, so give bTryDirectPaint a call
+    const bool bInvert(RasterOp::Invert == meRasterOp);
+    const bool bBitmapChangedColor(mnDrawMode & (DrawModeFlags::BlackBitmap | 
DrawModeFlags::WhiteBitmap | DrawModeFlags::GrayBitmap ));
+    const bool bTryDirectPaint(!bInvert && !bBitmapChangedColor && !bMetafile);
     if(bTryDirectPaint)
     {
         // tdf#130768 CAUTION(!) using GetViewTransformation() is *not* enough 
here, it may
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to