summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-10-28 11:30:37 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-10-28 11:55:27 +0100
commita02069df2ddc259d65ad468834f7968d283b713f (patch)
tree2a15e22c27be08af23bb825d220501a68d85fe86
parent48eff1676c4066c8b8e069fd579a1b6fc2329960 (diff)
sna: Faster unclipped spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c47
1 files changed, 30 insertions, 17 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 31f40138..2a9f2a4a 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1837,24 +1837,38 @@ no_damage_translate:
dx += drawable->x;
dy += drawable->y;
no_damage:
- {
- unsigned offset = dx|dy;
+ if (dx|dy) {
do {
- *(DDXPointRec *)b = *pt++;
- if (offset) {
+ int nbox = n;
+ if (nbox > last_box - box)
+ nbox = last_box - box;
+ n -= nbox;
+ do {
+ *(DDXPointRec *)b = *pt++;
b->x1 += dx;
b->y1 += dy;
- }
- b->x2 = b->x1 + (int)*width++;
- b->y2 = b->y1 + 1;
-
- if (++b == last_box) {
- fill.boxes(sna, &fill, box, last_box - box);
- b = box;
- }
- } while (--n);
- if (b != box)
+ b->x2 = b->x1 + (int)*width++;
+ b->y2 = b->y1 + 1;
+ b++;
+ } while (--nbox);
fill.boxes(sna, &fill, box, b - box);
+ b = box;
+ } while (n);
+ } else {
+ do {
+ int nbox = n;
+ if (nbox > last_box - box)
+ nbox = last_box - box;
+ n -= nbox;
+ do {
+ *(DDXPointRec *)b = *pt++;
+ b->x2 = b->x1 + (int)*width++;
+ b->y2 = b->y1 + 1;
+ b++;
+ } while (--nbox);
+ fill.boxes(sna, &fill, box, b - box);
+ b = box;
+ } while (n);
}
goto done;
@@ -2192,9 +2206,8 @@ sna_fill_spans(DrawablePtr drawable, GCPtr gc, int n,
RegionRec region;
unsigned flags;
- DBG(("%s(n=%d, pt[0]=(%d, %d)\n",
- __FUNCTION__, n, pt[0].x, pt[0].y));
-
+ DBG(("%s(n=%d, pt[0]=(%d, %d)+%d, sorted=%d\n",
+ __FUNCTION__, n, pt[0].x, pt[0].y, width[0], sorted));
flags = sna_spans_extents(drawable, gc, n, pt, width, &region.extents);
if (flags == 0)