diff options
author | Chia-I Wu <[email protected]> | 2009-07-17 11:53:03 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-07-17 11:53:03 -0600 |
commit | cca31340b5a9c0b941946753a31236c7201ca87c (patch) | |
tree | cdd0c35eb777b16cd8dcd3d9442d0e9861acc07f /src/egl/main/eglscreen.c | |
parent | 18457cb263e3e062e12314e7b3d5c81a7f2ba048 (diff) |
egl: Use the link functions to manage resources.
This commit uses the newly introduced link functions to manage EGL
contexts and surfaces. As a result of this, the API for drivers are
changed. All drivers are updated for the change.
Signed-off-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'src/egl/main/eglscreen.c')
-rw-r--r-- | src/egl/main/eglscreen.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/egl/main/eglscreen.c b/src/egl/main/eglscreen.c index 9c9a8377bf2..b6bde65e8b5 100644 --- a/src/egl/main/eglscreen.c +++ b/src/egl/main/eglscreen.c @@ -128,20 +128,25 @@ _eglCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, { #if 0 /* THIS IS JUST EXAMPLE CODE */ _EGLSurface *surf; + _EGLConfig *conf; + + conf = _eglLookupConfig(drv, dpy, config); + if (!conf) { + _eglError(EGL_BAD_CONFIG, "eglCreateScreenSurfaceMESA"); + return EGL_NO_SURFACE; + } surf = (_EGLSurface *) calloc(1, sizeof(_EGLSurface)); if (!surf) return EGL_NO_SURFACE; - if (!_eglInitSurface(drv, dpy, surf, EGL_SCREEN_BIT_MESA, - config, attrib_list)) { + if (!_eglInitSurface(drv, surf, EGL_SCREEN_BIT_MESA, + conf, attrib_list)) { free(surf); return EGL_NO_SURFACE; } - _eglSaveSurface(surf); - - return surf->Handle; + return _eglLinkSurface(surf, _eglLookupDisplay(dpy)); #endif return EGL_NO_SURFACE; } |