summaryrefslogtreecommitdiffstats
path: root/opengl/libs/EGL/eglApi.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2012-03-25 00:49:46 -0700
committerMathias Agopian <mathias@google.com>2012-03-25 00:49:46 -0700
commit7db993a98b9239bd4e384cc4aa128262fe3cf52c (patch)
treeeaae74ffe09790c10cb331ed5671a4ef73f0a185 /opengl/libs/EGL/eglApi.cpp
parent94ff71fd6a4eeb36f02d277a0d2c96230b5c9ee6 (diff)
downloadframeworks_native-7db993a98b9239bd4e384cc4aa128262fe3cf52c.zip
frameworks_native-7db993a98b9239bd4e384cc4aa128262fe3cf52c.tar.gz
frameworks_native-7db993a98b9239bd4e384cc4aa128262fe3cf52c.tar.bz2
debug.egl.finish can be used to force a glFinish() when eglSwapBuffers() is called
this debug property is evaludated at eglInitialize() time. Change-Id: Ie439e4aac87f7fdc6ab2add86183d6d042f3ee8b
Diffstat (limited to 'opengl/libs/EGL/eglApi.cpp')
-rw-r--r--opengl/libs/EGL/eglApi.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/opengl/libs/EGL/eglApi.cpp b/opengl/libs/EGL/eglApi.cpp
index a1bd82d..8bfa16d 100644
--- a/opengl/libs/EGL/eglApi.cpp
+++ b/opengl/libs/EGL/eglApi.cpp
@@ -30,6 +30,7 @@
#include <cutils/log.h>
#include <cutils/atomic.h>
+#include <cutils/compiler.h>
#include <cutils/properties.h>
#include <cutils/memory.h>
@@ -732,6 +733,17 @@ EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface draw)
#endif
egl_surface_t const * const s = get_surface(draw);
+
+ if (CC_UNLIKELY(dp->finishOnSwap)) {
+ uint32_t pixel;
+ egl_context_t * const c = get_context( egl_tls_t::getContext() );
+ if (c) {
+ // glReadPixels() ensures that the frame is complete
+ s->cnx->hooks[c->version]->gl.glReadPixels(0,0,1,1,
+ GL_RGBA,GL_UNSIGNED_BYTE,&pixel);
+ }
+ }
+
return s->cnx->egl.eglSwapBuffers(dp->disp.dpy, s->surface);
}