summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglcurrent.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/main/eglcurrent.c')
-rw-r--r--src/egl/main/eglcurrent.c46
1 files changed, 10 insertions, 36 deletions
diff --git a/src/egl/main/eglcurrent.c b/src/egl/main/eglcurrent.c
index df506151b58..a19dcf4096c 100644
--- a/src/egl/main/eglcurrent.c
+++ b/src/egl/main/eglcurrent.c
@@ -1,10 +1,10 @@
#include <stdlib.h>
#include <string.h>
-#include "eglcurrent.h"
+#include "eglglobals.h"
#include "eglcontext.h"
#include "egllog.h"
#include "eglmutex.h"
-#include "eglglobals.h"
+#include "eglcurrent.h"
/* This should be kept in sync with _eglInitThreadInfo() */
@@ -227,50 +227,24 @@ _eglIsCurrentThreadDummy(void)
/**
- * Return the currently bound context, or NULL.
- */
-_EGLContext *
-_eglGetCurrentContext(void)
-{
- _EGLThreadInfo *t = _eglGetCurrentThread();
- return t->CurrentContexts[t->CurrentAPIIndex];
-}
-
-
-/**
- * Return the display of the currently bound context, or NULL.
+ * Return the currently bound context of the given API, or NULL.
*/
-_EGLDisplay *
-_eglGetCurrentDisplay(void)
+PUBLIC _EGLContext *
+_eglGetAPIContext(EGLenum api)
{
_EGLThreadInfo *t = _eglGetCurrentThread();
- _EGLContext *ctx = t->CurrentContexts[t->CurrentAPIIndex];
- if (ctx)
- return ctx->Display;
- else
- return NULL;
+ return t->CurrentContexts[_eglConvertApiToIndex(api)];
}
/**
- * Return the read or write surface of the currently bound context, or NULL.
+ * Return the currently bound context of the current API, or NULL.
*/
-_EGLSurface *
-_eglGetCurrentSurface(EGLint readdraw)
+_EGLContext *
+_eglGetCurrentContext(void)
{
_EGLThreadInfo *t = _eglGetCurrentThread();
- _EGLContext *ctx = t->CurrentContexts[t->CurrentAPIIndex];
- if (ctx) {
- switch (readdraw) {
- case EGL_DRAW:
- return ctx->DrawSurface;
- case EGL_READ:
- return ctx->ReadSurface;
- default:
- return NULL;
- }
- }
- return NULL;
+ return t->CurrentContexts[t->CurrentAPIIndex];
}