summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglsurface.h
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2017-05-04 17:46:33 -0700
committerChad Versace <[email protected]>2017-05-04 17:46:33 -0700
commit23c86c74cc450a23848b85cfe914376caede1cdf (patch)
treed6c13a8d1a82849afcad93409ae9140a14d76297 /src/egl/main/eglsurface.h
parent69e6eab6533ff48f72223cd21ef640242c52598b (diff)
egl: Emit error when EGLSurface is lost
Add a new bool, _EGLSurface::Lost, and check it in eglMakeCurrent and eglSwapBuffers. The EGL 1.5 spec says that those functions emit errors when the native surface is no longer valid. This patch just updates core EGL. No driver sets _EGLSurface::Lost yet. I discovered that Mesa failed to detect lost surfaces while debugging an Android CTS camera test, android.hardware.camera2.cts.RobustnessTest#testAbandonRepeatingRequestSurface. This patch doesn't fix the test though, though, because the test expects EGL_BAD_SURFACE when the surface becomes lost, and this patch actually complies with the EGL spec. If I interpreted the EGL spec correctly, EGL_BAD_NATIVE_WINDOW or EGL_BAD_CURRENT_SURFACE is the correct error. Cc: [email protected] Cc: Tomasz Figa <[email protected]> Cc: Tapani Pälli <[email protected]> Reviewed-by: Nicolas Boichat <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/egl/main/eglsurface.h')
-rw-r--r--src/egl/main/eglsurface.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/egl/main/eglsurface.h b/src/egl/main/eglsurface.h
index fc799ee43dc..f13cf49741b 100644
--- a/src/egl/main/eglsurface.h
+++ b/src/egl/main/eglsurface.h
@@ -56,6 +56,11 @@ struct _egl_surface
EGLint Type; /* one of EGL_WINDOW_BIT, EGL_PIXMAP_BIT or EGL_PBUFFER_BIT */
+ /* The native surface is lost. The EGL spec requires certain functions
+ * to generate EGL_BAD_NATIVE_WINDOW when given this surface.
+ */
+ EGLBoolean Lost;
+
/* attributes set by attribute list */
EGLint Width, Height;
EGLenum TextureFormat;