summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/egl/common
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-06-04 12:05:37 +0800
committerChia-I Wu <[email protected]>2010-06-04 12:12:50 +0800
commit22c2e57cbb0fd5ed6856a7350672fa01c02b00ca (patch)
tree6b43a33760acc1e5abf906550c6700b76c918095 /src/gallium/state_trackers/egl/common
parent27910c42a9769a63855db06035c9874dd2ef5da0 (diff)
st/egl: Move sw screen creation to native helper.
The code is shared by ximage and gdi backend.
Diffstat (limited to 'src/gallium/state_trackers/egl/common')
-rw-r--r--src/gallium/state_trackers/egl/common/native_helper.c18
-rw-r--r--src/gallium/state_trackers/egl/common/native_helper.h3
2 files changed, 21 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/egl/common/native_helper.c b/src/gallium/state_trackers/egl/common/native_helper.c
index 7832b2b693f..206817ed666 100644
--- a/src/gallium/state_trackers/egl/common/native_helper.c
+++ b/src/gallium/state_trackers/egl/common/native_helper.c
@@ -31,6 +31,9 @@
#include "pipe/p_screen.h"
#include "pipe/p_context.h"
#include "pipe/p_state.h"
+#include "softpipe/sp_public.h"
+#include "llvmpipe/lp_public.h"
+#include "target-helpers/wrap_screen.h"
#include "native_helper.h"
@@ -233,3 +236,18 @@ resource_surface_present(struct resource_surface *rsurf,
return TRUE;
}
+
+struct pipe_screen *
+native_create_sw_screen(struct sw_winsys *ws)
+{
+ struct pipe_screen *screen = NULL;
+
+#if defined(GALLIUM_LLVMPIPE)
+ if (!screen && !debug_get_bool_option("GALLIUM_NO_LLVM", FALSE))
+ screen = llvmpipe_create_screen(ws);
+#endif
+ if (!screen)
+ screen = softpipe_create_screen(ws);
+
+ return (screen) ? gallium_wrap_screen(screen) : NULL;
+}
diff --git a/src/gallium/state_trackers/egl/common/native_helper.h b/src/gallium/state_trackers/egl/common/native_helper.h
index 62956d52201..25fafd04651 100644
--- a/src/gallium/state_trackers/egl/common/native_helper.h
+++ b/src/gallium/state_trackers/egl/common/native_helper.h
@@ -68,3 +68,6 @@ boolean
resource_surface_present(struct resource_surface *rsurf,
enum native_attachment which,
void *winsys_drawable_handle);
+
+struct pipe_screen *
+native_create_sw_screen(struct sw_winsys *ws);