summaryrefslogtreecommitdiff
path: root/src/sna/sna_trapezoids_mono.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-01-23 17:30:29 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-01-23 17:38:27 +0000
commite916c922ce3913712cd8a9b76ab037840b7f07f1 (patch)
treebceb4d0e04a3d07aa2101a6f5b1d5cafde07c9ba /src/sna/sna_trapezoids_mono.c
parent59e769e1b1eede466482a950b242ce81c52b276b (diff)
sna: Avoid erroneous discarding operations for partial composites
Composite operations were presumed to cover their entire width x height area. However, a few paths submit boxes that do not cover the clip region and so the optimisation made during prepare to discard completely overwritten data is incorrect (and leads to corruption - stale data is seen which the client expected to have been overdrawn). So along these more unusual paths, we must add a flag to prevent the overzealous discard. Notably, xfce4 triggers this as it uses a lot of unantialiased trapezoids in its theme drawing. References: https://bugs.freedesktop.org/show_bug.cgi?id=69528 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_trapezoids_mono.c')
-rw-r--r--src/sna/sna_trapezoids_mono.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/sna/sna_trapezoids_mono.c b/src/sna/sna_trapezoids_mono.c
index be2e3a67..49296a36 100644
--- a/src/sna/sna_trapezoids_mono.c
+++ b/src/sna/sna_trapezoids_mono.c
@@ -813,7 +813,7 @@ mono_trapezoids_span_converter(struct sna *sna,
mono.clip.extents.x1, mono.clip.extents.y1,
mono.clip.extents.x2 - mono.clip.extents.x1,
mono.clip.extents.y2 - mono.clip.extents.y1,
- memset(&mono.op, 0, sizeof(mono.op))))
+ COMPOSITE_PARTIAL, memset(&mono.op, 0, sizeof(mono.op))))
return false;
num_threads = 1;
@@ -924,7 +924,6 @@ mono_trapezoids_span_converter(struct sna *sna,
traps[n].top, traps[n].bottom,
&traps[n].right.p1, &traps[n].right.p2, -1);
}
- memset(&mono.op, 0, sizeof(mono.op));
if (mono.sna->render.composite(mono.sna,
PictOpClear,
mono.sna->clear, NULL, dst,
@@ -933,7 +932,7 @@ mono_trapezoids_span_converter(struct sna *sna,
mono.clip.extents.x1, mono.clip.extents.y1,
mono.clip.extents.x2 - mono.clip.extents.x1,
mono.clip.extents.y2 - mono.clip.extents.y1,
- &mono.op)) {
+ COMPOSITE_PARTIAL, memset(&mono.op, 0, sizeof(mono.op)))) {
mono_render(&mono);
mono.op.done(mono.sna, &mono.op);
}
@@ -1273,14 +1272,13 @@ mono_trap_span_converter(struct sna *sna,
&p1, &p2, -1);
}
- memset(&mono.op, 0, sizeof(mono.op));
if (mono.sna->render.composite(mono.sna, PictOpAdd, src, NULL, dst,
- 0, 0,
- 0, 0,
- mono.clip.extents.x1, mono.clip.extents.y1,
- mono.clip.extents.x2 - mono.clip.extents.x1,
- mono.clip.extents.y2 - mono.clip.extents.y1,
- &mono.op)) {
+ 0, 0,
+ 0, 0,
+ mono.clip.extents.x1, mono.clip.extents.y1,
+ mono.clip.extents.x2 - mono.clip.extents.x1,
+ mono.clip.extents.y2 - mono.clip.extents.y1,
+ COMPOSITE_PARTIAL, memset(&mono.op, 0, sizeof(mono.op)))) {
mono_render(&mono);
mono.op.done(mono.sna, &mono.op);
}
@@ -1356,7 +1354,6 @@ mono_triangles_span_converter(struct sna *sna,
&tri[n].p3, &tri[n].p1, 1);
}
- memset(&mono.op, 0, sizeof(mono.op));
if (mono.sna->render.composite(mono.sna, op, src, NULL, dst,
src_x + mono.clip.extents.x1 - dst_x - dx,
src_y + mono.clip.extents.y1 - dst_y - dy,
@@ -1364,7 +1361,7 @@ mono_triangles_span_converter(struct sna *sna,
mono.clip.extents.x1, mono.clip.extents.y1,
mono.clip.extents.x2 - mono.clip.extents.x1,
mono.clip.extents.y2 - mono.clip.extents.y1,
- &mono.op)) {
+ COMPOSITE_PARTIAL, memset(&mono.op, 0, sizeof(mono.op)))) {
if (mono.clip.data == NULL && mono.op.damage == NULL)
mono.span = mono_span__fast;
else
@@ -1402,7 +1399,6 @@ mono_triangles_span_converter(struct sna *sna,
&tri[n].p3, &tri[n].p1, 1);
}
- memset(&mono.op, 0, sizeof(mono.op));
if (mono.sna->render.composite(mono.sna,
PictOpClear,
mono.sna->clear, NULL, dst,
@@ -1411,7 +1407,7 @@ mono_triangles_span_converter(struct sna *sna,
mono.clip.extents.x1, mono.clip.extents.y1,
mono.clip.extents.x2 - mono.clip.extents.x1,
mono.clip.extents.y2 - mono.clip.extents.y1,
- &mono.op)) {
+ COMPOSITE_PARTIAL, memset(&mono.op, 0, sizeof(mono.op)))) {
if (mono.clip.data == NULL && mono.op.damage == NULL)
mono.span = mono_span__fast;
else