summaryrefslogtreecommitdiff
path: root/src/egl/drivers/demo/demo.c
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2009-07-17 11:53:03 -0600
committerBrian Paul <brianp@vmware.com>2009-07-17 11:53:03 -0600
commitcca31340b5a9c0b941946753a31236c7201ca87c (patch)
treecdd0c35eb777b16cd8dcd3d9442d0e9861acc07f /src/egl/drivers/demo/demo.c
parent18457cb263e3e062e12314e7b3d5c81a7f2ba048 (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 <olvaffe@gmail.com>
Diffstat (limited to 'src/egl/drivers/demo/demo.c')
-rw-r--r--src/egl/drivers/demo/demo.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/egl/drivers/demo/demo.c b/src/egl/drivers/demo/demo.c
index 1750e976b8..fa9efa5d35 100644
--- a/src/egl/drivers/demo/demo.c
+++ b/src/egl/drivers/demo/demo.c
@@ -146,12 +146,12 @@ demoCreateContext(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config, EGLContext
if (!c)
return EGL_NO_CONTEXT;
- _eglInitContext(drv, dpy, &c->Base, config, attrib_list);
+ _eglInitContext(drv, &c->Base, conf, attrib_list);
c->DemoStuff = 1;
printf("demoCreateContext\n");
- /* generate handle and insert into hash table */
- _eglSaveContext(&c->Base);
+ /* link to display */
+ _eglLinkContext(&c->Base, _eglLookupDisplay(dpy));
assert(_eglGetContextHandle(&c->Base));
return _eglGetContextHandle(&c->Base);
@@ -213,11 +213,14 @@ demoCreatePbufferSurface(_EGLDriver *drv, EGLDisplay dpy, EGLConfig config,
const EGLint *attrib_list)
{
DemoSurface *surf = (DemoSurface *) calloc(1, sizeof(DemoSurface));
+ _EGLConfig *conf;
+
if (!surf)
return EGL_NO_SURFACE;
- if (!_eglInitSurface(drv, dpy, &surf->Base, EGL_PBUFFER_BIT,
- config, attrib_list)) {
+ conf = _eglLookupConfig(drv, dpy, config);
+ if (!_eglInitSurface(drv, &surf->Base, EGL_PBUFFER_BIT,
+ conf, attrib_list)) {
free(surf);
return EGL_NO_SURFACE;
}
@@ -232,7 +235,7 @@ static EGLBoolean
demoDestroySurface(_EGLDriver *drv, EGLDisplay dpy, EGLSurface surface)
{
DemoSurface *fs = LookupDemoSurface(surface);
- _eglRemoveSurface(&fs->Base);
+ _eglUnlinkSurface(&fs->Base);
if (fs->Base.IsBound) {
fs->Base.DeletePending = EGL_TRUE;
}
@@ -247,7 +250,7 @@ static EGLBoolean
demoDestroyContext(_EGLDriver *drv, EGLDisplay dpy, EGLContext context)
{
DemoContext *fc = LookupDemoContext(context);
- _eglRemoveContext(&fc->Base);
+ _eglUnlinkContext(&fc->Base);
if (fc->Base.IsBound) {
fc->Base.DeletePending = EGL_TRUE;
}