summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglcurrent.c
diff options
context:
space:
mode:
authorKyle Brenneman <[email protected]>2016-07-08 15:21:17 -0600
committerAdam Jackson <[email protected]>2016-09-07 11:56:48 -0400
commit6e066f76ee22909b0653ff8b89429de819e60f14 (patch)
tree07b82d16ed9c2a74263f8ca92a8dad65875cbc14 /src/egl/main/eglcurrent.c
parent74b1969d717f2428f0b9dcaaea611e95736120a5 (diff)
EGL: Combine the GL and GLES current contexts (v2)
Only keep track of a single current context, instead of separate contexts for GL and GLES. In EGL 1.4 (and 1.5), EGL_OPENGL_API and EGL_OPENGL_ES_API are supposed to be interchangeable for all purposes except for eglCreateContext. The _EGLThreadInfo::CurrentContexts array is now a single pointer to the current context, which may be a GL or GLES context. In addition, it now keeps track of the current API as an enum instead of an index. eglMakeCurrent will now replace the current context, regardless of which client API is used for for the current and new contexts. It no longer checks for a conflicting context. In addition, calling eglMakeCurrent with EGL_NO_CONTEXT will now release the current context regardless of the current API. v2: Rebased against master (Adam Jackson) Reviewed-by: Adam Jackson <[email protected]>
Diffstat (limited to 'src/egl/main/eglcurrent.c')
-rw-r--r--src/egl/main/eglcurrent.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/egl/main/eglcurrent.c b/src/egl/main/eglcurrent.c
index 835631d3ba3..345f4cc8922 100644
--- a/src/egl/main/eglcurrent.c
+++ b/src/egl/main/eglcurrent.c
@@ -111,7 +111,7 @@ _eglInitThreadInfo(_EGLThreadInfo *t)
memset(t, 0, sizeof(*t));
t->LastError = EGL_SUCCESS;
/* default, per EGL spec */
- t->CurrentAPIIndex = _eglConvertApiToIndex(EGL_OPENGL_ES_API);
+ t->CurrentAPI = EGL_OPENGL_ES_API;
}
@@ -205,24 +205,13 @@ _eglIsCurrentThreadDummy(void)
/**
- * Return the currently bound context of the given API, or NULL.
- */
-_EGLContext *
-_eglGetAPIContext(EGLenum api)
-{
- _EGLThreadInfo *t = _eglGetCurrentThread();
- return t->CurrentContexts[_eglConvertApiToIndex(api)];
-}
-
-
-/**
* Return the currently bound context of the current API, or NULL.
*/
_EGLContext *
_eglGetCurrentContext(void)
{
_EGLThreadInfo *t = _eglGetCurrentThread();
- return t->CurrentContexts[t->CurrentAPIIndex];
+ return t->CurrentContext;
}