Merge commit '85a9498a2f33d62a4313a3561b5468456974696e' * commit '85a9498a2f33d62a4313a3561b5468456974696e': Improve the exception message text by including eglGetError().
This commit is contained in:
@@ -935,7 +935,7 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
|
||||
mEglDisplay, mEglConfig, holder);
|
||||
|
||||
if (mEglSurface == null || mEglSurface == EGL10.EGL_NO_SURFACE) {
|
||||
throw new RuntimeException("createWindowSurface failed");
|
||||
throwEglException("createWindowSurface");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -943,7 +943,7 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
|
||||
* the context is current and bound to a surface.
|
||||
*/
|
||||
if (!mEgl.eglMakeCurrent(mEglDisplay, mEglSurface, mEglSurface, mEglContext)) {
|
||||
throw new RuntimeException("eglMakeCurrent failed.");
|
||||
throwEglException("eglMakeCurrent");
|
||||
}
|
||||
|
||||
GL gl = mEglContext.getGL();
|
||||
@@ -1002,6 +1002,10 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
|
||||
}
|
||||
}
|
||||
|
||||
private void throwEglException(String function) {
|
||||
throw new RuntimeException(function + " failed: " + mEgl.eglGetError());
|
||||
}
|
||||
|
||||
EGL10 mEgl;
|
||||
EGLDisplay mEglDisplay;
|
||||
EGLSurface mEglSurface;
|
||||
|
||||
Reference in New Issue
Block a user