diff options
author | Chia-I Wu <[email protected]> | 2010-06-29 14:58:33 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-06-29 17:16:20 +0800 |
commit | d5ab243d5a5bacbd2ba615d40f13c8ab37364745 (patch) | |
tree | bbf3c92d3c512e0d12eab3a7036c60c8e2cf7171 /src/gallium/state_trackers/egl/gdi | |
parent | d8e0e114567ec19fd59f974080a418dc959cc9b6 (diff) |
st/egl: Move module loading code to targets.
Several changes are made. libegl.a no longer defines _eglMain. It
defines functions to create and destroy a _EGLDriver instead. The
creation function is called by the targets. It takes an egl_g3d_loader
as its argument. The loader is defined by the targets and is in charge
of creating st_api and pipe_screen. This allows us to move the module
loading code to targets. Lastly, the modules are now loaded as the
respective contexts are created.
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 = { |