summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-04-08 14:25:49 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-04-08 14:25:49 +0100
commit479cb6ba71038fe44f66fb31fad90d0d454fea7a (patch)
tree493f9648603a7d80e969d16bfaed90c8b07d121d
parentc5c01c13badeb7c2ead0c848b746d8d474277a77 (diff)
sna: Compress adjoining spans during FillSpans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 8f02380a..7425a51c 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4255,8 +4255,15 @@ sna_fill_spans__fill(DrawablePtr drawable,
b->y2 = b->y1 + 1;
DBG(("%s: (%d, %d), (%d, %d)\n",
__FUNCTION__, b->x1, b->y1, b->x2, b->y2));
- if (b->x2 > b->x1)
- b++;
+ if (b->x2 > b->x1) {
+ if (b != box &&
+ b->y1 == b[-1].y2 &&
+ b->x1 == b[-1].x1 &&
+ b->x2 == b[-1].x2)
+ b[-1].y2 = b->y2;
+ else
+ b++;
+ }
} while (--nbox);
if (b != box)
op->boxes(data->sna, op, box, b - box);
@@ -4322,7 +4329,12 @@ sna_fill_spans__fill_clip_extents(DrawablePtr drawable,
b->x1 += data->dx; b->x2 += data->dx;
b->y1 += data->dy; b->y2 += data->dy;
}
- if (++b == last_box) {
+ if (b != box &&
+ b->y1 == b[-1].y2 &&
+ b->x1 == b[-1].x1 &&
+ b->x2 == b[-1].x2) {
+ b[-1].y2 = b->y2;
+ } else if (++b == last_box) {
op->boxes(data->sna, op, box, last_box - box);
b = box;
}