diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-03-17 23:57:46 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-03-18 15:10:37 +0000 |
commit | 97cd0c7da51024400e8900e46f51620a5f7ad402 (patch) | |
tree | 0d8b36eb3efb28bc3406126ee097e26ebd10537a | |
parent | e31d9dacafe060dc86de801114b475fdd0142eb6 (diff) |
sna/traps: Upon reducing an ADD to a SRC, we need to apply the pending clear
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47444
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_trapezoids.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c index 3a93450c..55940238 100644 --- a/src/sna/sna_trapezoids.c +++ b/src/sna/sna_trapezoids.c @@ -4077,6 +4077,7 @@ trapezoid_span_inplace(CARD8 op, PicturePtr src, PicturePtr dst, struct sna_pixmap *priv; RegionRec region; uint32_t color; + bool unbounded; int16_t dst_x, dst_y; int dx, dy; int n; @@ -4125,19 +4126,27 @@ trapezoid_span_inplace(CARD8 op, PicturePtr src, PicturePtr dst, return false; } + unbounded = false; switch (op) { case PictOpAdd: - if (priv->clear && priv->clear_color == 0) + if (priv->clear && priv->clear_color == 0) { + unbounded = true; op = PictOpSrc; + } if ((color >> 24) == 0) return true; break; case PictOpIn: if (priv->clear && priv->clear_color == 0) return true; + if (priv->clear && priv->clear_color == 0xff) + op = PictOpSrc; if ((color >> 24) == 0) return true; + unbounded = true; + break; case PictOpSrc: + unbounded = !(priv->clear && priv->clear_color == 0); break; default: DBG(("%s: fallback -- can not perform op [%d] in place\n", @@ -4237,7 +4246,7 @@ trapezoid_span_inplace(CARD8 op, PicturePtr src, PicturePtr dst, inplace.opacity = color >> 24; tor_render(NULL, &tor, (void*)&inplace, - dst->pCompositeClip, span, op == PictOpIn); + dst->pCompositeClip, span, unbounded); tor_fini(&tor); |