Bug 950203 - Correctly handle EGL_NO_SURFACE result from eglCreateWindowSurface - r=kats

This commit is contained in:
Benoit Jacob 2013-12-18 15:49:11 -05:00
parent db7b17af4c
commit 6d741f377e

View File

@ -301,10 +301,18 @@ public class GLController {
initEGL();
try {
mEGLSurfaceForCompositor = mEGL.eglCreateWindowSurface(mEGLDisplay, mEGLConfig, mView.getNativeWindow(), null);
// In failure cases, eglCreateWindowSurface should return EGL_NO_SURFACE.
// We currently normalize this to null, and compare to null in all our checks.
if (mEGLSurfaceForCompositor == EGL10.EGL_NO_SURFACE) {
mEGLSurfaceForCompositor = null;
}
} catch (Exception e) {
Log.e(LOGTAG, "eglCreateWindowSurface threw", e);
}
}
if (mEGLSurfaceForCompositor == null) {
Log.w(LOGTAG, "eglCreateWindowSurface returned no surface!");
}
return mEGLSurfaceForCompositor != null;
}