summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-04-07 07:59:42 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-04-07 07:59:42 +0100
commit8ef81d676c52e42a6d9048fd92b2843470b62945 (patch)
treea15d1e92fdd96e21f04b66f55d8de9862911a013 /src
parentf5014b3fddf6c79f5ca01a91eec5ca92184c8829 (diff)
sna: Simplify checking for singular damage
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_damage.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sna/sna_damage.c b/src/sna/sna_damage.c
index 47e88835..f80ce229 100644
--- a/src/sna/sna_damage.c
+++ b/src/sna/sna_damage.c
@@ -641,7 +641,7 @@ static struct sna_damage *__sna_damage_add_box(struct sna_damage *damage,
break;
}
- if (REGION_NUM_RECTS(&damage->region) <= 1 ||
+ if (damage->region.data == NULL ||
box_contains_region(box, &damage->region)) {
_pixman_region_union_box(&damage->region, box);
assert(damage->region.extents.x2 > damage->region.extents.x1);
@@ -679,7 +679,7 @@ inline static struct sna_damage *__sna_damage_add(struct sna_damage *damage,
if (region->data == NULL)
return __sna_damage_add_box(damage, &region->extents);
- if (REGION_NUM_RECTS(&damage->region) <= 1) {
+ if (damage->region.data == NULL) {
pixman_region_union(&damage->region, &damage->region, region);
assert(damage->region.extents.x2 > damage->region.extents.x1);
assert(damage->region.extents.y2 > damage->region.extents.y1);