diff options
author | José Fonseca <jfonseca@vmware.com> | 2009-08-09 22:59:12 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2009-08-29 09:21:27 +0100 |
commit | 62c91998efad508fe5323f25a7435aa93e718fdc (patch) | |
tree | 81228115b81e2ad411aa3bfa65e103206a39a25c /src/gallium/state_trackers/glx/xlib/xm_api.c | |
parent | 0318f3e53eed88f0feea6e7a4fd8a8d9becc9774 (diff) |
xlib: Ensure one screen instance.
Diffstat (limited to 'src/gallium/state_trackers/glx/xlib/xm_api.c')
-rw-r--r-- | src/gallium/state_trackers/glx/xlib/xm_api.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c index 79c2230588..f4c5893427 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_api.c +++ b/src/gallium/state_trackers/glx/xlib/xm_api.c @@ -742,7 +742,7 @@ PUBLIC XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) { static GLboolean firstTime = GL_TRUE; - struct pipe_screen *screen; + static struct pipe_screen *screen = NULL; struct pipe_context *pipe; XMesaContext c; GLcontext *mesaCtx; @@ -750,6 +750,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) if (firstTime) { pipe_mutex_init(_xmesa_lock); + screen = driver.create_pipe_screen(); firstTime = GL_FALSE; } @@ -765,9 +766,6 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) c->xm_buffer = NULL; /* set later by XMesaMakeCurrent */ c->xm_read_buffer = NULL; - /* XXX: create once per Xlib Display. - */ - screen = driver.create_pipe_screen(); if (screen == NULL) goto fail; @@ -801,9 +799,6 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) else if (pipe) pipe->destroy(pipe); - if (screen) - screen->destroy( screen ); - FREE(c); return NULL; } |