summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-12-22 14:20:20 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-12-22 15:52:37 +0000
commit62602209e54c3568795122ee1c902c3b81985303 (patch)
tree583b84fdca5543f25171e6117b7ede88907e9b73
parentf68a99a55e1e63d7e76a13a7b77b4bb3f7802b9e (diff)
sna: discard damage-all even for width|height==0 operations
Even if we don't know the extents of the render operation, if the entire pixmap is damaged we can still reduce the damage tracking. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_render_inline.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/sna/sna_render_inline.h b/src/sna/sna_render_inline.h
index 758833ed..58eced01 100644
--- a/src/sna/sna_render_inline.h
+++ b/src/sna/sna_render_inline.h
@@ -139,7 +139,15 @@ sna_render_reduce_damage(struct sna_composite_op *op,
{
BoxRec r;
- if (width == 0 || height == 0 || op->damage == NULL)
+ if (op->damage == NULL || *op->damage == NULL)
+ return;
+
+ if ((*op->damage)->mode == DAMAGE_ALL) {
+ op->damage = NULL;
+ return;
+ }
+
+ if (width == 0 || height == 0)
return;
r.x1 = dst_x + op->dst.x;