From fafc059a17416502722622ff52f38a3e4acd7998 Mon Sep 17 00:00:00 2001 From: Luboš Luňák Date: Fri, 3 Apr 2020 10:50:58 +0200 Subject: avoid Skia bitmap->image pixel copying in raster mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SkImage::MakeFromBitmap() shares the pixels instead of copying, so in raster mode this saves some work. Change-Id: I89aa86c269c4b4f24e305dec390ae0f80e2537da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91769 Tested-by: Jenkins Reviewed-by: Luboš Luňák --- vcl/inc/skia/utils.hxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'vcl/inc/skia') diff --git a/vcl/inc/skia/utils.hxx b/vcl/inc/skia/utils.hxx index c1f35e812d00..16e5addd6909 100644 --- a/vcl/inc/skia/utils.hxx +++ b/vcl/inc/skia/utils.hxx @@ -43,6 +43,9 @@ inline sk_sp createSkSurface(const Size& size, SkColorType type = kN3 return createSkSurface(size.Width(), size.Height(), type); } +// Create SkImage, GPU-backed if possible. +VCL_DLLPUBLIC sk_sp createSkImage(const SkBitmap& bitmap); + // Must be called in any VCL backend before any Skia functionality is used. // If not set, Skia will be disabled. VCL_DLLPUBLIC void -- cgit