summaryrefslogtreecommitdiff
path: root/opengl
diff options
context:
space:
mode:
authorrnlee <rnlee@google.com>2021-06-03 15:41:25 -0700
committerRachel Lee <rnlee@google.com>2021-06-04 21:42:08 +0000
commit84ff7b2ad9c20d50a45d2e34fa159650ba537e79 (patch)
treef1b77d9c4bb639541a67fb869e0b51f647162e5a /opengl
parent3acce53a18d77add3743a1496c1f4db061d742a2 (diff)
eglSurfaceAttrib EGL_TIMESTAMPS_ANDROID non-window surface fix.
The spec says: "If attribute is EGL_TIMESTAMPS_ANDROID, then values specifies whether to enable/disable timestamp collection for this surface. A value of EGL_TRUE 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." Setting an error is considered a side effect, so return EGL_TRUE for EGL_TIMESTAMPS_ANDROID attribute. BUG: 174481138 Test: APK b/174481138#comment1, `adb logcat *:E -e egl` no error Change-Id: Ia6f04126bd3dead47648a1c71f7100224f28553d
Diffstat (limited to 'opengl')
-rw-r--r--opengl/libs/EGL/egl_platform_entries.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/opengl/libs/EGL/egl_platform_entries.cpp b/opengl/libs/EGL/egl_platform_entries.cpp
index f57666077e..de36a7aea6 100644
--- a/opengl/libs/EGL/egl_platform_entries.cpp
+++ b/opengl/libs/EGL/egl_platform_entries.cpp
@@ -1453,7 +1453,9 @@ EGLBoolean eglSurfaceAttribImpl(EGLDisplay dpy, EGLSurface surface, EGLint attri
if (attribute == EGL_TIMESTAMPS_ANDROID) {
if (!s->getNativeWindow()) {
- return setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE);
+ // According to the spec, "if surface is not a window surface this has no
+ // effect."
+ return EGL_TRUE;
}
int err = native_window_enable_frame_timestamps(s->getNativeWindow(), value != 0);
return (err == 0) ? EGL_TRUE : setError(EGL_BAD_SURFACE, (EGLBoolean)EGL_FALSE);