summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorAndroid (Google) Code Review <android-gerrit@google.com>2009-11-25 13:43:07 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2009-11-25 13:43:07 -0800
commitca00dee21425882619aef4ecbe3e0d08de0544e5 (patch)
tree26fa091b8ff2a4ab7543cec7b0b1bd60532aaf81 /opengl
parent8e1985d4f28bfa9bea7db05f324759991d4e59e9 (diff)
parent5aa3adcf304ec3767b3c22128acb23240d8d0bab (diff)
downloadframeworks_base-ca00dee21425882619aef4ecbe3e0d08de0544e5.zip
frameworks_base-ca00dee21425882619aef4ecbe3e0d08de0544e5.tar.gz
frameworks_base-ca00dee21425882619aef4ecbe3e0d08de0544e5.tar.bz2
Merge change I5aa3adcf into eclair
* changes: Improve the exception message text by including eglGetError().
Diffstat (limited to 'opengl')
-rw-r--r--opengl/java/android/opengl/GLSurfaceView.java8
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;