summaryrefslogtreecommitdiffstats
path: root/opengl/libs/EGL/egl.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-09-23 13:28:47 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-09-23 13:28:47 -0700
commitaa22d205549f5c9604f5d66b5368c53b484c3638 (patch)
treede37fba2bf73f69a025d3c4f3ee308e070ed23c3 /opengl/libs/EGL/egl.cpp
parent5975b48b383516be8b9ec630f9612ff7a2b60c3f (diff)
parent6ee79cfa2f2885967910ffd27f6f81e1928b3d8d (diff)
downloadframeworks_native-aa22d205549f5c9604f5d66b5368c53b484c3638.zip
frameworks_native-aa22d205549f5c9604f5d66b5368c53b484c3638.tar.gz
frameworks_native-aa22d205549f5c9604f5d66b5368c53b484c3638.tar.bz2
am 9c4d7d67: am 5c6c5c7a: fix [3028370] GL get error should return a valid error if no context is bound.
Merge commit '9c4d7d677097981a349c718902e29050dad3d59f' * commit '9c4d7d677097981a349c718902e29050dad3d59f': fix [3028370] GL get error should return a valid error if no context is bound.
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 a8200be..d99fc1e 100644
--- a/opengl/libs/EGL/egl.cpp
+++ b/opengl/libs/EGL/egl.cpp
@@ -453,6 +453,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
@@ -463,6 +469,9 @@ static void early_egl_init(void)
(uint32_t*)(void*)&gHooksNoContext,
addr,
sizeof(gHooksNoContext));
+
+ gHooksNoContext.gl.glGetError = gl_no_context_glGetError;
+
setGlThreadSpecific(&gHooksNoContext);
}