}
static struct native_display *
-gdi_create_display(HDC hDC, struct pipe_screen *screen,
- struct native_event_handler *event_handler)
+gdi_create_display(HDC hDC, struct native_event_handler *event_handler,
+ void *user_data)
{
struct gdi_display *gdpy;
+ struct sw_winsys *winsys;
gdpy = CALLOC_STRUCT(gdi_display);
if (!gdpy)
gdpy->hDC = hDC;
gdpy->event_handler = event_handler;
+ gdpy->base.user_data = user_data;
+
+ winsys = gdi_create_sw_winsys();
+ if (!winsys) {
+ FREE(gdpy);
+ return NULL;
+ }
- gdpy->base.screen = screen;
+ gdpy->base.screen = gdpy->event_handler->create_sw_screen(winsys);
+ if (!gdpy->base.screen) {
+ if (winsys->destroy)
+ winsys->destroy(winsys);
+ FREE(gdpy);
+ return NULL;
+ }
gdpy->base.destroy = gdi_display_destroy;
gdpy->base.get_param = gdi_display_get_param;
}
static struct native_display *
-native_create_display(void *dpy, struct native_event_handler *event_handler)
+native_create_display(void *dpy, struct native_event_handler *event_handler,
+ void *user_data)
{
- struct sw_winsys *winsys;
- struct pipe_screen *screen;
-
- winsys = gdi_create_sw_winsys();
- if (!winsys)
- return NULL;
-
- screen = native_create_sw_screen(winsys);
- if (!screen) {
- if (winsys->destroy)
- winsys->destroy(winsys);
- return NULL;
- }
-
- return gdi_create_display((HDC) dpy, screen, event_handler);
+ return gdi_create_display((HDC) dpy, event_handler, user_data);
}
static const struct native_platform gdi_platform = {
"GDI", /* name */
- NULL, /* create_probe */
- NULL, /* get_probe_result */
native_create_display
};