diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-23 11:05:50 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-23 11:10:28 +0000 |
commit | 803f6558c665c16ba2d20415e778b5bd1d308c2f (patch) | |
tree | dce99669fbddfd28adc4a7b2d75e427e7902300d | |
parent | 267493f39137704bd52df65b7605be30d2a062b2 (diff) |
sna: Only subtract the fillrect from the CPU damage if it covers the drawable
The idea behind that optimisation is for the inactive pixmap to be
refreshed and allowed to be transfered back to the GPU when it is
entirely redrawn. As such performing the subtraction when it does not
completely remove it only incurs additional overhead.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index f9b3a48c..86b8dfe8 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -8735,11 +8735,17 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect) if (!PM_IS_SOLID(draw, gc->planemask)) goto fallback; - if (n == 1 && - region_is_singular(gc->pCompositeClip) && + /* Clear the cpu damage so that we refresh the GPU status of the + * pixmap upon a redraw after a period of inactivity. + */ + if (priv->cpu_damage && + n == 1 && region_is_singular(gc->pCompositeClip) && gc->fillStyle != FillStippled && alu_overwrites(gc->alu)) { region.data = NULL; - sna_damage_subtract(&priv->cpu_damage, ®ion); + if (region_subsumes_damage(®ion, priv->cpu_damage)) { + sna_damage_destroy(&priv->cpu_damage); + list_del(&priv->list); + } } if (gc->fillStyle == FillSolid || |