[Libreoffice-commits] core.git: Branch 'libreoffice-7-0' - vcl/skia
LuboÅ¡ LuÅák (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jun 26 10:49:42 UTC 2020
vcl/skia/gdiimpl.cxx | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
New commits:
commit d00d56db1b5552e5db52caa9058e5d6ca0ff1de4
Author: Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Wed Jun 24 10:38:41 2020 +0200
Commit: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Fri Jun 26 12:49:10 2020 +0200
in Skia raster mode cache even enlarging of images (tdf#134160)
Change-Id: I842b55cd922eb0e411fd7450e84224b41ba82a2c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96989
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
(cherry picked from commit 4654ac5aa75abc59226e15d12e77bd9fa95f7528)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97004
Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index b632f6369363..c33a035329ed 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -1263,16 +1263,23 @@ static sk_sp<SkImage> mergeBitmaps(const SkiaSalBitmap& bitmap, const SkiaSalBit
{
sk_sp<SkImage> image;
OString key;
+ // Probably not much point in caching of just doing a copy.
if (alphaBitmap == nullptr && targetSize == bitmap.GetSize())
- blockCaching = true; // probably not much point in caching of just doing a copy
- if (targetSize.Width() > bitmap.GetSize().Width()
- || targetSize.Height() > bitmap.GetSize().Height())
- blockCaching = true; // caching enlarging is probably wasteful and not worth it
- if (bitmap.GetSize().Width() < 100 && bitmap.GetSize().Height() < 100)
- blockCaching = true; // image too small to be worth caching
+ blockCaching = true;
+ // Caching enlarging is probably wasteful and not worth it.
+ // With Raster it may make a difference though (tdf#134160).
+ if (SkiaHelper::renderMethodToUse() != SkiaHelper::RenderRaster
+ && (targetSize.Width() > bitmap.GetSize().Width()
+ || targetSize.Height() > bitmap.GetSize().Height()))
+ blockCaching = true;
+ // Image too small to be worth caching.
+ if (bitmap.GetSize().Width() < 100 && bitmap.GetSize().Height() < 100
+ && targetSize.Width() < 100 && targetSize.Height() < 100)
+ blockCaching = true;
+ // GPU-accelerated shouldn't need caching of applying alpha.
if (SkiaHelper::renderMethodToUse() != SkiaHelper::RenderRaster
&& targetSize == bitmap.GetSize())
- blockCaching = true; // GPU-accelerated shouldn't need caching of applying alpha
+ blockCaching = true;
if (!blockCaching)
{
OStringBuffer keyBuf;
More information about the Libreoffice-commits
mailing list