diff options
Diffstat (limited to 'src/gallium/state_trackers/egl/gdi')
-rw-r--r-- | src/gallium/state_trackers/egl/gdi/native_gdi.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/src/gallium/state_trackers/egl/gdi/native_gdi.c b/src/gallium/state_trackers/egl/gdi/native_gdi.c index 4ec229a3f2a..ed955c4132d 100644 --- a/src/gallium/state_trackers/egl/gdi/native_gdi.c +++ b/src/gallium/state_trackers/egl/gdi/native_gdi.c @@ -343,10 +343,11 @@ gdi_display_destroy(struct native_display *ndpy) } 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) @@ -354,8 +355,21 @@ gdi_create_display(HDC hDC, struct pipe_screen *screen, 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; @@ -367,23 +381,10 @@ gdi_create_display(HDC hDC, struct pipe_screen *screen, } 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 = { |