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

kbr at google.com kbr at google.com
Wed Dec 22 15:29:40 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit f927025b227c69ad200e94b9fda75a69a019b3ed
Author: kbr at google.com <kbr at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 5 00:33:18 2010 +0000

    2010-11-04  Kenneth Russell  <kbr at google.com>
    
            Reviewed by Adam Barth.
    
            [chromium] Mac: WebGL: all textured content is blue
            https://bugs.webkit.org/show_bug.cgi?id=49021
    
            Added support for 8-bit, little-endian CGImages. The previous
            image decode path used the default byte order, which is apparently
            big-endian.
    
            Tested with various WebGL content and layout tests in Chromium.
            Ran layout tests in WebKit and tested various WebGL content in
            Safari. Was not able to run layout tests with Chromium port of
            DumpRenderTree due to build failures currently in the tree.
    
            * platform/graphics/GraphicsContext3D.cpp:
            (WebCore::doPacking):
            * platform/graphics/GraphicsContext3D.h:
            * platform/graphics/cg/GraphicsContext3DCG.cpp:
            (WebCore::getSourceDataFormat):
            (WebCore::GraphicsContext3D::getImageData):
    2010-11-04  Kenneth Russell  <kbr at google.com>
    
            Reviewed by Adam Barth.
    
            [chromium] Mac: WebGL: all textured content is blue
            https://bugs.webkit.org/show_bug.cgi?id=49021
    
            Updated expectations for WebGL layout tests which were affected by
            the image decoder change
            https://bugs.webkit.org/show_bug.cgi?id=47974 .
    
            * platform/chromium/test_expectations.txt:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71370 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index ceb581f..1fbdb99 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2010-11-04  Kenneth Russell  <kbr at google.com>
+
+        Reviewed by Adam Barth.
+
+        [chromium] Mac: WebGL: all textured content is blue
+        https://bugs.webkit.org/show_bug.cgi?id=49021
+
+        Updated expectations for WebGL layout tests which were affected by
+        the image decoder change
+        https://bugs.webkit.org/show_bug.cgi?id=47974 .
+
+        * platform/chromium/test_expectations.txt:
+
 2010-11-03  Zhenyao Mo  <zmo at google.com>
 
         Reviewed by Kenneth Russell.
diff --git a/LayoutTests/platform/chromium/test_expectations.txt b/LayoutTests/platform/chromium/test_expectations.txt
index 2c5b844..fcfcd30 100644
--- a/LayoutTests/platform/chromium/test_expectations.txt
+++ b/LayoutTests/platform/chromium/test_expectations.txt
@@ -3346,10 +3346,6 @@ BUGWK48634 MAC : fast/lists/ol-start-dynamic.html = IMAGE
 BUGWK48634 MAC : fast/lists/ordered-list-with-no-ol-tag.html = IMAGE
 BUGWK48634 MAC : fast/lists/scrolled-marker-paint.html = IMAGE
 BUGWK48634 MAC : fast/repaint/block-layout-inline-children-replaced.html = IMAGE
-BUGWK48634 MAC : fast/canvas/webgl/gl-teximage.html = TEXT
-BUGWK48634 MAC : fast/canvas/webgl/tex-image-and-sub-image-2d-with-image.html = TEXT
-BUGWK48634 MAC : fast/canvas/webgl/tex-image-with-format-and-type.html = TEXT
-BUGWK48634 MAC : fast/canvas/webgl/texture-transparent-pixels-initialized.html = TEXT
 
 // New test, seems V8 differs from JSC here.
 // Added by http://trac.webkit.org/changeset/70910
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8387935..c46b79a 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,26 @@
+2010-11-04  Kenneth Russell  <kbr at google.com>
+
+        Reviewed by Adam Barth.
+
+        [chromium] Mac: WebGL: all textured content is blue
+        https://bugs.webkit.org/show_bug.cgi?id=49021
+
+        Added support for 8-bit, little-endian CGImages. The previous
+        image decode path used the default byte order, which is apparently
+        big-endian.
+
+        Tested with various WebGL content and layout tests in Chromium.
+        Ran layout tests in WebKit and tested various WebGL content in
+        Safari. Was not able to run layout tests with Chromium port of
+        DumpRenderTree due to build failures currently in the tree.
+
+        * platform/graphics/GraphicsContext3D.cpp:
+        (WebCore::doPacking):
+        * platform/graphics/GraphicsContext3D.h:
+        * platform/graphics/cg/GraphicsContext3DCG.cpp:
+        (WebCore::getSourceDataFormat):
+        (WebCore::GraphicsContext3D::getImageData):
+
 2010-11-03  Zhenyao Mo  <zmo at google.com>
 
         Reviewed by Kenneth Russell.
diff --git a/WebCore/platform/graphics/GraphicsContext3D.cpp b/WebCore/platform/graphics/GraphicsContext3D.cpp
index 061c87e..2a65128 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.cpp
+++ b/WebCore/platform/graphics/GraphicsContext3D.cpp
@@ -303,6 +303,14 @@ void unpackRGB16BigToRGBA8(const uint16_t* source, uint8_t* destination)
     destination[3] = 0xFF;
 }
 
+void unpackBGR8ToRGBA8(const uint8_t* source, uint8_t* destination)
+{
+    destination[0] = source[2];
+    destination[1] = source[1];
+    destination[2] = source[0];
+    destination[3] = 0xFF;
+}
+
 void unpackARGB8ToRGBA8(const uint8_t* source, uint8_t* destination)
 {
     destination[0] = source[1];
@@ -327,6 +335,14 @@ void unpackARGB16BigToRGBA8(const uint16_t* source, uint8_t* destination)
     destination[3] = convertColor16BigTo8(source[0]);
 }
 
+void unpackABGR8ToRGBA8(const uint8_t* source, uint8_t* destination)
+{
+    destination[0] = source[3];
+    destination[1] = source[2];
+    destination[2] = source[1];
+    destination[3] = source[0];
+}
+
 void unpackBGRA8ToRGBA8(const uint8_t* source, uint8_t* destination)
 {
     destination[0] = source[2];
@@ -819,6 +835,12 @@ static void doPacking(const void* sourceData,
         doUnpackingAndPacking<uint16_t, DestType, unpackRGB16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
+    case GraphicsContext3D::SourceFormatBGR8: {
+        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
+        computeIncrementParameters<uint8_t>(width, 3, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
+        doUnpackingAndPacking<uint8_t, DestType, unpackBGR8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        break;
+    }
     case GraphicsContext3D::SourceFormatARGB8: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint8_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
@@ -837,6 +859,12 @@ static void doPacking(const void* sourceData,
         doUnpackingAndPacking<uint16_t, DestType, unpackARGB16BigToRGBA8, packingFunc>(static_cast<const uint16_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
         break;
     }
+    case GraphicsContext3D::SourceFormatABGR8: {
+        unsigned int sourceElementsPerPixel, sourceElementsPerRow;
+        computeIncrementParameters<uint8_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
+        doUnpackingAndPacking<uint8_t, DestType, unpackABGR8ToRGBA8, packingFunc>(static_cast<const uint8_t*>(sourceData), width, height, sourceElementsPerPixel, sourceElementsPerRow, destinationData, destinationElementsPerPixel);
+        break;
+    }
     case GraphicsContext3D::SourceFormatBGRA8: {
         unsigned int sourceElementsPerPixel, sourceElementsPerRow;
         computeIncrementParameters<uint8_t>(width, 4, sourceUnpackAlignment, &sourceElementsPerPixel, &sourceElementsPerRow);
diff --git a/WebCore/platform/graphics/GraphicsContext3D.h b/WebCore/platform/graphics/GraphicsContext3D.h
index c4dbf31..d8059e5 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/WebCore/platform/graphics/GraphicsContext3D.h
@@ -540,12 +540,14 @@ public:
         SourceFormatRGB8,
         SourceFormatRGB16Little,
         SourceFormatRGB16Big,
+        SourceFormatBGR8,
         SourceFormatBGRA8,
         SourceFormatBGRA16Little,
         SourceFormatBGRA16Big,
         SourceFormatARGB8,
         SourceFormatARGB16Little,
         SourceFormatARGB16Big,
+        SourceFormatABGR8,
         SourceFormatRGBA5551,
         SourceFormatRGBA4444,
         SourceFormatRGB565,
diff --git a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
index 60b5033..0c6acf9 100644
--- a/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
+++ b/WebCore/platform/graphics/cg/GraphicsContext3DCG.cpp
@@ -69,26 +69,22 @@ static GraphicsContext3D::SourceDataFormat getSourceDataFormat(unsigned int comp
         { SourceFormatBaseRGB,        SourceFormatBaseNumFormats, SourceFormatBaseNumFormats }, // 3 componentsPerPixel
         { SourceFormatBaseNumFormats, SourceFormatBaseARGB,       SourceFormatBaseRGBA        } // 4 componentsPerPixel
     };
-    const static GraphicsContext3D::SourceDataFormat formatTable[SourceFormatBaseNumFormats][3] = { // SourceDataFormatBase x bitsPerComponentAndEndian
-        // 8bits                                16bits, little endian                        16bits, big endian
-        { GraphicsContext3D::SourceFormatR8,    GraphicsContext3D::SourceFormatR16Little,    GraphicsContext3D::SourceFormatR16Big },
-        { GraphicsContext3D::SourceFormatA8,    GraphicsContext3D::SourceFormatA16Little,    GraphicsContext3D::SourceFormatA16Big },
-        { GraphicsContext3D::SourceFormatRA8,   GraphicsContext3D::SourceFormatRA16Little,   GraphicsContext3D::SourceFormatRA16Big },
-        { GraphicsContext3D::SourceFormatAR8,   GraphicsContext3D::SourceFormatAR16Little,   GraphicsContext3D::SourceFormatAR16Big },
-        { GraphicsContext3D::SourceFormatRGB8,  GraphicsContext3D::SourceFormatRGB16Little,  GraphicsContext3D::SourceFormatRGB16Big },
-        { GraphicsContext3D::SourceFormatRGBA8, GraphicsContext3D::SourceFormatRGBA16Little, GraphicsContext3D::SourceFormatRGBA16Big },
-        { GraphicsContext3D::SourceFormatARGB8, GraphicsContext3D::SourceFormatARGB16Little, GraphicsContext3D::SourceFormatARGB16Big }
+    const static GraphicsContext3D::SourceDataFormat formatTable[SourceFormatBaseNumFormats][4] = { // SourceDataFormatBase x bitsPerComponent x endian
+        // 8bits, little endian                 8bits, big endian                     16bits, little endian                        16bits, big endian
+        { GraphicsContext3D::SourceFormatR8,    GraphicsContext3D::SourceFormatR8,    GraphicsContext3D::SourceFormatR16Little,    GraphicsContext3D::SourceFormatR16Big },
+        { GraphicsContext3D::SourceFormatA8,    GraphicsContext3D::SourceFormatA8,    GraphicsContext3D::SourceFormatA16Little,    GraphicsContext3D::SourceFormatA16Big },
+        { GraphicsContext3D::SourceFormatAR8,   GraphicsContext3D::SourceFormatRA8,   GraphicsContext3D::SourceFormatRA16Little,   GraphicsContext3D::SourceFormatRA16Big },
+        { GraphicsContext3D::SourceFormatRA8,   GraphicsContext3D::SourceFormatAR8,   GraphicsContext3D::SourceFormatAR16Little,   GraphicsContext3D::SourceFormatAR16Big },
+        { GraphicsContext3D::SourceFormatBGR8,  GraphicsContext3D::SourceFormatRGB8,  GraphicsContext3D::SourceFormatRGB16Little,  GraphicsContext3D::SourceFormatRGB16Big },
+        { GraphicsContext3D::SourceFormatABGR8, GraphicsContext3D::SourceFormatRGBA8, GraphicsContext3D::SourceFormatRGBA16Little, GraphicsContext3D::SourceFormatRGBA16Big },
+        { GraphicsContext3D::SourceFormatBGRA8, GraphicsContext3D::SourceFormatARGB8, GraphicsContext3D::SourceFormatARGB16Little, GraphicsContext3D::SourceFormatARGB16Big }
     };
 
     ASSERT(componentsPerPixel <= 4 && componentsPerPixel > 0);
     SourceDataFormatBase formatBase = formatTableBase[componentsPerPixel - 1][alphaFormat];
     if (formatBase == SourceFormatBaseNumFormats)
         return GraphicsContext3D::SourceFormatNumFormats;
-    if (!is16BitFormat)
-        return formatTable[formatBase][0];
-    if (!bigEndian)
-        return formatTable[formatBase][1];
-    return formatTable[formatBase][2];
+    return formatTable[formatBase][(is16BitFormat ? 2 : 0) + (bigEndian ? 1 : 0)];
 }
 
 bool GraphicsContext3D::getImageData(Image* image,
@@ -125,21 +121,40 @@ bool GraphicsContext3D::getImageData(Image* image,
         return false;
     size_t componentsPerPixel = bitsPerPixel / bitsPerComponent;
 
-    bool srcByteOrder16Big = false;
+    CGBitmapInfo bitInfo = CGImageGetBitmapInfo(cgImage);
+    bool bigEndianSource = false;
+    // These could technically be combined into one large switch
+    // statement, but we prefer not to so that we fail fast if we
+    // encounter an unexpected image configuration.
     if (bitsPerComponent == 16) {
-        CGBitmapInfo bitInfo = CGImageGetBitmapInfo(cgImage);
         switch (bitInfo & kCGBitmapByteOrderMask) {
         case kCGBitmapByteOrder16Big:
-            srcByteOrder16Big = true;
+            bigEndianSource = true;
             break;
         case kCGBitmapByteOrder16Little:
-            srcByteOrder16Big = false;
+            bigEndianSource = false;
             break;
         case kCGBitmapByteOrderDefault:
             // This is a bug in earlier version of cg where the default endian
             // is little whereas the decoded 16-bit png image data is actually
             // Big. Later version (10.6.4) no longer returns ByteOrderDefault.
-            srcByteOrder16Big = true;
+            bigEndianSource = true;
+            break;
+        default:
+            return false;
+        }
+    } else {
+        switch (bitInfo & kCGBitmapByteOrderMask) {
+        case kCGBitmapByteOrder32Big:
+            bigEndianSource = true;
+            break;
+        case kCGBitmapByteOrder32Little:
+            bigEndianSource = false;
+            break;
+        case kCGBitmapByteOrderDefault:
+            // It appears that the default byte order is actually big
+            // endian even on little endian architectures.
+            bigEndianSource = true;
             break;
         default:
             return false;
@@ -190,7 +205,7 @@ bool GraphicsContext3D::getImageData(Image* image,
     default:
         return false;
     }
-    SourceDataFormat srcDataFormat = getSourceDataFormat(componentsPerPixel, alphaFormat, bitsPerComponent == 16, srcByteOrder16Big);
+    SourceDataFormat srcDataFormat = getSourceDataFormat(componentsPerPixel, alphaFormat, bitsPerComponent == 16, bigEndianSource);
     if (srcDataFormat == SourceFormatNumFormats)
         return false;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list