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

Chris Wilson ickle at kemper.freedesktop.org
Mon Oct 31 12:14:11 PDT 2011


 src/sna/gen3_render.c |    2 
 src/sna/sna_accel.c   |  113 ++++++++++++++++++++++----------------------------
 2 files changed, 51 insertions(+), 64 deletions(-)

New commits:
commit 8939ddbc27efedbb3e446dd26425a6bed39577f2
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Oct 31 17:45:02 2011 +0000

    sna: Improve rendering of thin segments
    
    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 cf3f5d3..346038e 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -3820,6 +3820,8 @@ rectangle_continue:
 					 */
 					if (pt2_clipped)
 						length++;
+					if (length == 0)
+						continue;
 
 					if (pt1_clipped) {
 						int clipdx = abs(x1 - x);
@@ -3827,24 +3829,22 @@ rectangle_continue:
 						e += clipdy * e2 + (clipdx - clipdy) * e1;
 					}
 				}
-				if (length == 0)
-					continue;
-
 				e3 = e2 - e1;
 				e  = e - e1;
 
+				if (sdx < 0) {
+					x1 = x2;
+					y1 = y2;
+					sdy = -sdy;
+				}
+
 				b->x1 = x1;
 				b->y2 = b->y1 = y1;
 				while (--length) {
 					e += e1;
+					x1++;
 					if (e >= 0) {
 						b->x2 = x1;
-						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_continue;
@@ -3855,19 +3855,11 @@ X_continue:
 						y1 += sdy;
 						e += e3;
 						b->y2 = b->y1 = y1;
-						b->x1 = x1 + sdx;
+						b->x1 = x1;
 					}
-					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->x2 = ++x1;
 				b->y2++;
 				if (++b == last_box) {
 					ret = &&X_continue2;
@@ -3906,6 +3898,8 @@ X_continue2:
 					 */
 					if (pt2_clipped)
 						length++;
+					if (length == 0)
+						continue;
 
 					if (pt1_clipped) {
 						int clipdx = abs(x1 - x);
@@ -3913,16 +3907,21 @@ X_continue2:
 						e += clipdx * e2 + (clipdy - clipdx) * e1;
 					}
 				}
-				if (length == 0)
-					continue;
 
 				e3 = e2 - e1;
 				e  = e - e1;
 
+				if (sdx < 0) {
+					x1 = x2;
+					y1 = y2;
+					sdy = -sdy;
+				}
+
 				b->x2 = b->x1 = x1;
 				b->y1 = y1;
 				while (--length) {
 					e += e1;
+					y1 += sdy;
 					if (e >= 0) {
 						b->y2 = y1;
 						if (b->y2 < b->y1) {
@@ -3931,30 +3930,25 @@ X_continue2:
 							b->y2 = t;
 						}
 						b->x2++;
-						b->y2++;
 						if (++b == last_box) {
 							ret = &&Y_continue;
 							goto *jump;
 Y_continue:
 							b = box;
 						}
-						x1 += sdx;
 						e += e3;
-						b->x2 = b->x1 = x1;
-						b->y1 = y1 + sdy;
+						b->x2 = b->x1 = ++x1;
+						b->y1 = y1;
 					}
-					y1 += sdy;
 				}
 
-				b->y2 = y1;
+				b->y2 = y1 + sdy;
 				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;
commit 98b830a975e04685455b244a8414a293857cbd00
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Oct 31 17:41:27 2011 +0000

    sna: Improve rendering of thin lines
    
    Reported-by: Clemens Eisserer <linuxhippy at gmail.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42443
    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 dead314..cf3f5d3 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2717,10 +2717,8 @@ sna_poly_zero_line_blt(DrawablePtr drawable,
 		y2 = ystart;
 		oc2 = 0;
 		MIOUTCODES(oc2, x2, y2,
-			   extents->x1,
-			   extents->y1,
-			   extents->x2,
-			   extents->y2);
+			   extents->x1, extents->y1,
+			   extents->x2, extents->y2);
 
 		while (--n) {
 			int16_t sdx, sdy;
@@ -2752,10 +2750,8 @@ sna_poly_zero_line_blt(DrawablePtr drawable,
 
 			oc2 = 0;
 			MIOUTCODES(oc2, x2, y2,
-				   extents->x1,
-				   extents->y1,
-				   extents->x2,
-				   extents->y2);
+				   extents->x1, extents->y1,
+				   extents->x2, extents->y2);
 			if (oc1 & oc2)
 				continue;
 
@@ -2822,6 +2818,8 @@ rectangle_continue:
 					 */
 					if (pt2_clipped)
 						length++;
+					if (length == 0)
+						continue;
 
 					if (pt1_clipped) {
 						int clipdx = abs(x - x1);
@@ -2829,24 +2827,23 @@ rectangle_continue:
 						e += clipdy * e2 + (clipdx - clipdy) * e1;
 					}
 				}
-				if (length == 0)
-					continue;
 
 				e3 = e2 - e1;
 				e  = e - e1;
 
+				if (sdx < 0) {
+					x = x2;
+					y = y2;
+					sdy = -sdy;
+				}
+
 				b->x1 = x;
 				b->y2 = b->y1 = y;
 				while (--length) {
 					e += e1;
+					x++;
 					if (e >= 0) {
 						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_continue;
@@ -2857,18 +2854,11 @@ X_continue:
 						y += sdy;
 						e += e3;
 						b->y2 = b->y1 = y;
-						b->x1 = x + dx;
+						b->x1 = x;
 					}
-					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->x2 = ++x;
 				b->y2++;
 				if (++b == last_box) {
 					ret = &&X_continue2;
@@ -2909,6 +2899,8 @@ X_continue2:
 					 */
 					if (pt2_clipped)
 						length++;
+					if (length == 0)
+						continue;
 
 					if (pt1_clipped) {
 						int clipdx = abs(x - x1);
@@ -2916,16 +2908,21 @@ X_continue2:
 						e += clipdx * e2 + (clipdy - clipdx) * e1;
 					}
 				}
-				if (length == 0)
-					continue;
 
 				e3 = e2 - e1;
 				e  = e - e1;
 
+				if (sdx < 0) {
+					x = x2;
+					y = y2;
+					sdy = -sdy;
+				}
+
 				b->x2 = b->x1 = x;
 				b->y1 = y;
 				while (--length) {
 					e += e1;
+					y += sdy;
 					if (e >= 0) {
 						b->y2 = y;
 						if (b->y2 < b->y1) {
@@ -2934,29 +2931,25 @@ X_continue2:
 							b->y2 = t;
 						}
 						b->x2++;
-						b->y2++;
 						if (++b == last_box) {
 							ret = &&Y_continue;
 							goto *jump;
 Y_continue:
 							b = box;
 						}
-						x += sdx;
 						e += e3;
-						b->x2 = b->x1 = x;
-						b->y1 = y + sdy;
+						b->x2 = b->x1 = ++x;
+						b->y1 = y;
 					}
-					y += sdy;
 				}
 
-				b->y2 = y;
+				b->y2 = y + sdy;
 				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;
commit 6a5834ae560ef3b05c42b58ee0654316a66eaed0
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Oct 31 16:28:59 2011 +0000

    sna/gen3: Fix invalid assert
    
    SHADER_CONSTANT is expected here, the other IMMEDIATES however should
    have already been handled.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index bf68841..7f68b00 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -906,11 +906,11 @@ gen3_composite_emit_shader(struct sna *sna,
 			break;
 
 		case SHADER_NONE:
-		case SHADER_CONSTANT:
 		case SHADER_WHITE:
 		case SHADER_BLACK:
 		case SHADER_ZERO:
 			assert(0);
+		case SHADER_CONSTANT:
 			break;
 		}
 


More information about the xorg-commit mailing list