diff options
author | Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> | 2023-05-23 07:56:44 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2023-05-23 07:56:44 +0000 |
commit | b7a27525ebcf0bfeb3055b6120f35888a6a47b6a (patch) | |
tree | b64b1d6377b0d03c474642bb4c5c8273e377d01e | |
parent | 82ba983cae11328463b925077ad3c6348c9da4e5 (diff) | |
parent | b5177ba85a1b78a06bfa8388bfcfa0c5f7ac3bcf (diff) | |
download | native-b7a27525ebcf0bfeb3055b6120f35888a6a47b6a.tar.gz |
Merge "Conditionally expose EGL_ANDROID_get_frame_timestamps extension" into android13-gsi
-rw-r--r-- | opengl/libs/EGL/egl_display.cpp | 11 | ||||
-rw-r--r-- | opengl/libs/EGL/egl_platform_entries.cpp | 23 |
2 files changed, 33 insertions, 1 deletions
diff --git a/opengl/libs/EGL/egl_display.cpp b/opengl/libs/EGL/egl_display.cpp index 0b755aadca..c2c856e22a 100644 --- a/opengl/libs/EGL/egl_display.cpp +++ b/opengl/libs/EGL/egl_display.cpp @@ -322,6 +322,16 @@ EGLBoolean egl_display_t::initialize(EGLint* major, EGLint* minor) { mExtensionString = gBuiltinExtensionString; + // b/269060366 Conditionally enabled EGL_ANDROID_get_frame_timestamps extension if the + // device's present timestamps are reliable (which may not be the case on emulators). + if (cnx->useAngle) { + if (android::base::GetBoolProperty("service.sf.present_timestamp", false)) { + mExtensionString.append("EGL_ANDROID_get_frame_timestamps"); + } + } else { + mExtensionString.append("EGL_ANDROID_get_frame_timestamps"); + } + hasColorSpaceSupport = findExtension(disp.queryString.extensions, "EGL_KHR_gl_colorspace"); // Note: CDD requires that devices supporting wide color and/or HDR color also support @@ -361,6 +371,7 @@ EGLBoolean egl_display_t::initialize(EGLint* major, EGLint* minor) { findExtension(disp.queryString.extensions, "EGL_KHR_image_gl_colorspace")) { mExtensionString.append("EGL_EXT_image_gl_colorspace "); } + if (findExtension(disp.queryString.extensions, ext.c_str(), len)) { mExtensionString.append(ext + " "); } diff --git a/opengl/libs/EGL/egl_platform_entries.cpp b/opengl/libs/EGL/egl_platform_entries.cpp index f4dbe499eb..38075036b6 100644 --- a/opengl/libs/EGL/egl_platform_entries.cpp +++ b/opengl/libs/EGL/egl_platform_entries.cpp @@ -84,7 +84,8 @@ extern const char* const gExtensionString; // Extensions implemented by the EGL wrapper. const char* const gBuiltinExtensionString = "EGL_ANDROID_front_buffer_auto_refresh " - "EGL_ANDROID_get_frame_timestamps " + // b/269060366 Conditionally enabled during display initialization: + //"EGL_ANDROID_get_frame_timestamps " "EGL_ANDROID_get_native_client_buffer " "EGL_ANDROID_presentation_time " "EGL_EXT_surface_CTA861_3_metadata " @@ -2175,6 +2176,10 @@ EGLBoolean eglGetNextFrameIdANDROIDImpl(EGLDisplay dpy, EGLSurface surface, EGLu return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE); } + if (!dp->haveExtension("EGL_ANDROID_get_frame_timestamps")) { + return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE); + } + SurfaceRef _s(dp, surface); if (!_s.get()) { return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE); @@ -2208,6 +2213,10 @@ EGLBoolean eglGetCompositorTimingANDROIDImpl(EGLDisplay dpy, EGLSurface surface, return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE); } + if (!dp->haveExtension("EGL_ANDROID_get_frame_timestamps")) { + return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE); + } + SurfaceRef _s(dp, surface); if (!_s.get()) { return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE); @@ -2262,6 +2271,10 @@ EGLBoolean eglGetCompositorTimingSupportedANDROIDImpl(EGLDisplay dpy, EGLSurface return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE); } + if (!dp->haveExtension("EGL_ANDROID_get_frame_timestamps")) { + return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE); + } + SurfaceRef _s(dp, surface); if (!_s.get()) { return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE); @@ -2292,6 +2305,10 @@ EGLBoolean eglGetFrameTimestampsANDROIDImpl(EGLDisplay dpy, EGLSurface surface, return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE); } + if (!dp->haveExtension("EGL_ANDROID_get_frame_timestamps")) { + return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE); + } + SurfaceRef _s(dp, surface); if (!_s.get()) { return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE); @@ -2377,6 +2394,10 @@ EGLBoolean eglGetFrameTimestampSupportedANDROIDImpl(EGLDisplay dpy, EGLSurface s return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE); } + if (!dp->haveExtension("EGL_ANDROID_get_frame_timestamps")) { + return setError(EGL_BAD_DISPLAY, (EGLBoolean)EGL_FALSE); + } + SurfaceRef _s(dp, surface); if (!_s.get()) { return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE); |