From 15485602d8451bcf6c2e979ccbd9cdc11111bcce Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 13 Jun 2014 20:30:25 +0100 Subject: sna: Use the right is-clipped hint The region here has yet to be clipped, and so the only valid is-clipped hint is from the flags computed from the PolyRect extents. Make sure we use those when determining whether it is valid to discard damage. Fixes regression from commit ad0390068832ad4727371902fe41a85a53de1894 [2.99.903] Author: Chris Wilson Date: Tue Sep 24 10:00:03 2013 +0100 sna: Separate out copy preferrence from operating in place decision Reported-by: Nick Bowler Tested-by: Nick Bowler Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79992 Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 13fe6ed6..ce04ca0d 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -14382,16 +14382,15 @@ sna_poly_fill_rect(DrawablePtr draw, GCPtr gc, int n, xRectangle *rect) RegionTranslate(®ion, dx, dy); } - if (region_subsumes_drawable(®ion, &pixmap->drawable)) { - discard_cpu_damage(sna, priv); - hint |= IGNORE_CPU | REPLACES; - } else { - if ((flags & 2) == 0) - hint |= IGNORE_CPU; - if (priv->cpu_damage && - region_subsumes_damage(®ion, priv->cpu_damage)) { + if ((flags & 2) == 0) { + hint |= IGNORE_CPU; + if (region_subsumes_drawable(®ion, &pixmap->drawable)) { discard_cpu_damage(sna, priv); - hint |= IGNORE_CPU; + hint |= REPLACES; + } else { + if (priv->cpu_damage && + region_subsumes_damage(®ion, priv->cpu_damage)) + discard_cpu_damage(sna, priv); } } if (priv->cpu_damage == NULL) { -- cgit v1.2.3