Title: [95494] trunk
Revision
95494
Author
[email protected]
Date
2011-09-19 16:48:27 -0700 (Mon, 19 Sep 2011)

Log Message

Unreviewed, rolling out r95482.
http://trac.webkit.org/changeset/95482
https://bugs.webkit.org/show_bug.cgi?id=68410

Broke chromium webkit-tests (Requested by dslomov on #webkit).

Patch by Sheriff Bot <[email protected]> on 2011-09-19

Source/WebCore:

* platform/image-encoders/skia/JPEGImageEncoder.cpp:
(WebCore::RGBAtoRGB):

LayoutTests:

* fast/canvas/webgl/premultiplyalpha-test-expected.txt:
* fast/canvas/webgl/premultiplyalpha-test.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (95493 => 95494)


--- trunk/LayoutTests/ChangeLog	2011-09-19 23:15:21 UTC (rev 95493)
+++ trunk/LayoutTests/ChangeLog	2011-09-19 23:48:27 UTC (rev 95494)
@@ -1,3 +1,14 @@
+2011-09-19  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r95482.
+        http://trac.webkit.org/changeset/95482
+        https://bugs.webkit.org/show_bug.cgi?id=68410
+
+        Broke chromium webkit-tests (Requested by dslomov on #webkit).
+
+        * fast/canvas/webgl/premultiplyalpha-test-expected.txt:
+        * fast/canvas/webgl/premultiplyalpha-test.html:
+
 2011-09-19  Adam Barth  <[email protected]>
 
         [V8] document.all gets confused about its prototype chain

Modified: trunk/LayoutTests/fast/canvas/webgl/premultiplyalpha-test-expected.txt (95493 => 95494)


--- trunk/LayoutTests/fast/canvas/webgl/premultiplyalpha-test-expected.txt	2011-09-19 23:15:21 UTC (rev 95493)
+++ trunk/LayoutTests/fast/canvas/webgl/premultiplyalpha-test-expected.txt	2011-09-19 23:48:27 UTC (rev 95494)
@@ -3,57 +3,35 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-testing: premultipliedAlpha: true imageFormat: image/png
+testing: premultipliedAlpha: true toDataURL: true
 PASS gl.getContextAttributes().premultipledAlpha is premultipledAlpha
-PASS gl.getContextAttributes().preserveDrawingBuffer is true
 PASS getError was expected value: NO_ERROR : Should be no errors from setup.
 PASS getError was expected value: NO_ERROR : Should be no errors from drawing.
 PASS getError was expected value: NO_ERROR : Should be no errors from creating copy.
 PASS getError was expected value: NO_ERROR : Should be no errors from 2nd drawing.
 PASS should draw with 64,128,255,128
 
-testing: premultipliedAlpha: true imageFormat: undefined
+testing: premultipliedAlpha: true toDataURL: false
 PASS gl.getContextAttributes().premultipledAlpha is premultipledAlpha
-PASS gl.getContextAttributes().preserveDrawingBuffer is true
 PASS getError was expected value: NO_ERROR : Should be no errors from setup.
 PASS getError was expected value: NO_ERROR : Should be no errors from drawing.
 PASS getError was expected value: NO_ERROR : Should be no errors from creating copy.
 PASS getError was expected value: NO_ERROR : Should be no errors from 2nd drawing.
 PASS should draw with 64,128,255,128
 
-testing: premultipliedAlpha: false imageFormat: image/png
+testing: premultipliedAlpha: false toDataURL: true
 PASS gl.getContextAttributes().premultipledAlpha is premultipledAlpha
-PASS gl.getContextAttributes().preserveDrawingBuffer is true
 PASS getError was expected value: NO_ERROR : Should be no errors from setup.
 PASS getError was expected value: NO_ERROR : Should be no errors from drawing.
 PASS getError was expected value: NO_ERROR : Should be no errors from creating copy.
 PASS getError was expected value: NO_ERROR : Should be no errors from 2nd drawing.
 PASS should draw with 255,192,128,1
 
-testing: premultipliedAlpha: false imageFormat: undefined
+testing: premultipliedAlpha: false toDataURL: false
 PASS gl.getContextAttributes().premultipledAlpha is premultipledAlpha
-PASS gl.getContextAttributes().preserveDrawingBuffer is true
 PASS getError was expected value: NO_ERROR : Should be no errors from setup.
 PASS getError was expected value: NO_ERROR : Should be no errors from drawing.
 PASS getError was expected value: NO_ERROR : Should be no errors from creating copy.
 PASS getError was expected value: NO_ERROR : Should be no errors from 2nd drawing.
 PASS should draw with 255,192,128,1
 
-testing: premultipliedAlpha: false imageFormat: image/jpeg
-PASS gl.getContextAttributes().premultipledAlpha is premultipledAlpha
-PASS gl.getContextAttributes().preserveDrawingBuffer is true
-PASS getError was expected value: NO_ERROR : Should be no errors from setup.
-PASS getError was expected value: NO_ERROR : Should be no errors from drawing.
-PASS getError was expected value: NO_ERROR : Should be no errors from creating copy.
-PASS getError was expected value: NO_ERROR : Should be no errors from 2nd drawing.
-PASS should draw with 128,128,128,255
-
-testing: premultipliedAlpha: true imageFormat: image/jpeg
-PASS gl.getContextAttributes().premultipledAlpha is premultipledAlpha
-PASS gl.getContextAttributes().preserveDrawingBuffer is true
-PASS getError was expected value: NO_ERROR : Should be no errors from setup.
-PASS getError was expected value: NO_ERROR : Should be no errors from drawing.
-PASS getError was expected value: NO_ERROR : Should be no errors from creating copy.
-PASS getError was expected value: NO_ERROR : Should be no errors from 2nd drawing.
-PASS should draw with 128,128,128,255
-

Modified: trunk/LayoutTests/fast/canvas/webgl/premultiplyalpha-test.html (95493 => 95494)


--- trunk/LayoutTests/fast/canvas/webgl/premultiplyalpha-test.html	2011-09-19 23:15:21 UTC (rev 95493)
+++ trunk/LayoutTests/fast/canvas/webgl/premultiplyalpha-test.html	2011-09-19 23:48:27 UTC (rev 95494)
@@ -1,7 +1,7 @@
-<!DOCTYPE html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+  "http://www.w3.org/TR/html4/loose.dtd">
 <html>
 <head>
-<meta charset="utf-8">
 <title>Test the WebGL premultipledAlpha context creation flag.</title>
 <link rel="stylesheet" href=""
 <script src=""
@@ -21,7 +21,7 @@
     sentColor: [32, 64, 128, 128],
     expectedColor: [64, 128, 255, 128],
     errorRange: 2,
-    imageFormat: "image/png"
+    useToDataURL: true,
   },
   // If premultipledAlpha is true then
   // [texture]           [canvas]             [texture]
@@ -30,6 +30,7 @@
     sentColor: [32, 64, 128, 128],
     expectedColor: [64, 128, 255, 128],
     errorRange: 2,
+    useToDataURL: false,
   },
   // If premultipledAlpha is false then
   // [texture]           [canvas]            [dataURL]
@@ -38,7 +39,7 @@
     sentColor: [255, 192, 128, 1],
     expectedColor: [255, 192, 128, 1],
     errorRange: 0,
-    imageFormat: "image/png"
+    useToDataURL: true,
   },
   // If premultipledAlpha is false then
   // [texture]           [canvas]            [texture]
@@ -47,24 +48,7 @@
     sentColor: [255, 192, 128, 1],
     expectedColor: [255, 192, 128, 1],
     errorRange: 0,
-  },
-  // If premultipledAlpha is false then
-  // [texture]             [canvas]            [dataURL]
-  // 255, 255, 255, 128 -> 255, 255, 255, 128 -> 128, 128, 128, 255
-  { creationAttributes: {premultipliedAlpha: false},
-    sentColor: [255, 255, 255, 128],
-    expectedColor: [128, 128, 128, 255],
-    errorRange: 2,
-    imageFormat: "image/jpeg"
-  },
-  // If premultipledAlpha is true then
-  // [texture]             [canvas]            [dataURL]
-  // 128, 128, 128, 128 -> 255, 255, 255, 128 -> 128, 128, 128, 255
-  { creationAttributes: {},
-    sentColor: [128, 128, 128, 128],
-    expectedColor: [128, 128, 128, 255],
-    errorRange: 2,
-    imageFormat: "image/jpeg"
+    useToDataURL: false,
   }
 ];
 
@@ -84,15 +68,12 @@
   if (g_count < tests.length) {
      var test = tests[g_count++];
      canvas = document.createElement("canvas");
-     // Need to preserve drawing buffer to load it in a callback
-     test.creationAttributes.preserveDrawingBuffer = true;
      gl = wtu.create3DContext(canvas, test.creationAttributes);
      var premultipliedAlpha = test.creationAttributes.premultipliedAlpha != false;
      debug("")
-     debug("testing: premultipliedAlpha: " + premultipliedAlpha + " imageFormat: " + test.imageFormat);
+     debug("testing: premultipliedAlpha: " + premultipliedAlpha + " toDataURL: " + test.useToDataURL);
 
      shouldBe('gl.getContextAttributes().premultipledAlpha', 'premultipledAlpha');
-     shouldBeTrue('gl.getContextAttributes().preserveDrawingBuffer');
 
      var program = wtu.setupTexturedQuad(gl);
 
@@ -115,7 +96,7 @@
        // gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);
        gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, false);
        gl.bindTexture(gl.TEXTURE_2D, pngTex);
-       if (test.imageFormat) {
+       if (test.useToDataURL) {
           // create texture from image
           gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, this);
        } else {
@@ -136,20 +117,13 @@
        doNextTest();
      }
 
-     if (test.imageFormat) {
+     if (test.useToDataURL) {
         // Load canvas into string using toDataURL
-        var imageUrl = canvas.toDataURL(test.imageFormat);
-        if (test.imageFormat != "image/png" &&
-            (imageUrl.indexOf("data:image/png,") == 0 ||
-             imageUrl.indexOf("data:image/png;") == 0)) {
-          debug("Image format " + test.imageFormat + " not supported; skipping");
-          setTimeout(doNextTest, 0);
-        } else {
-          // Load string into the texture
-          var input = document.createElement("img");
-          input._onload_ = loadTexture;
-          input.src = ""
-        }
+        var png = canvas.toDataURL();
+        // Load string into the texture
+        var input = document.createElement("img");
+        input._onload_ = loadTexture;
+        input.src = ""
      } else {
         // Load canvas into the texture asynchronously (to prevent unbounded stack consumption)
         setTimeout(loadTexture, 0);
@@ -164,6 +138,9 @@
 
 </script>
 
+<script>
+</script>
+
 </body>
 </html>
 

Modified: trunk/Source/WebCore/ChangeLog (95493 => 95494)


--- trunk/Source/WebCore/ChangeLog	2011-09-19 23:15:21 UTC (rev 95493)
+++ trunk/Source/WebCore/ChangeLog	2011-09-19 23:48:27 UTC (rev 95494)
@@ -1,3 +1,14 @@
+2011-09-19  Sheriff Bot  <[email protected]>
+
+        Unreviewed, rolling out r95482.
+        http://trac.webkit.org/changeset/95482
+        https://bugs.webkit.org/show_bug.cgi?id=68410
+
+        Broke chromium webkit-tests (Requested by dslomov on #webkit).
+
+        * platform/image-encoders/skia/JPEGImageEncoder.cpp:
+        (WebCore::RGBAtoRGB):
+
 2011-09-19  Oliver Hunt  <[email protected]>
 
         Refactor Heap allocation logic into separate AllocationSpace class

Modified: trunk/Source/WebCore/platform/image-encoders/skia/JPEGImageEncoder.cpp (95493 => 95494)


--- trunk/Source/WebCore/platform/image-encoders/skia/JPEGImageEncoder.cpp	2011-09-19 23:15:21 UTC (rev 95493)
+++ trunk/Source/WebCore/platform/image-encoders/skia/JPEGImageEncoder.cpp	2011-09-19 23:48:27 UTC (rev 95494)
@@ -92,10 +92,9 @@
 static void RGBAtoRGB(const unsigned char* pixels, unsigned int pixelCount, unsigned char* output)
 {
     for (; pixelCount-- > 0; pixels += 4) {
-        // Do source-over composition on black.
-        *output++ = pixels[0] * pixels[3] / 255;
-        *output++ = pixels[1] * pixels[3] / 255;
-        *output++ = pixels[2] * pixels[3] / 255;
+        *output++ = pixels[0];
+        *output++ = pixels[1];
+        *output++ = pixels[2];
     }
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to