diff options
author | Patrick Luby <plubius@neooffice.org> | 2023-08-07 12:17:36 -0400 |
---|---|---|
committer | Patrick Luby <plubius@neooffice.org> | 2023-08-10 14:01:10 +0200 |
commit | 12fd870113a663dde5ceb38c61f1986a34095d0e (patch) | |
tree | 04982fbf6a4ed1de1fda1346e73385b375e76e52 /vcl/skia/osx | |
parent | 0d8a5f89bff51480d721395729a67e7b4260aea5 (diff) |
tdf#156630 eliminate opaque parts when drawing animated PNG images
Due to the switch from transparency to alpha in commit
81994cb2b8b32453a92bcb011830fcb884f22ff3, flip the background colors
for the VirtualDevices and invert an 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.
Lastly, respect system animation settings when determining if the image
should be animated.
Change-Id: I8144691a6c99bf8361b301b88d22172991463f26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155429
Tested-by: Jenkins
Reviewed-by: Patrick Luby <plubius@neooffice.org>
Diffstat (limited to 'vcl/skia/osx')
-rw-r--r-- | vcl/skia/osx/gdiimpl.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vcl/skia/osx/gdiimpl.cxx b/vcl/skia/osx/gdiimpl.cxx index d774077b4168..abe9befb2fce 100644 --- a/vcl/skia/osx/gdiimpl.cxx +++ b/vcl/skia/osx/gdiimpl.cxx @@ -135,7 +135,10 @@ void AquaSkiaSalGraphicsImpl::flushSurfaceToScreenCG() // by creating a subset SkImage (which as is said above copies data), or set the x coordinate // to 0, which will then make rowBytes() match the actual data. mDirtyRect.fLeft = 0; - assert(mDirtyRect.width() == pixmap.bounds().width()); + // Related tdf#156630 pixmaps can be wider than the dirty rectangle + // This seems to most commonly occur when SAL_FORCE_HIDPI_SCALING=1 + // and the native window scale is 2. + assert(mDirtyRect.width() <= pixmap.bounds().width()); } // tdf#145843 Do not use CGBitmapContextCreate() to create a bitmap context |