diff options
author | Patrick Luby <plubius@neooffice.org> | 2023-08-18 15:14:18 -0400 |
---|---|---|
committer | Patrick Luby <plubius@neooffice.org> | 2023-08-19 15:59:14 +0200 |
commit | 5baac4e53128d3c0fc73b9918dc9a9c2777ace08 (patch) | |
tree | 1900dd155b8a7e9e0f7f2c4919e6fabb088599d6 /vcl/inc/skia | |
parent | 56ca109d841b02e1646d7c92b8d0acd74c2683c3 (diff) |
Reimplement fix for tdf#156629 and tdf#156630
Reimplement fix in commit 926c5246b6694d469a6caed5d7ea4c3a68648468
in an attempt to reduce the fix's performance hit. Instead of
invoking EnsureBitmapData() and converting the SkImage to a
memory buffer, any pending scaling on alpha masks is handled by
creating a new, scaled SkImage.
Note that in commit 926c5246b6694d469a6caed5d7ea4c3a68648468,
EnsureBitmapData() was invoked which converted the SkImage to a
memory buffer. That in turn would make Invert() a noop which
fixed the related bug where an image has been opened and, before
it has been printed or run in a slideshow, the alpha mask would
unexpectedly be inverted. So keep this immutable behavior without
calling EnsureBitmapData() by adding a new mutability flag.
Change-Id: I99dc272b40c53664ea49333402a6a637b1548a5f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155850
Tested-by: Jenkins
Reviewed-by: Patrick Luby <plubius@neooffice.org>
Diffstat (limited to 'vcl/inc/skia')
-rw-r--r-- | vcl/inc/skia/salbmp.hxx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/vcl/inc/skia/salbmp.hxx b/vcl/inc/skia/salbmp.hxx index 3c8b1a964806..c42aa30f4654 100644 --- a/vcl/inc/skia/salbmp.hxx +++ b/vcl/inc/skia/salbmp.hxx @@ -211,6 +211,7 @@ private: boost::shared_ptr<sal_uInt8[]> mBuffer; int mScanlineSize; // size of one row in mBuffer (based on mPixelsSize) sk_sp<SkImage> mImage; // possibly GPU-backed + bool mImageImmutable = false; sk_sp<SkImage> mAlphaImage; // cached contents as alpha image, possibly GPU-backed // Actual scaling triggered by scale() is done on-demand. This is the size of the pixel // data in mBuffer, if it differs from mSize, then there is a scaling operation pending. |