diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-05 10:31:15 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-05 11:50:26 +0000 |
commit | 292097590ba0f81b7505aedb2a4fbd18021641a5 (patch) | |
tree | 138ce80d6f53f843450b596355902f062b506671 | |
parent | 5ddae8bf21067e7d2a031a6b9020c02ab977cfed (diff) |
sna: Try doing a cheap is-contained check before reducing damage
If the pixmap is entirely within the current CPU damage, we can forgo
reducing either the GPU or CPU damage when checking whether we need to
upload dirty pixels for a source texture.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_render.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index faa2730b..f633daa1 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -374,6 +374,12 @@ _texture_is_cpu(PixmapPtr pixmap, const BoxRec *box) if (!priv->cpu_damage) return FALSE; + if (priv->cpu_damage->mode == DAMAGE_ALL) + return TRUE; + + if (sna_damage_contains_box__no_reduce(priv->cpu_damage, box)) + return TRUE; + if (sna_damage_contains_box(priv->gpu_damage, box) != PIXMAN_REGION_OUT) return FALSE; |