From b56971986d2d495aa38f015beb659fb12f0d433a Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 24 Jan 2012 17:23:59 +0000 Subject: [PATCH] sna: Trim the clipped Segment to the right length Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 4b997a54..a6e211d2 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -6687,12 +6687,6 @@ rectangle_continue: continue; length = abs(x2 - x1); - - /* if we've clipped the endpoint, always draw the full length - * of the segment, because then the capstyle doesn't matter - */ - if (pt2_clipped) - length++; if (length == 0) continue; @@ -6713,7 +6707,7 @@ rectangle_continue: b->x1 = x1; b->y2 = b->y1 = y1; - while (length--) { + while (--length) { e += e1; x1++; if (e >= 0) { @@ -6765,12 +6759,6 @@ X_continue2: continue; length = abs(y2 - y1); - - /* if we've clipped the endpoint, always draw the full length - * of the segment, because then the capstyle doesn't matter - */ - if (pt2_clipped) - length++; if (length == 0) continue; @@ -6792,7 +6780,7 @@ X_continue2: b->x2 = b->x1 = x1; b->y1 = y1; - while (length--) { + while (--length) { e += e1; y1 += sdy; if (e >= 0) {