Title: [138327] trunk/Source/WebCore
Revision
138327
Author
commit-qu...@webkit.org
Date
2012-12-20 17:01:47 -0800 (Thu, 20 Dec 2012)

Log Message

[EFL] [WebGL] [Wk2] Contents are not rendered properly.
https://bugs.webkit.org/show_bug.cgi?id=104664

Patch by Viatcheslav Ostapenko <sl.ostape...@samsung.com> on 2012-12-20
Reviewed by Noam Rosenthal.

WebGL pages that render more than one frame are broken. Only 1st
frame comes to the UI side. All webgl repaint tests fail because
of this.
Specification of EXT_texture_from_pixmap extension here
http://www.opengl.org/registry/specs/EXT/texture_from_pixmap.txt
says, that:
"The contents of the texture after the drawable has been bound are defined
as the result of all rendering that has completed before the call to
glXBindTexImageEXT."
It means that in order to get updates for every frame glXBindTexImageEXT has
to be called on every frame update.

Covered by existing fast/canavs/webgl/*repaint tests.

* platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp:
(WebCore::GraphicsSurfacePrivate::isReceiver):
(WebCore::GraphicsSurface::platformSwapBuffers):
* platform/graphics/texmap/TextureMapperBackingStore.cpp:
(WebCore::TextureMapperSurfaceBackingStore::swapBuffersIfNeeded):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (138326 => 138327)


--- trunk/Source/WebCore/ChangeLog	2012-12-21 00:59:46 UTC (rev 138326)
+++ trunk/Source/WebCore/ChangeLog	2012-12-21 01:01:47 UTC (rev 138327)
@@ -1,3 +1,30 @@
+2012-12-20  Viatcheslav Ostapenko  <sl.ostape...@samsung.com>
+
+        [EFL] [WebGL] [Wk2] Contents are not rendered properly.
+        https://bugs.webkit.org/show_bug.cgi?id=104664
+
+        Reviewed by Noam Rosenthal.
+
+        WebGL pages that render more than one frame are broken. Only 1st
+        frame comes to the UI side. All webgl repaint tests fail because
+        of this.
+        Specification of EXT_texture_from_pixmap extension here
+        http://www.opengl.org/registry/specs/EXT/texture_from_pixmap.txt
+        says, that:
+        "The contents of the texture after the drawable has been bound are defined
+        as the result of all rendering that has completed before the call to
+        glXBindTexImageEXT."
+        It means that in order to get updates for every frame glXBindTexImageEXT has
+        to be called on every frame update.
+
+        Covered by existing fast/canavs/webgl/*repaint tests.
+
+        * platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp:
+        (WebCore::GraphicsSurfacePrivate::isReceiver):
+        (WebCore::GraphicsSurface::platformSwapBuffers):
+        * platform/graphics/texmap/TextureMapperBackingStore.cpp:
+        (WebCore::TextureMapperSurfaceBackingStore::swapBuffersIfNeeded):
+
 2012-12-20  Ryuan Choi  <ryuan.c...@samsung.com>
 
         [EFL] Build break with latest EFL libraries.

Modified: trunk/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp (138326 => 138327)


--- trunk/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp	2012-12-21 00:59:46 UTC (rev 138326)
+++ trunk/Source/WebCore/platform/graphics/surfaces/glx/GraphicsSurfaceGLX.cpp	2012-12-21 01:01:47 UTC (rev 138327)
@@ -354,6 +354,7 @@
         return m_size;
     }
 
+    bool isReceiver() const { return m_isReceiver; }
 private:
     OffScreenRootWindow m_offScreenWindow;
     IntSize m_size;
@@ -437,6 +438,14 @@
 
 uint32_t GraphicsSurface::platformSwapBuffers()
 {
+    if (m_private->isReceiver()) {
+        glBindTexture(GL_TEXTURE_2D, platformGetTextureID());
+        // Release previous lock and rebind texture to surface to get frame update.
+        pGlXReleaseTexImageEXT(m_private->display(), m_private->glxPixmap(), GLX_FRONT_EXT);
+        pGlXBindTexImageEXT(m_private->display(), m_private->glxPixmap(), GLX_FRONT_EXT, 0);
+        return 0;
+    }
+
     m_private->swapBuffers();
     return 0;
 }

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp (138326 => 138327)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp	2012-12-21 00:59:46 UTC (rev 138326)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp	2012-12-21 01:01:47 UTC (rev 138327)
@@ -39,9 +39,9 @@
     m_graphicsSurface = surface;
 }
 
-void TextureMapperSurfaceBackingStore::swapBuffersIfNeeded(uint32_t frontBuffer)
+void TextureMapperSurfaceBackingStore::swapBuffersIfNeeded(uint32_t)
 {
-    if (m_graphicsSurface && m_graphicsSurface->frontBuffer() != frontBuffer)
+    if (m_graphicsSurface)
         m_graphicsSurface->swapBuffers();
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to