summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2012-08-01 17:10:25 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-08-13 12:13:05 -0700
commit7e5099a9ece6a3ed7edb1b5bf60a43422428326c (patch)
treef16bfa38dd0f88185433f9aeed0ac25c450babad /opengl
parente57f292595bec48f65c8088b00ff6beea01217e9 (diff)
downloadframeworks_native-7e5099a9ece6a3ed7edb1b5bf60a43422428326c.zip
frameworks_native-7e5099a9ece6a3ed7edb1b5bf60a43422428326c.tar.gz
frameworks_native-7e5099a9ece6a3ed7edb1b5bf60a43422428326c.tar.bz2
Add compile-time option to systrace GL-ES calls
Change-Id: Ibec103bbf159626ad9745d0e071192ad424bc0e9
Diffstat (limited to 'opengl')
-rw-r--r--opengl/libs/Android.mk2
-rw-r--r--opengl/libs/GLES2/gl2.cpp11
2 files changed, 12 insertions, 1 deletions
diff --git a/opengl/libs/Android.mk b/opengl/libs/Android.mk
index 42aaa24..eea79f8 100644
--- a/opengl/libs/Android.mk
+++ b/opengl/libs/Android.mk
@@ -122,7 +122,7 @@ LOCAL_SRC_FILES:= \
GLES2/gl2.cpp.arm \
#
-LOCAL_SHARED_LIBRARIES += libcutils libEGL
+LOCAL_SHARED_LIBRARIES += libcutils libutils libEGL
LOCAL_LDLIBS := -lpthread -ldl
LOCAL_MODULE:= libGLESv2
diff --git a/opengl/libs/GLES2/gl2.cpp b/opengl/libs/GLES2/gl2.cpp
index 4345c2b..b00af1b 100644
--- a/opengl/libs/GLES2/gl2.cpp
+++ b/opengl/libs/GLES2/gl2.cpp
@@ -26,6 +26,9 @@
#include <cutils/log.h>
#include <cutils/properties.h>
+#define ATRACE_TAG ATRACE_TAG_GRAPHICS
+#include <utils/Trace.h>
+
#include "hooks.h"
#include "egl_impl.h"
@@ -40,6 +43,7 @@ using namespace android;
#undef CALL_GL_API_RETURN
#define DEBUG_CALL_GL_API 0
+#define SYSTRACE_CALL_GL_API 0
#if USE_FAST_TLS_KEY
@@ -86,6 +90,13 @@ using namespace android;
ALOGD("[" #_api "] 0x%x", status); \
}
+#elif SYSTRACE_CALL_GL_API
+
+ #define CALL_GL_API(_api, ...) \
+ ATRACE_CALL(); \
+ gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \
+ _c->_api(__VA_ARGS__);
+
#else
#define CALL_GL_API(_api, ...) \