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.
This commit is contained in:
Mathias Agopian 2010-09-23 13:28:47 -07:00 committed by Android Git Automerger
commit aa22d20554
1 changed files with 9 additions and 0 deletions

View File

@ -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);
}