summaryrefslogtreecommitdiffstats
path: root/external/skia
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2020-04-02 12:33:57 +0200
committerLuboš Luňák <l.lunak@collabora.com>2020-04-07 11:52:43 +0200
commitc27d2e9145be8972e5d2174fb3f317dc08930074 (patch)
treebc8063b6e69956c553edfca0a2d5d2d551785b4c /external/skia
parentuse delayed scaling in SalSkiaBitmap (diff)
downloadcore-c27d2e9145be8972e5d2174fb3f317dc08930074.tar.gz
core-c27d2e9145be8972e5d2174fb3f317dc08930074.zip
optimize bit depth conversions to/from Skia where possible
Skia has an optimized function for RGB->RGBA conversion that we are going to do often because 24bpp is the most common LO image format. The function is private, so patch that. Also optimize 32bpp->8bpp conversion with gray palette. Change-Id: I48b06f80d5ca9e1c8e3ee51da61e87541bd83d5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91768 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'external/skia')
-rw-r--r--external/skia/UnpackedTarball_skia.mk1
-rw-r--r--external/skia/extend-rgb-to-rgba.patch.023
2 files changed, 24 insertions, 0 deletions
diff --git a/external/skia/UnpackedTarball_skia.mk b/external/skia/UnpackedTarball_skia.mk
index 99344871cb9d..da0a2a7a0547 100644
--- a/external/skia/UnpackedTarball_skia.mk
+++ b/external/skia/UnpackedTarball_skia.mk
@@ -32,6 +32,7 @@ skia_patches := \
windows-force-unicode-api.patch.0 \
operator-eq-bool.patch.0 \
fix-without-gl.patch.0 \
+ extend-rgb-to-rgba.patch.0 \
$(eval $(call gb_UnpackedTarball_set_patchlevel,skia,1))
diff --git a/external/skia/extend-rgb-to-rgba.patch.0 b/external/skia/extend-rgb-to-rgba.patch.0
new file mode 100644
index 000000000000..f68dbab96336
--- /dev/null
+++ b/external/skia/extend-rgb-to-rgba.patch.0
@@ -0,0 +1,23 @@
+diff --git a/include/core/SkSwizzle.h b/include/core/SkSwizzle.h
+index 61e93b2da7..c19063bb91 100644
+--- ./include/core/SkSwizzle.h
++++ ./include/core/SkSwizzle.h
+@@ -16,4 +16,6 @@
+ */
+ SK_API void SkSwapRB(uint32_t* dest, const uint32_t* src, int count);
+
++SK_API void SkExtendRGBToRGBA(uint32_t* dest, const uint8_t* src, int count);
++
+ #endif
+diff --git a/src/core/SkSwizzle.cpp b/src/core/SkSwizzle.cpp
+index 301b0184f1..6e6dd27558 100644
+--- ./src/core/SkSwizzle.cpp
++++ ./src/core/SkSwizzle.cpp
+@@ -12,3 +12,7 @@
+ void SkSwapRB(uint32_t* dest, const uint32_t* src, int count) {
+ SkOpts::RGBA_to_BGRA(dest, src, count);
+ }
++
++void SkExtendRGBToRGBA(uint32_t* dest, const uint8_t* src, int count) {
++ SkOpts::RGB_to_RGB1(dest, src, count);
++}