From: Chia-I Wu Date: Tue, 26 Jan 2010 08:52:14 +0000 (+0800) Subject: egl: Add _eglGetAPIContext. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6f6f3e4227855c87a78a717bce7374a7d64172ce;p=mesa.git egl: Add _eglGetAPIContext. It will return the currently bound context of the given API. --- diff --git a/src/egl/main/eglcurrent.c b/src/egl/main/eglcurrent.c index f91631240fd..b3be2305fd6 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 c4478b38914..b8c2bda4855 100644 --- a/src/egl/main/eglcurrent.h +++ b/src/egl/main/eglcurrent.h @@ -72,6 +72,10 @@ extern EGLBoolean _eglIsCurrentThreadDummy(void); +PUBLIC _EGLContext * +_eglGetAPIContext(EGLenum api); + + PUBLIC _EGLContext * _eglGetCurrentContext(void);