[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 13:48:05 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit fdf1e59db604e0ad979846956eaa9a0adf4be335
Author: zmo at google.com <zmo at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Sep 27 17:01:45 2010 +0000

    2010-09-24  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by Kenneth Russell.
    
            gl-teximage fails on chrome mac bot
            https://bugs.webkit.org/show_bug.cgi?id=45332
    
            Add support for alpha first pixel formats.
    
            * platform/graphics/GraphicsContext3D.cpp:
            (WebCore::doPacking):
            * platform/graphics/GraphicsContext3D.h:
            * platform/graphics/cg/GraphicsContext3DCG.cpp:
            (WebCore::GraphicsContext3D::getImageData):
    2010-09-24  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by Kenneth Russell.
    
            gl-teximage fails on chrome mac bot
            https://bugs.webkit.org/show_bug.cgi?id=45332
    
            * platform/chromium/test_expectations.txt: Re-enabling gl-textimage.html with the fix.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68399 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index e87922e..be610ac 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,12 @@
+2010-09-24  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by Kenneth Russell.
+
+        gl-teximage fails on chrome mac bot
+        https://bugs.webkit.org/show_bug.cgi?id=45332
+
+        * platform/chromium/test_expectations.txt: Re-enabling gl-textimage.html with the fix.
+
 2010-09-27  Alexander Pavlov  <apavlov at chromium.org>
 
         Reviewed by Sam Weinig.
diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt
index 278ab78..a424540 100644
--- a/LayoutTests/platform/chromium/test_expectations.txt
+++ b/LayoutTests/platform/chromium/test_expectations.txt
@@ -3101,7 +3101,6 @@ BUGWEBGL WIN LINUX : fast/canvas/webgl/context-attributes-alpha-depth-stencil-an
 BUGWEBGL : fast/canvas/webgl/css-webkit-canvas-repaint.html = IMAGE
 BUGWEBGL : fast/canvas/webgl/css-webkit-canvas.html = IMAGE
 BUGWEBGL WIN LINUX : fast/canvas/webgl/gl-object-get-calls.html = TEXT
-BUGWEBGL MAC : fast/canvas/webgl/gl-teximage.html = TEXT
 BUGWEBGL WIN LINUX : fast/canvas/webgl/gl-uniform-arrays.html = TEXT
 BUGWEBGL WIN LINUX : fast/canvas/webgl/point-size.html = TEXT
 BUGWEBGL WIN MAC : fast/canvas/webgl/tex-image-and-sub-image-2d-with-video.html = TEXT PASS
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 049136e..c662573 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-09-24  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by Kenneth Russell.
+
+        gl-teximage fails on chrome mac bot
+        https://bugs.webkit.org/show_bug.cgi?id=45332
+
+        Add support for alpha first pixel formats.
+
+        * platform/graphics/GraphicsContext3D.cpp:
+        (WebCore::doPacking):
+        * platform/graphics/GraphicsContext3D.h:
+        * platform/graphics/cg/GraphicsContext3DCG.cpp:
+        (WebCore::GraphicsContext3D::getImageData):
+
 2010-09-17  Yury Semikhatsky  <yurys at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/platform/graphics/GraphicsContext3D.cpp b/WebCore/platform/graphics/GraphicsContext3D.cpp
index 2da5862..86e9569 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.cpp
+++ b/WebCore/platform/graphics/GraphicsContext3D.cpp
@@ -255,6 +255,14 @@ void unpackRGB8ToRGBA8(const uint8_t* source, uint8_t* destination)
     destination[3] = 0xFF;
 }
 
+void unpackARGB8ToRGBA8(const uint8_t* source, uint8_t* destination)
+{
+    destination[0] = source[1];
+    destination[1] = source[2];
+    destination[2] = source[3];
+    destination[3] = source[0];
+}
+
 void unpackBGRA8ToRGBA8(const uint8_t* source, uint8_t* destination)
 {
     destination[0] = source[2];
@@ -316,6 +324,14 @@ void unpackRA8ToRGBA8(const uint8_t* source, uint8_t* destination)
     destination[3] = source[1];
 }
 
+void unpackAR8ToRGBA8(const uint8_t* source, uint8_t* destination)
+{
+    destination[0] = source[1];
+    destination[1] = source[1];
+    destination[2] = source[1];
+    destination[3] = source[0];
+}
+
 void unpackA8ToRGBA8(const uint8_t* source, uint8_t* destination)
 {
     destination[0] = 0x0;
@@ -634,6 +650,12 @@ static void doPacking(const void* sourceData,
         doUnpackingAndPacking<uint8_t, DestType, unpackRGB8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
+    case GraphicsContext3D::kSourceFormatARGB8: {
+        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
+        computeIncrementParameters<uint8_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
+        doUnpackingAndPacking<uint8_t, DestType, unpackARGB8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        break;
+    }
     case GraphicsContext3D::kSourceFormatBGRA8: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint8_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
@@ -670,6 +692,12 @@ static void doPacking(const void* sourceData,
         doUnpackingAndPacking<uint8_t, DestType, unpackRA8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
+    case GraphicsContext3D::kSourceFormatAR8: {
+        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
+        computeIncrementParameters<uint8_t>(width, 2, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
+        doUnpackingAndPacking<uint8_t, DestType, unpackAR8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        break;
+    }
     case GraphicsContext3D::kSourceFormatA8: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint8_t>(width, 1, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
diff --git a/WebCore/platform/graphics/GraphicsContext3D.h b/WebCore/platform/graphics/GraphicsContext3D.h
index bcb7997..7412ff2 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/WebCore/platform/graphics/GraphicsContext3D.h
@@ -537,11 +537,13 @@ public:
         kSourceFormatRGBA8,
         kSourceFormatRGB8,
         kSourceFormatBGRA8,
+        kSourceFormatARGB8,
         kSourceFormatRGBA5551,
         kSourceFormatRGBA4444,
         kSourceFormatRGB565,
         kSourceFormatR8,
         kSourceFormatRA8,
+        kSourceFormatAR8,
         kSourceFormatA8
     };
 
diff --git a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
index fadc385..2a81fd2 100644
--- a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
+++ b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
@@ -71,9 +71,54 @@ bool GraphicsContext3D::getImageData(Image* image,
     AlphaOp neededAlphaOp = kAlphaDoNothing;
     switch (CGImageGetAlphaInfo(cgImage)) {
     case kCGImageAlphaPremultipliedFirst:
+        // This path is only accessible for MacOS earlier than 10.6.4.
+        // This is a special case for texImage2D with HTMLCanvasElement input,
+        // in which case image->data() should be null.
+        ASSERT(!image->data());
+        if (!premultiplyAlpha)
+            neededAlphaOp = kAlphaDoUnmultiply;
+        switch (componentsPerPixel) {
+        case 2:
+            srcDataFormat = kSourceFormatAR8;
+            break;
+        case 4:
+            srcDataFormat = kSourceFormatARGB8;
+            break;
+        default:
+            return false;
+        }
+        break;
     case kCGImageAlphaFirst:
+        // This path is only accessible for MacOS earlier than 10.6.4.
+        if (premultiplyAlpha)
+            neededAlphaOp = kAlphaDoPremultiply;
+        switch (componentsPerPixel) {
+        case 1:
+            srcDataFormat = kSourceFormatA8;
+            break;
+        case 2:
+            srcDataFormat = kSourceFormatAR8;
+            break;
+        case 4:
+            srcDataFormat = kSourceFormatARGB8;
+            break;
+        default:
+            return false;
+        }
+        break;
     case kCGImageAlphaNoneSkipFirst:
-        return false;
+        // This path is only accessible for MacOS earlier than 10.6.4.
+        switch (componentsPerPixel) {
+        case 2:
+            srcDataFormat = kSourceFormatAR8;
+            break;
+        case 4:
+            srcDataFormat = kSourceFormatARGB8;
+            break;
+        default:
+            return false;
+        }
+        break;
     case kCGImageAlphaPremultipliedLast:
         // This is a special case for texImage2D with HTMLCanvasElement input,
         // in which case image->data() should be null.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list