diff options
Diffstat (limited to 'src/egl/drivers')
-rw-r--r-- | src/egl/drivers/demo/demo.c | 19 | ||||
-rw-r--r-- | src/egl/drivers/glx/egl_glx.c | 18 |
2 files changed, 27 insertions, 10 deletions
diff --git a/src/egl/drivers/demo/demo.c b/src/egl/drivers/demo/demo.c index e9e6bac5b16..aea4894448b 100644 --- a/src/egl/drivers/demo/demo.c +++ b/src/egl/drivers/demo/demo.c @@ -84,7 +84,9 @@ demoInitialize(_EGLDriver *drv, _EGLDisplay *disp, EGLint *major, EGLint *minor) _eglAddConfig(disp, config); } - drv->Initialized = EGL_TRUE; + /* enable supported extensions */ + disp->Extensions.MESA_screen_surface = EGL_TRUE; + disp->Extensions.MESA_copy_context = EGL_TRUE; *major = 1; *minor = 0; @@ -97,7 +99,6 @@ static EGLBoolean demoTerminate(_EGLDriver *drv, _EGLDisplay *dpy) { /*DemoDriver *demo = DEMO_DRIVER(dpy);*/ - free(drv); return EGL_TRUE; } @@ -247,12 +248,19 @@ demoMakeCurrent(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *drawSurf, _EGLSu } +static void +demoUnload(_EGLDriver *drv) +{ + free(drv); +} + + /** * The bootstrap function. Return a new DemoDriver object and * plug in API functions. */ _EGLDriver * -_eglMain(_EGLDisplay *dpy, const char *args) +_eglMain(const char *args) { DemoDriver *demo; @@ -274,9 +282,8 @@ _eglMain(_EGLDisplay *dpy, const char *args) demo->Base.API.DestroySurface = demoDestroySurface; demo->Base.API.DestroyContext = demoDestroyContext; - /* enable supported extensions */ - demo->Base.Extensions.MESA_screen_surface = EGL_TRUE; - demo->Base.Extensions.MESA_copy_context = EGL_TRUE; + demo->Base.Name = "egl/demo"; + demo->Base.Unload = demoUnload; return &demo->Base; } 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); |