Mesa (master): egl: Clarify IsLinked and IsBound.

Chia-I Wu olv at kemper.freedesktop.org
Fri Feb 5 03:45:14 UTC 2010


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

Author: Chia-I Wu <olvaffe at gmail.com>
Date:   Fri Feb  5 11:34:53 2010 +0800

egl: Clarify IsLinked and IsBound.

Both a link and a binding creates a reference to the resource.  Drivers
should not destroy the resource when there is a reference.  The
difference is better described in doc/egl.html.

---

 src/egl/main/eglcontext.h |    6 ++++++
 src/egl/main/eglsurface.h |    6 ++++++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/egl/main/eglcontext.h b/src/egl/main/eglcontext.h
index 14fce02..cfe92dd 100644
--- a/src/egl/main/eglcontext.h
+++ b/src/egl/main/eglcontext.h
@@ -60,6 +60,9 @@ _eglCopyContextMESA(_EGLDriver *drv, EGLDisplay dpy, EGLContext source, EGLConte
 
 /**
  * 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)
@@ -119,6 +122,9 @@ _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)
diff --git a/src/egl/main/eglsurface.h b/src/egl/main/eglsurface.h
index feba30d..0a00035 100644
--- a/src/egl/main/eglsurface.h
+++ b/src/egl/main/eglsurface.h
@@ -107,6 +107,9 @@ _eglCreatePbufferFromClientBuffer(_EGLDriver *drv, _EGLDisplay *dpy,
 
 /**
  * Return true if there is a context bound to the surface.
+ *
+ * The binding is considered a reference to the surface.  Drivers should not
+ * destroy a surface when it is bound.
  */
 static INLINE EGLBoolean
 _eglIsSurfaceBound(_EGLSurface *surf)
@@ -166,6 +169,9 @@ _eglGetSurfaceHandle(_EGLSurface *surf)
 
 /**
  * Return true if the surface is linked to a display.
+ *
+ * The link is considered a reference to the surface (the display is owning the
+ * surface).  Drivers should not destroy a surface when it is linked.
  */
 static INLINE EGLBoolean
 _eglIsSurfaceLinked(_EGLSurface *surf)




More information about the mesa-commit mailing list