summaryrefslogtreecommitdiffstats
path: root/opengl/libs/EGL/egl.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-09-23 11:32:52 -0700
committerMathias Agopian <mathias@google.com>2010-09-23 13:19:02 -0700
commit5c6c5c7a43d44316395f5c35ab713372124b8b4c (patch)
tree43ec94e3ed008616b1ddeee67aef3420180cbe1b /opengl/libs/EGL/egl.cpp
parentbb0d23b5475cb516fa6f61ee3fe4e7b79cd980f8 (diff)
downloadframeworks_base-5c6c5c7a43d44316395f5c35ab713372124b8b4c.zip
frameworks_base-5c6c5c7a43d44316395f5c35ab713372124b8b4c.tar.gz
frameworks_base-5c6c5c7a43d44316395f5c35ab713372124b8b4c.tar.bz2
fix [3028370] GL get error should return a valid error if no context is bound.
glGetError() will now always return GL_INVALID_OPERATION if called from a thread with no GL context bound. Change-Id: I28ba458871db051bb4f5a26668a1fa123526869c
Diffstat (limited to 'opengl/libs/EGL/egl.cpp')
-rw-r--r--opengl/libs/EGL/egl.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/opengl/libs/EGL/egl.cpp b/opengl/libs/EGL/egl.cpp
index 105ebb4..0437263 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -437,6 +437,12 @@ static void gl_no_context() {
}
}
+// Always return GL_INVALID_OPERATION from glGetError() when called from
+// a thread without a bound context.
+static GLenum gl_no_context_glGetError() {
+ return GL_INVALID_OPERATION;
+}
+
static void early_egl_init(void)
{
#if !USE_FAST_TLS_KEY
@@ -447,6 +453,9 @@ static void early_egl_init(void)
(uint32_t*)(void*)&gHooksNoContext,
addr,
sizeof(gHooksNoContext));
+
+ gHooksNoContext.gl.glGetError = gl_no_context_glGetError;
+
setGlThreadSpecific(&gHooksNoContext);
}