summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-29 11:59:57 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-29 11:59:57 +0000
commitf85a853455249fd782e907ce1d78d11f75362def (patch)
treec251be977944ca04c67d587785b31e67e6d89ac6
parentf53936407bd68f3d36ab525b4e0531fad58098e3 (diff)
sna: Only update the damage region as necesary for contains-box
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_damage.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sna/sna_damage.c b/src/sna/sna_damage.c
index 02c125ae..f2a5a933 100644
--- a/src/sna/sna_damage.c
+++ b/src/sna/sna_damage.c
@@ -1112,11 +1112,11 @@ static int _sna_damage_contains_box(struct sna_damage *damage,
if (!sna_damage_maybe_contains_box(damage, box))
return PIXMAN_REGION_OUT;
- if (damage->mode == DAMAGE_SUBTRACT)
- __sna_damage_reduce(damage);
-
ret = pixman_region_contains_rectangle(&damage->region, (BoxPtr)box);
- if (ret != PIXMAN_REGION_OUT || !damage->dirty)
+ if (!damage->dirty)
+ return ret;
+
+ if (damage->mode == DAMAGE_ADD && ret == PIXMAN_REGION_IN)
return ret;
__sna_damage_reduce(damage);