[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e
commit-queue at webkit.org
commit-queue at webkit.org
Fri Jan 21 14:56:19 UTC 2011
The following commit has been merged in the debian/experimental branch:
commit 613004480b36edae7c035a241d6329cb0743ee33
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jan 5 01:14:53 2011 +0000
2011-01-04 Cosmin Truta <ctruta at chromium.org>
Reviewed by Eric Seidel.
[chromium] PNG compression settings optimized for speed
https://bugs.webkit.org/show_bug.cgi?id=51719
Although Z_HUFFMAN_ONLY is the fastest on hard-to-compress images,
it is also the slowest, by a wide margin, on easy-to-compress images.
Use a more balanced configuration, based on the libpng compression defaults,
but with a faster compression level (3 instead of 6), and a faster filter
("sub" instead of "all").
No change in behaviour, so no new tests.
* platform/image-encoders/skia/PNGImageEncoder.cpp:
(WebCore::PNGImageEncoder::encode):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75032 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 5ece5a4..0cda95c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2011-01-04 Cosmin Truta <ctruta at chromium.org>
+
+ Reviewed by Eric Seidel.
+
+ [chromium] PNG compression settings optimized for speed
+ https://bugs.webkit.org/show_bug.cgi?id=51719
+
+ Although Z_HUFFMAN_ONLY is the fastest on hard-to-compress images,
+ it is also the slowest, by a wide margin, on easy-to-compress images.
+ Use a more balanced configuration, based on the libpng compression defaults,
+ but with a faster compression level (3 instead of 6), and a faster filter
+ ("sub" instead of "all").
+
+ No change in behaviour, so no new tests.
+
+ * platform/image-encoders/skia/PNGImageEncoder.cpp:
+ (WebCore::PNGImageEncoder::encode):
+
2011-01-04 Chris Fleizach <cfleizach at apple.com>
Reviewed by Sam Weinig.
diff --git a/WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp b/WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp
index 265c14a..78f737e 100644
--- a/WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp
+++ b/WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp
@@ -83,8 +83,17 @@ bool PNGImageEncoder::encode(const SkBitmap& bitmap, Vector<unsigned char>* outp
return false;
}
- png_set_compression_level(png, Z_BEST_SPEED);
- png_set_compression_strategy(png, Z_HUFFMAN_ONLY);
+ // Optimize compression for speed.
+ // The parameters are the same as what libpng uses by default for RGB and RGBA images, except:
+ // - the zlib compression level is 3 instead of 6, to avoid the lazy Ziv-Lempel match searching;
+ // - the delta filter is 1 ("sub") instead of 5 ("all"), to reduce the filter computations.
+ // The zlib memory level (8) and strategy (Z_FILTERED) will be set inside libpng.
+ //
+ // Avoid the zlib strategies Z_HUFFMAN_ONLY or Z_RLE.
+ // Although they are the fastest for poorly-compressible images (e.g. photographs),
+ // they are very slow for highly-compressible images (e.g. text, drawings or business graphics).
+ png_set_compression_level(png, 3);
+ png_set_filter(png, PNG_FILTER_TYPE_BASE, PNG_FILTER_SUB);
png_set_write_fn(png, output, writeOutput, 0);
png_set_IHDR(png, info, imageSize.width(), imageSize.height(),
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list