diff options
author | Chia-I Wu <[email protected]> | 2009-08-13 13:38:24 +0800 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-08-18 08:49:09 -0600 |
commit | 5a2c9372a0d9fa1efd924f9386a4e3df47c17d0e (patch) | |
tree | 2dee512255194f0eb3eefe2a9064ece8da3b3885 /src/egl/drivers/glx/egl_glx.c | |
parent | 0eaa02c836821556c1e8d0141f49f57e23f2548d (diff) |
egl: Some per-driver data should be per-display.
Move some fields of _EGLDriver to _EGLDisplay. It also becomes
unnecessary to pass _EGLDisplay to drivers when _eglMain is called.
Signed-off-by: Chia-I Wu <[email protected]>
Diffstat (limited to 'src/egl/drivers/glx/egl_glx.c')
-rw-r--r-- | src/egl/drivers/glx/egl_glx.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/egl/drivers/glx/egl_glx.c b/src/egl/drivers/glx/egl_glx.c index 607e649e5cb..9d80bc1a84b 100644 --- a/src/egl/drivers/glx/egl_glx.c +++ b/src/egl/drivers/glx/egl_glx.c @@ -462,10 +462,10 @@ GLX_eglInitialize(_EGLDriver *drv, _EGLDisplay *disp, } } + disp->ClientAPIsMask = all_apis; + glXQueryVersion(disp->Xdpy, &GLX_drv->glx_maj, &GLX_drv->glx_min); - GLX_drv->Base.Initialized = EGL_TRUE; - GLX_drv->Base.Name = "GLX"; /* we're supporting EGL 1.4 */ @@ -513,7 +513,9 @@ GLX_eglTerminate(_EGLDriver *drv, _EGLDisplay *disp) { _eglLog(_EGL_DEBUG, "GLX: eglTerminate"); + _eglReleaseDisplayResources(drv, disp); FreeDisplayExt(disp->Xdpy); + _eglCleanupDisplay(disp); return EGL_TRUE; } @@ -797,12 +799,20 @@ GLX_eglGetProcAddress(const char *procname) } +static void +GLX_Unload(_EGLDriver *drv) +{ + struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv); + free(GLX_drv); +} + + /** * This is the main entrypoint into the driver, called by libEGL. * Create a new _EGLDriver object and init its dispatch table. */ _EGLDriver * -_eglMain(_EGLDisplay *disp, const char *args) +_eglMain(const char *args) { struct GLX_egl_driver *GLX_drv = CALLOC_STRUCT(GLX_egl_driver); char *env; @@ -831,8 +841,8 @@ _eglMain(_EGLDisplay *disp, const char *args) GLX_drv->Base.API.SwapBuffers = GLX_eglSwapBuffers; GLX_drv->Base.API.GetProcAddress = GLX_eglGetProcAddress; - GLX_drv->Base.ClientAPIsMask = all_apis; GLX_drv->Base.Name = "GLX"; + GLX_drv->Base.Unload = GLX_Unload; _eglLog(_EGL_DEBUG, "GLX: main(%s)", args); |