sna/damage: Early check for contains-box? if subtract and box outside region

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-06-30 09:34:21 +01:00
parent abd7be1cee
commit e625c02e62
1 changed files with 7 additions and 2 deletions

View File

@ -1260,8 +1260,13 @@ static int __sna_damage_contains_box(struct sna_damage *damage,
if (!damage->dirty)
return ret;
if (damage->mode == DAMAGE_ADD && ret == PIXMAN_REGION_IN)
return ret;
if (damage->mode == DAMAGE_ADD) {
if (ret == PIXMAN_REGION_IN)
return ret;
} else {
if (ret == PIXMAN_REGION_OUT)
return ret;
}
__sna_damage_reduce(damage);
return pixman_region_contains_rectangle(&damage->region, (BoxPtr)box);