Bug 682327 - ASSERTION: Failed to make GL context current; r=ajuma
authorOleg Romashin <romaxa@gmail.com>
Sat, 27 Aug 2011 00:23:02 +0100
changeset 75973 c62371f0112a025305c6c4446ff390b4ede5df8f
parent 75972 7d6ebd18ecb6929212350814f8ab35b29e9f3202
child 75974 14eb4130996517df8cf6f2301d5eba2f8677305f
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersajuma
bugs682327
milestone9.0a1
Bug 682327 - ASSERTION: Failed to make GL context current; r=ajuma
gfx/thebes/GLContextProviderEGL.cpp
--- a/gfx/thebes/GLContextProviderEGL.cpp
+++ b/gfx/thebes/GLContextProviderEGL.cpp
@@ -777,23 +777,24 @@ public:
     }
 
     PRBool MakeCurrentImpl(PRBool aForce = PR_FALSE) {
         PRBool succeeded = PR_TRUE;
 
         // Assume that EGL has the same problem as WGL does,
         // where MakeCurrent with an already-current context is
         // still expensive.
-        if (!mSurface || aForce || sEGLLibrary.fGetCurrentContext() != mContext) {
 #ifndef MOZ_WIDGET_QT
-            if (!mSurface) {
-                EGLConfig config = CreateConfig();
-                mSurface = CreateSurfaceForWindow(NULL, config);
-            }
+        if (!mSurface) {
+            EGLConfig config = CreateConfig();
+            mSurface = CreateSurfaceForWindow(NULL, config);
+            aForce = PR_TRUE;
+        }
 #endif
+        if (aForce || sEGLLibrary.fGetCurrentContext() != mContext) {
             succeeded = sEGLLibrary.fMakeCurrent(EGL_DISPLAY(),
                                                  mSurface, mSurface,
                                                  mContext);
             NS_ASSERTION(succeeded, "Failed to make GL context current!");
         }
 
         return succeeded;
     }