diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-03-07 08:15:21 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-03-10 14:54:38 +0000 |
commit | 928453b1bc5a059a87fbcdba9156d318a0310073 (patch) | |
tree | ac165d6a4ed3fa4a2035b4e556273e4b5aa76584 /src/sna/sna_accel.c | |
parent | a2b4f2657f8cd503fce4e3b8cc3240d7b45d36ce (diff) |
sna: Emit points using the BLT primitive when appropriate
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_accel.c')
-rw-r--r-- | src/sna/sna_accel.c | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 6359de1d..aff7b343 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -6586,10 +6586,14 @@ sna_poly_point__fill(DrawablePtr drawable, GCPtr gc, DDXPointRec last; DBG(("%s: count=%d\n", __FUNCTION__, n)); + if (n == 0) + return; last.x = drawable->x + data->dx; last.y = drawable->y + data->dy; - while (n) { + if (op->points && mode != CoordModePrevious) { + op->points(data->sna, op, last.x, last.y, pt, n); + } else do { BoxRec *b = box; unsigned nbox = n; if (nbox > ARRAY_SIZE(box)) @@ -6608,7 +6612,7 @@ sna_poly_point__fill(DrawablePtr drawable, GCPtr gc, b++; } while (--nbox); op->boxes(data->sna, op, box, b - box); - } + } while (n); } static void @@ -8177,26 +8181,30 @@ sna_poly_point_blt(DrawablePtr drawable, assert_pixmap_contains_points(pixmap, pt, n, last.x, last.y); sna_damage_add_points(damage, pt, n, last.x, last.y); - do { - unsigned nbox = n; - if (nbox > ARRAY_SIZE(box)) - nbox = ARRAY_SIZE(box); - n -= nbox; + if (fill.points && mode != CoordModePrevious) { + fill.points(sna, &fill, last.x, last.y, pt, n); + } else { do { - *(DDXPointRec *)b = *pt++; + unsigned 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 = *(DDXPointRec *)b; + b->x1 += last.x; + b->y1 += last.y; + if (mode == CoordModePrevious) + last = *(DDXPointRec *)b; - b->x2 = b->x1 + 1; - b->y2 = b->y1 + 1; - b++; - } while (--nbox); - fill.boxes(sna, &fill, box, b - box); - b = box; - } while (n); + 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 { RegionPtr clip = gc->pCompositeClip; |