[PATCH 3/9] glamor: Move glamor_emit_composite_vert() to traps, where it's used.

Eric Anholt eric at anholt.net
Sat Mar 8 20:07:04 PST 2014


It's only used in the nonantialiased, triangle-based trapezoids path.

Signed-off-by: Eric Anholt <eric at anholt.net>
---
 glamor/glamor_priv.h      |  4 ----
 glamor/glamor_render.c    | 25 -------------------------
 glamor/glamor_trapezoid.c | 25 +++++++++++++++++++++++++
 3 files changed, 25 insertions(+), 29 deletions(-)

diff --git a/glamor/glamor_priv.h b/glamor/glamor_priv.h
index fe4b423..c93f483 100644
--- a/glamor/glamor_priv.h
+++ b/glamor/glamor_priv.h
@@ -703,10 +703,6 @@ void glamor_composite_set_shader_blend(glamor_pixmap_private *dest_priv,
                                        struct blendinfo *op_info);
 
 void glamor_setup_composite_vbo(ScreenPtr screen, int n_verts);
-void glamor_emit_composite_vert(ScreenPtr screen,
-                                const float *src_coords,
-                                const float *mask_coords,
-                                const float *dst_coords, int i);
 
 /* glamor_trapezoid.c */
 void glamor_trapezoids(CARD8 op,
diff --git a/glamor/glamor_render.c b/glamor/glamor_render.c
index 98343c3..7e25cd5 100644
--- a/glamor/glamor_render.c
+++ b/glamor/glamor_render.c
@@ -767,31 +767,6 @@ glamor_setup_composite_vbo(ScreenPtr screen, int n_verts)
     glamor_put_context(glamor_priv);
 }
 
-void
-glamor_emit_composite_vert(ScreenPtr screen,
-                           const float *src_coords,
-                           const float *mask_coords,
-                           const float *dst_coords, int i)
-{
-    glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
-    float *vb = (float *) (glamor_priv->vb + glamor_priv->vbo_offset);
-    int j = 0;
-
-    vb[j++] = dst_coords[i * 2 + 0];
-    vb[j++] = dst_coords[i * 2 + 1];
-    if (glamor_priv->has_source_coords) {
-        vb[j++] = src_coords[i * 2 + 0];
-        vb[j++] = src_coords[i * 2 + 1];
-    }
-    if (glamor_priv->has_mask_coords) {
-        vb[j++] = mask_coords[i * 2 + 0];
-        vb[j++] = mask_coords[i * 2 + 1];
-    }
-
-    glamor_priv->render_nr_verts++;
-    glamor_priv->vbo_offset += glamor_priv->vb_stride;
-}
-
 static void
 glamor_flush_composite_rects(ScreenPtr screen)
 {
diff --git a/glamor/glamor_trapezoid.c b/glamor/glamor_trapezoid.c
index 7bc925a..7bbee4b 100644
--- a/glamor/glamor_trapezoid.c
+++ b/glamor/glamor_trapezoid.c
@@ -190,6 +190,31 @@ point_inside_trapezoid(int point[2], xTrapezoid *trap, xFixed cut_y)
 }
 
 static void
+glamor_emit_composite_vert(ScreenPtr screen,
+                           const float *src_coords,
+                           const float *mask_coords,
+                           const float *dst_coords, int i)
+{
+    glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
+    float *vb = (float *) (glamor_priv->vb + glamor_priv->vbo_offset);
+    int j = 0;
+
+    vb[j++] = dst_coords[i * 2 + 0];
+    vb[j++] = dst_coords[i * 2 + 1];
+    if (glamor_priv->has_source_coords) {
+        vb[j++] = src_coords[i * 2 + 0];
+        vb[j++] = src_coords[i * 2 + 1];
+    }
+    if (glamor_priv->has_mask_coords) {
+        vb[j++] = mask_coords[i * 2 + 0];
+        vb[j++] = mask_coords[i * 2 + 1];
+    }
+
+    glamor_priv->render_nr_verts++;
+    glamor_priv->vbo_offset += glamor_priv->vb_stride;
+}
+
+static void
 glamor_emit_composite_triangle(ScreenPtr screen,
                                const float *src_coords,
                                const float *mask_coords,
-- 
1.9.0



More information about the xorg-devel mailing list