diff options
author | 2016-03-07 18:48:18 +0000 | |
---|---|---|
committer | 2016-03-07 18:48:18 +0000 | |
commit | 9c3e10b4bf83985f138821c5af7c804635242f29 (patch) | |
tree | 4cbbd6ab3a9d3f2c0fcb795f59b6a2f7e3f77e3b | |
parent | 2c6d71bb46f8fdff2381cfcdce732cb5ce866573 (diff) | |
parent | 02b05da60a4669df44c9c0747ec262ec1862cf61 (diff) |
Merge "egl: Add EGL extension for front buffer auto-refresh mode" into nyc-dev
-rw-r--r-- | opengl/include/EGL/eglext.h | 6 | ||||
-rw-r--r-- | opengl/libs/EGL/eglApi.cpp | 12 | ||||
-rw-r--r-- | opengl/specs/EGL_ANDROID_front_buffer_auto_refresh.txt | 70 | ||||
-rw-r--r-- | opengl/specs/README | 9 |
4 files changed, 86 insertions, 11 deletions
diff --git a/opengl/include/EGL/eglext.h b/opengl/include/EGL/eglext.h index 267f8aff05..5d838e63ba 100644 --- a/opengl/include/EGL/eglext.h +++ b/opengl/include/EGL/eglext.h @@ -611,6 +611,12 @@ typedef EGLAPI EGLClientBuffer (EGLAPIENTRYP PFNEGLCREATENATIVECLIENTBUFFERANDRO #endif #endif +#ifndef EGL_ANDROID_front_buffer_auto_refresh +#define EGL_ANDROID_front_buffer_auto_refresh 1 +#define EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID 0x314C +#endif + + #ifdef __cplusplus } #endif diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp index 05700f8c69..794a7e528f 100644 --- a/opengl/libs/EGL/eglApi.cpp +++ b/opengl/libs/EGL/eglApi.cpp @@ -72,7 +72,7 @@ struct extention_map_t { * 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 @@ extern char const * const gBuiltinExtensionString = "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 @@ EGLBoolean eglSurfaceAttrib( 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) { diff --git a/opengl/specs/EGL_ANDROID_front_buffer_auto_refresh.txt b/opengl/specs/EGL_ANDROID_front_buffer_auto_refresh.txt new file mode 100644 index 0000000000..4c0e64cf15 --- /dev/null +++ b/opengl/specs/EGL_ANDROID_front_buffer_auto_refresh.txt @@ -0,0 +1,70 @@ +Name + + ANDROID_front_buffer_auto_refresh + +Name Strings + + EGL_ANDROID_front_buffer_auto_refresh + +Contributors + + Pablo Ceballos + +Contact + + Pablo Ceballos, Google Inc. (pceballos 'at' google.com) + +Status + + Draft + +Version + + Version 1, February 3, 2016 + +Number + + EGL Extension #XXX + +Dependencies + + Requires EGL 1.2 + + This extension is written against the wording of the EGL 1.5 Specification + +Overview + + This extension is intended for latency-sensitive applications that are doing + front-buffer rendering. It allows them to indicate to the Android compositor + that it should perform composition every time the display refreshes. This + removes the overhead of having to notify the compositor that the window + surface has been updated, but it comes at the cost of doing potentially + unneeded composition work if the window surface has not been updated. + +New Types + + None + +New Procedures and Functions + + None + +New Tokens + + EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID 0x314C + +Add to the list of supported tokens for eglSurfaceAttrib in section 3.5.6 +"Surface Attributes", page 43: + + If attribute is EGL_ANDROID_front_buffer_auto_refresh, then value specifies + whether to enable or disable auto-refresh in the Android compositor when + doing front-buffer rendering. + +Issues + + None + +Revision History + +#1 (Pablo Ceballos, February 3, 2016) + - Initial draft. diff --git a/opengl/specs/README b/opengl/specs/README index f4de1b3d62..8f1eaf3cf6 100644 --- a/opengl/specs/README +++ b/opengl/specs/README @@ -6,10 +6,10 @@ for use by Android extensions. Value Extension ---------------- ---------------------------------- -0x3140 EGL_ANDROID_image_native_buffer -0x3141 (unused) +0x3140 EGL_NATIVE_BUFFER_ANDROID (EGL_ANDROID_image_native_buffer) +0x3141 EGL_PLATFORM_ANDROID_KHR (KHR_platform_android) 0x3142 EGL_RECORDABLE_ANDROID (EGL_ANDROID_recordable) -0x3143 EGL_VERSION_HW_ANDROID (internal use) +0x3143 EGL_NATIVE_BUFFER_USAGE_ANDROID (EGL_ANDROID_create_native_client_buffer) 0x3144 EGL_SYNC_NATIVE_FENCE_ANDROID (EGL_ANDROID_native_fence_sync) 0x3145 EGL_SYNC_NATIVE_FENCE_FD_ANDROID (EGL_ANDROID_native_fence_sync) 0x3146 EGL_SYNC_NATIVE_FENCE_SIGNALED_ANDROID (EGL_ANDROID_native_fence_sync) @@ -18,4 +18,5 @@ for use by Android extensions. 0x3149 EGL_IMAGE_CROP_TOP_ANDROID (EGL_ANDROID_image_crop) 0x314A EGL_IMAGE_CROP_RIGHT_ANDROID (EGL_ANDROID_image_crop) 0x314B EGL_IMAGE_CROP_BOTTOM_ANDROID (EGL_ANDROID_image_crop) -0x314C - 0x314F (unused) +0x314C EGL_FRONT_BUFFER_AUTO_REFRESH_ANDROID (EGL_ANDROID_front_buffer_auto_refresh) +0x314D - 0x314F (unused) |