summaryrefslogtreecommitdiffstats
path: root/opengl/libs/GLES2
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-09-23 16:38:38 -0700
committerMathias Agopian <mathias@google.com>2010-09-23 16:44:48 -0700
commit25b388c43bd0444985776c4d129e0ccaef9b6229 (patch)
treed58e3de3d31497d20adfd170de367eff3e02fc17 /opengl/libs/GLES2
parent5c6c5c7a43d44316395f5c35ab713372124b8b4c (diff)
downloadframeworks_base-25b388c43bd0444985776c4d129e0ccaef9b6229.zip
frameworks_base-25b388c43bd0444985776c4d129e0ccaef9b6229.tar.gz
frameworks_base-25b388c43bd0444985776c4d129e0ccaef9b6229.tar.bz2
better fix for [3028370] GL get error should return a valid error if no context is bound.
it turns out that we cannot return INVALID_OPERATION from glGetError() because the GL spec says that it must be called in a loop until it returns GL_NO_ERROR. now, we always return 0 from GL functions called from a thread with no context bound. This means that glGetError() will return NO_ERROR in this case, which is better than returning a random value (which could trap the app in a loop). if this happens in the main thread of a process, we LOG an error message once. Change-Id: Id59620e675a890286ef62a257c02b06e0fdcaf69
Diffstat (limited to 'opengl/libs/GLES2')
-rw-r--r--opengl/libs/GLES2/gl2.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/opengl/libs/GLES2/gl2.cpp b/opengl/libs/GLES2/gl2.cpp
index 924737e..18dd483 100644
--- a/opengl/libs/GLES2/gl2.cpp
+++ b/opengl/libs/GLES2/gl2.cpp
@@ -58,6 +58,7 @@ using namespace android;
"ldr r12, [r12, %[tls]] \n" \
"cmp r12, #0 \n" \
"ldrne pc, [r12, %[api]] \n" \
+ "mov r0, #0 \n" \
"bx lr \n" \
: \
: [tls] "J"(TLS_SLOT_OPENGL_API*4), \