summaryrefslogtreecommitdiff
path: root/src/sna/sna_composite.c
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_composite.c
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_composite.c')
-rw-r--r--src/sna/sna_composite.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c
index 070faf4b..8b4aa808 100644
--- a/src/sna/sna_composite.c
+++ b/src/sna/sna_composite.c
@@ -418,9 +418,12 @@ static void apply_damage(struct sna_composite_op *op, RegionPtr region)
assert_pixmap_contains_box(op->dst.pixmap, RegionExtents(region));
if (region->data == NULL &&
region->extents.x2 - region->extents.x1 == op->dst.width &&
- region->extents.y2 - region->extents.y1 == op->dst.height)
- sna_damage_all(op->damage, op->dst.width, op->dst.height);
- else
+ region->extents.y2 - region->extents.y1 == op->dst.height) {
+ *op->damage = _sna_damage_all(*op->damage,
+ op->dst.width,
+ op->dst.height);
+ op->damage = NULL;
+ } else
sna_damage_add(op->damage, region);
}
@@ -964,9 +967,7 @@ sna_composite_rectangles(CARD8 op,
if (priv->gpu_bo && priv->cpu_damage == NULL) {
DBG(("%s: promoting to full GPU\n", __FUNCTION__));
assert(priv->gpu_bo->proxy == NULL);
- sna_damage_all(&priv->gpu_damage,
- pixmap->drawable.width,
- pixmap->drawable.height);
+ sna_damage_all(&priv->gpu_damage, pixmap);
}
}
}
@@ -1037,9 +1038,7 @@ sna_composite_rectangles(CARD8 op,
*/
if (region_subsumes_drawable(&region, &pixmap->drawable)) {
if (damage) {
- sna_damage_all(damage,
- pixmap->drawable.width,
- pixmap->drawable.height);
+ sna_damage_all(damage, pixmap);
sna_damage_destroy(damage == &priv->gpu_damage ?
&priv->cpu_damage : &priv->gpu_damage);
}