diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-06-02 12:02:55 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-06-02 12:02:55 +0100 |
commit | a1953f1d4abc6e158a5e3ca53d3207548842254c (patch) | |
tree | 3fb893c582e9ad45eb92fcac0d5cfd3c70ebdf5d /src/sna/sna_composite.c | |
parent | ce85cd1a36e31795a966ea8983c2d6f803a4eccd (diff) |
sna: Prefer to use memset() for extremely large clears
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_composite.c')
-rw-r--r-- | src/sna/sna_composite.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c index 9dc38081..973a6572 100644 --- a/src/sna/sna_composite.c +++ b/src/sna/sna_composite.c @@ -868,7 +868,12 @@ fallback: dst->format)) goto fallback_composite; - do { + if (pixel == 0 && + box->x2 - box->x1 == pixmap->drawable.width && + box->y2 - box->y1 == pixmap->drawable.height) { + memset(pixmap->devPrivate.ptr, 0, + pixmap->devKind*pixmap->drawable.height); + } else do { DBG(("%s: fallback fill: (%d, %d)x(%d, %d) %08x\n", __FUNCTION__, box->x1, box->y1, |