OSDN Git Service

fix logging of eglMakeCurrent() errors
authorMathias Agopian <mathias@google.com>
Fri, 26 Aug 2011 01:38:24 +0000 (18:38 -0700)
committerMathias Agopian <mathias@google.com>
Fri, 26 Aug 2011 01:38:24 +0000 (18:38 -0700)
Change-Id: Ie22cabff822a8fb3186f082491234b9503b431c3

core/java/android/view/HardwareRenderer.java
opengl/libs/EGL/eglApi.cpp

index 926d424..5b592e0 100644 (file)
@@ -810,9 +810,9 @@ public abstract class HardwareRenderer {
             if (!mEglContext.equals(sEgl.eglGetCurrentContext()) ||
                     !mEglSurface.equals(sEgl.eglGetCurrentSurface(EGL_DRAW))) {
                 if (!sEgl.eglMakeCurrent(sEglDisplay, mEglSurface, mEglSurface, mEglContext)) {
-                    fallback(true);
                     Log.e(LOG_TAG, "eglMakeCurrent failed " +
                             GLUtils.getEGLErrorString(sEgl.eglGetError()));
+                    fallback(true);
                     return SURFACE_STATE_ERROR;
                 } else {
                     return SURFACE_STATE_UPDATED;
index 1f0016a..7e85230 100644 (file)
@@ -675,6 +675,9 @@ EGLBoolean eglMakeCurrent(  EGLDisplay dpy, EGLSurface draw,
             setGLHooksThreadSpecific(&gHooksNoContext);
             egl_tls_t::setContext(EGL_NO_CONTEXT);
         }
+    } else {
+        // this will LOGE the error
+        result = setError(c->cnx->egl.eglGetError(), EGL_FALSE);
     }
     return result;
 }