diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-31 11:58:24 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-07-31 13:11:46 +0100 |
commit | 8f166d26b8a93592939068c5a8d160981c724cfd (patch) | |
tree | 7c7ed9e44ef2e465508dbda8b3b6b577653ca02c /src/sna/sna_composite.c | |
parent | e6cb5d93eaa01e7f4763f797bba341f3cc481d98 (diff) |
sna: Be more careful with damage reduction during CompositeRectangles
We actually need to force DAMAGE_ALL in case we are promoting the GPU
pixmap.
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.c | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c index 36287c65..0ca66c7e 100644 --- a/src/sna/sna_composite.c +++ b/src/sna/sna_composite.c @@ -855,25 +855,34 @@ sna_composite_rectangles(CARD8 op, /* Clearing a pixmap after creation is a common operation, so take * advantage and reduce further damage operations. */ - if (op <= PictOpSrc && - region_subsumes_drawable(®ion, &pixmap->drawable)) { - bool ok; - - assert(DAMAGE_IS_ALL(priv->gpu_damage)); - - priv->undamaged = false; - priv->clear_color = 0; - ok = true; - if (op == PictOpSrc) - ok = sna_get_pixel_from_rgba(&priv->clear_color, - color->red, - color->green, - color->blue, - color->alpha, - dst->format); - priv->clear = ok; - DBG(("%s: marking clear [%08x]? %d\n", - __FUNCTION__, priv->clear_color, ok)); + if (region_subsumes_drawable(®ion, &pixmap->drawable)) { + if (damage) { + sna_damage_all(damage, + pixmap->drawable.width, + pixmap->drawable.height); + sna_damage_destroy(damage == &priv->gpu_damage ? + &priv->cpu_damage : &priv->gpu_damage); + priv->undamaged = false; + } + + if (op <= PictOpSrc && bo == priv->gpu_bo) { + bool ok; + + assert(DAMAGE_IS_ALL(priv->gpu_damage)); + + priv->clear_color = 0; + ok = true; + if (op == PictOpSrc) + ok = sna_get_pixel_from_rgba(&priv->clear_color, + color->red, + color->green, + color->blue, + color->alpha, + dst->format); + priv->clear = ok; + DBG(("%s: marking clear [%08x]? %d\n", + __FUNCTION__, priv->clear_color, ok)); + } } goto done; |