[BlackBerry] GraphicsContext3D::reshapeFBOs does not report when bound FBOs should...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jul 2012 02:46:37 +0000 (02:46 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jul 2012 02:46:37 +0000 (02:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=92304

Patch by Joshua Netterfield <jnetterfield@rim.com> on 2012-07-25
Reviewed by Rob Buis.

No new tests, because it corrects existing functionality, but it makes BlackBerry
pass framebuffer-bindings-unaffected-on-resize.html.

* platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp

index 3fa860d..b408ea9 100644 (file)
@@ -1,5 +1,18 @@
 2012-07-25  Joshua Netterfield  <jnetterfield@rim.com>
 
+        [BlackBerry] GraphicsContext3D::reshapeFBOs does not report when bound FBOs should be restored
+        https://bugs.webkit.org/show_bug.cgi?id=92304
+
+        Reviewed by Rob Buis.
+
+        No new tests, because it corrects existing functionality, but it makes BlackBerry
+        pass framebuffer-bindings-unaffected-on-resize.html.
+
+        * platform/graphics/blackberry/GraphicsContext3DBlackBerry.cpp:
+        (WebCore::GraphicsContext3D::reshapeFBOs):
+
+2012-07-25  Joshua Netterfield  <jnetterfield@rim.com>
+
         [BlackBerry] readPixels should set alpha to 255 instead of 0 when alpha is disabled
         https://bugs.webkit.org/show_bug.cgi?id=92303
 
index dd4e3f4..592de3e 100644 (file)
@@ -173,7 +173,11 @@ bool GraphicsContext3D::reshapeFBOs(const IntSize& size)
         sampleCount = std::min(8, maxSampleCount);
     }
 
-    ::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_boundFBO);
+    bool mustRestoreFBO = false;
+    if (m_boundFBO != m_fbo) {
+        mustRestoreFBO = true;
+        ::glBindFramebufferEXT(GraphicsContext3D::FRAMEBUFFER, m_fbo);
+    }
 
     ::glBindTexture(GL_TEXTURE_2D, m_texture);
     ::glTexImage2D(GL_TEXTURE_2D, 0, internalColorFormat, fboWidth, fboHeight, 0, colorFormat, GL_UNSIGNED_BYTE, 0);
@@ -211,7 +215,7 @@ bool GraphicsContext3D::reshapeFBOs(const IntSize& size)
 
     logFrameBufferStatus(__LINE__);
 
-    return true;
+    return mustRestoreFBO;
 }
 
 void GraphicsContext3D::logFrameBufferStatus(int line)