summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorPatrick Luby <plubius@neooffice.org>2023-08-10 16:25:11 -0400
committerPatrick Luby <plubius@neooffice.org>2023-08-13 19:46:13 +0200
commit926c5246b6694d469a6caed5d7ea4c3a68648468 (patch)
tree6e6597b2c4105389ddf1cfbc72daaee3407a0d3b /drawinglayer
parent2bda87fd8758448267c447ba26f1932325a1338d (diff)
Related tdf#156630 and tdf#156629 force snapshot of alpha mask
On macOS, with Skia/Metal or Skia/Raster with a Retina display (i.e. 2.0 window scale), the alpha mask gets upscaled in certain cases. This bug appears to be caused by pending scaling of an existing SkImage in the bitmap parameter. So, force the SkiaSalBitmap to handle its pending scaling. This change consolidates the three duplicate fixes added in the following commits into the AlphaMask(const Bitmap&) constructor. commit 12fd870113a663dde5ceb38c61f1986a34095d0e commit ce2d9f5dd4b6a26847c4779bce4866d969ff4400 From my light testing, the bitmap's SkImage is not scaled except when running macOS with a Retina display. The only exception is that this fix will be triggered on all platforms when exporting to PDF images with an alpha mask. Change-Id: Iea5afd55aac984ca606b2b4b44e457d81d76fac0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155568 Tested-by: Jenkins Reviewed-by: Patrick Luby <plubius@neooffice.org>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx14
1 files changed, 1 insertions, 13 deletions
diff --git a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
index 7c9f7b3f3397..e5658f6cf0d3 100644
--- a/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
+++ b/drawinglayer/source/primitive2d/graphicprimitivehelper2d.cxx
@@ -180,19 +180,7 @@ namespace drawinglayer::primitive2d
BitmapEx bitmap;
if( useAlphaMask )
{
- AlphaMask aMaskBitmap(maVirtualDeviceMask->GetBitmap(Point(), maVirtualDeviceMask->GetOutputSizePixel()));
-
- // Related tdf#156630 force snapshot of alpha mask
- // On macOS, with Skia/Raster with a Retina display (i.e.
- // 2.0 window scale), the alpha mask gets upscaled. Also,
- // when Skia is enabled, the alpha mask gets inverted in
- // the first export to PDF after launching the application.
- // These two bugs appear to be caused by asynchronous
- // rendering of the returned bitmap. So, we force a copy
- // of the alpha mask in case it changes before the bitmap
- // is actually drawn.
- AlphaMask::ScopedReadAccess pAccessAlpha(aMaskBitmap);
-
+ const AlphaMask aMaskBitmap(maVirtualDeviceMask->GetBitmap(Point(), maVirtualDeviceMask->GetOutputSizePixel()));
bitmap = BitmapEx(aMainBitmap, aMaskBitmap);
}
else