Module: Mesa
Branch: master
Commit: 811aa02c7a0f4804189a8978395f07d27fb726ec
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=811aa02c7a0f4804189a8978395f07d27fb726ec

Author: Zack Rusin <[email protected]>
Date:   Tue Sep  1 14:43:59 2009 -0400

st/xorg: fold back the helper function into core

---

 src/gallium/state_trackers/xorg/xorg_composite.c |   74 +++++++++------------
 1 files changed, 32 insertions(+), 42 deletions(-)

diff --git a/src/gallium/state_trackers/xorg/xorg_composite.c 
b/src/gallium/state_trackers/xorg/xorg_composite.c
index 8a12c03..132c05e 100644
--- a/src/gallium/state_trackers/xorg/xorg_composite.c
+++ b/src/gallium/state_trackers/xorg/xorg_composite.c
@@ -222,46 +222,6 @@ setup_vertex_data2(struct exa_context *ctx,
                                   sizeof(vertices));
 }
 
-
-static void
-draw_pictures(struct exa_context *exa,
-              int srcX, int srcY, int maskX, int maskY,
-              int dstX, int dstY, int width, int height)
-{
-   struct pipe_context *pipe = exa->ctx;
-   struct pipe_buffer *buf = 0;
-
-   if (exa->num_bound_samplers == 0 ) { /* solid fill */
-      buf = setup_vertex_data0(exa,
-                               srcX, srcY, maskX, maskY,
-                               dstX, dstY, width, height);
-   } else if (exa->num_bound_samplers == 1 ) /* src */
-      buf = setup_vertex_data1(exa,
-                               srcX, srcY, maskX, maskY,
-                               dstX, dstY, width, height);
-   else if (exa->num_bound_samplers == 2) /* src + mask */
-      buf = setup_vertex_data2(exa,
-                               srcX, srcY, maskX, maskY,
-                               dstX, dstY, width, height);
-   else if (exa->num_bound_samplers == 3) { /* src + mask + dst */
-      debug_assert(!"src/mask/dst not handled right now");
-#if 0
-      buf = setup_vertex_data2(exa,
-                               srcX, srcY, maskX, maskY,
-                               dstX, dstY, width, height);
-#endif
-   }
-
-   if (buf) {
-      util_draw_vertex_buffer(pipe, buf, 0,
-                              PIPE_PRIM_TRIANGLE_FAN,
-                              4,  /* verts */
-                              1 + exa->num_bound_samplers); /* attribs/vert */
-
-      pipe_buffer_reference(&buf, NULL);
-   }
-}
-
 boolean xorg_composite_accelerated(int op,
                                    PicturePtr pSrcPicture,
                                    PicturePtr pMaskPicture,
@@ -536,7 +496,37 @@ void xorg_composite(struct exa_context *exa,
                     int srcX, int srcY, int maskX, int maskY,
                     int dstX, int dstY, int width, int height)
 {
-   draw_pictures(exa, srcX, srcY, maskX, maskY,
-                 dstX, dstY, width, height);
+   struct pipe_context *pipe = exa->ctx;
+   struct pipe_buffer *buf = 0;
+
+   if (exa->num_bound_samplers == 0 ) { /* solid fill */
+      buf = setup_vertex_data0(exa,
+                               srcX, srcY, maskX, maskY,
+                               dstX, dstY, width, height);
+   } else if (exa->num_bound_samplers == 1 ) /* src */
+      buf = setup_vertex_data1(exa,
+                               srcX, srcY, maskX, maskY,
+                               dstX, dstY, width, height);
+   else if (exa->num_bound_samplers == 2) /* src + mask */
+      buf = setup_vertex_data2(exa,
+                               srcX, srcY, maskX, maskY,
+                               dstX, dstY, width, height);
+   else if (exa->num_bound_samplers == 3) { /* src + mask + dst */
+      debug_assert(!"src/mask/dst not handled right now");
+#if 0
+      buf = setup_vertex_data2(exa,
+                               srcX, srcY, maskX, maskY,
+                               dstX, dstY, width, height);
+#endif
+   }
+
+   if (buf) {
+      util_draw_vertex_buffer(pipe, buf, 0,
+                              PIPE_PRIM_TRIANGLE_FAN,
+                              4,  /* verts */
+                              1 + exa->num_bound_samplers); /* attribs/vert */
+
+      pipe_buffer_reference(&buf, NULL);
+   }
 }
 

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to