Skip to content

Commit 48a59c3

Browse files
committed
Ignore EGL_BAD_CURRENT_SURFACE errors from eglSwapBuffers
Certain EGL device drivers are generating this error, so we need to survive it. (It's not clear from the EGL spec whether this is a legitimate error code, but since it's being generated we need to handle it.) Remove logging of expected errors from elSwapBuffers. We expect these errors to happen, and are handeling them by ignoring them. No need to clutter the logs. Bug: 6083241 Change-Id: If17dcfbb68d3009b92cf95a448728ccb47023b51
1 parent 6c25ffb commit 48a59c3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

opengl/java/android/opengl/GLSurfaceView.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,11 +1145,15 @@ public boolean swap() {
11451145
switch(error) {
11461146
case EGL11.EGL_CONTEXT_LOST:
11471147
return false;
1148+
case EGL10.EGL_BAD_CURRENT_SURFACE:
1149+
// The current surface is bad, probably because the window manager has closed
1150+
// the associated window. Ignore this error, on the assumption that the
1151+
// application will be closed soon.
1152+
break;
11481153
case EGL10.EGL_BAD_NATIVE_WINDOW:
1149-
// The native window is bad, probably because the
1150-
// window manager has closed it. Ignore this error,
1151-
// on the expectation that the application will be closed soon.
1152-
Log.e("EglHelper", "eglSwapBuffers returned EGL_BAD_NATIVE_WINDOW. tid=" + Thread.currentThread().getId());
1154+
// The native window is bad, probably because the window manager has closed it.
1155+
// Ignore this error, on the assumption that the application will be closed
1156+
// soon.
11531157
break;
11541158
default:
11551159
throwEglException("eglSwapBuffers", error);

0 commit comments

Comments
 (0)