summaryrefslogtreecommitdiff
path: root/canvas
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-11-17 10:36:25 +0100
committerLuboš Luňák <l.lunak@collabora.com>2021-11-17 14:12:48 +0100
commitb4f03a95db84c1d18c9435d13f41787596d34b12 (patch)
tree7754058b3d738d0ebeedb54905b3641d1909efdb /canvas
parent23b17e409976f3c106028cc6617ca3a841eb839d (diff)
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.lunak@collabora.com>
Diffstat (limited to 'canvas')
-rw-r--r--canvas/source/vcl/canvashelper.cxx5
1 files changed, 3 insertions, 2 deletions
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));
}