From 9566fc0ccc71bc4fcd6bf83b567a41cc5366f5ee Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Thu, 5 Jun 2014 12:26:23 +0100 Subject: 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 --- src/sna/sna_damage.h | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/sna/sna_damage.h') 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); -- cgit v1.2.3