diff options
author | 2017-02-16 00:39:29 +0000 | |
---|---|---|
committer | 2017-02-16 00:39:29 +0000 | |
commit | 4ec48ac409111d5bbd714331e8ca208efb5e827c (patch) | |
tree | 8a7581a094058299dc297d8130123420cf6c68c0 | |
parent | 5a2ad34b514cfc07f54e464e1062b1dfc0964e40 (diff) | |
parent | aaa354656e0727a6129f5f6292f56b4050510e12 (diff) |
Merge "EGL: Enable eglGetFrameTimestamps."
-rw-r--r-- | opengl/libs/EGL/eglApi.cpp | 10 | ||||
-rw-r--r-- | opengl/specs/EGL_ANDROID_get_frame_timestamps.txt | 36 |
2 files changed, 25 insertions, 21 deletions
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp index ab3ac3ac5c..4681b89aa6 100644 --- a/opengl/libs/EGL/eglApi.cpp +++ b/opengl/libs/EGL/eglApi.cpp @@ -56,8 +56,6 @@ using namespace android; -#define ENABLE_EGL_ANDROID_GET_FRAME_TIMESTAMPS 0 - // ---------------------------------------------------------------------------- namespace android { @@ -88,9 +86,7 @@ extern char const * const gBuiltinExtensionString = "EGL_KHR_swap_buffers_with_damage " "EGL_ANDROID_create_native_client_buffer " "EGL_ANDROID_front_buffer_auto_refresh " -#if ENABLE_EGL_ANDROID_GET_FRAME_TIMESTAMPS "EGL_ANDROID_get_frame_timestamps " -#endif ; extern char const * const gExtensionString = "EGL_KHR_image " // mandatory @@ -1246,7 +1242,6 @@ EGLBoolean eglSurfaceAttrib( setError(EGL_BAD_SURFACE, EGL_FALSE); } -#if ENABLE_EGL_ANDROID_GET_FRAME_TIMESTAMPS if (attribute == EGL_TIMESTAMPS_ANDROID) { if (!s->win.get()) { return setError(EGL_BAD_SURFACE, EGL_FALSE); @@ -1256,7 +1251,6 @@ EGLBoolean eglSurfaceAttrib( return (err == NO_ERROR) ? EGL_TRUE : setError(EGL_BAD_SURFACE, EGL_FALSE); } -#endif if (s->cnx->egl.eglSurfaceAttrib) { return s->cnx->egl.eglSurfaceAttrib( @@ -2168,12 +2162,10 @@ EGLBoolean eglGetCompositorTimingSupportedANDROID( } switch (name) { -#if ENABLE_EGL_ANDROID_GET_FRAME_TIMESTAMPS case EGL_COMPOSITE_DEADLINE_ANDROID: case EGL_COMPOSITE_INTERVAL_ANDROID: case EGL_COMPOSITE_TO_PRESENT_LATENCY_ANDROID: return EGL_TRUE; -#endif default: return EGL_FALSE; } @@ -2294,7 +2286,6 @@ EGLBoolean eglGetFrameTimestampSupportedANDROID( } switch (timestamp) { -#if ENABLE_EGL_ANDROID_GET_FRAME_TIMESTAMPS case EGL_COMPOSITE_DEADLINE_ANDROID: case EGL_COMPOSITE_INTERVAL_ANDROID: case EGL_COMPOSITE_TO_PRESENT_LATENCY_ANDROID: @@ -2319,7 +2310,6 @@ EGLBoolean eglGetFrameTimestampSupportedANDROID( NATIVE_WINDOW_FRAME_TIMESTAMPS_SUPPORTS_RETIRE, &value); return value == 0 ? EGL_FALSE : EGL_TRUE; } -#endif default: return EGL_FALSE; } diff --git a/opengl/specs/EGL_ANDROID_get_frame_timestamps.txt b/opengl/specs/EGL_ANDROID_get_frame_timestamps.txt index f946418588..d0ed8e172f 100644 --- a/opengl/specs/EGL_ANDROID_get_frame_timestamps.txt +++ b/opengl/specs/EGL_ANDROID_get_frame_timestamps.txt @@ -8,11 +8,19 @@ Name Strings Contributors + Brian Anderson + Dan Stoza Pablo Ceballos + Jesse Hall + Fabien Sanglard Contact + Brian Anderson, Google Inc. (brianderson 'at' google.com) + Dan Stoza, Google Inc. (stoza 'at' google.com) Pablo Ceballos, Google Inc. (pceballos 'at' google.com) + Jesse Hall, Google Inc. (jessehall 'at' google.com) + Fabien Sanglard, Google Inc. (sanglardf 'at' google.com) Status @@ -20,7 +28,7 @@ Status Version - Version 1, May 31, 2016 + Version 1, January 13, 2017 Number @@ -96,7 +104,6 @@ Add to the list of supported tokens for eglSurfaceAttrib in section 3.5.6 enables timestamp collection, while a value of EGL_FALSE disables it. The initial value is false. If surface is not a window surface this has no effect. - Changes to Chapter 3 of the EGL 1.5 Specification (EGL Functions and Errors) Add a new subsection under Section 3, @@ -154,6 +161,12 @@ Changes to Chapter 3 of the EGL 1.5 Specification (EGL Functions and Errors) supported will generate an EGL_BAD_PARAMETER error. If any error is generated the function will return EGL_FALSE. + The application can poll for the timestamp of particular events by calling + eglGetFrameTimestamps over and over without needing to call any other EGL + function between calls. This is true even for the most recently swapped + frame. eglGetFrameTimestamps is thread safe and can be called from a + different thread than the swapping thread. + The eglGetFrameTimestampsANDROID function takes an array of timestamps to query and returns timestamps in the corresponding indices of the values array. The possible timestamps that can be queried are: @@ -212,20 +225,21 @@ Issues Revision History -#1 (Pablo Ceballos, May 31, 2016) - - Initial draft. +#5 (Brian Anderson, January 13, 2017) + - Add eglGetCompositorTimingANDROID. -#2 (Brian Anderson, July 22, 2016) - - Replace EGL_QUEUE_TIME_ANDROID with EGL_REQUESTED_PRESENT_TIME_ANDROID. - - Add DISPLAY_PRESENT_TIME_ANDROID. +#4 (Brian Anderson, January 10, 2017) + - Use an absolute frameId rather than a relative framesAgo. #3 (Brian Anderson, November 30, 2016) - Add EGL_COMPOSITION_LATCH_TIME_ANDROID, EGL_LAST_COMPOSITION_START_TIME_ANDROID, and EGL_DEQUEUE_READY_TIME_ANDROID. -#4 (Brian Anderson, January 10, 2017) - - Use an absolute frameId rather than a relative framesAgo. +#2 (Brian Anderson, July 22, 2016) + - Replace EGL_QUEUE_TIME_ANDROID with EGL_REQUESTED_PRESENT_TIME_ANDROID. + - Add DISPLAY_PRESENT_TIME_ANDROID. + +#1 (Pablo Ceballos, May 31, 2016) + - Initial draft. -#5 (Brian Anderson, January 13, 2017) - - Add eglGetCompositorTimingANDROID. |