From 7df096eeca5fdbe603e5bb62caa4afa6612abe68 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 14 Jan 2014 09:39:47 +1000 Subject: [PATCH] increase performance of lines fallback. [airlied: ported from Eric's X server branch from talking at LCA]. Signed-off-by: Dave Airlie --- src/glamor_polylines.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/glamor_polylines.c b/src/glamor_polylines.c index e723e95..a71655f 100644 --- a/src/glamor_polylines.c +++ b/src/glamor_polylines.c @@ -51,7 +51,7 @@ _glamor_poly_lines(DrawablePtr drawable, GCPtr gc, int mode, int n, /* This ends up in miSetSpans, which is accelerated as well as we * can hope X wide lines will be. */ - goto wide_line; + goto fail; } if (gc->lineStyle != LineSolid) { glamor_fallback @@ -104,18 +104,17 @@ _glamor_poly_lines(DrawablePtr drawable, GCPtr gc, int mode, int n, && glamor_ddx_fallback_check_gc(gc)) return FALSE; - if (gc->lineWidth == 0) { - if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) { - if (glamor_prepare_access_gc(gc)) { - fbPolyLine(drawable, gc, mode, n, points); - glamor_finish_access_gc(gc); - } - glamor_finish_access(drawable, GLAMOR_ACCESS_RW); - } - } else { -wide_line: - /* fb calls mi functions in the lineWidth != 0 case. */ - fbPolyLine(drawable, gc, mode, n, points); + switch (gc->lineStyle) { + case LineSolid: + if (gc->lineWidth == 0) + miZeroLine(drawable, gc, mode, n, points); + else + miWideLine(drawable, gc, mode, n, points); + break; + case LineOnOffDash: + case LineDoubleDash: + miWideDash(drawable, gc, mode, n, points); + break; } return TRUE; } -- 1.8.3.1