xf86-video-intel: 2 commits - src/sna/sna_accel.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Oct 27 09:09:07 PDT 2011


 src/sna/sna_accel.c |   88 ++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 75 insertions(+), 13 deletions(-)

New commits:
commit 5d52d5009375618bb703909fa0fad04e6d54a2ba
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Oct 27 17:06:51 2011 +0100

    sna: Tweak zero line spans to include missing last segment
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 950eba1..c0f9572 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2692,7 +2692,7 @@ rectangle_continue:
 
 				b->x1 = x;
 				b->y2 = b->y1 = y;
-				while (length--) {
+				while (--length) {
 					e += e1;
 					if (e >= 0) {
 						b->x2 = x;
@@ -2712,10 +2712,25 @@ X_continue:
 						y += sdy;
 						e += e3;
 						b->y2 = b->y1 = y;
-						b->x1 = x;
+						b->x1 = x + dx;
 					}
 					x += sdx;
 				}
+
+				b->x2 = x;
+				if (b->x2 < b->x1) {
+					int16_t t = b->x1;
+					b->x1 = b->x2;
+					b->x2 = t;
+				}
+				b->x2++;
+				b->y2++;
+				if (++b == last_box) {
+					ret = &&X_continue2;
+					goto *jump;
+X_continue2:
+					b = box;
+				}
 			} else {
 				/* Y-major segment */
 				e1 = adx << 1;
@@ -2766,7 +2781,7 @@ X_continue:
 
 				b->x2 = b->x1 = x;
 				b->y1 = y;
-				while (length--) {
+				while (--length) {
 					e += e1;
 					if (e >= 0) {
 						b->y2 = y;
@@ -2786,10 +2801,25 @@ Y_continue:
 						x += sdx;
 						e += e3;
 						b->x2 = b->x1 = x;
-						b->y1 = y;
+						b->y1 = y + sdy;
 					}
 					y += sdy;
 				}
+
+				b->y2 = y;
+				if (b->y2 < b->y1) {
+					int16_t t = b->y1;
+					b->y1 = b->y2;
+					b->y2 = t;
+				}
+				b->x2++;
+				b->y2++;
+				if (++b == last_box) {
+					ret = &&Y_continue2;
+					goto *jump;
+Y_continue2:
+					b = box;
+				}
 			}
 		}
 
@@ -3620,7 +3650,7 @@ rectangle_continue:
 
 				b->x1 = x1;
 				b->y2 = b->y1 = y1;
-				while (length--) {
+				while (--length) {
 					e += e1;
 					if (e >= 0) {
 						b->x2 = x1;
@@ -3640,10 +3670,26 @@ X_continue:
 						y1 += sdy;
 						e += e3;
 						b->y2 = b->y1 = y1;
-						b->x1 = x1;
+						b->x1 = x1 + sdx;
 					}
 					x1 += sdx;
 				}
+
+				b->x2 = x1;
+				if (b->x2 < b->x1) {
+					int16_t t = b->x1;
+					b->x1 = b->x2;
+					b->x2 = t;
+				}
+				if (gc->capStyle != CapNotLast)
+					b->x2++;
+				b->y2++;
+				if (++b == last_box) {
+					ret = &&X_continue2;
+					goto *jump;
+X_continue2:
+					b = box;
+				}
 			} else {
 				/* Y-major segment */
 				e1 = adx << 1;
@@ -3690,7 +3736,7 @@ X_continue:
 
 				b->x2 = b->x1 = x1;
 				b->y1 = y1;
-				while (length--) {
+				while (--length) {
 					e += e1;
 					if (e >= 0) {
 						b->y2 = y1;
@@ -3710,10 +3756,26 @@ Y_continue:
 						x1 += sdx;
 						e += e3;
 						b->x2 = b->x1 = x1;
-						b->y1 = y1;
+						b->y1 = y1 + sdy;
 					}
 					y1 += sdy;
 				}
+
+				b->y2 = y1;
+				if (b->y2 < b->y1) {
+					int16_t t = b->y1;
+					b->y1 = b->y2;
+					b->y2 = t;
+				}
+				b->x2++;
+				if (gc->capStyle != CapNotLast)
+					b->y2++;
+				if (++b == last_box) {
+					ret = &&Y_continue2;
+					goto *jump;
+Y_continue2:
+					b = box;
+				}
 			}
 		} while (--n);
 	} while (++extents != last_extents);
commit 72e00096351137bd7eb0ae91474657a597836252
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Oct 27 16:36:39 2011 +0100

    sna: Fix advance through clip boxes for fill->boxes
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 58ef208..950eba1 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -3046,7 +3046,7 @@ sna_poly_line_blt(DrawablePtr drawable,
 						break;
 
 					*b = box;
-					if (box_intersect(b, c)) {
+					if (box_intersect(b, c++)) {
 						b->x1 += dx;
 						b->x2 += dx;
 						b->y1 += dy;
@@ -3376,7 +3376,7 @@ sna_poly_segment_blt(DrawablePtr drawable,
 						break;
 
 					*b = box;
-					if (box_intersect(b, c)) {
+					if (box_intersect(b, c++)) {
 						b->x1 += dx;
 						b->x2 += dx;
 						b->y1 += dy;
@@ -4135,7 +4135,7 @@ zero_clipped:
 							break;
 
 						*b = box[count];
-						if (box_intersect(b, c)) {
+						if (box_intersect(b, c++)) {
 							b->x1 += dx;
 							b->x2 += dx;
 							b->y1 += dy;
@@ -4275,7 +4275,7 @@ wide_clipped:
 							break;
 
 						*b = box[count];
-						if (box_intersect(b, c)) {
+						if (box_intersect(b, c++)) {
 							b->x1 += dx;
 							b->x2 += dx;
 							b->y1 += dy;
@@ -4738,7 +4738,7 @@ sna_poly_fill_rect_blt(DrawablePtr drawable,
 						break;
 
 					*b = box;
-					if (box_intersect(b, c)) {
+					if (box_intersect(b, c++)) {
 						b->x1 += dx;
 						b->x2 += dx;
 						b->y1 += dy;


More information about the xorg-commit mailing list