summaryrefslogtreecommitdiff
path: root/src/sna/sna.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-07-06 14:16:36 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-07-06 14:16:36 +0100
commit24b59a8955eb15522ad334a541530aca937fcf07 (patch)
treedfe5fe29378c5867ea9b2aa59ed1ca69aa444d32 /src/sna/sna.h
parent68b357454af705f1ed3a9599435a402f2611a180 (diff)
sna: Refactor a common function: is_clipped()
Had I done this earlier, I would not have the bug in the open-coded version. Le sigh. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna.h')
-rw-r--r--src/sna/sna.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h
index bda3cb87..3219e151 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -703,4 +703,12 @@ inline static bool is_power_of_two(unsigned x)
return (x & (x-1)) == 0;
}
+inline static bool is_clipped(const RegionRec *r,
+ const DrawableRec *d)
+{
+ return (r->data ||
+ r->extents.x2 - r->extents.x1 != d->width ||
+ r->extents.y2 - r->extents.y1 != d->height);
+}
+
#endif /* _SNA_H */