Bug 705641 - Back out Bug 696768 to fix a top crasher on OS X. r=jrmuizel a=asa
authorAli Juma <ajuma@mozilla.com>
Wed, 30 Nov 2011 09:40:59 -0500
changeset 80720 0bfc9ef09601ea1ad3728b43c8a909d203f63b19
parent 80719 1745ad74a8e5918114e770b5efb9ab7a1a929239
child 80721 bcddede9ce1e4fd8e5e8ea9a0ee07584776ab17b
push id564
push userajuma@mozilla.com
push dateWed, 30 Nov 2011 14:51:43 +0000
treeherdermozilla-aurora@0bfc9ef09601 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel, asa
bugs705641, 696768
milestone10.0a2
Bug 705641 - Back out Bug 696768 to fix a top crasher on OS X. r=jrmuizel a=asa
gfx/layers/opengl/LayerManagerOGL.cpp
gfx/thebes/GLContext.cpp
--- a/gfx/layers/opengl/LayerManagerOGL.cpp
+++ b/gfx/layers/opengl/LayerManagerOGL.cpp
@@ -991,20 +991,18 @@ LayerManagerOGL::SetupBackBuffer(int aWi
 
   mGLContext->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, mBackBufferFBO);
   mGLContext->fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER,
                                     LOCAL_GL_COLOR_ATTACHMENT0,
                                     mFBOTextureTarget,
                                     mBackBufferTexture,
                                     0);
 
-  if (mGLContext->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER) !=
-      LOCAL_GL_FRAMEBUFFER_COMPLETE) {
-    NS_RUNTIMEABORT("Error setting up framebuffer --- framebuffer not complete");
-  }
+  NS_ASSERTION(mGLContext->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER) ==
+               LOCAL_GL_FRAMEBUFFER_COMPLETE, "Error setting up framebuffer.");
 
   mBackBufferSize.width = aWidth;
   mBackBufferSize.height = aHeight;
 }
 
 void
 LayerManagerOGL::CopyToTarget()
 {
@@ -1152,22 +1150,18 @@ LayerManagerOGL::CreateFBOWithTexture(co
   mGLContext->fGenFramebuffers(1, &fbo);
   mGLContext->fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, fbo);
   mGLContext->fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER,
                                     LOCAL_GL_COLOR_ATTACHMENT0,
                                     mFBOTextureTarget,
                                     tex,
                                     0);
 
-  // Making this call to fCheckFramebufferStatus prevents a crash on
-  // PowerVR. See bug 695246.
-  if (mGLContext->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER) !=
-      LOCAL_GL_FRAMEBUFFER_COMPLETE) {
-    NS_RUNTIMEABORT("Error setting up framebuffer --- framebuffer not complete");
-  }
+  NS_ASSERTION(mGLContext->fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER) ==
+               LOCAL_GL_FRAMEBUFFER_COMPLETE, "Error setting up framebuffer.");
 
   SetupPipeline(aRect.width, aRect.height, DontApplyWorldTransform);
   mGLContext->fScissor(0, 0, aRect.width, aRect.height);
 
   if (aInit == InitModeClear) {
     mGLContext->fClearColor(0.0, 0.0, 0.0, 0.0);
     mGLContext->fClear(LOCAL_GL_COLOR_BUFFER_BIT);
   }
--- a/gfx/thebes/GLContext.cpp
+++ b/gfx/thebes/GLContext.cpp
@@ -2484,24 +2484,24 @@ GLContext::SetBlitFramebufferForDestText
 
     fBindFramebuffer(LOCAL_GL_FRAMEBUFFER, mBlitFramebuffer);
     fFramebufferTexture2D(LOCAL_GL_FRAMEBUFFER,
                           LOCAL_GL_COLOR_ATTACHMENT0,
                           LOCAL_GL_TEXTURE_2D,
                           aTexture,
                           0);
 
-    if (aTexture && (fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER) !=
-                     LOCAL_GL_FRAMEBUFFER_COMPLETE)) {
+    if (aTexture) {
+        DebugOnly<GLenum> status = fCheckFramebufferStatus(LOCAL_GL_FRAMEBUFFER);
 
-        // Note: if you are hitting this, it is likely that
+        // Note: if you are hitting this assertion, it is likely that
         // your texture is not texture complete -- that is, you
         // allocated a texture name, but didn't actually define its
         // size via a call to TexImage2D.
-        NS_RUNTIMEABORT("Error setting up framebuffer --- framebuffer not complete!");
+        NS_ASSERTION(status == LOCAL_GL_FRAMEBUFFER_COMPLETE, "Framebuffer not complete!");
     }
 }
 
 #ifdef DEBUG
 
 void
 GLContext::CreatedProgram(GLContext *aOrigin, GLuint aName)
 {