Update producer's cache of frame events in de/queue
* Cache is only updated during queue and dequeue if
the getFrameTimestamps is enabled.
* The consumer avoids sending a copy of the acquire
fence back to the producer since the producer
already has a copy.
Test: adb shell /data/nativetest/libgui_test/libgui_test
--gtest_filter=*GetFrameTimestamps*
Change-Id: I6a8b965ae79441a40893b5df937f9ed004fe7359
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index d5a02e3..3d3df76 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -1218,7 +1218,6 @@
if (!s->win.get()) {
return setError(EGL_BAD_SURFACE, EGL_FALSE);
}
- s->enableTimestamps = value;
int err = native_window_enable_frame_timestamps(
s->win.get(), value ? true : false);
return (err == NO_ERROR) ? EGL_TRUE :
@@ -2040,7 +2039,7 @@
egl_surface_t const * const s = get_surface(surface);
- if (!s->enableTimestamps) {
+ if (!s->win.get()) {
return setError(EGL_BAD_SURFACE, EGL_FALSE);
}
@@ -2090,6 +2089,8 @@
return EGL_TRUE;
case NAME_NOT_FOUND:
return setError(EGL_BAD_ACCESS, EGL_FALSE);
+ case INVALID_OPERATION:
+ return setError(EGL_BAD_SURFACE, EGL_FALSE);
case BAD_VALUE:
return setError(EGL_BAD_PARAMETER, EGL_FALSE);
default:
diff --git a/opengl/libs/EGL/egl_object.cpp b/opengl/libs/EGL/egl_object.cpp
index 6a76737..7fc5609 100644
--- a/opengl/libs/EGL/egl_object.cpp
+++ b/opengl/libs/EGL/egl_object.cpp
@@ -68,7 +68,7 @@
EGLNativeWindowType win, EGLSurface surface,
egl_connection_t const* cnx) :
egl_object_t(dpy), surface(surface), config(config), win(win), cnx(cnx),
- enableTimestamps(false), connected(true)
+ connected(true)
{}
egl_surface_t::~egl_surface_t() {
diff --git a/opengl/libs/EGL/egl_object.h b/opengl/libs/EGL/egl_object.h
index 3150ba6..8ceba1d 100644
--- a/opengl/libs/EGL/egl_object.h
+++ b/opengl/libs/EGL/egl_object.h
@@ -139,7 +139,6 @@
EGLConfig config;
sp<ANativeWindow> win;
egl_connection_t const* cnx;
- bool enableTimestamps;
private:
bool connected;
void disconnect();