Mesa (master): egl: Add _eglGetAPIContext.

Chia-I Wu olv at kemper.freedesktop.org
Tue Jan 26 10:47:33 UTC 2010


Module: Mesa
Branch: master
Commit: 6f6f3e4227855c87a78a717bce7374a7d64172ce
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6f6f3e4227855c87a78a717bce7374a7d64172ce

Author: Chia-I Wu <olvaffe at gmail.com>
Date:   Tue Jan 26 16:52:14 2010 +0800

egl: Add _eglGetAPIContext.

It will return the currently bound context of the given API.

---

 src/egl/main/eglcurrent.c |   13 ++++++++++++-
 src/egl/main/eglcurrent.h |    4 ++++
 2 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/src/egl/main/eglcurrent.c b/src/egl/main/eglcurrent.c
index f916312..b3be230 100644
--- a/src/egl/main/eglcurrent.c
+++ b/src/egl/main/eglcurrent.c
@@ -227,7 +227,18 @@ _eglIsCurrentThreadDummy(void)
 
 
 /**
- * Return the currently bound context, or NULL.
+ * Return the currently bound context of the given API, or NULL.
+ */
+PUBLIC _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)
diff --git a/src/egl/main/eglcurrent.h b/src/egl/main/eglcurrent.h
index c4478b3..b8c2bda 100644
--- a/src/egl/main/eglcurrent.h
+++ b/src/egl/main/eglcurrent.h
@@ -73,6 +73,10 @@ _eglIsCurrentThreadDummy(void);
 
 
 PUBLIC _EGLContext *
+_eglGetAPIContext(EGLenum api);
+
+
+PUBLIC _EGLContext *
 _eglGetCurrentContext(void);
 
 




More information about the mesa-commit mailing list