summaryrefslogtreecommitdiff
path: root/src/sna/sna_damage.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-05 12:26:23 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-05 13:58:27 +0100
commit9566fc0ccc71bc4fcd6bf83b567a41cc5366f5ee (patch)
treecb78754fc20bc549d87b2fae8920bf1a688df6f9 /src/sna/sna_damage.h
parent1327918f91dce2051b809594db5a3ed555934612 (diff)
sna: Curry parameters to sna_damage_all()
It is far easily to pass the PixmapPtr into the function and have it pluck out the width and height than do so in all callers. 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.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/sna/sna_damage.h b/src/sna/sna_damage.h
index 187d312d..42edb105 100644
--- a/src/sna/sna_damage.h
+++ b/src/sna/sna_damage.h
@@ -141,10 +141,12 @@ _sna_damage_all(struct sna_damage *damage,
}
static inline void sna_damage_all(struct sna_damage **damage,
- int width, int height)
+ PixmapPtr pixmap)
{
if (!DAMAGE_IS_ALL(*damage))
- *damage = _sna_damage_all(*damage, width, height);
+ *damage = _sna_damage_all(*damage,
+ pixmap->drawable.width,
+ pixmap->drawable.height);
}
fastcall struct sna_damage *_sna_damage_subtract(struct sna_damage *damage,
@@ -262,7 +264,7 @@ static inline void sna_damage_reduce(struct sna_damage **damage)
}
static inline void sna_damage_reduce_all(struct sna_damage **_damage,
- int width, int height)
+ PixmapPtr pixmap)
{
struct sna_damage *damage = *_damage;
@@ -274,8 +276,8 @@ static inline void sna_damage_reduce_all(struct sna_damage **_damage,
if (damage->mode == DAMAGE_ADD) {
if (damage->extents.x1 <= 0 &&
damage->extents.y1 <= 0 &&
- damage->extents.x2 >= width &&
- damage->extents.y2 >= height) {
+ damage->extents.x2 >= pixmap->drawable.width &&
+ damage->extents.y2 >= pixmap->drawable.height) {
if (damage->dirty) {
damage = *_damage = _sna_damage_reduce(damage);
if (damage == NULL)
@@ -283,7 +285,9 @@ static inline void sna_damage_reduce_all(struct sna_damage **_damage,
}
if (damage->region.data == NULL)
- *_damage = _sna_damage_all(damage, width, height);
+ *_damage = _sna_damage_all(damage,
+ pixmap->drawable.width,
+ pixmap->drawable.height);
}
} else
*_damage = _sna_damage_reduce(damage);