util: move functions from u_resource.c to u_transfer.c
authorBrian Paul <brianp@vmware.com>
Wed, 3 Apr 2013 16:21:34 +0000 (10:21 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 3 Apr 2013 17:02:47 +0000 (11:02 -0600)
The functions are prototyped in u_transfer.h and are related to the
other functions in u_transfer.c.

The next patch will re-use the u_resource.c file for new code.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/util/u_resource.c
src/gallium/auxiliary/util/u_transfer.c

index a32c4f6dfa897d92be68a4ec9c689e47a34f6eb7..8d15f8db71c72b05fd68b0c0dfd341567fb5589d 100644 (file)
@@ -1,76 +1,2 @@
 
-
-#include "util/u_inlines.h"
-#include "util/u_transfer.h"
-
-static INLINE struct u_resource *
-u_resource( struct pipe_resource *res )
-{
-   return (struct u_resource *)res;
-}
-
-boolean u_resource_get_handle_vtbl(struct pipe_screen *screen,
-                                   struct pipe_resource *resource,
-                                   struct winsys_handle *handle)
-{
-   struct u_resource *ur = u_resource(resource);
-   return ur->vtbl->resource_get_handle(screen, resource, handle);
-}
-
-void u_resource_destroy_vtbl(struct pipe_screen *screen,
-                             struct pipe_resource *resource)
-{
-   struct u_resource *ur = u_resource(resource);
-   ur->vtbl->resource_destroy(screen, resource);
-}
-
-void *u_transfer_map_vtbl(struct pipe_context *context,
-                          struct pipe_resource *resource,
-                          unsigned level,
-                          unsigned usage,
-                          const struct pipe_box *box,
-                          struct pipe_transfer **transfer)
-{
-   struct u_resource *ur = u_resource(resource);
-   return ur->vtbl->transfer_map(context, resource, level, usage, box,
-                                 transfer);
-}
-
-void u_transfer_flush_region_vtbl( struct pipe_context *pipe,
-                                   struct pipe_transfer *transfer,
-                                   const struct pipe_box *box)
-{
-   struct u_resource *ur = u_resource(transfer->resource);
-   ur->vtbl->transfer_flush_region(pipe, transfer, box);
-}
-
-void u_transfer_unmap_vtbl( struct pipe_context *pipe,
-                            struct pipe_transfer *transfer )
-{
-   struct u_resource *ur = u_resource(transfer->resource);
-   ur->vtbl->transfer_unmap(pipe, transfer);
-}
-
-void u_transfer_inline_write_vtbl( struct pipe_context *pipe,
-                                   struct pipe_resource *resource,
-                                   unsigned level,
-                                   unsigned usage,
-                                   const struct pipe_box *box,
-                                   const void *data,
-                                   unsigned stride,
-                                   unsigned layer_stride)
-{
-   struct u_resource *ur = u_resource(resource);
-   ur->vtbl->transfer_inline_write(pipe,
-                                   resource,
-                                   level,
-                                   usage,
-                                   box,
-                                   data,
-                                   stride,
-                                   layer_stride);
-}
-
-
-
-
+/* temporarily empty */
index 86168255325c8dc5dbd8773aa176717b1871909b..56e059bfd03a85e72a06f4632f3f30f4cfcd6aa8 100644 (file)
@@ -87,3 +87,76 @@ void u_default_transfer_unmap( struct pipe_context *pipe,
                                struct pipe_transfer *transfer )
 {
 }
+
+
+static INLINE struct u_resource *
+u_resource( struct pipe_resource *res )
+{
+   return (struct u_resource *)res;
+}
+
+boolean u_resource_get_handle_vtbl(struct pipe_screen *screen,
+                                   struct pipe_resource *resource,
+                                   struct winsys_handle *handle)
+{
+   struct u_resource *ur = u_resource(resource);
+   return ur->vtbl->resource_get_handle(screen, resource, handle);
+}
+
+void u_resource_destroy_vtbl(struct pipe_screen *screen,
+                             struct pipe_resource *resource)
+{
+   struct u_resource *ur = u_resource(resource);
+   ur->vtbl->resource_destroy(screen, resource);
+}
+
+void *u_transfer_map_vtbl(struct pipe_context *context,
+                          struct pipe_resource *resource,
+                          unsigned level,
+                          unsigned usage,
+                          const struct pipe_box *box,
+                          struct pipe_transfer **transfer)
+{
+   struct u_resource *ur = u_resource(resource);
+   return ur->vtbl->transfer_map(context, resource, level, usage, box,
+                                 transfer);
+}
+
+void u_transfer_flush_region_vtbl( struct pipe_context *pipe,
+                                   struct pipe_transfer *transfer,
+                                   const struct pipe_box *box)
+{
+   struct u_resource *ur = u_resource(transfer->resource);
+   ur->vtbl->transfer_flush_region(pipe, transfer, box);
+}
+
+void u_transfer_unmap_vtbl( struct pipe_context *pipe,
+                            struct pipe_transfer *transfer )
+{
+   struct u_resource *ur = u_resource(transfer->resource);
+   ur->vtbl->transfer_unmap(pipe, transfer);
+}
+
+void u_transfer_inline_write_vtbl( struct pipe_context *pipe,
+                                   struct pipe_resource *resource,
+                                   unsigned level,
+                                   unsigned usage,
+                                   const struct pipe_box *box,
+                                   const void *data,
+                                   unsigned stride,
+                                   unsigned layer_stride)
+{
+   struct u_resource *ur = u_resource(resource);
+   ur->vtbl->transfer_inline_write(pipe,
+                                   resource,
+                                   level,
+                                   usage,
+                                   box,
+                                   data,
+                                   stride,
+                                   layer_stride);
+}
+
+
+
+