canvas/source/vcl/canvashelper.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit b4f03a95db84c1d18c9435d13f41787596d34b12
Author:     Luboš Luňák <l.lu...@collabora.com>
AuthorDate: Wed Nov 17 10:36:25 2021 +0100
Commit:     Luboš Luňák <l.lu...@collabora.com>
CommitDate: Wed Nov 17 14:12:48 2021 +0100

    stop vclcanvas from ruining alpha of bitmaps in Skia mode
    
    According to the comment and tdf#45219 vclcanvas deliberately forces
    alpha to be 1bpp because of poor performance. But that's not the case
    with Skia, alpha is always 8bpp there, so all the hack does it make
    animations look ugly and it also breaks caching capabilities of the
    Skia backend because the hack always generates a new bitmap.
    
    I don't know which VCL backend the original problem was related to,
    so at least disable the hack for Skia.
    
    Change-Id: I8a90c32dbe911cb79b617c0c447f3e9ced05f746
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125373
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lu...@collabora.com>

diff --git a/canvas/source/vcl/canvashelper.cxx 
b/canvas/source/vcl/canvashelper.cxx
index 69ef1922de5a..80a0dc2a8fa6 100644
--- a/canvas/source/vcl/canvashelper.cxx
+++ b/canvas/source/vcl/canvashelper.cxx
@@ -41,6 +41,7 @@
 #include <vcl/BitmapReadAccess.hxx>
 #include <vcl/canvastools.hxx>
 #include <vcl/BitmapAlphaClampFilter.hxx>
+#include <vcl/skia/SkiaHelper.hxx>
 
 #include <canvas/canvastools.hxx>
 
@@ -707,7 +708,7 @@ namespace vclcanvas
                     // actually what mp2ndOutDev is...  well, here we do &
                     // assume a 1bpp target - everything beyond 97%
                     // transparency is fully transparent
-                    if( aBmpEx.IsAlpha() )
+                    if( aBmpEx.IsAlpha() && !SkiaHelper::isVCLSkiaEnabled())
                     {
                         BitmapFilter::Filter(aBmpEx, 
BitmapAlphaClampFilter(253));
                     }
@@ -734,7 +735,7 @@ namespace vclcanvas
                     // actually what mp2ndOutDev is...  well, here we do &
                     // assume a 1bpp target - everything beyond 97%
                     // transparency is fully transparent
-                    if( aBmpEx.IsAlpha() )
+                    if( aBmpEx.IsAlpha() && !SkiaHelper::isVCLSkiaEnabled())
                     {
                         BitmapFilter::Filter(aBmpEx, 
BitmapAlphaClampFilter(253));
                     }

Reply via email to