summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-09-27 16:04:03 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-09-27 16:04:04 -0700
commitcb094a783f14daae3378ac8aa7dc509980f037b2 (patch)
treec5d37fb6d447f15212aec59e25cb5d9df4c59815
parent38b657265ccc5ae45bd7860a68b0d9373b47a2f3 (diff)
parentf12fe43e8c280923fde743f22cea238e48c929f1 (diff)
downloadframeworks_native-cb094a783f14daae3378ac8aa7dc509980f037b2.zip
frameworks_native-cb094a783f14daae3378ac8aa7dc509980f037b2.tar.gz
frameworks_native-cb094a783f14daae3378ac8aa7dc509980f037b2.tar.bz2
Merge "New compile-time flags to make debugging easier for us poor souls Bug #7195815" into jb-mr1-dev
-rw-r--r--opengl/libs/GLES2/gl2.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/opengl/libs/GLES2/gl2.cpp b/opengl/libs/GLES2/gl2.cpp
index b00af1b..9e52298 100644
--- a/opengl/libs/GLES2/gl2.cpp
+++ b/opengl/libs/GLES2/gl2.cpp
@@ -29,6 +29,8 @@
#define ATRACE_TAG ATRACE_TAG_GRAPHICS
#include <utils/Trace.h>
+#include <utils/CallStack.h>
+
#include "hooks.h"
#include "egl_impl.h"
@@ -43,9 +45,10 @@ using namespace android;
#undef CALL_GL_API_RETURN
#define DEBUG_CALL_GL_API 0
+#define DEBUG_PRINT_CALL_STACK_ON_ERROR 0
#define SYSTRACE_CALL_GL_API 0
-#if USE_FAST_TLS_KEY
+#if USE_FAST_TLS_KEY___
#ifdef HAVE_ARM_TLS_REGISTER
#define GET_TLS(reg) \
@@ -86,8 +89,15 @@ using namespace android;
gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \
_c->_api(__VA_ARGS__); \
GLenum status = GL_NO_ERROR; \
+ bool error = false; \
while ((status = glGetError()) != GL_NO_ERROR) { \
ALOGD("[" #_api "] 0x%x", status); \
+ error = true; \
+ } \
+ if (DEBUG_PRINT_CALL_STACK_ON_ERROR && error) { \
+ CallStack s; \
+ s.update(); \
+ s.dump("glGetError:" #_api); \
}
#elif SYSTRACE_CALL_GL_API