egl: Use reference counting to replace IsLinked or IsBound.
[mesa.git] / src / egl / main / eglcontext.h
index 9c1e2184c640d887759ae3a1b0323a4a53b10b43..8cd0df173135bd69079541114619bf5dc13ad021 100644 (file)
@@ -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 */