Bug 681333 - Check MakeCurrent return code on init; r=jmuizelaar
authorBenoit Girard <b56girard@gmail.com>
Wed, 31 Aug 2011 07:27:05 -0700
changeset 76327 6006d67f5a0972bab8a137039b08c3908781ebc4
parent 76326 79f89328862d8acbf6ee6f312e1cb010a8aadae9
child 76328 db59a3f2f6612fffaa2831a83177bbf0bf3b82f1
push id21097
push userbmo@edmorley.co.uk
push dateThu, 01 Sep 2011 07:45:07 +0000
treeherdermozilla-central@7d3d1c2c75f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmuizelaar
bugs681333
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 681333 - Check MakeCurrent return code on init; r=jmuizelaar
gfx/thebes/GLContextProviderEGL.cpp
--- a/gfx/thebes/GLContextProviderEGL.cpp
+++ b/gfx/thebes/GLContextProviderEGL.cpp
@@ -130,16 +130,17 @@ public:
 
 #else
 
 #error "Platform not recognized"
 
 #endif
 
 #include "gfxUtils.h"
+#include "gfxFailure.h"
 #include "gfxASurface.h"
 #include "gfxImageSurface.h"
 #include "gfxPlatform.h"
 #include "GLContextProvider.h"
 #include "nsDebug.h"
 #include "nsThreadUtils.h"
 #include "EGLUtils.h"
 
@@ -703,17 +704,23 @@ public:
 
     PRBool Init()
     {
         if (!OpenLibrary(GLES2_LIB)) {
             NS_WARNING("Couldn't load EGL LIB.");
             return PR_FALSE;
         }
 
-        MakeCurrent();
+        PRBool current = MakeCurrent();
+        if (!current) {
+            gfx::LogFailure(NS_LITERAL_CSTRING(
+                "Couldn't get device attachments for device."));
+            return PR_FALSE;
+        }
+
         PRBool ok = InitWithPrefix("gl", PR_TRUE);
 #if 0
         if (ok) {
             EGLint v;
             sEGLLibrary.fQueryContext(EGL_DISPLAY(), mContext, LOCAL_EGL_RENDER_BUFFER, &v);
             if (v == LOCAL_EGL_BACK_BUFFER)
                 mIsDoubleBuffered = PR_TRUE;
         }