aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/glx
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2009-08-09 22:59:12 +0100
committerJosé Fonseca <[email protected]>2009-08-29 09:21:27 +0100
commit62c91998efad508fe5323f25a7435aa93e718fdc (patch)
tree81228115b81e2ad411aa3bfa65e103206a39a25c /src/gallium/state_trackers/glx
parent0318f3e53eed88f0feea6e7a4fd8a8d9becc9774 (diff)
xlib: Ensure one screen instance.
Diffstat (limited to 'src/gallium/state_trackers/glx')
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_api.c9
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 79c2230588f..f4c5893427d 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;
}