From 969ff9e9bf3dfae08d087bbc47ce43f17d107bfc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 14 Aug 2008 10:47:39 +0100 Subject: [PATCH] xlib: Use trace usage. --- src/gallium/winsys/xlib/xm_api.c | 5 ++++- src/gallium/winsys/xlib/xm_winsys.c | 15 ++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/gallium/winsys/xlib/xm_api.c b/src/gallium/winsys/xlib/xm_api.c index 4e5441a13d2..d2f92a08751 100644 --- a/src/gallium/winsys/xlib/xm_api.c +++ b/src/gallium/winsys/xlib/xm_api.c @@ -67,6 +67,7 @@ #include "state_tracker/st_public.h" #include "state_tracker/st_context.h" #include "pipe/p_defines.h" +#include "pipe/p_screen.h" #include "pipe/p_context.h" #include "xm_winsys_aub.h" @@ -833,7 +834,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) fail: if (c->st) st_destroy_context(c->st); - if (pipe) + else if (pipe) pipe->destroy(pipe); FREE(c); return NULL; @@ -844,7 +845,9 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) PUBLIC void XMesaDestroyContext( XMesaContext c ) { + struct pipe_screen *screen = c->st->pipe->screen; st_destroy_context(c->st); + screen->destroy(screen); _mesa_free(c); } diff --git a/src/gallium/winsys/xlib/xm_winsys.c b/src/gallium/winsys/xlib/xm_winsys.c index 6071a5ad5e4..3ab4c67caec 100644 --- a/src/gallium/winsys/xlib/xm_winsys.c +++ b/src/gallium/winsys/xlib/xm_winsys.c @@ -55,7 +55,6 @@ #endif #ifdef GALLIUM_TRACE -#include "trace/tr_winsys.h" #include "trace/tr_screen.h" #include "trace/tr_context.h" #endif @@ -651,11 +650,7 @@ xmesa_get_pipe_winsys(struct xmesa_visual *xm_vis) ws->base.get_name = xm_get_name; } -#ifdef GALLIUM_TRACE - return trace_winsys_create(&ws->base); -#else - return &ws->base; -#endif + return &ws->base; } @@ -684,14 +679,12 @@ xmesa_create_pipe_context(XMesaContext xmesa, uint pixelformat) { struct pipe_screen *screen = softpipe_create_screen(pws); -#ifdef GALLIUM_TRACE - screen = trace_screen_create(screen); -#endif - pipe = softpipe_create(screen, pws, NULL); #ifdef GALLIUM_TRACE - pipe = trace_context_create(pipe); + screen = trace_screen_create(screen); + + pipe = trace_context_create(screen, pipe); #endif } -- 2.30.2