summaryrefslogtreecommitdiffstats
path: root/opengl
diff options
context:
space:
mode:
authorEric Fischer <enf@google.com>2009-10-13 12:04:49 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2009-10-13 12:04:49 -0700
commit945ff2024357bd4367cb437d3ebb32d6fb7e9438 (patch)
tree653ef7121e91eb96ad983781ef91e58dc47f173f /opengl
parent74ae80b623d72d7fab1999fb9ce4b759419f4553 (diff)
parent94f3a36326ddecaa09787d795451b0a229fe111c (diff)
downloadframeworks_base-945ff2024357bd4367cb437d3ebb32d6fb7e9438.zip
frameworks_base-945ff2024357bd4367cb437d3ebb32d6fb7e9438.tar.gz
frameworks_base-945ff2024357bd4367cb437d3ebb32d6fb7e9438.tar.bz2
am 94f3a363: Merge branch \'eclair-plus-aosp\' of ssh://android-git.corp.google.com:29418/platform/frameworks/base into eclair-mr2-plus-aosp
Merge commit '94f3a36326ddecaa09787d795451b0a229fe111c' * commit '94f3a36326ddecaa09787d795451b0a229fe111c': Remove STOPSHIP BT logging. BT API security audit: fix a couple of permission mistakes. Fix issue #2175693: Add vmallocinfo to dumpstate add a way to easily catch and log GL errors (compile time flag) GPS: Fix problem with SUPL when SUPL APN is already active. Import revised translations. DO NOT MERGE Fix issue 2174002: After rejecting Call when device ringtone is mute and playing music, audio is not transfered to BT device. Import revised translations. DO NOT MERGE
Diffstat (limited to 'opengl')
-rw-r--r--opengl/libs/GLES_CM/gl.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/opengl/libs/GLES_CM/gl.cpp b/opengl/libs/GLES_CM/gl.cpp
index 3204d9a..1e4c136 100644
--- a/opengl/libs/GLES_CM/gl.cpp
+++ b/opengl/libs/GLES_CM/gl.cpp
@@ -31,6 +31,9 @@
using namespace android;
+// set this to 1 for crude GL debugging
+#define CHECK_FOR_GL_ERRORS 0
+
// ----------------------------------------------------------------------------
// extensions for the framework
// ----------------------------------------------------------------------------
@@ -71,7 +74,7 @@ void glVertexPointerBounds(GLint size, GLenum type,
#undef CALL_GL_API
#undef CALL_GL_API_RETURN
-#if USE_FAST_TLS_KEY
+#if USE_FAST_TLS_KEY && !CHECK_FOR_GL_ERRORS
#define API_ENTRY(_api) __attribute__((naked)) _api
@@ -95,12 +98,27 @@ void glVertexPointerBounds(GLint size, GLenum type,
#else
+ #if CHECK_FOR_GL_ERRORS
+
+ #define CHECK_GL_ERRORS(_api) \
+ do { GLint err = glGetError(); \
+ LOGE_IF(err != GL_NO_ERROR, "%s failed (0x%04X)", #_api, err); \
+ } while(false);
+
+ #else
+
+ #define CHECK_GL_ERRORS(_api) do { } while(false);
+
+ #endif
+
+
#define API_ENTRY(_api) _api
#define CALL_GL_API(_api, ...) \
gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \
- _c->_api(__VA_ARGS__)
-
+ _c->_api(__VA_ARGS__); \
+ CHECK_GL_ERRORS(_api)
+
#define CALL_GL_API_RETURN(_api, ...) \
gl_hooks_t::gl_t const * const _c = &getGlThreadSpecific()->gl; \
return _c->_api(__VA_ARGS__)