Bug 615753. Let the OpenGL layer manager handle double bufffering. r=vlad, a=blocking
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Tue, 07 Dec 2010 11:46:39 -0500
changeset 58779 a2743e6bc5e8aebdef04b642142832128cb9490d
parent 58778 ded653253911202b8e1723927bbe8f83160e42a4
child 58780 37f128b0d6bd2609d63d68960767b1843db84eaa
push id1
push usershaver@mozilla.com
push dateTue, 04 Jan 2011 17:58:04 +0000
reviewersvlad, blocking
bugs615753
milestone2.0b8pre
Bug 615753. Let the OpenGL layer manager handle double bufffering. r=vlad, a=blocking Letting the OpenGL layer manager handle double buffering cleans things up and makes them work properly.
gfx/thebes/GLContextProviderEGL.cpp
widget/src/android/nsWindow.cpp
--- a/gfx/thebes/GLContextProviderEGL.cpp
+++ b/gfx/thebes/GLContextProviderEGL.cpp
@@ -1538,17 +1538,17 @@ TRY_AGAIN_NO_SHARING:
 
     nsRefPtr<GLContextEGL> glContext = new GLContextEGL(ContextFormat(ContextFormat::BasicRGB24),
                                                         shareContext,
                                                         config, surface, context);
 
     if (!glContext->Init())
         return nsnull;
 
-#ifdef XP_WIN
+#if defined(XP_WIN) || defined(ANDROID)
     glContext->SetIsDoubleBuffered(PR_TRUE);
 #endif
 
     return glContext.forget();
 #endif
 }
 
 already_AddRefed<GLContextEGL>
--- a/widget/src/android/nsWindow.cpp
+++ b/widget/src/android/nsWindow.cpp
@@ -991,18 +991,16 @@ nsWindow::OnDraw(AndroidGeckoEvent *ae)
         }
 
         NS_ASSERTION(sGLContext, "Drawing with GLES without a GL context?");
 
         sGLContext->fClear(LOCAL_GL_COLOR_BUFFER_BIT | LOCAL_GL_DEPTH_BUFFER_BIT);
 
         DrawTo(nsnull);
 
-        if (sGLContext)
-            sGLContext->SwapBuffers();
         sview.EndDrawing();
     }
 }
 
 void
 nsWindow::OnSizeChanged(const gfxIntSize& aSize)
 {
     int w = aSize.width;