diff options
author | Jack Palevich <jackpal@google.com> | 2009-11-25 13:56:21 +0800 |
---|---|---|
committer | Jack Palevich <jackpal@google.com> | 2009-11-25 13:56:21 +0800 |
commit | 5aa3adcf304ec3767b3c22128acb23240d8d0bab (patch) | |
tree | 2ceb679ff56e9964bacc79c3e29c744f58a131c0 /opengl/java | |
parent | 55896f3c5121e73e3f657ed14e7ee8937ad72449 (diff) | |
download | frameworks_base-5aa3adcf304ec3767b3c22128acb23240d8d0bab.zip frameworks_base-5aa3adcf304ec3767b3c22128acb23240d8d0bab.tar.gz frameworks_base-5aa3adcf304ec3767b3c22128acb23240d8d0bab.tar.bz2 |
Improve the exception message text by including eglGetError().
Should help us track down the cause of bug 2285187
Diffstat (limited to 'opengl/java')
-rw-r--r-- | opengl/java/android/opengl/GLSurfaceView.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/opengl/java/android/opengl/GLSurfaceView.java b/opengl/java/android/opengl/GLSurfaceView.java index e60859b..fb3747c 100644 --- a/opengl/java/android/opengl/GLSurfaceView.java +++ b/opengl/java/android/opengl/GLSurfaceView.java @@ -867,7 +867,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"); } /* @@ -875,7 +875,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(); @@ -934,6 +934,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; |