summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-23 10:54:13 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-23 10:54:13 +0000
commit267493f39137704bd52df65b7605be30d2a062b2 (patch)
tree046aafd148131328017e53a8bcefa9dc147a6b3f /src/sna
parent2908fe2df7b8f870a55fc5856f94ea541a7c7b75 (diff)
sna: Assert that the subtract operation does reduce an all-damaged
Somewhere somewhen it appears that I am discarding the all-damaged flag on the pointer. The only possibility I can see is for a no-op subtraction, so put an assert there just in case the impossible is happening. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/sna_damage.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sna/sna_damage.h b/src/sna/sna_damage.h
index 5c003ca9..dc0962f2 100644
--- a/src/sna/sna_damage.h
+++ b/src/sna/sna_damage.h
@@ -101,6 +101,7 @@ static inline bool sna_damage_is_all(struct sna_damage **_damage,
case DAMAGE_SUBTRACT:
return false;
default:
+ assert(0);
case DAMAGE_ADD:
if (damage->extents.x2 < width || damage->extents.x1 > 0)
return false;
@@ -140,6 +141,7 @@ static inline void sna_damage_subtract(struct sna_damage **damage,
RegionPtr region)
{
*damage = _sna_damage_subtract(DAMAGE_PTR(*damage), region);
+ assert(*damage == NULL || (*damage)->mode != DAMAGE_ALL);
}
fastcall struct sna_damage *_sna_damage_subtract_box(struct sna_damage *damage,
@@ -148,6 +150,7 @@ static inline void sna_damage_subtract_box(struct sna_damage **damage,
const BoxRec *box)
{
*damage = _sna_damage_subtract_box(DAMAGE_PTR(*damage), box);
+ assert(*damage == NULL || (*damage)->mode != DAMAGE_ALL);
}
Bool _sna_damage_intersect(struct sna_damage *damage,