[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:37:10 UTC 2011


The following commit has been merged in the debian/experimental branch:
commit 5cc59ce3a1af2b323d02eab2e96dc6456fb4ae0b
Author: commit-queue at webkit.org <commit-queue at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Dec 23 08:00:26 2010 +0000

    2010-12-23  Noel Gordon  <noel.gordon at gmail.com>
    
            Reviewed by Adam Barth.
    
            [chromium] Reduce canvas.toDataURL("image/png") run-time costs 300%
            https://bugs.webkit.org/show_bug.cgi?id=51455
    
            Chromium uses the libpng compression defaults.  Good compression results,
            but at much larger run-time cost compared to other browsers.  Chrome is 2
            times slower than Mozilla 3.6.12 and 3-4 times slower than Safari 5.0.3.
    
            libpng has supported alternative compression methods for some time, they
            better meet the dual goals of good compression and run-time cost for the
            on-line case, and are well-documented.  Here use Huffman encoding.  It's
            2-20% faster than other encodings (Z_RLE, Z_FILTERED) and the compressed
            size is within 1% of the Safari 5.0.3 result independent of image size.
    
            No change in behaviour, so no new tests.
    
            * platform/image-encoders/skia/PNGImageEncoder.cpp:
            (WebCore::PNGImageEncoder::encode): Apply Huffman image encoding.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74541 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index abc1e23..731e8ca 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-12-23  Noel Gordon  <noel.gordon at gmail.com>
+
+        Reviewed by Adam Barth.
+
+        [chromium] Reduce canvas.toDataURL("image/png") run-time costs 300%
+        https://bugs.webkit.org/show_bug.cgi?id=51455
+
+        Chromium uses the libpng compression defaults.  Good compression results,
+        but at much larger run-time cost compared to other browsers.  Chrome is 2
+        times slower than Mozilla 3.6.12 and 3-4 times slower than Safari 5.0.3.
+
+        libpng has supported alternative compression methods for some time, they
+        better meet the dual goals of good compression and run-time cost for the
+        on-line case, and are well-documented.  Here use Huffman encoding.  It's
+        2-20% faster than other encodings (Z_RLE, Z_FILTERED) and the compressed
+        size is within 1% of the Safari 5.0.3 result independent of image size.
+
+        No change in behaviour, so no new tests.
+
+        * platform/image-encoders/skia/PNGImageEncoder.cpp:
+        (WebCore::PNGImageEncoder::encode): Apply Huffman image encoding.
+
 2010-12-22  Noel Gordon  <noel.gordon at gmail.com>
 
         Reviewed by Darin Fisher.
diff --git a/WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp b/WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp
index 92dd69a..265c14a 100644
--- a/WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp
+++ b/WebCore/platform/image-encoders/skia/PNGImageEncoder.cpp
@@ -83,6 +83,9 @@ 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);
+
     png_set_write_fn(png, output, writeOutput, 0);
     png_set_IHDR(png, info, imageSize.width(), imageSize.height(),
                  8, PNG_COLOR_TYPE_RGB_ALPHA, 0, 0, 0);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list