summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets/libgl-xlib
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2010-03-09 17:27:58 +0000
committerKeith Whitwell <[email protected]>2010-03-09 17:32:10 +0000
commitd0aea650320fec0b8e01110eeee22b1f3700d587 (patch)
tree9957f1c5d2d8bf897d994b6f5430665aa2e8533b /src/gallium/targets/libgl-xlib
parentc27ffc5215573d6ff106d4770168117adea884f9 (diff)
gallium: create helper for swrast+xlib combination
Several targets may want to reuse this code. It's pretty simple, not sure if this is really a win.
Diffstat (limited to 'src/gallium/targets/libgl-xlib')
-rw-r--r--src/gallium/targets/libgl-xlib/xlib.c70
1 files changed, 4 insertions, 66 deletions
diff --git a/src/gallium/targets/libgl-xlib/xlib.c b/src/gallium/targets/libgl-xlib/xlib.c
index 7881bc2cb18..54764440e70 100644
--- a/src/gallium/targets/libgl-xlib/xlib.c
+++ b/src/gallium/targets/libgl-xlib/xlib.c
@@ -30,81 +30,19 @@
* Authors:
* Keith Whitwell
*/
-
-#include "state_tracker/xlib_sw_winsys.h"
-#include "xm_winsys.h"
-#include "util/u_debug.h"
-#include "softpipe/sp_public.h"
-#include "llvmpipe/lp_public.h"
-#include "identity/id_public.h"
-#include "trace/tr_public.h"
-#include "cell/ppu/cell_public.h"
-
+#include "pipe/p_compiler.h"
+#include "target-helpers/swrast_xlib.h"
+#include "xm_public.h"
/* advertise OpenGL support */
PUBLIC const int st_api_OpenGL = 1;
-
-static struct pipe_screen *
-create_screen( struct sw_winsys *winsys )
-{
-#if defined(GALLIUM_CELL)
- if (!debug_get_bool_option("GALLIUM_NOCELL", FALSE))
- return cell_create_screen( winsys );
-#endif
-
-#if defined(GALLIUM_LLVMPIPE)
- return llvmpipe_create_screen( winsys );
-#endif
-
- return softpipe_create_screen( winsys );
-}
-
-
-
-static struct pipe_screen *
-xlib_create_screen( Display *display )
-{
- struct sw_winsys *winsys;
- struct pipe_screen *screen;
-
- winsys = xlib_create_sw_winsys( display );
- if (winsys == NULL)
- return NULL;
-
- screen = create_screen(winsys);
- if (screen == NULL)
- goto fail;
-
- /* Finally we have somewhere to inject layers into the stack in a
- * clean fashion:
- */
- if (debug_get_bool_option("GALLIUM_WRAP", FALSE)) {
- screen = identity_screen_create(screen);
- }
-
- if (debug_get_bool_option("GALLIUM_TRACE", FALSE)) {
- screen = trace_screen_create( screen );
- }
-
- return screen;
-
-fail:
- if (winsys)
- winsys->destroy( winsys );
-
- return NULL;
-}
-
-
struct xm_driver xlib_driver =
{
- .create_pipe_screen = xlib_create_screen,
+ .create_pipe_screen = swrast_xlib_create_screen,
};
-
-
/* Build the rendering stack.
*/
static void _init( void ) __attribute__((constructor));