summaryrefslogtreecommitdiff
path: root/src/sna/sna_damage.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-09-09 11:19:19 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-09-09 11:19:19 +0100
commit6d5df67b3e4ed5d5b9f1aabf01b5657d4c9eeac7 (patch)
tree89016058605ef013367a6a22961dc91c2979e741 /src/sna/sna_damage.h
parent634748486f33658f09c8a7f4508840fad6df85f2 (diff)
sna: Remember to offset the box before asserting damage
When using sna_copy_boxes__inplace(), we need to remember that the region is in destination space, so we need to offset the boxes when comparing against the source. The assertion forgot to do so, and so failed as soon as it met a little complexity. Reported-by: Jiri Slaby <jirislaby@gmail.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_damage.h')
-rw-r--r--src/sna/sna_damage.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/sna/sna_damage.h b/src/sna/sna_damage.h
index 03a54a3d..187d312d 100644
--- a/src/sna/sna_damage.h
+++ b/src/sna/sna_damage.h
@@ -215,6 +215,19 @@ static inline int sna_damage_contains_box(struct sna_damage *damage,
return _sna_damage_contains_box(damage, box);
}
+static inline int sna_damage_contains_box__offset(struct sna_damage *damage,
+ const BoxRec *box, int dx, int dy)
+{
+ BoxRec b;
+
+ if (DAMAGE_IS_ALL(damage))
+ return PIXMAN_REGION_IN;
+
+ b = *box;
+ b.x1 += dx; b.x2 += dx;
+ b.y1 += dy; b.y2 += dy;
+ return _sna_damage_contains_box(damage, &b);
+}
bool _sna_damage_contains_box__no_reduce(const struct sna_damage *damage,
const BoxRec *box);
static inline bool