diff options
Diffstat (limited to 'opengl/java')
-rw-r--r-- | opengl/java/android/opengl/GLSurfaceView.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/opengl/java/android/opengl/GLSurfaceView.java b/opengl/java/android/opengl/GLSurfaceView.java index 8e2294c..f69fc53 100644 --- a/opengl/java/android/opengl/GLSurfaceView.java +++ b/opengl/java/android/opengl/GLSurfaceView.java @@ -1145,11 +1145,15 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback switch(error) { case EGL11.EGL_CONTEXT_LOST: return false; + case EGL10.EGL_BAD_CURRENT_SURFACE: + // The current surface is bad, probably because the window manager has closed + // the associated window. Ignore this error, on the assumption that the + // application will be closed soon. + break; case EGL10.EGL_BAD_NATIVE_WINDOW: - // The native window is bad, probably because the - // window manager has closed it. Ignore this error, - // on the expectation that the application will be closed soon. - Log.e("EglHelper", "eglSwapBuffers returned EGL_BAD_NATIVE_WINDOW. tid=" + Thread.currentThread().getId()); + // The native window is bad, probably because the window manager has closed it. + // Ignore this error, on the assumption that the application will be closed + // soon. break; default: throwEglException("eglSwapBuffers", error); @@ -1841,7 +1845,7 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback ! renderer.startsWith(kMSM7K_RENDERER_PREFIX); notifyAll(); } - mLimitedGLESContexts = !mMultipleGLESContextsAllowed || renderer.startsWith(kADRENO); + mLimitedGLESContexts = !mMultipleGLESContextsAllowed; if (LOG_SURFACE) { Log.w(TAG, "checkGLDriver renderer = \"" + renderer + "\" multipleContextsAllowed = " + mMultipleGLESContextsAllowed @@ -1867,6 +1871,11 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback } } + /** + * This check was required for some pre-Android-3.0 hardware. Android 3.0 provides + * support for hardware-accelerated views, therefore multiple EGL contexts are + * supported on all Android 3.0+ EGL drivers. + */ private boolean mGLESVersionCheckComplete; private int mGLESVersion; private boolean mGLESDriverCheckComplete; @@ -1875,7 +1884,6 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback private static final int kGLES_20 = 0x20000; private static final String kMSM7K_RENDERER_PREFIX = "Q3Dimension MSM7500 "; - private static final String kADRENO = "Adreno"; private GLThread mEglOwner; } |