summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/demo
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2009-08-13 13:38:24 +0800
committerBrian Paul <[email protected]>2009-08-18 08:49:09 -0600
commit5a2c9372a0d9fa1efd924f9386a4e3df47c17d0e (patch)
tree2dee512255194f0eb3eefe2a9064ece8da3b3885 /src/egl/drivers/demo
parent0eaa02c836821556c1e8d0141f49f57e23f2548d (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/demo')
-rw-r--r--src/egl/drivers/demo/demo.c19
1 files changed, 13 insertions, 6 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;
}