summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/dri/sw/drisw.c
diff options
context:
space:
mode:
authorGeorge Sapountzis <gsapountzis@gmail.com>2010-07-18 18:23:36 +0300
committerGeorge Sapountzis <gsapountzis@gmail.com>2010-07-18 18:28:11 +0300
commit129d9cf2e80e03b411672960419382eba787ac1b (patch)
tree8e215dfb49d19d4ec4b6e829ff4ce7176271f38d /src/gallium/state_trackers/dri/sw/drisw.c
parentf6cae4cd33cd4edd375d06d5823fd390a7a9e2a3 (diff)
st/dri: move backend hooks to appropriate objectst-dri
Diffstat (limited to 'src/gallium/state_trackers/dri/sw/drisw.c')
-rw-r--r--src/gallium/state_trackers/dri/sw/drisw.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/dri/sw/drisw.c b/src/gallium/state_trackers/dri/sw/drisw.c
index f5ab5aecf706..1154f761d908 100644
--- a/src/gallium/state_trackers/dri/sw/drisw.c
+++ b/src/gallium/state_trackers/dri/sw/drisw.c
@@ -269,9 +269,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;
sPriv->private = (void *)screen;
sPriv->extensions = drisw_screen_extensions;
@@ -290,21 +287,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,
};