am 82f385a3: Merge "Add extra EGL error checking" into jb-mr1-dev

* commit '82f385a372329b767876ace2b3715a2d8ec13221':
  Add extra EGL error checking
This commit is contained in:
Romain Guy
2012-09-18 00:04:12 -07:00
committed by Android Git Automerger

View File

@@ -733,13 +733,17 @@ public abstract class HardwareRenderer {
*/ */
void checkEglErrors() { void checkEglErrors() {
if (isEnabled()) { if (isEnabled()) {
int error = sEgl.eglGetError(); checkEglErrorsForced();
if (error != EGL_SUCCESS) { }
// something bad has happened revert to }
// normal rendering.
Log.w(LOG_TAG, "EGL error: " + GLUtils.getEGLErrorString(error)); private void checkEglErrorsForced() {
fallback(error != EGL11.EGL_CONTEXT_LOST); int error = sEgl.eglGetError();
} if (error != EGL_SUCCESS) {
// something bad has happened revert to
// normal rendering.
Log.w(LOG_TAG, "EGL error: " + GLUtils.getEGLErrorString(error));
fallback(error != EGL11.EGL_CONTEXT_LOST);
} }
} }
@@ -812,7 +816,9 @@ public abstract class HardwareRenderer {
throw new RuntimeException("eglInitialize failed " + throw new RuntimeException("eglInitialize failed " +
GLUtils.getEGLErrorString(sEgl.eglGetError())); GLUtils.getEGLErrorString(sEgl.eglGetError()));
} }
checkEglErrorsForced();
sEglConfig = chooseEglConfig(); sEglConfig = chooseEglConfig();
if (sEglConfig == null) { if (sEglConfig == null) {
// We tried to use EGL_SWAP_BEHAVIOR_PRESERVED_BIT, try again without // We tried to use EGL_SWAP_BEHAVIOR_PRESERVED_BIT, try again without