From 16928bfeca8858a0acae6942fc68c14a040b92ff Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Thu, 18 Oct 2012 16:16:10 -0700 Subject: Add runtime debugging capabilities to OpenGL The shell property debug.egl.trace can now be set to: 0 disables tracing 1 logs all GL calls error checks glGetError after every GL call, logs a stack trace on error systrace logs each GL call to systrace Change-Id: I34a2a2d4e19c373fd9eaa1b0cd93e67c87378996 --- opengl/libs/GLES2/gl2.cpp | 37 ------------------------------------- 1 file changed, 37 deletions(-) (limited to 'opengl/libs/GLES2') diff --git a/opengl/libs/GLES2/gl2.cpp b/opengl/libs/GLES2/gl2.cpp index 2d0045e..55ef499 100644 --- a/opengl/libs/GLES2/gl2.cpp +++ b/opengl/libs/GLES2/gl2.cpp @@ -26,11 +26,6 @@ #include #include -#define ATRACE_TAG ATRACE_TAG_GRAPHICS -#include - -#include - #include "hooks.h" #include "egl_impl.h" @@ -44,10 +39,6 @@ using namespace android; #undef CALL_GL_API #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 #ifdef HAVE_ARM_TLS_REGISTER @@ -83,38 +74,10 @@ using namespace android; #define API_ENTRY(_api) _api -#if DEBUG_CALL_GL_API - #define CALL_GL_API(_api, ...) \ 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 - - #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, ...) \ - gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \ - _c->_api(__VA_ARGS__); - -#endif - #define CALL_GL_API_RETURN(_api, ...) \ gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \ return _c->_api(__VA_ARGS__) -- cgit v1.1