summaryrefslogtreecommitdiff
path: root/vcl/skia/gdiimpl.cxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-09-29 19:33:08 +0200
committerLuboš Luňák <l.lunak@collabora.com>2020-10-02 15:42:48 +0200
commit5acdb23a413ce82a279eb4fee0ddf867e989fec8 (patch)
tree125040132b94bdb5d7b42e4ac7dd80b8756492f7 /vcl/skia/gdiimpl.cxx
parente9ecdfc758280189760d50ed2dfe454d3f83a0ea (diff)
cache Skia bitmaps if they are small but to be scaled
In raster mode this still may cost a bit, especially with code that paints the same bitmap repeatedly to create tiling. Change-Id: I0b65414b418f96a8b1620c8487562b61bd87c221 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103783 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl/skia/gdiimpl.cxx')
-rw-r--r--vcl/skia/gdiimpl.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index b6ffda221424..e194ba964c58 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -1491,9 +1491,8 @@ sk_sp<SkImage> SkiaSalGraphicsImpl::mergeCacheBitmaps(const SkiaSalBitmap& bitma
// Probably not much point in caching of just doing a copy.
if (alphaBitmap == nullptr && targetSize == bitmap.GetSize())
return image;
- // Image too small to be worth caching.
- if (bitmap.GetSize().Width() < 100 && bitmap.GetSize().Height() < 100
- && targetSize.Width() < 100 && targetSize.Height() < 100)
+ // Image too small to be worth caching if not scaling.
+ if (targetSize == bitmap.GetSize() && targetSize.Width() < 100 && targetSize.Height() < 100)
return image;
// In some cases (tdf#134237) the target size may be very large. In that case it's
// better to rely on Skia to clip and draw only the necessary, rather than prepare