summaryrefslogtreecommitdiffstats
path: root/src/egl/main/eglsurface.h
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-01-23 22:57:23 +0800
committerChia-I Wu <[email protected]>2010-01-24 20:38:15 +0800
commitb4d2c97a2d2cce92fa638ff74bef7dedf593fd1f (patch)
tree5ddae3e0769a79f65bd7c12d5049e7c622418d66 /src/egl/main/eglsurface.h
parent5e66d1893234b3002d71985c05253321d4cdedc4 (diff)
egl: Move surface functions in egldisplay.[ch] to eglsurface.[ch]
Move functions to where they should be. There should be no real change here.
Diffstat (limited to 'src/egl/main/eglsurface.h')
-rw-r--r--src/egl/main/eglsurface.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/src/egl/main/eglsurface.h b/src/egl/main/eglsurface.h
index dacdf7e63ce..b1163293fe6 100644
--- a/src/egl/main/eglsurface.h
+++ b/src/egl/main/eglsurface.h
@@ -111,4 +111,67 @@ _eglIsSurfaceBound(_EGLSurface *surf)
}
+extern EGLSurface
+_eglLinkSurface(_EGLSurface *surf, _EGLDisplay *dpy);
+
+
+extern void
+_eglUnlinkSurface(_EGLSurface *surf);
+
+
+#ifndef _EGL_SKIP_HANDLE_CHECK
+
+
+extern EGLBoolean
+_eglCheckSurfaceHandle(EGLSurface surf, _EGLDisplay *dpy);
+
+
+#else /* !_EGL_SKIP_HANDLE_CHECK */
+
+
+static INLINE EGLBoolean
+_eglCheckSurfaceHandle(EGLSurface surf, _EGLDisplay *dpy)
+{
+ _EGLSurface *s = (_EGLSurface *) surf;
+ return (dpy && s && s->Display == dpy);
+}
+
+
+#endif /* _EGL_SKIP_HANDLE_CHECK */
+
+
+/**
+ * Lookup a handle to find the linked surface.
+ * Return NULL if the handle has no corresponding linked surface.
+ */
+static INLINE _EGLSurface *
+_eglLookupSurface(EGLSurface surface, _EGLDisplay *dpy)
+{
+ _EGLSurface *surf = (_EGLSurface *) surface;
+ if (!_eglCheckSurfaceHandle(surf, dpy))
+ surf = NULL;
+ return surf;
+}
+
+
+/**
+ * Return the handle of a linked surface, or EGL_NO_SURFACE.
+ */
+static INLINE EGLSurface
+_eglGetSurfaceHandle(_EGLSurface *surf)
+{
+ return (EGLSurface) ((surf && surf->Display) ? surf : EGL_NO_SURFACE);
+}
+
+
+/**
+ * Return true if the surface is linked to a display.
+ */
+static INLINE EGLBoolean
+_eglIsSurfaceLinked(_EGLSurface *surf)
+{
+ return (EGLBoolean) (_eglGetSurfaceHandle(surf) != EGL_NO_SURFACE);
+}
+
+
#endif /* EGLSURFACE_INCLUDED */