summaryrefslogtreecommitdiff
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorKeith Whitwell <keithw@vmware.com>2010-03-09 15:02:21 +0000
committerKeith Whitwell <keithw@vmware.com>2010-03-09 15:02:21 +0000
commitb694f321707c98c71478aceb11f814643109367b (patch)
treef8a8803bfc7d646b50f5e6c7eb040f2c48890c5f /src/gallium/winsys
parent73d9400ad65c1ec0a20c29805a9fc1930687988c (diff)
winsys/gdi: get softpipe version compiling
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/gdi/SConscript8
-rw-r--r--src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c26
-rw-r--r--src/gallium/winsys/gdi/gdi_softpipe_winsys.c28
-rw-r--r--src/gallium/winsys/gdi/gdi_sw_winsys.c22
-rw-r--r--src/gallium/winsys/gdi/gdi_sw_winsys.h6
5 files changed, 56 insertions, 34 deletions
diff --git a/src/gallium/winsys/gdi/SConscript b/src/gallium/winsys/gdi/SConscript
index 4b32aa27e1..0a3f141e72 100644
--- a/src/gallium/winsys/gdi/SConscript
+++ b/src/gallium/winsys/gdi/SConscript
@@ -18,17 +18,19 @@ if env['platform'] == 'windows':
'ws2_32',
])
- sources = ['gdi_sw_winsys.c']
+ sources = []
drivers = []
if 'softpipe' in env['drivers']:
- sources = ['gdi_softpipe_winsys.c']
+ sources = ['gdi_sw_winsys.c',
+ 'gdi_softpipe_winsys.c']
drivers = [softpipe]
if 'llvmpipe' in env['drivers']:
env.Tool('llvm')
if 'LLVM_VERSION' in env:
- sources = ['gdi_llvmpipe_winsys.c']
+ sources = ['gdi_sw_winsys.c',
+ 'gdi_llvmpipe_winsys.c']
drivers = [llvmpipe]
if not sources or not drivers:
diff --git a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c
index e627028dd4..4ea33f673f 100644
--- a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c
+++ b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c
@@ -36,8 +36,10 @@
#include <windows.h>
+#include "stw_winsys.h"
#include "gdi_sw_winsys.h"
#include "llvmpipe/lp_texture.h"
+#include "llvmpipe/lp_screen.h"
static struct pipe_screen *
@@ -57,7 +59,7 @@ gdi_llvmpipe_screen_create(void)
return screen;
no_screen:
- FREE(winsys);
+ winsys->destroy(winsys);
no_winsys:
return NULL;
}
@@ -70,16 +72,18 @@ gdi_llvmpipe_present(struct pipe_screen *screen,
struct pipe_surface *surface,
HDC hDC)
{
- struct llvmpipe_texture *texture;
- struct gdi_llvmpipe_displaytarget *gdt;
-
- texture = llvmpipe_texture(surface->texture);
- gdt = gdi_llvmpipe_displaytarget(texture->dt);
-
- StretchDIBits(hDC,
- 0, 0, gdt->width, gdt->height,
- 0, 0, gdt->width, gdt->height,
- gdt->data, &gdt->bmi, 0, SRCCOPY);
+ /* This will fail if any interposing layer (trace, debug, etc) has
+ * been introduced between the state-trackers and llvmpipe.
+ *
+ * Ideally this would get replaced with a call to
+ * pipe_screen::flush_frontbuffer().
+ *
+ * Failing that, it may be necessary for intervening layers to wrap
+ * other structs such as this stw_winsys as well...
+ */
+ gdi_sw_display(llvmpipe_screen(screen)->winsys,
+ llvmpipe_texture(surface->texture)->dt,
+ hDC);
}
diff --git a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c
index bb669bbb64..5c5c154c7f 100644
--- a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c
+++ b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c
@@ -36,14 +36,16 @@
#include <windows.h>
+#include "stw_winsys.h"
#include "gdi_sw_winsys.h"
#include "softpipe/sp_texture.h"
+#include "softpipe/sp_screen.h"
static struct pipe_screen *
gdi_softpipe_screen_create(void)
{
- static struct softpipe_winsys *winsys;
+ static struct sw_winsys *winsys;
struct pipe_screen *screen;
winsys = gdi_create_sw_winsys();
@@ -57,7 +59,7 @@ gdi_softpipe_screen_create(void)
return screen;
no_screen:
- FREE(winsys);
+ winsys->destroy(winsys);
no_winsys:
return NULL;
}
@@ -70,16 +72,18 @@ gdi_softpipe_present(struct pipe_screen *screen,
struct pipe_surface *surface,
HDC hDC)
{
- struct softpipe_texture *texture;
- struct gdi_softpipe_displaytarget *gdt;
-
- texture = softpipe_texture(surface->texture);
- gdt = gdi_softpipe_displaytarget(texture->dt);
-
- StretchDIBits(hDC,
- 0, 0, gdt->width, gdt->height,
- 0, 0, gdt->width, gdt->height,
- gdt->data, &gdt->bmi, 0, SRCCOPY);
+ /* This will fail if any interposing layer (trace, debug, etc) has
+ * been introduced between the state-trackers and softpipe.
+ *
+ * Ideally this would get replaced with a call to
+ * pipe_screen::flush_frontbuffer().
+ *
+ * Failing that, it may be necessary for intervening layers to wrap
+ * other structs such as this stw_winsys as well...
+ */
+ gdi_sw_display(softpipe_screen(screen)->winsys,
+ softpipe_texture(surface->texture)->dt,
+ hDC);
}
diff --git a/src/gallium/winsys/gdi/gdi_sw_winsys.c b/src/gallium/winsys/gdi/gdi_sw_winsys.c
index 00c6facd04..55f99c4f47 100644
--- a/src/gallium/winsys/gdi/gdi_sw_winsys.c
+++ b/src/gallium/winsys/gdi/gdi_sw_winsys.c
@@ -43,7 +43,7 @@
#include "util/u_math.h"
#include "util/u_memory.h"
#include "state_tracker/sw_winsys.h"
-#include "stw_winsys.h"
+#include "gdi_sw_winsys.h"
struct gdi_sw_displaytarget
@@ -168,21 +168,29 @@ no_gdt:
}
+void
+gdi_sw_display( struct sw_winsys *winsys,
+ struct sw_displaytarget *dt,
+ HDC hDC )
+{
+ struct gdi_sw_displaytarget *gdt = gdi_sw_displaytarget(dt);
+
+ StretchDIBits(hDC,
+ 0, 0, gdt->width, gdt->height,
+ 0, 0, gdt->width, gdt->height,
+ gdt->data, &gdt->bmi, 0, SRCCOPY);
+}
+
static void
gdi_sw_displaytarget_display(struct sw_winsys *winsys,
struct sw_displaytarget *dt,
void *context_private)
{
- struct gdi_softpipe_displaytarget *gdt = gdi_sw_displaytarget(dt);
-
/* nasty:
*/
HDC hDC = (HDC)context_private;
- StretchDIBits(hDC,
- 0, 0, gdt->width, gdt->height,
- 0, 0, gdt->width, gdt->height,
- gdt->data, &gdt->bmi, 0, SRCCOPY);
+ gdi_sw_display(winsys, dt, hDC);
}
diff --git a/src/gallium/winsys/gdi/gdi_sw_winsys.h b/src/gallium/winsys/gdi/gdi_sw_winsys.h
index 7e00d78911..8ecca7bbc3 100644
--- a/src/gallium/winsys/gdi/gdi_sw_winsys.h
+++ b/src/gallium/winsys/gdi/gdi_sw_winsys.h
@@ -4,7 +4,11 @@
#include "pipe/p_compiler.h"
#include "state_tracker/sw_winsys.h"
+void gdi_sw_display( struct sw_winsys *winsys,
+ struct sw_displaytarget *dt,
+ HDC hDC );
+
struct sw_winsys *
-gdi_create_sw_winsys(void)
+gdi_create_sw_winsys(void);
#endif