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.
This commit is contained in:
@@ -53,10 +53,7 @@ eglGetDisplay(NativeDisplayType displayName)
|
|||||||
_EGLDisplay *dpy;
|
_EGLDisplay *dpy;
|
||||||
_eglInitGlobals();
|
_eglInitGlobals();
|
||||||
dpy = _eglNewDisplay(displayName);
|
dpy = _eglNewDisplay(displayName);
|
||||||
if (dpy)
|
return _eglGetDisplayHandle(dpy);
|
||||||
return dpy->Handle;
|
|
||||||
else
|
|
||||||
return EGL_NO_DISPLAY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -269,10 +266,7 @@ EGLDisplay EGLAPIENTRY
|
|||||||
eglGetCurrentDisplay(void)
|
eglGetCurrentDisplay(void)
|
||||||
{
|
{
|
||||||
_EGLDisplay *dpy = _eglGetCurrentDisplay();
|
_EGLDisplay *dpy = _eglGetCurrentDisplay();
|
||||||
if (dpy)
|
return _eglGetDisplayHandle(dpy);
|
||||||
return dpy->Handle;
|
|
||||||
else
|
|
||||||
return EGL_NO_DISPLAY;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -288,10 +282,7 @@ EGLSurface EGLAPIENTRY
|
|||||||
eglGetCurrentSurface(EGLint readdraw)
|
eglGetCurrentSurface(EGLint readdraw)
|
||||||
{
|
{
|
||||||
_EGLSurface *s = _eglGetCurrentSurface(readdraw);
|
_EGLSurface *s = _eglGetCurrentSurface(readdraw);
|
||||||
if (s)
|
return _eglGetSurfaceHandle(s);
|
||||||
return s->Handle;
|
|
||||||
else
|
|
||||||
return EGL_NO_SURFACE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -101,8 +101,20 @@ _eglInitConfig(_EGLConfig *config, EGLint id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the public handle for an internal _EGLConfig.
|
||||||
|
* This is the inverse of _eglLookupConfig().
|
||||||
|
*/
|
||||||
|
EGLConfig
|
||||||
|
_eglGetConfigHandle(_EGLConfig *config)
|
||||||
|
{
|
||||||
|
return config ? config->Handle : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Given an EGLConfig handle, return the corresponding _EGLConfig object.
|
* Given an EGLConfig handle, return the corresponding _EGLConfig object.
|
||||||
|
* This is the inverse of _eglGetConfigHandle().
|
||||||
*/
|
*/
|
||||||
_EGLConfig *
|
_EGLConfig *
|
||||||
_eglLookupConfig(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config)
|
_eglLookupConfig(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config)
|
||||||
|
@@ -27,6 +27,10 @@ extern void
|
|||||||
_eglInitConfig(_EGLConfig *config, EGLint id);
|
_eglInitConfig(_EGLConfig *config, EGLint id);
|
||||||
|
|
||||||
|
|
||||||
|
extern EGLConfig
|
||||||
|
_eglGetConfigHandle(_EGLConfig *config);
|
||||||
|
|
||||||
|
|
||||||
extern _EGLConfig *
|
extern _EGLConfig *
|
||||||
_eglLookupConfig(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config);
|
_eglLookupConfig(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config);
|
||||||
|
|
||||||
|
@@ -39,9 +39,24 @@ _eglNewDisplay(NativeDisplayType displayName)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the public handle for an internal _EGLDisplay.
|
||||||
|
* This is the inverse of _eglLookupDisplay().
|
||||||
|
*/
|
||||||
|
EGLDisplay
|
||||||
|
_eglGetDisplayHandle(_EGLDisplay *display)
|
||||||
|
{
|
||||||
|
if (display)
|
||||||
|
return display->Handle;
|
||||||
|
else
|
||||||
|
return EGL_NO_DISPLAY;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the _EGLDisplay object that corresponds to the given public/
|
* Return the _EGLDisplay object that corresponds to the given public/
|
||||||
* opaque display handle.
|
* opaque display handle.
|
||||||
|
* This is the inverse of _eglGetDisplayHandle().
|
||||||
*/
|
*/
|
||||||
_EGLDisplay *
|
_EGLDisplay *
|
||||||
_eglLookupDisplay(EGLDisplay dpy)
|
_eglLookupDisplay(EGLDisplay dpy)
|
||||||
|
@@ -24,6 +24,10 @@ extern _EGLDisplay *
|
|||||||
_eglNewDisplay(NativeDisplayType displayName);
|
_eglNewDisplay(NativeDisplayType displayName);
|
||||||
|
|
||||||
|
|
||||||
|
EGLDisplay
|
||||||
|
_eglGetDisplayHandle(_EGLDisplay *display);
|
||||||
|
|
||||||
|
|
||||||
extern _EGLDisplay *
|
extern _EGLDisplay *
|
||||||
_eglLookupDisplay(EGLDisplay dpy);
|
_eglLookupDisplay(EGLDisplay dpy);
|
||||||
|
|
||||||
|
@@ -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 *
|
_EGLSurface *
|
||||||
_eglLookupSurface(EGLSurface surf)
|
_eglLookupSurface(EGLSurface surf)
|
||||||
{
|
{
|
||||||
|
@@ -51,6 +51,10 @@ extern void
|
|||||||
_eglRemoveSurface(_EGLSurface *surf);
|
_eglRemoveSurface(_EGLSurface *surf);
|
||||||
|
|
||||||
|
|
||||||
|
extern EGLSurface
|
||||||
|
_eglGetSurfaceHandle(_EGLSurface *surface);
|
||||||
|
|
||||||
|
|
||||||
extern _EGLSurface *
|
extern _EGLSurface *
|
||||||
_eglLookupSurface(EGLSurface surf);
|
_eglLookupSurface(EGLSurface surf);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user