2011-04-11 John Bates <jbates@google.com>
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Apr 2011 02:30:01 +0000 (02:30 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Apr 2011 02:30:01 +0000 (02:30 +0000)
        Reviewed by Kenneth Russell.

        chromium support for glSetLatch and glWaitLatch between 3D contexts
        https://bugs.webkit.org/show_bug.cgi?id=58003

        * platform/graphics/chromium/Canvas2DLayerChromium.cpp:
        (WebCore::Canvas2DLayerChromium::~Canvas2DLayerChromium):
        (WebCore::Canvas2DLayerChromium::setDrawingBuffer):
        (WebCore::Canvas2DLayerChromium::setLayerRenderer):
        * platform/graphics/chromium/Canvas2DLayerChromium.h:
        * platform/graphics/chromium/Extensions3DChromium.h:
        * platform/graphics/chromium/GLES2Canvas.cpp:
        (WebCore::Cubic::Cubic):
        * platform/graphics/chromium/LayerRendererChromium.cpp:
        (WebCore::LayerRendererChromium::LayerRendererChromium):
        (WebCore::LayerRendererChromium::updateAndDrawLayers):
        (WebCore::LayerRendererChromium::updateLayers):
        (WebCore::LayerRendererChromium::addChildContext):
        (WebCore::LayerRendererChromium::removeChildContext):
        * platform/graphics/chromium/LayerRendererChromium.h:
        * platform/graphics/chromium/WebGLLayerChromium.cpp:
        (WebCore::WebGLLayerChromium::~WebGLLayerChromium):
        (WebCore::WebGLLayerChromium::updateCompositorResources):
        (WebCore::WebGLLayerChromium::setContext):
        (WebCore::WebGLLayerChromium::setLayerRenderer):
        * platform/graphics/chromium/WebGLLayerChromium.h:
2011-04-11  John Bates  <jbates@google.com>

        Reviewed by Kenneth Russell.

        chromium support for glSetLatch and glWaitLatch between 3D contexts
        https://bugs.webkit.org/show_bug.cgi?id=58003

        * public/WebGraphicsContext3D.h:
        (WebKit::WebGraphicsContext3D::getParentToChildLatchCHROMIUM):
        (WebKit::WebGraphicsContext3D::getChildToParentLatchCHROMIUM):
        (WebKit::WebGraphicsContext3D::waitLatchCHROMIUM):
        (WebKit::WebGraphicsContext3D::setLatchCHROMIUM):
        * src/Extensions3DChromium.cpp:
        (WebCore::Extensions3DChromium::waitLatchCHROMIUM):
        (WebCore::Extensions3DChromium::setLatchCHROMIUM):
        * src/GraphicsContext3DChromium.cpp:
        * src/GraphicsContext3DInternal.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83552 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.h
Source/WebCore/platform/graphics/chromium/Extensions3DChromium.h
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.h
Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebGraphicsContext3D.h
Source/WebKit/chromium/src/Extensions3DChromium.cpp
Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp
Source/WebKit/chromium/src/GraphicsContext3DInternal.h

index 26c9d88..062a2bf 100644 (file)
@@ -1,3 +1,32 @@
+2011-04-11  John Bates  <jbates@google.com>
+
+        Reviewed by Kenneth Russell.
+
+        chromium support for glSetLatch and glWaitLatch between 3D contexts
+        https://bugs.webkit.org/show_bug.cgi?id=58003
+
+        * platform/graphics/chromium/Canvas2DLayerChromium.cpp:
+        (WebCore::Canvas2DLayerChromium::~Canvas2DLayerChromium):
+        (WebCore::Canvas2DLayerChromium::setDrawingBuffer):
+        (WebCore::Canvas2DLayerChromium::setLayerRenderer):
+        * platform/graphics/chromium/Canvas2DLayerChromium.h:
+        * platform/graphics/chromium/Extensions3DChromium.h:
+        * platform/graphics/chromium/GLES2Canvas.cpp:
+        (WebCore::Cubic::Cubic):
+        * platform/graphics/chromium/LayerRendererChromium.cpp:
+        (WebCore::LayerRendererChromium::LayerRendererChromium):
+        (WebCore::LayerRendererChromium::updateAndDrawLayers):
+        (WebCore::LayerRendererChromium::updateLayers):
+        (WebCore::LayerRendererChromium::addChildContext):
+        (WebCore::LayerRendererChromium::removeChildContext):
+        * platform/graphics/chromium/LayerRendererChromium.h:
+        * platform/graphics/chromium/WebGLLayerChromium.cpp:
+        (WebCore::WebGLLayerChromium::~WebGLLayerChromium):
+        (WebCore::WebGLLayerChromium::updateCompositorResources):
+        (WebCore::WebGLLayerChromium::setContext):
+        (WebCore::WebGLLayerChromium::setLayerRenderer):
+        * platform/graphics/chromium/WebGLLayerChromium.h:
+
 2011-04-11  Alexey Marinichev  <amarinichev@chromium.org>
 
         Reviewed by James Robinson.
index 4cb119a..e3253ab 100644 (file)
@@ -36,6 +36,7 @@
 
 #include "DrawingBuffer.h"
 #include "GraphicsContext3D.h"
+#include "LayerRendererChromium.h"
 
 namespace WebCore {
 
@@ -54,6 +55,8 @@ Canvas2DLayerChromium::~Canvas2DLayerChromium()
 {
     if (m_textureId)
         layerRendererContext()->deleteTexture(m_textureId);
+    if (m_drawingBuffer && layerRenderer())
+        layerRenderer()->removeChildContext(m_drawingBuffer->graphicsContext3D());
 }
 
 void Canvas2DLayerChromium::updateCompositorResources()
@@ -103,8 +106,28 @@ unsigned Canvas2DLayerChromium::textureId() const
 void Canvas2DLayerChromium::setDrawingBuffer(DrawingBuffer* drawingBuffer)
 {
     if (drawingBuffer != m_drawingBuffer) {
+        if (m_drawingBuffer && layerRenderer())
+            layerRenderer()->removeChildContext(m_drawingBuffer->graphicsContext3D());
+
         m_drawingBuffer = drawingBuffer;
         m_textureChanged = true;
+
+        if (drawingBuffer && layerRenderer())
+            layerRenderer()->addChildContext(m_drawingBuffer->graphicsContext3D());
+    }
+}
+
+void Canvas2DLayerChromium::setLayerRenderer(LayerRendererChromium* newLayerRenderer)
+{
+    if (layerRenderer() != newLayerRenderer) {
+        if (m_drawingBuffer->graphicsContext3D()) {
+            if (layerRenderer())
+                layerRenderer()->removeChildContext(m_drawingBuffer->graphicsContext3D());
+            if (newLayerRenderer)
+                newLayerRenderer->addChildContext(m_drawingBuffer->graphicsContext3D());
+        }
+
+        LayerChromium::setLayerRenderer(newLayerRenderer);
     }
 }
 
index 81b118c..4224ab1 100644 (file)
@@ -52,6 +52,8 @@ public:
     unsigned textureId() const;
     void setDrawingBuffer(DrawingBuffer*);
 
+    virtual void setLayerRenderer(LayerRendererChromium*);
+
 private:
     explicit Canvas2DLayerChromium(DrawingBuffer*, GraphicsLayerChromium* owner);
     DrawingBuffer* m_drawingBuffer;
index 3b0fdbf..0e0dffc 100644 (file)
@@ -66,6 +66,12 @@ public:
     // GL_CHROMIUM_copy_texture_to_parent_texture
     void copyTextureToParentTextureCHROMIUM(unsigned texture, unsigned parentTexture);
 
+    // Latch support
+    void getParentToChildLatchCHROMIUM(GC3Duint* latchId);
+    void getChildToParentLatchCHROMIUM(GC3Duint* latchId);
+    void waitLatchCHROMIUM(GC3Duint latchId);
+    void setLatchCHROMIUM(GC3Duint latchId);
+
 private:
     // Instances of this class are strictly owned by the GraphicsContext3D implementation and do not
     // need to be instantiated by any other code.
index 2753033..4bd8e06 100644 (file)
@@ -36,6 +36,7 @@
 
 #include "cc/CCLayerImpl.h"
 #include "Canvas2DLayerChromium.h"
+#include "Extensions3DChromium.h"
 #include "FloatQuad.h"
 #include "GeometryBinding.h"
 #include "GraphicsContext3D.h"
@@ -115,8 +116,11 @@ LayerRendererChromium::LayerRendererChromium(PassRefPtr<GraphicsContext3D> conte
     , m_offscreenFramebufferId(0)
     , m_compositeOffscreen(false)
     , m_context(context)
+    , m_childContextsWereCopied(false)
+    , m_contextSupportsLatch(false)
     , m_defaultRenderSurface(0)
 {
+    m_contextSupportsLatch = m_context->getExtensions()->supports("GL_CHROMIUM_latch");
     m_hardwareCompositing = initializeSharedObjects();
     m_rootLayerContentTiler = LayerTilerChromium::create(this, IntSize(256, 256), LayerTilerChromium::NoBorderTexels);
     ASSERT(m_rootLayerContentTiler);
@@ -271,8 +275,47 @@ void LayerRendererChromium::updateAndDrawLayers()
     LayerList renderSurfaceLayerList;
     updateLayers(renderSurfaceLayerList);
 
+    // Before drawLayers:
+    if (hardwareCompositing() && m_contextSupportsLatch) {
+        // FIXME: The multithreaded compositor case will not work as long as
+        // copyTexImage2D resolves to the parent texture, because the main
+        // thread can execute WebGL calls on the child context at any time,
+        // potentially clobbering the parent texture that is being renderered
+        // by the compositor thread.
+        if (m_childContextsWereCopied) {
+            Extensions3DChromium* parentExt = static_cast<Extensions3DChromium*>(m_context->getExtensions());
+            // For each child context:
+            //   glWaitLatch(Offscreen->Compositor);
+            ChildContextMap::iterator i = m_childContexts.begin();
+            for (; i != m_childContexts.end(); ++i) {
+                Extensions3DChromium* childExt = static_cast<Extensions3DChromium*>(i->first->getExtensions());
+                GC3Duint latchId;
+                childExt->getChildToParentLatchCHROMIUM(&latchId);
+                parentExt->waitLatchCHROMIUM(latchId);
+            }
+        }
+        // Reset to false to indicate that we have consumed the dirty child
+        // contexts' parent textures. (This is only useful when the compositor
+        // is multithreaded.)
+        m_childContextsWereCopied = false;
+    }
+
     drawLayers(renderSurfaceLayerList);
 
+    // After drawLayers:
+    if (hardwareCompositing() && m_contextSupportsLatch) {
+        Extensions3DChromium* parentExt = static_cast<Extensions3DChromium*>(m_context->getExtensions());
+        // For each child context:
+        //   glSetLatch(Compositor->Offscreen);
+        ChildContextMap::iterator i = m_childContexts.begin();
+        for (; i != m_childContexts.end(); ++i) {
+            Extensions3DChromium* childExt = static_cast<Extensions3DChromium*>(i->first->getExtensions());
+            GC3Duint latchId;
+            childExt->getParentToChildLatchCHROMIUM(&latchId);
+            parentExt->setLatchCHROMIUM(latchId);
+        }
+    }
+
     if (isCompositingOffscreen())
         copyOffscreenTextureToDisplay();
 }
@@ -309,7 +352,48 @@ void LayerRendererChromium::updateLayers(LayerList& renderSurfaceLayerList)
 
     paintContentsRecursive(m_rootLayer.get());
 
+    // FIXME: Before updateCompositorResourcesRecursive, when the compositor runs in
+    // its own thread, and when the copyTexImage2D bug is fixed, insert
+    // a glWaitLatch(Compositor->Offscreen) on all child contexts here instead
+    // of after updateCompositorResourcesRecursive.
+    // Also uncomment the glSetLatch(Compositor->Offscreen) code in addChildContext.
+//  if (hardwareCompositing() && m_contextSupportsLatch) {
+//      // For each child context:
+//      //   glWaitLatch(Compositor->Offscreen);
+//      ChildContextMap::iterator i = m_childContexts.begin();
+//      for (; i != m_childContexts.end(); ++i) {
+//          Extensions3DChromium* ext = static_cast<Extensions3DChromium*>(i->first->getExtensions());
+//          GC3Duint childToParentLatchId, parentToChildLatchId;
+//          ext->getParentToChildLatchCHROMIUM(&parentToChildLatchId);
+//          ext->waitLatchCHROMIUM(parentToChildLatchId);
+//      }
+//  }
+
     updateCompositorResourcesRecursive(m_rootLayer.get());
+
+    // After updateCompositorResourcesRecursive, set/wait latches for all child
+    // contexts. This will prevent the compositor from using any of the child
+    // parent textures while WebGL commands are executing from javascript *and*
+    // while the final parent texture is being blit'd. copyTexImage2D
+    // uses the parent texture as a temporary resolve buffer, so that's why the
+    // waitLatch is below, to block the compositor from using the parent texture
+    // until the next WebGL SwapBuffers (or copyTextureToParentTexture for
+    // Canvas2D).
+    if (hardwareCompositing() && m_contextSupportsLatch) {
+        m_childContextsWereCopied = true;
+        // For each child context:
+        //   glSetLatch(Offscreen->Compositor);
+        //   glWaitLatch(Compositor->Offscreen);
+        ChildContextMap::iterator i = m_childContexts.begin();
+        for (; i != m_childContexts.end(); ++i) {
+            Extensions3DChromium* ext = static_cast<Extensions3DChromium*>(i->first->getExtensions());
+            GC3Duint childToParentLatchId, parentToChildLatchId;
+            ext->getParentToChildLatchCHROMIUM(&parentToChildLatchId);
+            ext->getChildToParentLatchCHROMIUM(&childToParentLatchId);
+            ext->setLatchCHROMIUM(childToParentLatchId);
+            ext->waitLatchCHROMIUM(parentToChildLatchId);
+        }
+    }
 }
 
 void LayerRendererChromium::drawLayers(const LayerList& renderSurfaceLayerList)
@@ -1029,6 +1113,50 @@ String LayerRendererChromium::layerTreeAsText() const
     return ts.release();
 }
 
+void LayerRendererChromium::addChildContext(PassRefPtr<GraphicsContext3D> pctx)
+{
+    RefPtr<GraphicsContext3D> ctx = pctx;
+    if (!ctx->getExtensions()->supports("GL_CHROMIUM_latch"))
+        return;
+
+    // This is a ref-counting map, because some contexts are shared by multiple
+    // layers (specifically, Canvas2DLayerChromium).
+
+    // Insert the ctx with a count of 1, or return the existing iterator.
+    std::pair<ChildContextMap::iterator, bool> insert_result = m_childContexts.add(ctx, 1);
+    if (!insert_result.second) {
+        // Already present in map, so increment.
+        ++insert_result.first->second;
+    } else {
+// FIXME(jbates): when compositor is multithreaded and copyTexImage2D bug is fixed,
+// uncomment this block:
+//      // This is a new child context - set the parentToChild latch so that it
+//      // can continue past its first wait latch.
+//      Extensions3DChromium* ext = static_cast<Extensions3DChromium*>(ctx->getExtensions());
+//      GC3Duint latchId;
+//      ext->getParentToChildLatchCHROMIUM(&latchId);
+//      ext->setLatchCHROMIUM(0, latchId);
+    }
+}
+
+void LayerRendererChromium::removeChildContext(PassRefPtr<GraphicsContext3D> pctx)
+{
+    RefPtr<GraphicsContext3D> ctx = pctx;
+    if (!ctx->getExtensions()->supports("GL_CHROMIUM_latch"))
+        return;
+
+    ChildContextMap::iterator i = m_childContexts.find(ctx);
+    if (i != m_childContexts.end()) {
+        if (--i->second <= 0) {
+            // Count reached zero, so remove from map.
+            m_childContexts.remove(i);
+        }
+    } else {
+        // error
+        ASSERT(0 && "m_childContexts map has mismatched add/remove calls");
+    }
+}
+
 void LayerRendererChromium::dumpRenderSurfaces(TextStream& ts, int indent, LayerChromium* layer) const
 {
     if (layer->ccLayerImpl()->renderSurface())
index c5092c1..710878a 100644 (file)
@@ -131,8 +131,12 @@ public:
 
     String layerTreeAsText() const;
 
+    void addChildContext(PassRefPtr<GraphicsContext3D>);
+    void removeChildContext(PassRefPtr<GraphicsContext3D>);
+
 private:
     typedef Vector<RefPtr<CCLayerImpl> > LayerList;
+    typedef HashMap<RefPtr<GraphicsContext3D>, int> ChildContextMap;
 
     explicit LayerRendererChromium(PassRefPtr<GraphicsContext3D>, PassOwnPtr<TilePaintInterface> contentPaint, PassOwnPtr<TilePaintInterface> scrollbarPaint);
 
@@ -222,6 +226,15 @@ private:
     OwnPtr<CCHeadsUpDisplay> m_headsUpDisplay;
 
     RefPtr<GraphicsContext3D> m_context;
+    ChildContextMap m_childContexts;
+
+    // If true, the child contexts were copied to the compositor texture targets
+    // and the compositor will need to wait on the proper latches before using
+    // the target textures. If false, the compositor is reusing the textures
+    // from last frame.
+    bool m_childContextsWereCopied;
+
+    bool m_contextSupportsLatch;
 
     RenderSurfaceChromium* m_defaultRenderSurface;
 };
index 652e752..31b1b16 100644 (file)
@@ -51,6 +51,12 @@ WebGLLayerChromium::WebGLLayerChromium(GraphicsLayerChromium* owner)
 {
 }
 
+WebGLLayerChromium::~WebGLLayerChromium()
+{
+    if (m_context && layerRenderer())
+        layerRenderer()->removeChildContext(m_context);
+}
+
 void WebGLLayerChromium::updateCompositorResources()
 {
     if (!m_contentsDirty)
@@ -70,6 +76,9 @@ void WebGLLayerChromium::updateCompositorResources()
     }
     // Update the contents of the texture used by the compositor.
     if (m_contentsDirty && m_textureUpdated) {
+        // prepareTexture copies the contents of the off-screen render target into the texture
+        // used by the compositor.
+        //
         m_context->prepareTexture();
         m_context->markLayerComposited();
         m_contentsDirty = false;
@@ -84,6 +93,13 @@ void WebGLLayerChromium::setTextureUpdated()
 
 void WebGLLayerChromium::setContext(const GraphicsContext3D* context)
 {
+    if (m_context != context && layerRenderer()) {
+        if (m_context)
+            layerRenderer()->removeChildContext(m_context);
+        if (context)
+            layerRenderer()->addChildContext(m_context);
+    }
+
     m_context = const_cast<GraphicsContext3D*>(context);
 
     unsigned int textureId = m_context->platformTexture();
@@ -95,5 +111,19 @@ void WebGLLayerChromium::setContext(const GraphicsContext3D* context)
     m_premultipliedAlpha = m_context->getContextAttributes().premultipliedAlpha;
 }
 
+void WebGLLayerChromium::setLayerRenderer(LayerRendererChromium* newLayerRenderer)
+{
+    if (layerRenderer() != newLayerRenderer) {
+        if (m_context) {
+            if (layerRenderer())
+                layerRenderer()->removeChildContext(m_context);
+            if (newLayerRenderer)
+                newLayerRenderer->addChildContext(m_context);
+        }
+
+        LayerChromium::setLayerRenderer(newLayerRenderer);
+    }
+}
+
 }
 #endif // USE(ACCELERATED_COMPOSITING)
index 33db730..342275b 100644 (file)
@@ -44,12 +44,17 @@ class GraphicsContext3D;
 class WebGLLayerChromium : public CanvasLayerChromium {
 public:
     static PassRefPtr<WebGLLayerChromium> create(GraphicsLayerChromium* owner = 0);
+
+    virtual ~WebGLLayerChromium();
+
     virtual bool drawsContent() const { return m_context; }
     virtual void updateCompositorResources();
     void setTextureUpdated();
 
     void setContext(const GraphicsContext3D* context);
 
+    virtual void setLayerRenderer(LayerRendererChromium*);
+
 protected:
     virtual const char* layerTypeAsString() const { return "WebGLLayer"; }
 
index 194be76..a005483 100644 (file)
@@ -1,3 +1,21 @@
+2011-04-11  John Bates  <jbates@google.com>
+
+        Reviewed by Kenneth Russell.
+
+        chromium support for glSetLatch and glWaitLatch between 3D contexts
+        https://bugs.webkit.org/show_bug.cgi?id=58003
+
+        * public/WebGraphicsContext3D.h:
+        (WebKit::WebGraphicsContext3D::getParentToChildLatchCHROMIUM):
+        (WebKit::WebGraphicsContext3D::getChildToParentLatchCHROMIUM):
+        (WebKit::WebGraphicsContext3D::waitLatchCHROMIUM):
+        (WebKit::WebGraphicsContext3D::setLatchCHROMIUM):
+        * src/Extensions3DChromium.cpp:
+        (WebCore::Extensions3DChromium::waitLatchCHROMIUM):
+        (WebCore::Extensions3DChromium::setLatchCHROMIUM):
+        * src/GraphicsContext3DChromium.cpp:
+        * src/GraphicsContext3DInternal.h:
+
 2011-04-11  Ryosuke Niwa  <rniwa@webkit.org>
 
         Reviewed by Tony Chang.
index 984f79d..ff7e502 100644 (file)
@@ -168,6 +168,12 @@ public:
     virtual void blitFramebufferCHROMIUM(WGC3Dint srcX0, WGC3Dint srcY0, WGC3Dint srcX1, WGC3Dint srcY1, WGC3Dint dstX0, WGC3Dint dstY0, WGC3Dint dstX1, WGC3Dint dstY1, WGC3Dbitfield mask, WGC3Denum filter) = 0;
     virtual void renderbufferStorageMultisampleCHROMIUM(WGC3Denum target, WGC3Dsizei samples, WGC3Denum internalformat, WGC3Dsizei width, WGC3Dsizei height) = 0;
 
+    // GL_CHROMIUM_latch
+    virtual void getParentToChildLatchCHROMIUM(WGC3Duint* latchId) {} // FIXME: = 0;
+    virtual void getChildToParentLatchCHROMIUM(WGC3Duint* latchId) {} // FIXME: = 0;
+    virtual void waitLatchCHROMIUM(WGC3Duint latchId) {} // FIXME: = 0;
+    virtual void setLatchCHROMIUM(WGC3Duint latchId) {} // FIXME: = 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/
index 30101c7..7cd70df 100644 (file)
@@ -97,6 +97,26 @@ void Extensions3DChromium::copyTextureToParentTextureCHROMIUM(unsigned texture,
     m_internal->copyTextureToParentTextureCHROMIUM(texture, parentTexture);
 }
 
+void Extensions3DChromium::getParentToChildLatchCHROMIUM(GC3Duint* latchId)
+{
+    m_internal->getParentToChildLatchCHROMIUM(latchId);
+}
+
+void Extensions3DChromium::getChildToParentLatchCHROMIUM(GC3Duint* latchId)
+{
+    m_internal->getChildToParentLatchCHROMIUM(latchId);
+}
+
+void Extensions3DChromium::waitLatchCHROMIUM(GC3Duint latchId)
+{
+    m_internal->waitLatchCHROMIUM(latchId);
+}
+
+void Extensions3DChromium::setLatchCHROMIUM(GC3Duint latchId)
+{
+    m_internal->setLatchCHROMIUM(latchId);
+}
+
 Platform3DObject Extensions3DChromium::createVertexArrayOES()
 {
     return 0;
index 54c18e3..c3d3665 100644 (file)
@@ -800,6 +800,10 @@ DELEGATE_TO_IMPL_1(unmapTexSubImage2DCHROMIUM, const void*)
 DELEGATE_TO_IMPL_2(copyTextureToParentTextureCHROMIUM, Platform3DObject, Platform3DObject)
 DELEGATE_TO_IMPL_10(blitFramebufferCHROMIUM, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dint, GC3Dbitfield, GC3Denum)
 DELEGATE_TO_IMPL_5(renderbufferStorageMultisampleCHROMIUM, GC3Denum, GC3Dsizei, GC3Denum, GC3Dsizei, GC3Dsizei)
+DELEGATE_TO_IMPL_1(getParentToChildLatchCHROMIUM, GC3Duint*)
+DELEGATE_TO_IMPL_1(getChildToParentLatchCHROMIUM, GC3Duint*)
+DELEGATE_TO_IMPL_1(waitLatchCHROMIUM, GC3Duint)
+DELEGATE_TO_IMPL_1(setLatchCHROMIUM, GC3Duint)
 
 //----------------------------------------------------------------------
 // GraphicsContext3D
index 0af291e..09ae89c 100644 (file)
@@ -270,6 +270,12 @@ public:
     void blitFramebufferCHROMIUM(GC3Dint srcX0, GC3Dint srcY0, GC3Dint srcX1, GC3Dint srcY1, GC3Dint dstX0, GC3Dint dstY0, GC3Dint dstX1, GC3Dint dstY1, GC3Dbitfield mask, GC3Denum filter);
     void renderbufferStorageMultisampleCHROMIUM(GC3Denum target, GC3Dsizei samples, GC3Denum internalformat, GC3Dsizei width, GC3Dsizei height);
 
+    // Latch support
+    void getParentToChildLatchCHROMIUM(GC3Duint* latchId);
+    void getChildToParentLatchCHROMIUM(GC3Duint* latchId);
+    void waitLatchCHROMIUM(GC3Duint latchId);
+    void setLatchCHROMIUM(GC3Duint latchId);
+
 private:
     OwnPtr<WebKit::WebGraphicsContext3D> m_impl;
     OwnPtr<Extensions3DChromium> m_extensions;