summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-11-13 16:25:54 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-11-14 12:07:47 +0000
commitaa5a5684ebada60a1b103624a9b49aa085a406c1 (patch)
tree6a503c3a6f337ae3b4905e7ceee6889753bf56a5
parent97e684ab3c887c1992733d0031f0256e9692d452 (diff)
sna/gen6+: Only substitute SRC for CLEAR if using the correct source
If the source has not been verified to be clear, then using the SRC operator will paint the wrong color. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/gen6_render.c2
-rw-r--r--src/sna/gen7_render.c2
-rw-r--r--src/sna/sna_trapezoids_boxes.c3
-rw-r--r--src/sna/sna_trapezoids_mono.c3
4 files changed, 8 insertions, 2 deletions
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index 8c570007..a2b4082c 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -2159,7 +2159,7 @@ gen6_render_composite(struct sna *sna,
width, height,
tmp);
- if (op == PictOpClear)
+ if (op == PictOpClear && src == sna->clear)
op = PictOpSrc;
tmp->op = op;
if (!gen6_composite_set_target(sna, tmp, dst,
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c
index 82c785f7..f9408031 100644
--- a/src/sna/gen7_render.c
+++ b/src/sna/gen7_render.c
@@ -2437,7 +2437,7 @@ gen7_render_composite(struct sna *sna,
width, height,
tmp);
- if (op == PictOpClear)
+ if (op == PictOpClear && src == sna->clear)
op = PictOpSrc;
tmp->op = op;
if (!gen7_composite_set_target(sna, tmp, dst,
diff --git a/src/sna/sna_trapezoids_boxes.c b/src/sna/sna_trapezoids_boxes.c
index 4b0346b9..23a3b457 100644
--- a/src/sna/sna_trapezoids_boxes.c
+++ b/src/sna/sna_trapezoids_boxes.c
@@ -197,6 +197,9 @@ composite_aligned_boxes(struct sna *sna,
goto done;
}
+ if (op == PictOpClear && sna->clear)
+ src = sna->clear;
+
if (force_fallback ||
!sna->render.composite(sna, op, src, NULL, dst,
src_x, src_y,
diff --git a/src/sna/sna_trapezoids_mono.c b/src/sna/sna_trapezoids_mono.c
index f7b9a1c7..40d03819 100644
--- a/src/sna/sna_trapezoids_mono.c
+++ b/src/sna/sna_trapezoids_mono.c
@@ -803,6 +803,9 @@ mono_trapezoids_span_converter(struct sna *sna,
unbounded = (!sna_drawable_is_clear(dst->pDrawable) &&
!operator_is_bounded(op));
+ if (op == PictOpClear && mono.sna->clear)
+ src = mono.sna->clear;
+
mono.sna = sna;
if (!mono.sna->render.composite(mono.sna, op, src, NULL, dst,
src_x + mono.clip.extents.x1 - dst_x - dx,