[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

zmo at google.com zmo at google.com
Wed Dec 22 16:08:30 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit e65a82f7ba0c18584e101b5ad68dad5bba013646
Author: zmo at google.com <zmo at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Nov 18 23:56:00 2010 +0000

    2010-11-17  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by Kenneth Russell.
    
            Implement UNPACK_COLORSPACE_CONVERSION_WEBGL
            https://bugs.webkit.org/show_bug.cgi?id=47196
    
            * platform/image-decoders/ImageDecoder.h:
            (WebCore::ImageDecoder::ignoresGammaAndColorProfile): Add a getter function for the ignoreGammaAndColorProfile setting.
            * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
            (WebCore::JPEGImageReader::decode): Hookup ignoreGammaAndColorProfile setting with color profile processing.
            * platform/image-decoders/png/PNGImageDecoder.cpp:
            (WebCore::PNGImageDecoder::headerAvailable): Ditto.
    2010-11-17  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by Kenneth Russell.
    
            Implement UNPACK_COLORSPACE_CONVERSION_WEBGL
            https://bugs.webkit.org/show_bug.cgi?id=47196
    
            * fast/canvas/webgl/gl-teximage-expected.txt:
            * fast/canvas/webgl/gl-teximage.html: Add test cases for images with ICC profiles.
            * fast/canvas/webgl/resources/small-square-with-cie-rgb-profile.png: Added.
            * fast/canvas/webgl/resources/small-square-with-colormatch-profile.png: Added.
            * fast/canvas/webgl/resources/small-square-with-colorspin-profile.jpg: Added.
            * fast/canvas/webgl/resources/small-square-with-colorspin-profile.png: Added.
            * fast/canvas/webgl/resources/small-square-with-e-srgb-profile.png: Added.
            * fast/canvas/webgl/resources/small-square-with-smpte-c-profile.png: Added.
            * fast/canvas/webgl/resources/small-square-with-srgb-iec61966-2.1-profile.png: Added.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72341 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 038cdee..044446c 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,20 @@
+2010-11-17  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by Kenneth Russell.
+
+        Implement UNPACK_COLORSPACE_CONVERSION_WEBGL
+        https://bugs.webkit.org/show_bug.cgi?id=47196
+
+        * fast/canvas/webgl/gl-teximage-expected.txt:
+        * fast/canvas/webgl/gl-teximage.html: Add test cases for images with ICC profiles.
+        * fast/canvas/webgl/resources/small-square-with-cie-rgb-profile.png: Added.
+        * fast/canvas/webgl/resources/small-square-with-colormatch-profile.png: Added.
+        * fast/canvas/webgl/resources/small-square-with-colorspin-profile.jpg: Added.
+        * fast/canvas/webgl/resources/small-square-with-colorspin-profile.png: Added.
+        * fast/canvas/webgl/resources/small-square-with-e-srgb-profile.png: Added.
+        * fast/canvas/webgl/resources/small-square-with-smpte-c-profile.png: Added.
+        * fast/canvas/webgl/resources/small-square-with-srgb-iec61966-2.1-profile.png: Added.
+
 2010-11-18  Jian Li  <jianli at chromium.org>
 
         Reviewed by David Levin.
diff --git a/LayoutTests/fast/canvas/webgl/gl-teximage-expected.txt b/LayoutTests/fast/canvas/webgl/gl-teximage-expected.txt
index 6075bef..ad48988 100644
--- a/LayoutTests/fast/canvas/webgl/gl-teximage-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/gl-teximage-expected.txt
@@ -81,6 +81,27 @@ PASS getError was expected value: NO_ERROR : Should be no errors from setup
 PASS pixel 128, 8 should be within 10 units of 15, 121, 0, 255 was 15, 121, 0, 255
 PASS getError was expected value: NO_ERROR : Should be no errors
 
+check uploading of images with ICC profiles
+PASS getError was expected value: NO_ERROR : Should be no errors from setup
+PASS pixel 128, 8 should be within 10 units of 0, 0, 255, 255 was 0, 0, 254, 255
+PASS getError was expected value: NO_ERROR : Should be no errors from setup
+PASS pixel 128, 8 should be within 10 units of 0, 0, 255, 255 was 0, 0, 254, 255
+PASS getError was expected value: NO_ERROR : Should be no errors from setup
+PASS getError was expected value: NO_ERROR : Should be no errors
+PASS uploading PNGs with same data but various ICC profiles should generate the same results
+PASS getError was expected value: NO_ERROR : Should be no errors from setup
+PASS getError was expected value: NO_ERROR : Should be no errors
+PASS uploading PNGs with same data but various ICC profiles should generate the same results
+PASS getError was expected value: NO_ERROR : Should be no errors from setup
+PASS getError was expected value: NO_ERROR : Should be no errors
+PASS uploading PNGs with same data but various ICC profiles should generate the same results
+PASS getError was expected value: NO_ERROR : Should be no errors from setup
+PASS getError was expected value: NO_ERROR : Should be no errors
+PASS uploading PNGs with same data but various ICC profiles should generate the same results
+PASS getError was expected value: NO_ERROR : Should be no errors from setup
+PASS getError was expected value: NO_ERROR : Should be no errors
+PASS uploading PNGs with same data but various ICC profiles should generate the same results
+
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/LayoutTests/fast/canvas/webgl/gl-teximage.html b/LayoutTests/fast/canvas/webgl/gl-teximage.html
index 2a45120..f163fa0 100644
--- a/LayoutTests/fast/canvas/webgl/gl-teximage.html
+++ b/LayoutTests/fast/canvas/webgl/gl-teximage.html
@@ -34,7 +34,14 @@ var imgURLs = [
   'resources/zero-alpha.png',
   'resources/3x3.png',
   'resources/blue-1x1.jpg',
-  'resources/green-2x2-16bit.png'];
+  'resources/green-2x2-16bit.png',
+  'resources/small-square-with-colorspin-profile.jpg',
+  'resources/small-square-with-colorspin-profile.png',
+  'resources/small-square-with-cie-rgb-profile.png',
+  'resources/small-square-with-colormatch-profile.png',
+  'resources/small-square-with-e-srgb-profile.png',
+  'resources/small-square-with-smpte-c-profile.png',
+  'resources/small-square-with-srgb-iec61966-2.1-profile.png'];
 
 wtu.loadImagesAsync(imgURLs, runTests);
 
@@ -282,9 +289,7 @@ function runTests(imgs) {
   glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
   wtu.drawQuad(gl);
   gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf);
-
   checkPixelRange(buf, middle, center, [   0,   0, 255, 255], 10);
-
   glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors");
 
   debug("");
@@ -296,12 +301,56 @@ function runTests(imgs) {
   glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
   wtu.drawQuad(gl);
   gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf);
-
   checkPixelRange(buf, middle, center, [   15, 121,   0, 255], 10);
-
   glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors");
 
   debug("");
+  debug("check uploading of images with ICC profiles");
+  gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
+  gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, false);
+  gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);
+
+  gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,
+                imgs['resources/small-square-with-colorspin-profile.jpg']);
+  glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+  wtu.drawQuad(gl);
+  gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+  // The image is red.  However, if we ignore the color profile, it is blue.
+  checkPixelRange(buf, middle, center, [ 0, 0, 255, 255], 10);
+
+  gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,
+                imgs['resources/small-square-with-colorspin-profile.png']);
+  glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+  wtu.drawQuad(gl);
+  gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf);
+  // The image is red.  However, if we ignore the color profile, it is blue.
+  checkPixelRange(buf, middle, center, [ 0, 0, 255, 255], 10);
+
+  var iccPNGs = [
+    'resources/small-square-with-cie-rgb-profile.png',
+    'resources/small-square-with-colormatch-profile.png',
+    'resources/small-square-with-e-srgb-profile.png',
+    'resources/small-square-with-smpte-c-profile.png',
+    'resources/small-square-with-srgb-iec61966-2.1-profile.png'];
+  for (var ii = 0; ii < iccPNGs.length; ++ii) {
+    var buf2 = new Uint8Array(width * height * 4);
+    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGB, gl.RGB, gl.UNSIGNED_BYTE,
+                  imgs[iccPNGs[ii]]);
+    glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors from setup");
+    wtu.drawQuad(gl);
+    gl.readPixels(0, 0, width, height, gl.RGBA, gl.UNSIGNED_BYTE, buf2);
+    glErrorShouldBe(gl, gl.NO_ERROR, "Should be no errors");
+    var same = true;
+    for (var jj = 0; jj < buf.length; ++jj) {
+      if (buf[jj] != buf2[jj]) {
+        same = false;
+        break;
+      }
+    }
+    assertMsg(same, "uploading PNGs with same data but various ICC profiles should generate the same results");
+  }
+
+  debug("");
   successfullyParsed = true;
   shouldBeTrue("successfullyParsed");
   debug('<br /><span class="pass">TEST COMPLETE</span>');
diff --git a/LayoutTests/fast/canvas/webgl/resources/small-square-with-cie-rgb-profile.png b/LayoutTests/fast/canvas/webgl/resources/small-square-with-cie-rgb-profile.png
new file mode 100644
index 0000000..aa8bf37
Binary files /dev/null and b/LayoutTests/fast/canvas/webgl/resources/small-square-with-cie-rgb-profile.png differ
diff --git a/LayoutTests/fast/canvas/webgl/resources/small-square-with-colormatch-profile.png b/LayoutTests/fast/canvas/webgl/resources/small-square-with-colormatch-profile.png
new file mode 100644
index 0000000..63454ec
Binary files /dev/null and b/LayoutTests/fast/canvas/webgl/resources/small-square-with-colormatch-profile.png differ
diff --git a/LayoutTests/fast/canvas/webgl/resources/small-square-with-colorspin-profile.jpg b/LayoutTests/fast/canvas/webgl/resources/small-square-with-colorspin-profile.jpg
new file mode 100644
index 0000000..a918696
Binary files /dev/null and b/LayoutTests/fast/canvas/webgl/resources/small-square-with-colorspin-profile.jpg differ
diff --git a/LayoutTests/fast/canvas/webgl/resources/small-square-with-colorspin-profile.png b/LayoutTests/fast/canvas/webgl/resources/small-square-with-colorspin-profile.png
new file mode 100644
index 0000000..5922627
Binary files /dev/null and b/LayoutTests/fast/canvas/webgl/resources/small-square-with-colorspin-profile.png differ
diff --git a/LayoutTests/fast/canvas/webgl/resources/small-square-with-e-srgb-profile.png b/LayoutTests/fast/canvas/webgl/resources/small-square-with-e-srgb-profile.png
new file mode 100644
index 0000000..2792b0a
Binary files /dev/null and b/LayoutTests/fast/canvas/webgl/resources/small-square-with-e-srgb-profile.png differ
diff --git a/LayoutTests/fast/canvas/webgl/resources/small-square-with-smpte-c-profile.png b/LayoutTests/fast/canvas/webgl/resources/small-square-with-smpte-c-profile.png
new file mode 100644
index 0000000..2904e89
Binary files /dev/null and b/LayoutTests/fast/canvas/webgl/resources/small-square-with-smpte-c-profile.png differ
diff --git a/LayoutTests/fast/canvas/webgl/resources/small-square-with-srgb-iec61966-2.1-profile.png b/LayoutTests/fast/canvas/webgl/resources/small-square-with-srgb-iec61966-2.1-profile.png
new file mode 100644
index 0000000..a0201f1
Binary files /dev/null and b/LayoutTests/fast/canvas/webgl/resources/small-square-with-srgb-iec61966-2.1-profile.png differ
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index dc209b1..e0f6a2e 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-11-17  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by Kenneth Russell.
+
+        Implement UNPACK_COLORSPACE_CONVERSION_WEBGL
+        https://bugs.webkit.org/show_bug.cgi?id=47196
+
+        * platform/image-decoders/ImageDecoder.h:
+        (WebCore::ImageDecoder::ignoresGammaAndColorProfile): Add a getter function for the ignoreGammaAndColorProfile setting.
+        * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
+        (WebCore::JPEGImageReader::decode): Hookup ignoreGammaAndColorProfile setting with color profile processing.
+        * platform/image-decoders/png/PNGImageDecoder.cpp:
+        (WebCore::PNGImageDecoder::headerAvailable): Ditto.
+
 2010-11-18  Steve Falkenburg  <sfalken at apple.com>
 
         Reviewed by Adam Roben.
diff --git a/WebCore/platform/image-decoders/ImageDecoder.h b/WebCore/platform/image-decoders/ImageDecoder.h
index 68c6e31..5a04bee 100644
--- a/WebCore/platform/image-decoders/ImageDecoder.h
+++ b/WebCore/platform/image-decoders/ImageDecoder.h
@@ -316,6 +316,9 @@ namespace WebCore {
         // transparency.
         virtual bool supportsAlpha() const { return true; }
 
+        // Whether or not the gamma and color profile are applied.
+        bool ignoresGammaAndColorProfile() const { return m_ignoreGammaAndColorProfile; }
+
         // Sets the "decode failure" flag.  For caller convenience (since so
         // many callers want to return false after calling this), returns false
         // to enable easy tailcalling.  Subclasses may override this to also
diff --git a/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp b/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
index d1de2ca..ff1262e 100644
--- a/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/jpeg/JPEGImageDecoder.cpp
@@ -241,7 +241,8 @@ public:
             if (!m_decoder->setSize(m_info.image_width, m_info.image_height))
                 return false;
 
-            m_decoder->setColorProfile(readColorProfile(info()));              
+            if (!m_decoder->ignoresGammaAndColorProfile())
+                m_decoder->setColorProfile(readColorProfile(info()));
 
             if (m_decodingSizeOnly) {
                 // We can stop here.  Reduce our buffer length and available
diff --git a/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp b/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
index 8b81896..794a474 100644
--- a/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
+++ b/WebCore/platform/image-decoders/png/PNGImageDecoder.cpp
@@ -265,7 +265,7 @@ void PNGImageDecoder::headerAvailable()
     int bitDepth, colorType, interlaceType, compressionType, filterType, channels;
     png_get_IHDR(png, info, &width, &height, &bitDepth, &colorType, &interlaceType, &compressionType, &filterType);
 
-    if (colorType == PNG_COLOR_TYPE_RGB || colorType == PNG_COLOR_TYPE_RGB_ALPHA) {
+    if ((colorType == PNG_COLOR_TYPE_RGB || colorType == PNG_COLOR_TYPE_RGB_ALPHA) && !m_ignoreGammaAndColorProfile) {
         // We currently support color profiles only for RGB and RGBA PNGs.  Supporting
         // color profiles for gray-scale images is slightly tricky, at least using the
         // CoreGraphics ICC library, because we expand gray-scale images to RGB but we

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list