summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2021-01-04 16:11:53 +0100
committerLuboš Luňák <l.lunak@collabora.com>2021-01-07 16:27:34 +0100
commit121f5962fa03055f91d7e81b9ab41476d58278fe (patch)
tree2cd2fc3c60711674070fa21ec0639b7ee708cdae /external
parent41cabebf9c95459c2c1912528446c45e70c3f203 (diff)
faster debug dumping for Skia
Write out the png images as quickly as possible, with still at least minimal compression. Without compression the debug images are way too big, but otherwise it's preferred that this is fast (especially when possibly dumping thousands of images). Skia's PNG code ignores the quality and hardcodes the libpng defaults, so patch Skia to explicitly handle the quality we want. It'd be also possible to use SkPngEncoder directly, but SkImage makes it non-trivial to get at the pixel data if it's on the GPU, and the internal getROPixels() invoked by encodeToData() also caches the content, so be lazy and patch Skia. Change-Id: I09cc61115246de4fc9d076953eb7fec8140c32cb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108668 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'external')
-rw-r--r--external/skia/UnpackedTarball_skia.mk3
-rw-r--r--external/skia/fast-png-write.patch.115
2 files changed, 17 insertions, 1 deletions
diff --git a/external/skia/UnpackedTarball_skia.mk b/external/skia/UnpackedTarball_skia.mk
index 319b33716a96..946750730edb 100644
--- a/external/skia/UnpackedTarball_skia.mk
+++ b/external/skia/UnpackedTarball_skia.mk
@@ -36,7 +36,8 @@ skia_patches := \
c++20.patch.0 \
constexpr-debug-std-max.patch.1 \
swap-buffers-rect.patch.1 \
- ubsan.patch.0
+ ubsan.patch.0 \
+ fast-png-write.patch.1 \
$(eval $(call gb_UnpackedTarball_set_patchlevel,skia,1))
diff --git a/external/skia/fast-png-write.patch.1 b/external/skia/fast-png-write.patch.1
new file mode 100644
index 000000000000..f47a2af70460
--- /dev/null
+++ b/external/skia/fast-png-write.patch.1
@@ -0,0 +1,15 @@
+diff --git a/src/images/SkImageEncoder.cpp b/src/images/SkImageEncoder.cpp
+index a96a93e0fc..1c110afa58 100644
+--- a/src/images/SkImageEncoder.cpp
++++ b/src/images/SkImageEncoder.cpp
+@@ -46,6 +46,10 @@ bool SkEncodeImage(SkWStream* dst, const SkPixmap& src,
+ }
+ case SkEncodedImageFormat::kPNG: {
+ SkPngEncoder::Options opts;
++ if (quality == 1) {
++ opts.fFilterFlags = SkPngEncoder::FilterFlag::kNone;
++ opts.fZLibLevel = 1;
++ }
+ return SkPngEncoder::Encode(dst, src, opts);
+ }
+ case SkEncodedImageFormat::kWEBP: {