diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-28 14:01:24 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-28 14:35:42 +0100 |
commit | c1718f96f520874c1fb2af0eb975c7f548762d34 (patch) | |
tree | 87610b3a2c5255a23dcdfc378775a9be29dccb1a | |
parent | a4762ed891a50238abddf6c762a053db5c34b87f (diff) |
sna: Faster unclipped PolyPoint
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 61fe190f..9f00fd6a 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -2387,26 +2387,25 @@ sna_poly_point_blt(DrawablePtr drawable, sna_damage_add_points(damage, pt, n, last.x, last.y); do { - b->x1 = pt->x; - b->y1 = pt->y; - pt++; + int nbox = n; + if (nbox > ARRAY_SIZE(box)) + nbox = ARRAY_SIZE(box); + n -= nbox; + do { + *(DDXPointRec *)b = *pt++; - b->x1 += last.x; - b->y1 += last.y; - if (mode == CoordModePrevious) { - last.x = b->x1; - last.y = b->y1; - } + b->x1 += last.x; + b->y1 += last.y; + if (mode == CoordModePrevious) + last = *(DDXPointRec *)b; - b->x2 = b->x1 + 1; - 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 + 1; + b->y2 = b->y1 + 1; + b++; + } while (--nbox); fill.boxes(sna, &fill, box, b - box); + b = box; + } while (n); } else { while (n--) { int x, y; @@ -4846,9 +4845,9 @@ sna_poly_fill_rect_blt(DrawablePtr drawable, } RegionUninit(&clip); + if (b != boxes) + fill.boxes(sna, &fill, boxes, b-boxes); } - if (b != boxes) - fill.boxes(sna, &fill, boxes, b-boxes); done: fill.done(sna, &fill); return TRUE; |