ソースを参照

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.
tags/mesa_20090313
Brian Paul 17年前
コミット
721ba15bf4

+ 3
- 12
src/egl/main/eglapi.c ファイルの表示

@@ -53,10 +53,7 @@ eglGetDisplay(NativeDisplayType displayName)
_EGLDisplay *dpy;
_eglInitGlobals();
dpy = _eglNewDisplay(displayName);
if (dpy)
return dpy->Handle;
else
return EGL_NO_DISPLAY;
return _eglGetDisplayHandle(dpy);
}


@@ -269,10 +266,7 @@ EGLDisplay EGLAPIENTRY
eglGetCurrentDisplay(void)
{
_EGLDisplay *dpy = _eglGetCurrentDisplay();
if (dpy)
return dpy->Handle;
else
return EGL_NO_DISPLAY;
return _eglGetDisplayHandle(dpy);
}


@@ -288,10 +282,7 @@ EGLSurface EGLAPIENTRY
eglGetCurrentSurface(EGLint readdraw)
{
_EGLSurface *s = _eglGetCurrentSurface(readdraw);
if (s)
return s->Handle;
else
return EGL_NO_SURFACE;
return _eglGetSurfaceHandle(s);
}



+ 12
- 0
src/egl/main/eglconfig.c ファイルの表示

@@ -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.
* This is the inverse of _eglGetConfigHandle().
*/
_EGLConfig *
_eglLookupConfig(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config)

+ 4
- 0
src/egl/main/eglconfig.h ファイルの表示

@@ -27,6 +27,10 @@ extern void
_eglInitConfig(_EGLConfig *config, EGLint id);


extern EGLConfig
_eglGetConfigHandle(_EGLConfig *config);


extern _EGLConfig *
_eglLookupConfig(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config);


+ 15
- 0
src/egl/main/egldisplay.c ファイルの表示

@@ -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/
* opaque display handle.
* This is the inverse of _eglGetDisplayHandle().
*/
_EGLDisplay *
_eglLookupDisplay(EGLDisplay dpy)

+ 4
- 0
src/egl/main/egldisplay.h ファイルの表示

@@ -24,6 +24,10 @@ extern _EGLDisplay *
_eglNewDisplay(NativeDisplayType displayName);


EGLDisplay
_eglGetDisplayHandle(_EGLDisplay *display);


extern _EGLDisplay *
_eglLookupDisplay(EGLDisplay dpy);


+ 20
- 0
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)
{

+ 4
- 0
src/egl/main/eglsurface.h ファイルの表示

@@ -51,6 +51,10 @@ extern void
_eglRemoveSurface(_EGLSurface *surf);


extern EGLSurface
_eglGetSurfaceHandle(_EGLSurface *surface);


extern _EGLSurface *
_eglLookupSurface(EGLSurface surf);

読み込み中…
キャンセル
保存