Title: [136832] trunk/Source/WebCore
Revision
136832
Author
[email protected]
Date
2012-12-06 04:32:02 -0800 (Thu, 06 Dec 2012)

Log Message

[EFL] Active texture state gets corrupted after updating graphics surface contents.
https://bugs.webkit.org/show_bug.cgi?id=104248.

Patch by Kondapally Kalyan <[email protected]> on 2012-12-06
Reviewed by Kenneth Rohde Christiansen.

GraphicsContext3DPrivate::copyToGraphicsSurface() doesn't restore the previously bound texture
after copying texture contents. This corrupts the texture state.

Existing Tests should cover this.

* platform/graphics/efl/GraphicsContext3DPrivate.cpp:
(GraphicsContext3DPrivate::copyToGraphicsSurface):
* platform/graphics/opengl/GLPlatformSurface.cpp:
(WebCore::GLPlatformSurface::updateContents):
* platform/graphics/opengl/GLPlatformSurface.h:
(GLPlatformSurface):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (136831 => 136832)


--- trunk/Source/WebCore/ChangeLog	2012-12-06 12:29:34 UTC (rev 136831)
+++ trunk/Source/WebCore/ChangeLog	2012-12-06 12:32:02 UTC (rev 136832)
@@ -1,3 +1,22 @@
+2012-12-06  Kondapally Kalyan  <[email protected]>
+
+        [EFL] Active texture state gets corrupted after updating graphics surface contents.
+        https://bugs.webkit.org/show_bug.cgi?id=104248.
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        GraphicsContext3DPrivate::copyToGraphicsSurface() doesn't restore the previously bound texture
+        after copying texture contents. This corrupts the texture state.
+
+        Existing Tests should cover this.
+
+        * platform/graphics/efl/GraphicsContext3DPrivate.cpp:
+        (GraphicsContext3DPrivate::copyToGraphicsSurface):
+        * platform/graphics/opengl/GLPlatformSurface.cpp:
+        (WebCore::GLPlatformSurface::updateContents):
+        * platform/graphics/opengl/GLPlatformSurface.h:
+        (GLPlatformSurface):
+
 2012-12-06  Alexander Pavlov  <[email protected]>
 
         Web Inspector: Goto panel shortcuts and description are reversed

Modified: trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp (136831 => 136832)


--- trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp	2012-12-06 12:29:34 UTC (rev 136831)
+++ trunk/Source/WebCore/platform/graphics/efl/GraphicsContext3DPrivate.cpp	2012-12-06 12:32:02 UTC (rev 136832)
@@ -154,7 +154,7 @@
 #endif
     }
 
-    m_platformSurface->updateContents(m_context->m_texture, IntRect(0, 0, m_context->m_currentWidth, m_context->m_currentHeight), m_context->m_boundFBO);
+    m_platformSurface->updateContents(m_context->m_texture, IntRect(0, 0, m_context->m_currentWidth, m_context->m_currentHeight), m_context->m_boundFBO, m_context->m_boundTexture0);
     return 0;
 }
 

Modified: trunk/Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp (136831 => 136832)


--- trunk/Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp	2012-12-06 12:29:34 UTC (rev 136831)
+++ trunk/Source/WebCore/platform/graphics/opengl/GLPlatformSurface.cpp	2012-12-06 12:32:02 UTC (rev 136832)
@@ -129,7 +129,7 @@
     glPopAttrib();
 }
 
-void GLPlatformSurface::updateContents(uint32_t texture, const IntRect& sourceRect, const GLuint bindFboId)
+void GLPlatformSurface::updateContents(const uint32_t texture, const IntRect& sourceRect, const GLuint bindFboId, const uint32_t bindTexture)
 {
     m_restoreNeeded = false;
 
@@ -148,7 +148,7 @@
     glBlitFramebuffer(x, y, width, height, x, y, width, height, GL_COLOR_BUFFER_BIT, GL_LINEAR);
     swapBuffers();
     glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
-    glBindTexture(GL_TEXTURE_2D, 0);
+    glBindTexture(GL_TEXTURE_2D, bindTexture);
     glBindFramebuffer(GL_FRAMEBUFFER, bindFboId);
 }
 

Modified: trunk/Source/WebCore/platform/graphics/opengl/GLPlatformSurface.h (136831 => 136832)


--- trunk/Source/WebCore/platform/graphics/opengl/GLPlatformSurface.h	2012-12-06 12:29:34 UTC (rev 136831)
+++ trunk/Source/WebCore/platform/graphics/opengl/GLPlatformSurface.h	2012-12-06 12:32:02 UTC (rev 136832)
@@ -60,12 +60,12 @@
 
     virtual void copyTexture(uint32_t texture, const IntRect& sourceRect);
 
-    // Convenience Function to update surface backbuffer with texture contents and restore current FBO.
+    // Convenience Function to update surface backbuffer with texture contents, restore current FBO and Texture.
     // Function does the following(in order):
     // a)Blits texture contents to back buffer.
     // b)Calls Swap Buffers.
-    // c)Sets current FBO as bindFboId.
-    virtual void updateContents(uint32_t texture, const IntRect& sourceRect, const GLuint bindFboId);
+    // c)Sets current FBO as bindFboId and binds texture to bindTexture.
+    virtual void updateContents(const uint32_t texture, const IntRect& sourceRect, const GLuint bindFboId, const uint32_t bindTexture);
 
     virtual void setGeometry(const IntRect& newRect);
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to