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

senorblanco at chromium.org senorblanco at chromium.org
Wed Dec 22 11:57:31 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 3afa6af3989667137d60c5baf01204d659df4427
Author: senorblanco at chromium.org <senorblanco at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Aug 12 07:00:33 2010 +0000

    2010-08-11  Stephen White  <senorblanco at chromium.org>
    
            Reviewed by David Levin.
    
            Add support for BGRA pixel format to GraphicsContext3D.
            https://bugs.webkit.org/show_bug.cgi?id=43858
    
            Although this has been standard in desktop GL since 1.2, it's an
            extension in GL ES 2.0, so a query function is provided to check
            for support.  Since they differ on semantics (GL ES 2.0 requires
            TexImage2D()'s format and internalFormat to match, while desktop GL
            will not accept BGRA as an internalFormat), the stub implementation
            returns false until these quirks have been implemented and tested on
            each port.
    
            * platform/graphics/GraphicsContext3D.cpp:
            (WebCore::GraphicsContext3D::supportsBGRA):
            Add implementation for non-chromium platforms which returns false.
            * platform/graphics/GraphicsContext3D.h:
            (WebCore::GraphicsContext3D::):
            Add query function (supportsBGRA()) and the BGRA_EXT token.
    2010-08-11  Stephen White  <senorblanco at chromium.org>
    
            Reviewed by David Levin.
    
            Add support for BGRA pixel format to GraphicsContext3D.
            https://bugs.webkit.org/show_bug.cgi?id=43858
    
            Although this has been standard in desktop GL since 1.2, it's an
            extension in GL ES 2.0, so a query function is provided to check
            for support.  The DefaultImpl returns false, since it does not yet
            implement the TexImage2D internalFormat quirks.
    
            * public/WebGraphicsContext3D.h:
            (WebKit::WebGraphicsContext3D::supportsBGRA):
            * src/GraphicsContext3D.cpp:
            * src/WebGraphicsContext3DDefaultImpl.cpp:
            (WebKit::WebGraphicsContext3DDefaultImpl::supportsBGRA):
            * src/WebGraphicsContext3DDefaultImpl.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65221 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index c2cbb65..e61b147 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2010-08-11  Stephen White  <senorblanco at chromium.org>
+
+        Reviewed by David Levin.
+
+        Add support for BGRA pixel format to GraphicsContext3D.
+        https://bugs.webkit.org/show_bug.cgi?id=43858
+
+        Although this has been standard in desktop GL since 1.2, it's an 
+        extension in GL ES 2.0, so a query function is provided to check
+        for support.  Since they differ on semantics (GL ES 2.0 requires 
+        TexImage2D()'s format and internalFormat to match, while desktop GL
+        will not accept BGRA as an internalFormat), the stub implementation
+        returns false until these quirks have been implemented and tested on
+        each port.
+
+        * platform/graphics/GraphicsContext3D.cpp:
+        (WebCore::GraphicsContext3D::supportsBGRA):
+        Add implementation for non-chromium platforms which returns false.
+        * platform/graphics/GraphicsContext3D.h:
+        (WebCore::GraphicsContext3D::):
+        Add query function (supportsBGRA()) and the BGRA_EXT token.
+
 2010-08-11  Satish Sampath  <satish at chromium.org>
 
         Reviewed by Kent Tamura.
diff --git a/WebCore/platform/graphics/GraphicsContext3D.cpp b/WebCore/platform/graphics/GraphicsContext3D.cpp
index 79f6ecf..fd92042 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.cpp
+++ b/WebCore/platform/graphics/GraphicsContext3D.cpp
@@ -816,6 +816,21 @@ bool GraphicsContext3D::packPixels(const uint8_t* sourceData,
     return true;
 }
 
+#if !PLATFORM(CHROMIUM)
+GraphicsContext3D::supportsBGRA()
+{
+    // For OpenGL ES2.0, this requires checking for
+    // GL_EXT_texture_format_BGRA8888 and GL_EXT_read_format_bgra.
+    // For desktop GL, BGRA has been supported since OpenGL 1.2.
+
+    // However, note that the GL ES2 extension requires the internalFormat to
+    // glTexImage2D() be GL_BGRA, while desktop GL will not accept GL_BGRA
+    // (must be GL_RGBA), so this must be checked on each platform.
+    // Returning false for now to be safe.
+    return false;
+}
+#endif
+
 } // namespace WebCore
 
 #endif // ENABLE(3D_CANVAS)
diff --git a/WebCore/platform/graphics/GraphicsContext3D.h b/WebCore/platform/graphics/GraphicsContext3D.h
index d702096..dabd0ae 100644
--- a/WebCore/platform/graphics/GraphicsContext3D.h
+++ b/WebCore/platform/graphics/GraphicsContext3D.h
@@ -403,7 +403,9 @@ public:
 
         // WebGL-specific enums
         UNPACK_FLIP_Y_WEBGL = 0x9240,
-        UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241
+        UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241,
+
+        BGRA_EXT = 0x80E1
     };
 
     // Context creation attributes.
@@ -748,6 +750,8 @@ public:
     // getError in the order they were added.
     void synthesizeGLError(unsigned long error);
 
+    bool supportsBGRA();
+
   private:
     GraphicsContext3D(Attributes attrs, HostWindow* hostWindow);
 
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 94acc55..3ebff67 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,22 @@
+2010-08-11  Stephen White  <senorblanco at chromium.org>
+
+        Reviewed by David Levin.
+
+        Add support for BGRA pixel format to GraphicsContext3D.
+        https://bugs.webkit.org/show_bug.cgi?id=43858
+
+        Although this has been standard in desktop GL since 1.2, it's an 
+        extension in GL ES 2.0, so a query function is provided to check
+        for support.  The DefaultImpl returns false, since it does not yet
+        implement the TexImage2D internalFormat quirks.
+
+        * public/WebGraphicsContext3D.h:
+        (WebKit::WebGraphicsContext3D::supportsBGRA):
+        * src/GraphicsContext3D.cpp:
+        * src/WebGraphicsContext3DDefaultImpl.cpp:
+        (WebKit::WebGraphicsContext3DDefaultImpl::supportsBGRA):
+        * src/WebGraphicsContext3DDefaultImpl.h:
+
 2010-08-11  James Hawkins  <jhawkins at chromium.org>
 
         Reviewed by Dmitry Titov.
diff --git a/WebKit/chromium/public/WebGraphicsContext3D.h b/WebKit/chromium/public/WebGraphicsContext3D.h
index 4378afb..4c18076 100644
--- a/WebKit/chromium/public/WebGraphicsContext3D.h
+++ b/WebKit/chromium/public/WebGraphicsContext3D.h
@@ -129,6 +129,8 @@ public:
     // getError in the order they were added.
     virtual void synthesizeGLError(unsigned long error) = 0;
 
+    virtual bool supportsBGRA() = 0;
+
     // The entry points below map directly to the OpenGL ES 2.0 API.
     // See: http://www.khronos.org/registry/gles/
     // and: http://www.khronos.org/opengles/sdk/docs/man/
diff --git a/WebKit/chromium/src/GraphicsContext3D.cpp b/WebKit/chromium/src/GraphicsContext3D.cpp
index af0d842..d5d2adc 100644
--- a/WebKit/chromium/src/GraphicsContext3D.cpp
+++ b/WebKit/chromium/src/GraphicsContext3D.cpp
@@ -297,6 +297,7 @@ public:
     void deleteTexture(unsigned);
 
     void synthesizeGLError(unsigned long error);
+    bool supportsBGRA();
 
 private:
     OwnPtr<WebKit::WebGraphicsContext3D> m_impl;
@@ -907,6 +908,7 @@ DELEGATE_TO_IMPL_1(deleteShader, unsigned)
 DELEGATE_TO_IMPL_1(deleteTexture, unsigned)
 
 DELEGATE_TO_IMPL_1(synthesizeGLError, unsigned long)
+DELEGATE_TO_IMPL_R(supportsBGRA, bool)
 
 //----------------------------------------------------------------------
 // GraphicsContext3D
@@ -1241,6 +1243,7 @@ DELEGATE_TO_INTERNAL_1(deleteShader, unsigned)
 DELEGATE_TO_INTERNAL_1(deleteTexture, unsigned)
 
 DELEGATE_TO_INTERNAL_1(synthesizeGLError, unsigned long)
+DELEGATE_TO_INTERNAL_R(supportsBGRA, bool)
 
 bool GraphicsContext3D::isGLES2Compliant() const
 {
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
index 3d86346..6cab5ec 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
@@ -445,6 +445,14 @@ void WebGraphicsContext3DDefaultImpl::synthesizeGLError(unsigned long error)
     m_syntheticErrors.add(error);
 }
 
+bool WebGraphicsContext3DDefaultImpl::supportsBGRA()
+{
+    // Supported since OpenGL 1.2.  However, glTexImage2D() must be modified
+    // to translate the internalFormat from GL_BGRA to GL_RGBA, since the
+    // former is not accepted by desktop GL.  Return false until this is done.
+    return false;
+}
+
 // Helper macros to reduce the amount of code.
 
 #define DELEGATE_TO_GL(name, glname)                                           \
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
index d32fe7b..cf5f5b4 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.h
@@ -77,6 +77,7 @@ public:
     virtual void prepareTexture();
 
     virtual void synthesizeGLError(unsigned long error);
+    virtual bool supportsBGRA();
 
     virtual void activeTexture(unsigned long texture);
     virtual void attachShader(WebGLId program, WebGLId shader);

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list