[BlackBerry] Accelerated compositing layers fail to render when using WebPageCompositor
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Mar 2012 12:16:02 +0000 (12:16 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Mar 2012 12:16:02 +0000 (12:16 +0000)
https://bugs.webkit.org/show_bug.cgi?id=82104
RIM PR: 145963

Patch by Arvid Nilsson <anilsson@rim.com> on 2012-03-25
Reviewed by Rob Buis.

Source/WebCore:

The embedder may use vertex buffers, which affected the interpretation
our vertex array pointers from memory pointers to offsets into a vertex
buffer. The resulting geometry often resulted in no visible layers on
screen.

Fixed by getting rid of any bound buffer when we enter
LayerRenderer::drawLayers().

* platform/graphics/blackberry/LayerRenderer.cpp:
(WebCore::LayerRenderer::drawLayers):

Source/WebKit/blackberry:

The root layer may be set before we have a layer renderer, because the
latter is not created until we get an OpenGL context from the embedder.

Fixed by setting the root layer on the layer renderer when it's created
instead of assuming a certain order of events.

* Api/WebPageCompositor.cpp:
(BlackBerry::WebKit::WebPageCompositorPrivate::setContext):
(BlackBerry::WebKit::WebPageCompositorPrivate::setRootLayer):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/blackberry/LayerRenderer.cpp
Source/WebKit/blackberry/Api/WebPageCompositor.cpp
Source/WebKit/blackberry/ChangeLog

index 3580158..e50c623 100644 (file)
@@ -1,3 +1,22 @@
+2012-03-25  Arvid Nilsson  <anilsson@rim.com>
+
+        [BlackBerry] Accelerated compositing layers fail to render when using WebPageCompositor
+        https://bugs.webkit.org/show_bug.cgi?id=82104
+        RIM PR: 145963
+
+        Reviewed by Rob Buis.
+
+        The embedder may use vertex buffers, which affected the interpretation
+        our vertex array pointers from memory pointers to offsets into a vertex
+        buffer. The resulting geometry often resulted in no visible layers on
+        screen.
+
+        Fixed by getting rid of any bound buffer when we enter
+        LayerRenderer::drawLayers().
+
+        * platform/graphics/blackberry/LayerRenderer.cpp:
+        (WebCore::LayerRenderer::drawLayers):
+
 2012-03-24  Nat Duca  <nduca@chromium.org>
 
         [chromium] Instrument gesture animations with async traces
index 4012e46..ceefeeb 100644 (file)
@@ -270,6 +270,11 @@ void LayerRenderer::drawLayers(const FloatRect& visibleRect, const IntRect& layo
     // Okay, we're going to do some drawing.
     makeContextCurrent();
 
+    // Get rid of any bound buffer that might affect the interpretation of our
+    // glVertexAttribPointer calls.
+    glBindBuffer(GL_ARRAY_BUFFER, 0);
+    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
+
     glEnableVertexAttribArray(m_positionLocation);
     glEnableVertexAttribArray(m_texCoordLocation);
     glActiveTexture(GL_TEXTURE0);
index eff6ae6..461deb8 100644 (file)
@@ -68,6 +68,7 @@ void WebPageCompositorPrivate::setContext(Platform::Graphics::GLES2Context* cont
     }
 
     m_layerRenderer = LayerRenderer::create(m_context);
+    m_layerRenderer->setRootLayer(m_rootLayer.get());
 }
 
 bool WebPageCompositorPrivate::hardwareCompositing() const
@@ -79,7 +80,6 @@ void WebPageCompositorPrivate::setRootLayer(LayerCompositingThread* rootLayer)
 {
     m_rootLayer = rootLayer;
 
-    ASSERT(m_layerRenderer);
     if (m_layerRenderer)
         m_layerRenderer->setRootLayer(m_rootLayer.get());
 }
index a4a25fb..197fa2c 100644 (file)
@@ -1,3 +1,21 @@
+2012-03-25  Arvid Nilsson  <anilsson@rim.com>
+
+        [BlackBerry] Accelerated compositing layers fail to render when using WebPageCompositor
+        https://bugs.webkit.org/show_bug.cgi?id=82104
+        RIM PR: 145963
+
+        Reviewed by Rob Buis.
+
+        The root layer may be set before we have a layer renderer, because the
+        latter is not created until we get an OpenGL context from the embedder.
+
+        Fixed by setting the root layer on the layer renderer when it's created
+        instead of assuming a certain order of events.
+
+        * Api/WebPageCompositor.cpp:
+        (BlackBerry::WebKit::WebPageCompositorPrivate::setContext):
+        (BlackBerry::WebKit::WebPageCompositorPrivate::setRootLayer):
+
 2012-03-23  Arvid Nilsson  <anilsson@rim.com>
 
         [BlackBerry] Add WebPageCompositor class to BlackBerry WebKit API