sna: Tweak damage not to reduce if it will not affect the outcome of reducing to all

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-12-25 00:36:33 +00:00
parent be21a09fef
commit aff32e3e08
1 changed files with 4 additions and 3 deletions

View File

@ -147,14 +147,15 @@ static inline void sna_damage_reduce_all(struct sna_damage **damage,
if (*damage == NULL)
return;
if ((*damage)->dirty && (*damage = _sna_damage_reduce(*damage)) == NULL)
return;
if ((*damage)->mode == DAMAGE_ADD &&
(*damage)->extents.x1 <= 0 &&
(*damage)->extents.y1 <= 0 &&
(*damage)->extents.x2 >= width &&
(*damage)->extents.y2 >= height) {
if ((*damage)->dirty &&
(*damage = _sna_damage_reduce(*damage)) == NULL)
return;
if ((*damage)->region.data == NULL)
*damage = _sna_damage_all(*damage, width, height);
}