summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-10-27 17:06:51 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-10-27 17:07:33 +0100
commit5d52d5009375618bb703909fa0fad04e6d54a2ba (patch)
treef9453ebf71e51ca01d9a2877180e4330582a7fa7
parent72e00096351137bd7eb0ae91474657a597836252 (diff)
sna: Tweak zero line spans to include missing last segment
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c78
1 files changed, 70 insertions, 8 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 950eba1f..c0f95725 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);