From d19afc57fe49816f3f3290410e0124d326577be2 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sat, 23 Oct 2010 12:52:26 +0800 Subject: egl: Use reference counting to replace IsLinked or IsBound. Remove all _eglIsLinked and _eglIsBound. Update _eglBindContext and drivers to do reference counting. --- src/egl/main/eglcontext.h | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) (limited to 'src/egl/main/eglcontext.h') diff --git a/src/egl/main/eglcontext.h b/src/egl/main/eglcontext.h index 9c1e2184c6..8cd0df1731 100644 --- a/src/egl/main/eglcontext.h +++ b/src/egl/main/eglcontext.h @@ -39,7 +39,9 @@ _eglQueryContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx, EGLint att PUBLIC EGLBoolean -_eglBindContext(_EGLContext **ctx, _EGLSurface **draw, _EGLSurface **read); +_eglBindContext(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read, + _EGLContext **old_ctx, + _EGLSurface **old_draw, _EGLSurface **old_read); /** @@ -64,19 +66,6 @@ _eglPutContext(_EGLContext *ctx) } -/** - * Return true if the context is bound to a thread. - * - * The binding is considered a reference to the context. Drivers should not - * destroy a context when it is bound. - */ -static INLINE EGLBoolean -_eglIsContextBound(_EGLContext *ctx) -{ - return (ctx->Binding != NULL); -} - - /** * Link a context to its display and return the handle of the link. * The handle can be passed to client directly. @@ -126,18 +115,4 @@ _eglGetContextHandle(_EGLContext *ctx) } -/** - * Return true if the context is linked to a display. - * - * The link is considered a reference to the context (the display is owning the - * context). Drivers should not destroy a context when it is linked. - */ -static INLINE EGLBoolean -_eglIsContextLinked(_EGLContext *ctx) -{ - _EGLResource *res = (_EGLResource *) ctx; - return (res && _eglIsResourceLinked(res)); -} - - #endif /* EGLCONTEXT_INCLUDED */ -- cgit v1.2.3