summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/egl/common/native_helper.c
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-06-04 12:05:37 +0800
committerChia-I Wu <olv@lunarg.com>2010-06-04 12:12:50 +0800
commit22c2e57cbb0fd5ed6856a7350672fa01c02b00ca (patch)
tree6b43a33760acc1e5abf906550c6700b76c918095 /src/gallium/state_trackers/egl/common/native_helper.c
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/native_helper.c')
-rw-r--r--src/gallium/state_trackers/egl/common/native_helper.c18
1 files changed, 18 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 7832b2b693..206817ed66 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;
+}