vcl/skia/salbmp.cxx | 3 +++ 1 file changed, 3 insertions(+) New commits: commit 6456ffec9d2082cc61d4ae60cad99e3c4ebfe82d Author: Luboš Luňák <l.lu...@collabora.com> AuthorDate: Tue Oct 6 21:31:02 2020 +0200 Commit: Luboš Luňák <l.lu...@collabora.com> CommitDate: Wed Oct 7 16:17:58 2020 +0200
faster Skia from-image conversions if no alpha is involved Skia's drawImage() is faster if alpha types match. So if the source is opaque, use that and not unpremultiplied alpha (which is technically the same if no alpha is involved, but it leads to a slower path). Change-Id: Ie55eaa55099a9a4c9e6db1e66e212da0acef71f1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104043 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lu...@collabora.com> diff --git a/vcl/skia/salbmp.cxx b/vcl/skia/salbmp.cxx index 24f955891e05..bbf1e6f0670e 100644 --- a/vcl/skia/salbmp.cxx +++ b/vcl/skia/salbmp.cxx @@ -995,6 +995,9 @@ void SkiaSalBitmap::EnsureBitmapData() if (mBitCount == 32) alphaType = kPremul_SkAlphaType; #endif + // But if the source image has no alpha, then use no alpha (faster to convert). + if (mImage->imageInfo().alphaType() == kOpaque_SkAlphaType) + alphaType = kOpaque_SkAlphaType; SkBitmap bitmap; if (!bitmap.tryAllocPixels(SkImageInfo::MakeS32(mSize.Width(), mSize.Height(), alphaType))) abort(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits