summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglcontext.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/main/eglcontext.h')
-rw-r--r--src/egl/main/eglcontext.h57
1 files changed, 19 insertions, 38 deletions
diff --git a/src/egl/main/eglcontext.h b/src/egl/main/eglcontext.h
index cfe92dd9f5c..8cd0df17313 100644
--- a/src/egl/main/eglcontext.h
+++ b/src/egl/main/eglcontext.h
@@ -34,51 +34,46 @@ _eglInitContext(_EGLContext *ctx, _EGLDisplay *dpy,
_EGLConfig *config, const EGLint *attrib_list);
-extern _EGLContext *
-_eglCreateContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *conf, _EGLContext *share_list, const EGLint *attrib_list);
-
-
-extern EGLBoolean
-_eglDestroyContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx);
-
-
extern EGLBoolean
_eglQueryContext(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *ctx, EGLint attribute, EGLint *value);
PUBLIC EGLBoolean
-_eglBindContext(_EGLContext **ctx, _EGLSurface **draw, _EGLSurface **read);
-
-
-extern EGLBoolean
-_eglMakeCurrent(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *draw, _EGLSurface *read, _EGLContext *ctx);
+_eglBindContext(_EGLContext *ctx, _EGLSurface *draw, _EGLSurface *read,
+ _EGLContext **old_ctx,
+ _EGLSurface **old_draw, _EGLSurface **old_read);
-extern EGLBoolean
-_eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
+/**
+ * Increment reference count for the context.
+ */
+static INLINE _EGLContext *
+_eglGetContext(_EGLContext *ctx)
+{
+ if (ctx)
+ _eglGetResource(&ctx->Resource);
+ return 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.
+ * Decrement reference count for the context.
*/
static INLINE EGLBoolean
-_eglIsContextBound(_EGLContext *ctx)
+_eglPutContext(_EGLContext *ctx)
{
- return (ctx->Binding != NULL);
+ return (ctx) ? _eglPutResource(&ctx->Resource) : EGL_FALSE;
}
/**
- * Link a context to a display and return the handle of the link.
+ * Link a context to its display and return the handle of the link.
* The handle can be passed to client directly.
*/
static INLINE EGLContext
-_eglLinkContext(_EGLContext *ctx, _EGLDisplay *dpy)
+_eglLinkContext(_EGLContext *ctx)
{
- _eglLinkResource(&ctx->Resource, _EGL_RESOURCE_CONTEXT, dpy);
+ _eglLinkResource(&ctx->Resource, _EGL_RESOURCE_CONTEXT);
return (EGLContext) ctx;
}
@@ -120,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 */