From 873ddf547d5aeb68f37a172d73131c6bc51101f6 Mon Sep 17 00:00:00 2001 From: George Sapountzis Date: Sun, 18 Jul 2010 18:23:36 +0300 Subject: st/dri: move backend hooks to appropriate object --- src/gallium/state_trackers/dri/sw/drisw.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'src/gallium/state_trackers/dri/sw/drisw.c') diff --git a/src/gallium/state_trackers/dri/sw/drisw.c b/src/gallium/state_trackers/dri/sw/drisw.c index d2210098d1..ae96f1b20e 100644 --- a/src/gallium/state_trackers/dri/sw/drisw.c +++ b/src/gallium/state_trackers/dri/sw/drisw.c @@ -275,9 +275,6 @@ drisw_init_screen(__DRIscreen * sPriv) screen->sPriv = sPriv; screen->fd = -1; - screen->allocate_textures = drisw_allocate_textures; - screen->update_drawable_info = drisw_update_drawable_info; - screen->flush_frontbuffer = drisw_flush_frontbuffer; swrast_no_present = debug_get_option_swrast_no_present(); @@ -298,21 +295,40 @@ fail: return NULL; } +static boolean +drisw_create_buffer(__DRIscreen * sPriv, + __DRIdrawable * dPriv, + const __GLcontextModes * visual, boolean isPixmap) +{ + struct dri_drawable *drawable = NULL; + + if (!dri_create_buffer(sPriv, dPriv, visual, isPixmap)) + return FALSE; + + drawable = dPriv->driverPrivate; + + drawable->allocate_textures = drisw_allocate_textures; + drawable->update_drawable_info = drisw_update_drawable_info; + drawable->flush_frontbuffer = drisw_flush_frontbuffer; + + return TRUE; +} + /** * DRI driver virtual function table. * * DRI versions differ in their implementation of init_screen and swap_buffers. */ const struct __DriverAPIRec driDriverAPI = { + .InitScreen = drisw_init_screen, .DestroyScreen = dri_destroy_screen, .CreateContext = dri_create_context, .DestroyContext = dri_destroy_context, - .CreateBuffer = dri_create_buffer, + .CreateBuffer = drisw_create_buffer, .DestroyBuffer = dri_destroy_buffer, .MakeCurrent = dri_make_current, .UnbindContext = dri_unbind_context, - .InitScreen = drisw_init_screen, .SwapBuffers = drisw_swap_buffers, }; -- cgit v1.2.3