Loading opengl/libs/EGL/eglApi.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ #include <cutils/log.h> #include <cutils/atomic.h> #include <cutils/compiler.h> #include <cutils/properties.h> #include <cutils/memory.h> Loading Loading @@ -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); } Loading opengl/libs/EGL/egl_display.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include "egl_tls.h" #include "egl_impl.h" #include "Loader.h" #include <cutils/properties.h> // ---------------------------------------------------------------------------- namespace android { Loading Loading @@ -66,7 +67,7 @@ extern void setGLHooksThreadSpecific(gl_hooks_t const *value); egl_display_t egl_display_t::sDisplay[NUM_DISPLAYS]; egl_display_t::egl_display_t() : magic('_dpy'), refs(0) { magic('_dpy'), finishOnSwap(false), refs(0) { } egl_display_t::~egl_display_t() { Loading Loading @@ -232,6 +233,12 @@ EGLBoolean egl_display_t::initialize(EGLint *major, EGLint *minor) { egl_cache_t::get()->initialize(this); char value[PROPERTY_VALUE_MAX]; property_get("debug.egl.finish", value, "0"); if (atoi(value)) { finishOnSwap = true; } refs++; if (major != NULL) *major = VERSION_MAJOR; Loading opengl/libs/EGL/egl_display.h +1 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ private: public: DisplayImpl disp; bool finishOnSwap; private: uint32_t refs; Loading Loading
opengl/libs/EGL/eglApi.cpp +12 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,7 @@ #include <cutils/log.h> #include <cutils/atomic.h> #include <cutils/compiler.h> #include <cutils/properties.h> #include <cutils/memory.h> Loading Loading @@ -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); } Loading
opengl/libs/EGL/egl_display.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include "egl_tls.h" #include "egl_impl.h" #include "Loader.h" #include <cutils/properties.h> // ---------------------------------------------------------------------------- namespace android { Loading Loading @@ -66,7 +67,7 @@ extern void setGLHooksThreadSpecific(gl_hooks_t const *value); egl_display_t egl_display_t::sDisplay[NUM_DISPLAYS]; egl_display_t::egl_display_t() : magic('_dpy'), refs(0) { magic('_dpy'), finishOnSwap(false), refs(0) { } egl_display_t::~egl_display_t() { Loading Loading @@ -232,6 +233,12 @@ EGLBoolean egl_display_t::initialize(EGLint *major, EGLint *minor) { egl_cache_t::get()->initialize(this); char value[PROPERTY_VALUE_MAX]; property_get("debug.egl.finish", value, "0"); if (atoi(value)) { finishOnSwap = true; } refs++; if (major != NULL) *major = VERSION_MAJOR; Loading
opengl/libs/EGL/egl_display.h +1 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ private: public: DisplayImpl disp; bool finishOnSwap; private: uint32_t refs; Loading