Loading opengl/libs/Android.mk +2 −2 Original line number Original line Diff line number Diff line Loading @@ -13,8 +13,8 @@ LOCAL_SRC_FILES:= \ EGL/hooks.cpp \ EGL/hooks.cpp \ EGL/Loader.cpp \ EGL/Loader.cpp \ # # LOCAL_STATIC_LIBRARIES += libGLESv2_dbg libprotobuf-cpp-2.3.0-lite liblzf LOCAL_SHARED_LIBRARIES += libcutils libutils libstlport LOCAL_SHARED_LIBRARIES += libcutils libutils libGLESv2_dbg LOCAL_LDLIBS := -lpthread -ldl LOCAL_LDLIBS := -lpthread -ldl LOCAL_MODULE:= libEGL LOCAL_MODULE:= libEGL LOCAL_LDFLAGS += -Wl,--exclude-libs=ALL LOCAL_LDFLAGS += -Wl,--exclude-libs=ALL Loading opengl/libs/EGL/egl.cpp +11 −26 Original line number Original line Diff line number Diff line Loading @@ -46,6 +46,7 @@ #include "egl_impl.h" #include "egl_impl.h" #include "Loader.h" #include "Loader.h" #include "glesv2dbg.h" #include "glesv2dbg.h" #include "egl_tls.h" #define setError(_e, _r) setErrorEtc(__FUNCTION__, __LINE__, _e, _r) #define setError(_e, _r) setErrorEtc(__FUNCTION__, __LINE__, _e, _r) Loading Loading @@ -225,14 +226,11 @@ struct egl_context_t : public egl_object_t egl_context_t(EGLDisplay dpy, EGLContext context, EGLConfig config, egl_context_t(EGLDisplay dpy, EGLContext context, EGLConfig config, int impl, egl_connection_t const* cnx, int version) int impl, egl_connection_t const* cnx, int version) : egl_object_t(dpy), dpy(dpy), context(context), config(config), read(0), draw(0), : egl_object_t(dpy), dpy(dpy), context(context), config(config), read(0), draw(0), impl(impl), cnx(cnx), version(version), dbg(NULL) impl(impl), cnx(cnx), version(version) { { } } ~egl_context_t() ~egl_context_t() { { if (dbg) DestroyDbgContext(dbg); dbg = NULL; } } EGLDisplay dpy; EGLDisplay dpy; EGLContext context; EGLContext context; Loading @@ -242,7 +240,6 @@ struct egl_context_t : public egl_object_t int impl; int impl; egl_connection_t const* cnx; egl_connection_t const* cnx; int version; int version; DbgContext * dbg; }; }; struct egl_image_t : public egl_object_t struct egl_image_t : public egl_object_t Loading Loading @@ -277,15 +274,6 @@ typedef egl_context_t::Ref ContextRef; typedef egl_image_t::Ref ImageRef; typedef egl_image_t::Ref ImageRef; typedef egl_sync_t::Ref SyncRef; typedef egl_sync_t::Ref SyncRef; struct tls_t { tls_t() : error(EGL_SUCCESS), ctx(0), logCallWithNoContext(EGL_TRUE) { } EGLint error; EGLContext ctx; EGLBoolean logCallWithNoContext; }; // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- static egl_connection_t gEGLImpl[IMPL_NUM_IMPLEMENTATIONS]; static egl_connection_t gEGLImpl[IMPL_NUM_IMPLEMENTATIONS]; Loading Loading @@ -595,11 +583,6 @@ egl_context_t* get_context(EGLContext context) { return egl_to_native_cast<egl_context_t>(context); return egl_to_native_cast<egl_context_t>(context); } } DbgContext * getDbgContextThreadSpecific() { return get_context(getContext())->dbg; } static inline static inline egl_image_t* get_image(EGLImageKHR image) { egl_image_t* get_image(EGLImageKHR image) { return egl_to_native_cast<egl_image_t>(image); return egl_to_native_cast<egl_image_t>(image); Loading Loading @@ -1442,10 +1425,12 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw, loseCurrent(cur_c); loseCurrent(cur_c); if (ctx != EGL_NO_CONTEXT) { if (ctx != EGL_NO_CONTEXT) { if (!c->dbg && gEGLDebugLevel > 0) c->dbg = CreateDbgContext(c->version, c->cnx->hooks[c->version]); setGLHooksThreadSpecific(c->cnx->hooks[c->version]); setGLHooksThreadSpecific(c->cnx->hooks[c->version]); setContext(ctx); setContext(ctx); tls_t * const tls = getTLS(); if (!tls->dbg && gEGLDebugLevel > 0) tls->dbg = CreateDbgContext(gEGLThreadLocalStorageKey, c->version, c->cnx->hooks[c->version]); _c.acquire(); _c.acquire(); _r.acquire(); _r.acquire(); _d.acquire(); _d.acquire(); Loading opengl/libs/GLES2_dbg/Android.mk +4 −3 Original line number Original line Diff line number Diff line Loading @@ -21,7 +21,8 @@ LOCAL_C_INCLUDES := \ #LOCAL_CFLAGS += -O0 -g -DDEBUG -UNDEBUG #LOCAL_CFLAGS += -O0 -g -DDEBUG -UNDEBUG LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI LOCAL_STATIC_LIBRARIES := libprotobuf-cpp-2.3.0-lite liblzf LOCAL_SHARED_LIBRARIES := libcutils libutils libstlport ifeq ($(TARGET_ARCH),arm) ifeq ($(TARGET_ARCH),arm) LOCAL_CFLAGS += -fstrict-aliasing LOCAL_CFLAGS += -fstrict-aliasing endif endif Loading @@ -43,4 +44,4 @@ endif LOCAL_MODULE:= libGLESv2_dbg LOCAL_MODULE:= libGLESv2_dbg LOCAL_MODULE_TAGS := optional LOCAL_MODULE_TAGS := optional include $(BUILD_STATIC_LIBRARY) include $(BUILD_SHARED_LIBRARY) opengl/libs/GLES2_dbg/generate_api_cpp.py +7 −2 Original line number Original line Diff line number Diff line Loading @@ -192,11 +192,16 @@ if __name__ == "__main__": // auto generated by generate_api_cpp.py // auto generated by generate_api_cpp.py #include <utils/Debug.h> #include "src/header.h" #include "src/header.h" #include "src/api.h" #include "src/api.h" template<typename T> static int ToInt(const T & t) { STATIC_ASSERT(sizeof(T) == sizeof(int), bitcast); return (int &)t; } template<typename T> static int ToInt(const T & t) template<typename T> static T FromInt(const int & t) { STATIC_ASSERT(sizeof(T) == sizeof(int), bitcast); return (T &)t; } { COMPILE_TIME_ASSERT_FUNCTION_SCOPE(sizeof(T) == sizeof(int)); return (int &)t; } """ """ lines = open("gl2_api_annotated.in").readlines() lines = open("gl2_api_annotated.in").readlines() generate_api(lines) generate_api(lines) Loading opengl/libs/GLES2_dbg/generate_caller_cpp.py +0 −1 Original line number Original line Diff line number Diff line Loading @@ -177,7 +177,6 @@ const int * GenerateCall(DbgContext * const dbg, const glesv2debugger::Message & { { LOGD("GenerateCall function=%u", cmd.function()); LOGD("GenerateCall function=%u", cmd.function()); const int * ret = prevRet; // only some functions have return value const int * ret = prevRet; // only some functions have return value gl_hooks_t::gl_t const * const _c = &getGLTraceThreadSpecific()->gl; nsecs_t c0 = systemTime(timeMode); nsecs_t c0 = systemTime(timeMode); switch (cmd.function()) {""") switch (cmd.function()) {""") Loading Loading
opengl/libs/Android.mk +2 −2 Original line number Original line Diff line number Diff line Loading @@ -13,8 +13,8 @@ LOCAL_SRC_FILES:= \ EGL/hooks.cpp \ EGL/hooks.cpp \ EGL/Loader.cpp \ EGL/Loader.cpp \ # # LOCAL_STATIC_LIBRARIES += libGLESv2_dbg libprotobuf-cpp-2.3.0-lite liblzf LOCAL_SHARED_LIBRARIES += libcutils libutils libstlport LOCAL_SHARED_LIBRARIES += libcutils libutils libGLESv2_dbg LOCAL_LDLIBS := -lpthread -ldl LOCAL_LDLIBS := -lpthread -ldl LOCAL_MODULE:= libEGL LOCAL_MODULE:= libEGL LOCAL_LDFLAGS += -Wl,--exclude-libs=ALL LOCAL_LDFLAGS += -Wl,--exclude-libs=ALL Loading
opengl/libs/EGL/egl.cpp +11 −26 Original line number Original line Diff line number Diff line Loading @@ -46,6 +46,7 @@ #include "egl_impl.h" #include "egl_impl.h" #include "Loader.h" #include "Loader.h" #include "glesv2dbg.h" #include "glesv2dbg.h" #include "egl_tls.h" #define setError(_e, _r) setErrorEtc(__FUNCTION__, __LINE__, _e, _r) #define setError(_e, _r) setErrorEtc(__FUNCTION__, __LINE__, _e, _r) Loading Loading @@ -225,14 +226,11 @@ struct egl_context_t : public egl_object_t egl_context_t(EGLDisplay dpy, EGLContext context, EGLConfig config, egl_context_t(EGLDisplay dpy, EGLContext context, EGLConfig config, int impl, egl_connection_t const* cnx, int version) int impl, egl_connection_t const* cnx, int version) : egl_object_t(dpy), dpy(dpy), context(context), config(config), read(0), draw(0), : egl_object_t(dpy), dpy(dpy), context(context), config(config), read(0), draw(0), impl(impl), cnx(cnx), version(version), dbg(NULL) impl(impl), cnx(cnx), version(version) { { } } ~egl_context_t() ~egl_context_t() { { if (dbg) DestroyDbgContext(dbg); dbg = NULL; } } EGLDisplay dpy; EGLDisplay dpy; EGLContext context; EGLContext context; Loading @@ -242,7 +240,6 @@ struct egl_context_t : public egl_object_t int impl; int impl; egl_connection_t const* cnx; egl_connection_t const* cnx; int version; int version; DbgContext * dbg; }; }; struct egl_image_t : public egl_object_t struct egl_image_t : public egl_object_t Loading Loading @@ -277,15 +274,6 @@ typedef egl_context_t::Ref ContextRef; typedef egl_image_t::Ref ImageRef; typedef egl_image_t::Ref ImageRef; typedef egl_sync_t::Ref SyncRef; typedef egl_sync_t::Ref SyncRef; struct tls_t { tls_t() : error(EGL_SUCCESS), ctx(0), logCallWithNoContext(EGL_TRUE) { } EGLint error; EGLContext ctx; EGLBoolean logCallWithNoContext; }; // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- static egl_connection_t gEGLImpl[IMPL_NUM_IMPLEMENTATIONS]; static egl_connection_t gEGLImpl[IMPL_NUM_IMPLEMENTATIONS]; Loading Loading @@ -595,11 +583,6 @@ egl_context_t* get_context(EGLContext context) { return egl_to_native_cast<egl_context_t>(context); return egl_to_native_cast<egl_context_t>(context); } } DbgContext * getDbgContextThreadSpecific() { return get_context(getContext())->dbg; } static inline static inline egl_image_t* get_image(EGLImageKHR image) { egl_image_t* get_image(EGLImageKHR image) { return egl_to_native_cast<egl_image_t>(image); return egl_to_native_cast<egl_image_t>(image); Loading Loading @@ -1442,10 +1425,12 @@ EGLBoolean eglMakeCurrent( EGLDisplay dpy, EGLSurface draw, loseCurrent(cur_c); loseCurrent(cur_c); if (ctx != EGL_NO_CONTEXT) { if (ctx != EGL_NO_CONTEXT) { if (!c->dbg && gEGLDebugLevel > 0) c->dbg = CreateDbgContext(c->version, c->cnx->hooks[c->version]); setGLHooksThreadSpecific(c->cnx->hooks[c->version]); setGLHooksThreadSpecific(c->cnx->hooks[c->version]); setContext(ctx); setContext(ctx); tls_t * const tls = getTLS(); if (!tls->dbg && gEGLDebugLevel > 0) tls->dbg = CreateDbgContext(gEGLThreadLocalStorageKey, c->version, c->cnx->hooks[c->version]); _c.acquire(); _c.acquire(); _r.acquire(); _r.acquire(); _d.acquire(); _d.acquire(); Loading
opengl/libs/GLES2_dbg/Android.mk +4 −3 Original line number Original line Diff line number Diff line Loading @@ -21,7 +21,8 @@ LOCAL_C_INCLUDES := \ #LOCAL_CFLAGS += -O0 -g -DDEBUG -UNDEBUG #LOCAL_CFLAGS += -O0 -g -DDEBUG -UNDEBUG LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI LOCAL_CFLAGS := -DGOOGLE_PROTOBUF_NO_RTTI LOCAL_STATIC_LIBRARIES := libprotobuf-cpp-2.3.0-lite liblzf LOCAL_SHARED_LIBRARIES := libcutils libutils libstlport ifeq ($(TARGET_ARCH),arm) ifeq ($(TARGET_ARCH),arm) LOCAL_CFLAGS += -fstrict-aliasing LOCAL_CFLAGS += -fstrict-aliasing endif endif Loading @@ -43,4 +44,4 @@ endif LOCAL_MODULE:= libGLESv2_dbg LOCAL_MODULE:= libGLESv2_dbg LOCAL_MODULE_TAGS := optional LOCAL_MODULE_TAGS := optional include $(BUILD_STATIC_LIBRARY) include $(BUILD_SHARED_LIBRARY)
opengl/libs/GLES2_dbg/generate_api_cpp.py +7 −2 Original line number Original line Diff line number Diff line Loading @@ -192,11 +192,16 @@ if __name__ == "__main__": // auto generated by generate_api_cpp.py // auto generated by generate_api_cpp.py #include <utils/Debug.h> #include "src/header.h" #include "src/header.h" #include "src/api.h" #include "src/api.h" template<typename T> static int ToInt(const T & t) { STATIC_ASSERT(sizeof(T) == sizeof(int), bitcast); return (int &)t; } template<typename T> static int ToInt(const T & t) template<typename T> static T FromInt(const int & t) { STATIC_ASSERT(sizeof(T) == sizeof(int), bitcast); return (T &)t; } { COMPILE_TIME_ASSERT_FUNCTION_SCOPE(sizeof(T) == sizeof(int)); return (int &)t; } """ """ lines = open("gl2_api_annotated.in").readlines() lines = open("gl2_api_annotated.in").readlines() generate_api(lines) generate_api(lines) Loading
opengl/libs/GLES2_dbg/generate_caller_cpp.py +0 −1 Original line number Original line Diff line number Diff line Loading @@ -177,7 +177,6 @@ const int * GenerateCall(DbgContext * const dbg, const glesv2debugger::Message & { { LOGD("GenerateCall function=%u", cmd.function()); LOGD("GenerateCall function=%u", cmd.function()); const int * ret = prevRet; // only some functions have return value const int * ret = prevRet; // only some functions have return value gl_hooks_t::gl_t const * const _c = &getGLTraceThreadSpecific()->gl; nsecs_t c0 = systemTime(timeMode); nsecs_t c0 = systemTime(timeMode); switch (cmd.function()) {""") switch (cmd.function()) {""") Loading