static struct pipe_screen *
-xlib_create_brw_screen( struct pipe_winsys *winsys )
+xlib_create_brw_screen( void )
{
- return brw_create_screen(winsys, 0/* XXX pci_id */);
+ struct pipe_winsys *winsys;
+ struct pipe_screen *screen;
+
+ winsys = xlib_create_brw_winsys();
+ if (winsys == NULL)
+ return NULL;
+
+ screen = brw_create_screen(winsys, 0/* XXX pci_id */);
+ if (screen == NULL)
+ goto fail;
+
+ return screen;
+
+fail:
+ if (winsys)
+ winsys->destroy( winsys );
+
+ return NULL;
}
struct xm_driver xlib_brw_driver =
{
- .create_pipe_winsys = xlib_create_brw_winsys,
.create_pipe_screen = xlib_create_brw_screen,
.create_pipe_context = xlib_create_brw_context,
.display_surface = xlib_brw_display_surface,
static struct pipe_screen *
xlib_create_cell_screen( struct pipe_winsys *pws )
{
- return cell_create_screen( pws );
+ struct pipe_winsys *winsys;
+ struct pipe_screen *screen;
+
+ winsys = xlib_create_cell_winsys();
+ if (winsys == NULL)
+ return NULL;
+
+ screen = cell_create_screen(winsys);
+ if (screen == NULL)
+ goto fail;
+
+ return screen;
+
+fail:
+ if (winsys)
+ winsys->destroy( winsys );
+
+ return NULL;
}
struct xm_driver xlib_cell_driver =
{
- .create_pipe_winsys = xlib_create_cell_winsys,
.create_pipe_screen = xlib_create_cell_screen,
.create_pipe_context = xlib_create_cell_context,
.display_surface = xlib_cell_display_surface,
struct xm_driver xlib_cell_driver =
{
- .create_pipe_winsys = NULL,
.create_pipe_screen = NULL,
.create_pipe_context = NULL,
.display_surface = NULL,
struct xm_buffer *xm_buf = xm_buffer(surf->buffer);
static boolean no_swap = 0;
static boolean firsttime = 1;
- static int tileSize = 0;
if (firsttime) {
no_swap = getenv("SP_NO_RAST") != NULL;
static struct pipe_screen *
-xlib_create_softpipe_screen( struct pipe_winsys *pws )
+xlib_create_softpipe_screen( void )
{
+ struct pipe_winsys *winsys;
struct pipe_screen *screen;
- screen = softpipe_create_screen(pws);
+ winsys = xlib_create_softpipe_winsys();
+ if (winsys == NULL)
+ return NULL;
+
+ screen = softpipe_create_screen(winsys);
if (screen == NULL)
goto fail;
return screen;
fail:
+ if (winsys)
+ winsys->destroy( winsys );
+
return NULL;
}
struct xm_driver xlib_softpipe_driver =
{
- .create_pipe_winsys = xlib_create_softpipe_winsys,
.create_pipe_screen = xlib_create_softpipe_screen,
.create_pipe_context = xlib_create_softpipe_context,
.display_surface = xlib_softpipe_display_surface
#include "trace/tr_screen.h"
#include "trace/tr_context.h"
+#include "pipe/p_screen.h"
+
-static struct pipe_winsys *
-xlib_create_trace_winsys( void )
-{
- return xlib_softpipe_driver.create_pipe_winsys();
-}
static struct pipe_screen *
-xlib_create_trace_screen( struct pipe_winsys *winsys )
+xlib_create_trace_screen( void )
{
struct pipe_screen *screen, *trace_screen;
- screen = xlib_softpipe_driver.create_pipe_screen( winsys );
+ screen = xlib_softpipe_driver.create_pipe_screen();
if (screen == NULL)
goto fail;
return trace_screen;
fail:
- /* free stuff */
+ if (screen)
+ screen->destroy( screen );
return NULL;
}
struct xm_driver xlib_trace_driver =
{
- .create_pipe_winsys = xlib_create_trace_winsys,
.create_pipe_screen = xlib_create_trace_screen,
.create_pipe_context = xlib_create_trace_context,
.display_surface = xlib_trace_display_surface,