[PATCH 11/13] glamor: use miZeroPolyArc for 0-width arcs

Keith Packard keithp at keithp.com
Mon May 5 15:02:18 PDT 2014


miPolyArc is a whole lot slower than miZeroPolyArc.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 glamor/glamor_core.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/glamor/glamor_core.c b/glamor/glamor_core.c
index 9e3d2ea..df60e5d 100644
--- a/glamor/glamor_core.c
+++ b/glamor/glamor_core.c
@@ -292,6 +292,15 @@ glamor_fini_finish_access_shaders(ScreenPtr screen)
     glDeleteProgram(glamor_priv->finish_access_prog[1]);
 }
 
+static void
+glamor_poly_arc(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs)
+{
+    if (pGC->lineWidth == 0)
+        miZeroPolyArc(pDraw, pGC, narcs, parcs);
+    else
+        miPolyArc(pDraw, pGC, narcs, parcs);
+}
+
 GCOps glamor_gc_ops = {
     .FillSpans = glamor_fill_spans,
     .SetSpans = glamor_set_spans,
@@ -302,7 +311,7 @@ GCOps glamor_gc_ops = {
     .Polylines = glamor_poly_lines,
     .PolySegment = glamor_poly_segment,
     .PolyRectangle = miPolyRectangle,
-    .PolyArc = miPolyArc,
+    .PolyArc = glamor_poly_arc,
     .FillPolygon = miFillPolygon,
     .PolyFillRect = glamor_poly_fill_rect,
     .PolyFillArc = miPolyFillArc,
-- 
2.0.0.rc0



More information about the xorg-devel mailing list