summaryrefslogtreecommitdiff
path: root/vcl/skia
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-03-15 16:56:07 +0100
committerLuboš Luňák <l.lunak@collabora.com>2021-03-16 12:55:33 +0100
commit96007832dd3d800ca781c9ef12904b178adb61f1 (patch)
treec94cddbd81b580c9c2455e0ceb4796a47a8b9652 /vcl/skia
parent98fbedf9e59ba5b6159abfbc85c05c00ceab5b90 (diff)
don't repeatedly create (alpha)SkImage on mEraseColorSet
Change-Id: Iac42ead2bfd5a2b7f245cc44634f675a559d86ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112543 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/skia')
-rw-r--r--vcl/skia/salbmp.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/vcl/skia/salbmp.cxx b/vcl/skia/salbmp.cxx
index 0fa95deb39db..83dd16950eaa 100644
--- a/vcl/skia/salbmp.cxx
+++ b/vcl/skia/salbmp.cxx
@@ -730,6 +730,11 @@ const sk_sp<SkImage>& SkiaSalBitmap::GetSkImage() const
#endif
if (mEraseColorSet)
{
+ if (mImage)
+ {
+ assert(imageSize(mImage) == mSize);
+ return mImage;
+ }
SkiaZone zone;
sk_sp<SkSurface> surface = createSkSurface(
mSize, mEraseColor.IsTransparent() ? kPremul_SkAlphaType : kOpaque_SkAlphaType);
@@ -801,6 +806,11 @@ const sk_sp<SkImage>& SkiaSalBitmap::GetAlphaSkImage() const
#endif
if (mEraseColorSet)
{
+ if (mAlphaImage)
+ {
+ assert(imageSize(mAlphaImage) == mSize);
+ return mAlphaImage;
+ }
SkiaZone zone;
sk_sp<SkSurface> surface = createSkSurface(mSize, kAlpha_8_SkColorType);
assert(surface);