[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 12:44:30 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 906e4cd73cd34041b6ec5007dbbb665f0ddddbac
Author: zmo at google.com <zmo at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Aug 28 01:05:46 2010 +0000

    2010-08-26  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by Kenneth Russell.
    
            Passing premultiplyAlpha=false to tex{Sub}Image2D loses information (skia)
            https://bugs.webkit.org/show_bug.cgi?id=38282
    
            * platform/graphics/skia/GraphicsContext3DSkia.cpp: Dealing with the case of texImage2D with HTMLCanvasElement input.
            (WebCore::GraphicsContext3D::getImageData):
    2010-08-26  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by Kenneth Russell.
    
            Passing premultiplyAlpha=false to tex{Sub}Image2D loses information (skia)
            https://bugs.webkit.org/show_bug.cgi?id=38282
    
            * fast/canvas/webgl/gl-teximage-expected.txt: Adding back the tests using canvas as texImage2D input.
            * fast/canvas/webgl/gl-teximage.html: Ditto.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@66288 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d3334f8..b1e261e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-08-26  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by Kenneth Russell.
+
+        Passing premultiplyAlpha=false to tex{Sub}Image2D loses information (skia)
+        https://bugs.webkit.org/show_bug.cgi?id=38282
+
+        * fast/canvas/webgl/gl-teximage-expected.txt: Adding back the tests using canvas as texImage2D input.
+        * fast/canvas/webgl/gl-teximage.html: Ditto.
+
 2010-08-27  Joseph Pecoraro  <joepeck at webkit.org>
 
         Reviewed by Alexey Proskuryakov.
diff --git a/LayoutTests/fast/canvas/webgl/gl-teximage-expected.txt b/LayoutTests/fast/canvas/webgl/gl-teximage-expected.txt
index 727b9ee..b31b127 100644
--- a/LayoutTests/fast/canvas/webgl/gl-teximage-expected.txt
+++ b/LayoutTests/fast/canvas/webgl/gl-teximage-expected.txt
@@ -7,7 +7,7 @@ PASS getError was expected value: NO_ERROR : Should be no errors from setup.
 check pixels are NOT pre-multiplied
 PASS getError was expected value: NO_ERROR : Should be no errors from setup
 PASS pixel 0, 15 should be 0, 0, 0, 255 was 0, 0, 0, 255
-PASS pixel 128, 15 should be 255, 0, 255, 255 was 255, 0, 0, 255
+PASS pixel 128, 15 should be 255, 0, 255, 255 was 255, 0, 255, 255
 PASS pixel 255, 15 should be 0, 0, 255, 255 was 0, 0, 255, 255
 PASS pixel 0, 8 should be 128, 128, 128, 255 was 128, 128, 128, 255
 PASS pixel 128, 8 should be 255, 255, 255, 255 was 255, 255, 255, 255
@@ -38,6 +38,15 @@ PASS There should be 32 unique values in channel 1. Found 32
 PASS There should be 32 unique values in channel 2. Found 32
 PASS There should be 2 unique values in channel 3. Found 2
 
+check pixels are UN pre-multiplied
+PASS getError was expected value: NO_ERROR : Should be no errors from setup.
+PASS Half the pixels in channel 0 should be >= 128,128,128. found 50%
+PASS Half the pixels in channel 0 should be < 128,128,128. found 50%
+PASS Half the pixels in channel 1 should be >= 128,128,128. found 50%
+PASS Half the pixels in channel 1 should be < 128,128,128. found 50%
+PASS Half the pixels in channel 2 should be >= 128,128,128. found 50%
+PASS Half the pixels in channel 2 should be < 128,128,128. found 50%
+
 check pixels are pre-multiplied
 PASS getError was expected value: NO_ERROR : Should be no errors from setup
 PASS pixels should all be 0.
diff --git a/LayoutTests/fast/canvas/webgl/gl-teximage.html b/LayoutTests/fast/canvas/webgl/gl-teximage.html
index 016a5f6..cec91b4 100644
--- a/LayoutTests/fast/canvas/webgl/gl-teximage.html
+++ b/LayoutTests/fast/canvas/webgl/gl-teximage.html
@@ -169,6 +169,7 @@ function runTests(imgs) {
     }
     assertMsg(same, "pixels should be same regardless of gamma settings.");
   }
+*/
 
   debug("");
   debug("check pixels are UN pre-multiplied");
@@ -210,7 +211,6 @@ function runTests(imgs) {
               " should be < 128,128,128. found " +
               ((lt128Count[jj] / 256) * 100).toFixed() + "%");
   }
-*/
 
   debug("");
   debug("check pixels are pre-multiplied");
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 9e296f2..15b5959 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,13 @@
+2010-08-26  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by Kenneth Russell.
+
+        Passing premultiplyAlpha=false to tex{Sub}Image2D loses information (skia)
+        https://bugs.webkit.org/show_bug.cgi?id=38282
+
+        * platform/graphics/skia/GraphicsContext3DSkia.cpp: Dealing with the case of texImage2D with HTMLCanvasElement input.
+        (WebCore::GraphicsContext3D::getImageData):
+
 2010-08-26  Vangelis Kokkevis  <vangelis at chromium.org>
 
         Reviewed by Darin Fisher.
diff --git a/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp b/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
index 61039f2..c503307 100644
--- a/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
+++ b/WebCore/platform/graphics/skia/GraphicsContext3DSkia.cpp
@@ -44,28 +44,40 @@ bool GraphicsContext3D::getImageData(Image* image,
                                      bool premultiplyAlpha,
                                      Vector<uint8_t>& outputVector)
 {
-    if (!image || !image->data())
+    if (!image)
         return false;
-    ImageSource decoder(false);
-    decoder.setData(image->data(), true);
-    if (!decoder.frameCount() || !decoder.frameIsCompleteAtIndex(0))
-        return false;
-    bool hasAlpha = decoder.frameHasAlphaAtIndex(0);
-    OwnPtr<NativeImageSkia> pixels(decoder.createFrameAtIndex(0));
-    if (!pixels.get() || !pixels->isDataComplete() || !pixels->width() || !pixels->height())
-        return false;
-    SkBitmap::Config skiaConfig = pixels->config();
-    if (skiaConfig != SkBitmap::kARGB_8888_Config)
+    OwnPtr<NativeImageSkia> pixels;
+    NativeImageSkia* skiaImage = 0;
+    AlphaOp neededAlphaOp = kAlphaDoNothing;
+    if (image->data()) {
+        ImageSource decoder(false);
+        decoder.setData(image->data(), true);
+        if (!decoder.frameCount() || !decoder.frameIsCompleteAtIndex(0))
+            return false;
+        bool hasAlpha = decoder.frameHasAlphaAtIndex(0);
+        pixels = decoder.createFrameAtIndex(0);
+        if (!pixels.get() || !pixels->isDataComplete() || !pixels->width() || !pixels->height())
+            return false;
+        SkBitmap::Config skiaConfig = pixels->config();
+        if (skiaConfig != SkBitmap::kARGB_8888_Config)
+            return false;
+        skiaImage = pixels.get();
+        if (hasAlpha && premultiplyAlpha)
+            neededAlphaOp = kAlphaDoPremultiply;
+    } else {
+        // This is a special case for texImage2D with HTMLCanvasElement input.
+        skiaImage = image->nativeImageForCurrentFrame();
+        if (!premultiplyAlpha)
+            neededAlphaOp = kAlphaDoUnmultiply;
+    }
+    if (!skiaImage)
         return false;
-    SkBitmap& skiaImageRef = *pixels;
+    SkBitmap& skiaImageRef = *skiaImage;
     SkAutoLockPixels lock(skiaImageRef);
-    ASSERT(pixels->rowBytes() == pixels->width() * 4);
-    outputVector.resize(pixels->rowBytes() * pixels->height());
-    AlphaOp neededAlphaOp = kAlphaDoNothing;
-    if (hasAlpha && premultiplyAlpha)
-        neededAlphaOp = kAlphaDoPremultiply;
-    return packPixels(reinterpret_cast<const uint8_t*>(pixels->getPixels()),
-                      kSourceFormatBGRA8, pixels->width(), pixels->height(), 0,
+    ASSERT(skiaImage->rowBytes() == skiaImage->width() * 4);
+    outputVector.resize(skiaImage->rowBytes() * skiaImage->height());
+    return packPixels(reinterpret_cast<const uint8_t*>(skiaImage->getPixels()),
+                      kSourceFormatBGRA8, skiaImage->width(), skiaImage->height(), 0,
                       format, type, neededAlphaOp, outputVector.data());
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list