summaryrefslogtreecommitdiff
path: root/src/sna/sna_damage.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-06-30 09:34:21 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-06-30 09:34:21 +0100
commite625c02e6266403fcd8a72ccce2c6c6291e2e5fc (patch)
tree1f015b238d5210019c41e3329cb490bdb0be4698 /src/sna/sna_damage.c
parentabd7be1cee6f2f494a11cd9d2e7888c3043ffc02 (diff)
sna/damage: Early check for contains-box? if subtract and box outside region
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_damage.c')
-rw-r--r--src/sna/sna_damage.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sna/sna_damage.c b/src/sna/sna_damage.c
index ce16b773..745e2d12 100644
--- a/src/sna/sna_damage.c
+++ b/src/sna/sna_damage.c
@@ -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);