[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 15:31:51 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit bdd9899b7f7fac22f5513e51dfbca4a6a78f061a
Author: zmo at google.com <zmo at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Nov 5 20:28:49 2010 +0000

    2010-11-04  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by Kenneth Russell.
    
            Need to simulate DEPTH_STENCIL in framebufferRenderbuffer / getFramebufferAttachmentParameter
            https://bugs.webkit.org/show_bug.cgi?id=49020
    
            * src/WebGraphicsContext3DDefaultImpl.cpp: Remove DEPTH_STENCIL_ATTACHMENT emulation at this level.
    2010-11-04  Zhenyao Mo  <zmo at google.com>
    
            Reviewed by Kenneth Russell.
    
            Need to simulate DEPTH_STENCIL in framebufferRenderbuffer / getFramebufferAttachmentParameter
            https://bugs.webkit.org/show_bug.cgi?id=49020
    
            * html/canvas/WebGLFramebuffer.cpp:
            (WebCore::WebGLFramebuffer::getAttachment): Return the attached renderbuffer/texture.
            (WebCore::WebGLFramebuffer::isIncomplete): Add an extra parameter deciding whether we should check internal format matching the attachment point or not.
            (WebCore::WebGLFramebuffer::onAccess): Pass extra parameter in isIncomplete.
            * html/canvas/WebGLFramebuffer.h:
            * html/canvas/WebGLRenderingContext.cpp:
            (WebCore::WebGLRenderingContext::checkFramebufferStatus): Pass extra parameter in isIncomplete.
            (WebCore::WebGLRenderingContext::framebufferRenderbuffer): Emulate DEPTH_STENCIL_ATTACHMENT; re-attach previously conflicted buffers upon detachment.
            (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter): Throw an error when conflicted attachments exist.
            (WebCore::WebGLRenderingContext::renderbufferStorage): Map DEPTH_STENCIL to DEPTH24_STENCIL8.
            * platform/graphics/Extensions3D.h: Add DEPTH24_STENCIL8 enum and update the documentation.
            * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
            (WebCore::GraphicsContext3D::framebufferRenderbuffer): Remove emulation code at this level.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71449 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d5db43e..6e74f6f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2010-11-04  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by Kenneth Russell.
+
+        Need to simulate DEPTH_STENCIL in framebufferRenderbuffer / getFramebufferAttachmentParameter
+        https://bugs.webkit.org/show_bug.cgi?id=49020
+
+        * html/canvas/WebGLFramebuffer.cpp:
+        (WebCore::WebGLFramebuffer::getAttachment): Return the attached renderbuffer/texture.
+        (WebCore::WebGLFramebuffer::isIncomplete): Add an extra parameter deciding whether we should check internal format matching the attachment point or not.
+        (WebCore::WebGLFramebuffer::onAccess): Pass extra parameter in isIncomplete.
+        * html/canvas/WebGLFramebuffer.h:
+        * html/canvas/WebGLRenderingContext.cpp:
+        (WebCore::WebGLRenderingContext::checkFramebufferStatus): Pass extra parameter in isIncomplete.
+        (WebCore::WebGLRenderingContext::framebufferRenderbuffer): Emulate DEPTH_STENCIL_ATTACHMENT; re-attach previously conflicted buffers upon detachment.
+        (WebCore::WebGLRenderingContext::getFramebufferAttachmentParameter): Throw an error when conflicted attachments exist.
+        (WebCore::WebGLRenderingContext::renderbufferStorage): Map DEPTH_STENCIL to DEPTH24_STENCIL8.
+        * platform/graphics/Extensions3D.h: Add DEPTH24_STENCIL8 enum and update the documentation.
+        * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
+        (WebCore::GraphicsContext3D::framebufferRenderbuffer): Remove emulation code at this level.
+
 2010-11-05  Chris Guillory  <chris.guillory at google.com>
 
         Reviewed by Chris Fleizach.
diff --git a/WebCore/html/canvas/WebGLFramebuffer.cpp b/WebCore/html/canvas/WebGLFramebuffer.cpp
index 76a4675..5bf3779 100644
--- a/WebCore/html/canvas/WebGLFramebuffer.cpp
+++ b/WebCore/html/canvas/WebGLFramebuffer.cpp
@@ -103,6 +103,24 @@ void WebGLFramebuffer::setAttachment(unsigned long attachment, WebGLObject* atta
     }
 }
 
+WebGLObject* WebGLFramebuffer::getAttachment(unsigned long attachment) const
+{
+    if (!object())
+        return 0;
+    switch (attachment) {
+    case GraphicsContext3D::COLOR_ATTACHMENT0:
+        return m_colorAttachment.get();
+    case GraphicsContext3D::DEPTH_ATTACHMENT:
+        return m_depthAttachment.get();
+    case GraphicsContext3D::STENCIL_ATTACHMENT:
+        return m_stencilAttachment.get();
+    case GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT:
+        return m_depthStencilAttachment.get();
+    default:
+        return 0;
+    }
+}
+
 void WebGLFramebuffer::removeAttachment(WebGLObject* attachment)
 {
     if (!object())
@@ -137,22 +155,23 @@ unsigned long WebGLFramebuffer::getColorBufferFormat() const
     return 0;
 }
 
-bool WebGLFramebuffer::isIncomplete() const
+bool WebGLFramebuffer::isIncomplete(bool checkInternalFormat) const
 {
     unsigned int count = 0;
     if (isDepthAttached()) {
-        if (getInternalFormat(m_depthAttachment.get()) != GraphicsContext3D::DEPTH_COMPONENT16)
+        if (checkInternalFormat && getInternalFormat(m_depthAttachment.get()) != GraphicsContext3D::DEPTH_COMPONENT16)
             return true;
         count++;
     }
     if (isStencilAttached()) {
-        if (getInternalFormat(m_stencilAttachment.get()) != GraphicsContext3D::STENCIL_INDEX8)
+        if (checkInternalFormat && getInternalFormat(m_stencilAttachment.get()) != GraphicsContext3D::STENCIL_INDEX8)
             return true;
         count++;
     }
     if (isDepthStencilAttached()) {
-        if (getInternalFormat(m_depthStencilAttachment.get()) != GraphicsContext3D::DEPTH_STENCIL
-            || !isValid(m_depthStencilAttachment.get()))
+        if (checkInternalFormat && getInternalFormat(m_depthStencilAttachment.get()) != GraphicsContext3D::DEPTH_STENCIL)
+            return true;
+        if (!isValid(m_depthStencilAttachment.get()))
             return true;
         count++;
     }
@@ -163,7 +182,7 @@ bool WebGLFramebuffer::isIncomplete() const
 
 bool WebGLFramebuffer::onAccess()
 {
-    if (isIncomplete())
+    if (isIncomplete(true))
         return false;
     return initializeRenderbuffers();
 }
diff --git a/WebCore/html/canvas/WebGLFramebuffer.h b/WebCore/html/canvas/WebGLFramebuffer.h
index d455891..394b770 100644
--- a/WebCore/html/canvas/WebGLFramebuffer.h
+++ b/WebCore/html/canvas/WebGLFramebuffer.h
@@ -42,6 +42,7 @@ public:
     void setAttachment(unsigned long, WebGLObject*);
     // If an object is attached to the framebuffer, remove it.
     void removeAttachment(WebGLObject*);
+    WebGLObject* getAttachment(unsigned long) const;
 
     unsigned long getColorBufferFormat() const;
 
@@ -53,7 +54,7 @@ public:
     bool onAccess();
 
     // Return false does not mean COMPLETE, might still be INCOMPLETE.
-    bool isIncomplete() const;
+    bool isIncomplete(bool checkInternalFormat) const;
 
 protected:
     WebGLFramebuffer(WebGLRenderingContext*);
diff --git a/WebCore/html/canvas/WebGLRenderingContext.cpp b/WebCore/html/canvas/WebGLRenderingContext.cpp
index 5d4fdd9..94dac10 100644
--- a/WebCore/html/canvas/WebGLRenderingContext.cpp
+++ b/WebCore/html/canvas/WebGLRenderingContext.cpp
@@ -501,7 +501,7 @@ unsigned long WebGLRenderingContext::checkFramebufferStatus(unsigned long target
     }
     if (!m_framebufferBinding || !m_framebufferBinding->object())
         return GraphicsContext3D::FRAMEBUFFER_COMPLETE;
-    if (m_framebufferBinding->isIncomplete())
+    if (m_framebufferBinding->isIncomplete(true))
         return GraphicsContext3D::FRAMEBUFFER_UNSUPPORTED;
     return m_context->checkFramebufferStatus(target);
     cleanupAfterGraphicsCall(false);
@@ -1198,8 +1198,54 @@ void WebGLRenderingContext::framebufferRenderbuffer(unsigned long target, unsign
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return;
     }
-    m_context->framebufferRenderbuffer(target, attachment, renderbuffertarget, objectOrZero(buffer));
+    Platform3DObject bufferObject = objectOrZero(buffer);
+    bool reattachDepth = false;
+    bool reattachStencil = false;
+    bool reattachDepthStencilDepth = false;
+    bool reattachDepthStencilStencil = false;
+    switch (attachment) {
+    case GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT:
+        m_context->framebufferRenderbuffer(target, GraphicsContext3D::DEPTH_ATTACHMENT, renderbuffertarget, bufferObject);
+        m_context->framebufferRenderbuffer(target, GraphicsContext3D::STENCIL_ATTACHMENT, renderbuffertarget, bufferObject);
+        if (!bufferObject) {
+            reattachDepth = true;
+            reattachStencil = true;
+        }
+        break;
+    case GraphicsContext3D::DEPTH_ATTACHMENT:
+        m_context->framebufferRenderbuffer(target, attachment, renderbuffertarget, objectOrZero(buffer));
+        if (!bufferObject)
+            reattachDepthStencilDepth = true;
+        break;
+    case GraphicsContext3D::STENCIL_ATTACHMENT:
+        m_context->framebufferRenderbuffer(target, attachment, renderbuffertarget, objectOrZero(buffer));
+        if (!bufferObject)
+            reattachDepthStencilStencil = true;
+        break;
+    default:
+        m_context->framebufferRenderbuffer(target, attachment, renderbuffertarget, objectOrZero(buffer));
+    }
     m_framebufferBinding->setAttachment(attachment, buffer);
+    if (reattachDepth) {
+        Platform3DObject object = objectOrZero(m_framebufferBinding->getAttachment(GraphicsContext3D::DEPTH_ATTACHMENT));
+        if (object)
+            m_context->framebufferRenderbuffer(target, GraphicsContext3D::DEPTH_ATTACHMENT, renderbuffertarget, object);
+    }
+    if (reattachStencil) {
+        Platform3DObject object = objectOrZero(m_framebufferBinding->getAttachment(GraphicsContext3D::STENCIL_ATTACHMENT));
+        if (object)
+            m_context->framebufferRenderbuffer(target, GraphicsContext3D::STENCIL_ATTACHMENT, renderbuffertarget, object);
+    }
+    if (reattachDepthStencilDepth) {
+        Platform3DObject object = objectOrZero(m_framebufferBinding->getAttachment(GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT));
+        if (object)
+            m_context->framebufferRenderbuffer(target, GraphicsContext3D::DEPTH_ATTACHMENT, renderbuffertarget, object);
+    }
+    if (reattachDepthStencilStencil) {
+        Platform3DObject object = objectOrZero(m_framebufferBinding->getAttachment(GraphicsContext3D::DEPTH_STENCIL_ATTACHMENT));
+        if (object)
+            m_context->framebufferRenderbuffer(target, GraphicsContext3D::STENCIL_ATTACHMENT, renderbuffertarget, object);
+    }
     cleanupAfterGraphicsCall(false);
 }
 
@@ -1377,7 +1423,7 @@ WebGLGetInfo WebGLRenderingContext::getFramebufferAttachmentParameter(unsigned l
         return WebGLGetInfo();
     }
 
-    if (!m_framebufferBinding || !m_framebufferBinding->object()) {
+    if (!m_framebufferBinding || !m_framebufferBinding->object() || m_framebufferBinding->isIncomplete(false)) {
         m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
         return WebGLGetInfo();
     }
@@ -2233,7 +2279,7 @@ void WebGLRenderingContext::renderbufferStorage(unsigned long target, unsigned l
         break;
     case GraphicsContext3D::DEPTH_STENCIL:
         if (m_isDepthStencilSupported) {
-            m_context->renderbufferStorage(target, internalformat, width, height);
+            m_context->renderbufferStorage(target, Extensions3D::DEPTH24_STENCIL8, width, height);
             cleanupAfterGraphicsCall(false);
         } else
             m_renderbufferBinding->setSize(width, height);
diff --git a/WebCore/platform/graphics/Extensions3D.h b/WebCore/platform/graphics/Extensions3D.h
index 9b0c211..0aed8e7 100644
--- a/WebCore/platform/graphics/Extensions3D.h
+++ b/WebCore/platform/graphics/Extensions3D.h
@@ -47,6 +47,7 @@ public:
     //   GL_EXT_texture_format_BGRA8888
     //   GL_EXT_read_format_bgra
     //   GL_ARB_robustness
+    //   GL_EXT_packed_depth_stencil / GL_OES_packed_depth_stencil
 
     // Takes full name of extension; for example,
     // "GL_EXT_texture_format_BGRA8888".
@@ -59,7 +60,10 @@ public:
         // GL_ARB_robustness enums
         GUILTY_CONTEXT_RESET_ARB = 0x8253,
         INNOCENT_CONTEXT_RESET_ARB = 0x8254,
-        UNKNOWN_CONTEXT_RESET_ARB = 0x8255
+        UNKNOWN_CONTEXT_RESET_ARB = 0x8255,
+
+        // GL_EXT/OES_packed_depth_stencil enums
+        DEPTH24_STENCIL8 = 0x88F0
     };
 
     // GL_ARB_robustness
diff --git a/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp b/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
index a6b6466..85089a0 100644
--- a/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
+++ b/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp
@@ -569,12 +569,7 @@ void GraphicsContext3D::flush()
 void GraphicsContext3D::framebufferRenderbuffer(unsigned long target, unsigned long attachment, unsigned long renderbuffertarget, Platform3DObject buffer)
 {
     makeContextCurrent();
-    GLuint renderbuffer = (GLuint) buffer;
-    if (attachment == DEPTH_STENCIL_ATTACHMENT) {
-        ::glFramebufferRenderbufferEXT(target, DEPTH_ATTACHMENT, renderbuffertarget, renderbuffer);
-        ::glFramebufferRenderbufferEXT(target, STENCIL_ATTACHMENT, renderbuffertarget, renderbuffer);
-    } else
-        ::glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer);
+    ::glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, (GLuint) buffer);
 }
 
 void GraphicsContext3D::framebufferTexture2D(unsigned long target, unsigned long attachment, unsigned long textarget, Platform3DObject texture, long level)
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 48fcec5..6aa5648 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,12 @@
+2010-11-04  Zhenyao Mo  <zmo at google.com>
+
+        Reviewed by Kenneth Russell.
+
+        Need to simulate DEPTH_STENCIL in framebufferRenderbuffer / getFramebufferAttachmentParameter
+        https://bugs.webkit.org/show_bug.cgi?id=49020
+
+        * src/WebGraphicsContext3DDefaultImpl.cpp: Remove DEPTH_STENCIL_ATTACHMENT emulation at this level.
+
 2010-11-05  Darin Fisher  <darin at chromium.org>
 
         Pull chromium at 65229 to fix the build.
diff --git a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
index 14d3e8e..4cb701f 100644
--- a/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
+++ b/WebKit/chromium/src/WebGraphicsContext3DDefaultImpl.cpp
@@ -836,16 +836,7 @@ DELEGATE_TO_GL(finish, Finish)
 
 DELEGATE_TO_GL(flush, Flush)
 
-void WebGraphicsContext3DDefaultImpl::framebufferRenderbuffer(unsigned long target, unsigned long attachment,
-                                                              unsigned long renderbuffertarget, WebGLId buffer)
-{
-    makeContextCurrent();
-    if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
-        glFramebufferRenderbufferEXT(target, GL_DEPTH_ATTACHMENT, renderbuffertarget, buffer);
-        glFramebufferRenderbufferEXT(target, GL_STENCIL_ATTACHMENT, renderbuffertarget, buffer);
-    } else
-        glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, buffer);
-}
+DELEGATE_TO_GL_4(framebufferRenderbuffer, FramebufferRenderbufferEXT, unsigned long, unsigned long, unsigned long, WebGLId)
 
 DELEGATE_TO_GL_5(framebufferTexture2D, FramebufferTexture2DEXT, unsigned long, unsigned long, unsigned long, WebGLId, long)
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list