From 721ba15bf4596b2e9589e7656005b387724875c3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 May 2008 14:33:54 -0600 Subject: added _eglGet*Handle() functions These are the inverse of the _eglLookup*() functions. Returns the public handle for a private surface/config/display/etc. Removes glapi.c's direct access of private fields. --- src/egl/main/eglsurface.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/egl/main/eglsurface.c') diff --git a/src/egl/main/eglsurface.c b/src/egl/main/eglsurface.c index 134afa7cbd..1dbb12ecfe 100644 --- a/src/egl/main/eglsurface.c +++ b/src/egl/main/eglsurface.c @@ -223,6 +223,26 @@ _eglRemoveSurface(_EGLSurface *surf) } + +/** + * Return the public handle for an internal _EGLSurface. + * This is the inverse of _eglLookupSurface(). + */ +EGLSurface +_eglGetSurfaceHandle(_EGLSurface *surface) +{ + if (surface) + return surface->Handle; + else + return EGL_NO_SURFACE; +} + + +/** + * Return the private _EGLSurface which corresponds to a public EGLSurface + * handle. + * This is the inverse of _eglGetSurfaceHandle(). + */ _EGLSurface * _eglLookupSurface(EGLSurface surf) { -- cgit v1.2.3