Mesa (master): st/egl: Remove egl_g3d_get_current_context.

Chia-I Wu olv at kemper.freedesktop.org
Sun Jan 31 03:19:56 UTC 2010


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

Author: Chia-I Wu <olvaffe at gmail.com>
Date:   Sun Jan 31 01:18:18 2010 +0800

st/egl: Remove egl_g3d_get_current_context.

There is now _eglGetAPIContext that can return the current context of
the given API.

---

 src/gallium/state_trackers/egl/common/egl_g3d.c |   20 ++++----------------
 1 files changed, 4 insertions(+), 16 deletions(-)

diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c
index f4c4032..e8f46e5 100644
--- a/src/gallium/state_trackers/egl/common/egl_g3d.c
+++ b/src/gallium/state_trackers/egl/common/egl_g3d.c
@@ -244,17 +244,6 @@ egl_g3d_realloc_context(_EGLDisplay *dpy, _EGLContext *ctx)
 }
 
 /**
- * Return the current context of the given API.
- */
-static struct egl_g3d_context *
-egl_g3d_get_current_context(EGLint api)
-{
-   _EGLThreadInfo *t = _eglGetCurrentThread();
-   EGLint api_index = _eglConvertApiToIndex(api);
-   return egl_g3d_context(t->CurrentContexts[api_index]);
-}
-
-/**
  * Return the state tracker for the given context.
  */
 static const struct egl_g3d_st *
@@ -1098,7 +1087,8 @@ egl_g3d_bind_tex_image(_EGLDriver *drv, _EGLDisplay *dpy,
                        _EGLSurface *surf, EGLint buffer)
 {
    struct egl_g3d_surface *gsurf = egl_g3d_surface(surf);
-   struct egl_g3d_context *gctx;
+   _EGLContext *ctx = _eglGetAPIContext(EGL_OPENGL_ES_API);
+   struct egl_g3d_context *gctx = egl_g3d_context(ctx);
    enum pipe_format target_format;
    int target;
 
@@ -1135,7 +1125,6 @@ egl_g3d_bind_tex_image(_EGLDriver *drv, _EGLDisplay *dpy,
             PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_FRAME, NULL);
    }
 
-   gctx = egl_g3d_get_current_context(EGL_OPENGL_ES_API);
    if (gctx) {
       if (!gsurf->render_surface)
          return EGL_FALSE;
@@ -1161,9 +1150,8 @@ egl_g3d_release_tex_image(_EGLDriver *drv, _EGLDisplay *dpy,
       return _eglError(EGL_BAD_PARAMETER, "eglReleaseTexImage");
 
    if (gsurf->render_surface) {
-      _EGLThreadInfo *t = _eglGetCurrentThread();
-      struct egl_g3d_context *gctx = egl_g3d_context(
-            t->CurrentContexts[_eglConvertApiToIndex(EGL_OPENGL_ES_API)]);
+      _EGLContext *ctx = _eglGetAPIContext(EGL_OPENGL_ES_API);
+      struct egl_g3d_context *gctx = egl_g3d_context(ctx);
 
       /* what if the context the surface binds to is no longer current? */
       if (gctx)




More information about the mesa-commit mailing list