egl: Add EGL extension for front buffer auto-refresh mode
- Add an EGL extension for enabling/disabling auto-refresh mode on
a surface that's being used for front-buffer rendering.
- Remove the temporary hack that was directly enabling/disabling
front-buffer rendering from the EGL wrapper. From now on the driver
will have to implement it.
Bug 24949410
Change-Id: I722577521a37f9892dbadaf504b4551fe37182ed
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index 05700f8..794a7e5 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -72,7 +72,7 @@
* The rest (gExtensionString) depend on support in the EGL driver, and are
* only available if the driver supports them. However, some of these must be
* supported because they are used by the Android system itself; these are
- * listd as mandatory below and are required by the CDD. The system *assumes*
+ * listed as mandatory below and are required by the CDD. The system *assumes*
* the mandatory extensions are present and may not function properly if some
* are missing.
*
@@ -83,6 +83,7 @@
"EGL_ANDROID_presentation_time "
"EGL_KHR_swap_buffers_with_damage "
"EGL_ANDROID_create_native_client_buffer "
+ "EGL_ANDROID_front_buffer_auto_refresh "
;
extern char const * const gExtensionString =
"EGL_KHR_image " // mandatory
@@ -1194,12 +1195,9 @@
egl_surface_t const * const s = get_surface(surface);
- //XXX: temporary hack for the EGL hook-up for single buffer mode
- if (attribute == EGL_RENDER_BUFFER && (value == EGL_BACK_BUFFER ||
- value == EGL_SINGLE_BUFFER)) {
- native_window_set_auto_refresh(s->win.get(), true);
- return (native_window_set_single_buffer_mode(s->win.get(),
- value == EGL_SINGLE_BUFFER)) ? EGL_TRUE : EGL_FALSE;
+ if (attribute == EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID) {
+ return (native_window_set_auto_refresh(s->win.get(),
+ value ? true : false)) ? EGL_TRUE : EGL_FALSE;
}
if (s->cnx->egl.eglSurfaceAttrib) {