winsys/gdi: get softpipe version compiling

This commit is contained in:
Keith Whitwell
2010-03-09 15:02:21 +00:00
parent 73d9400ad6
commit b694f32170
5 changed files with 59 additions and 37 deletions
+5 -3
View File
@@ -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:
+15 -11
View File
@@ -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);
}
+16 -12
View File
@@ -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);
}
+18 -10
View File
@@ -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,16 +168,12 @@ no_gdt:
}
static void
gdi_sw_displaytarget_display(struct sw_winsys *winsys,
struct sw_displaytarget *dt,
void *context_private)
void
gdi_sw_display( struct sw_winsys *winsys,
struct sw_displaytarget *dt,
HDC hDC )
{
struct gdi_softpipe_displaytarget *gdt = gdi_sw_displaytarget(dt);
/* nasty:
*/
HDC hDC = (HDC)context_private;
struct gdi_sw_displaytarget *gdt = gdi_sw_displaytarget(dt);
StretchDIBits(hDC,
0, 0, gdt->width, gdt->height,
@@ -185,6 +181,18 @@ gdi_sw_displaytarget_display(struct sw_winsys *winsys,
gdt->data, &gdt->bmi, 0, SRCCOPY);
}
static void
gdi_sw_displaytarget_display(struct sw_winsys *winsys,
struct sw_displaytarget *dt,
void *context_private)
{
/* nasty:
*/
HDC hDC = (HDC)context_private;
gdi_sw_display(winsys, dt, hDC);
}
static void
gdi_sw_destroy(struct sw_winsys *winsys)
+5 -1
View File
@@ -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