summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-03-27 10:42:59 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-03-27 11:26:08 +0100
commit2e7b5f7eafbf452c781e50eba7dc8323260af59e (patch)
tree74ffb317e4683234938a4d5581ab1d838cad6666
parent522b41b393b979fdccf1ad62194cde8129f98c8c (diff)
sna/traps: Prefer to try mono spans on the GPU before trying inplace CPU
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_trapezoids.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c
index be467897..4067757f 100644
--- a/src/sna/sna_trapezoids.c
+++ b/src/sna/sna_trapezoids.c
@@ -3092,12 +3092,14 @@ composite_unaligned_boxes(struct sna *sna,
switch (op) {
case PictOpAdd:
+ case PictOpOver:
if (priv->clear && priv->clear_color == 0)
op = PictOpSrc;
break;
case PictOpIn:
if (priv->clear && priv->clear_color == 0)
return true;
+ break;
}
memset(&tmp, 0, sizeof(tmp));
@@ -4479,7 +4481,7 @@ sna_composite_trapezoids(CARD8 op,
/* scan through for fast rectangles */
rectilinear = pixel_aligned = true;
- if (maskFormat ? maskFormat->depth == 1 : dst->polyEdge == PolyEdgeSharp) {
+ if (is_mono(dst, maskFormat)) {
for (n = 0; n < ntrap && rectilinear; n++) {
int lx1 = pixman_fixed_to_int(traps[n].left.p1.x + pixman_fixed_1_minus_e/2);
int lx2 = pixman_fixed_to_int(traps[n].left.p2.x + pixman_fixed_1_minus_e/2);
@@ -4531,6 +4533,13 @@ sna_composite_trapezoids(CARD8 op,
}
flags |= COMPOSITE_SPANS_RECTILINEAR;
}
+
+ if (is_mono(dst, maskFormat) &&
+ mono_trapezoids_span_converter(op, src, dst,
+ xSrc, ySrc,
+ ntrap, traps))
+ return;
+
if (trapezoid_spans_maybe_inplace(op, src, dst, maskFormat)) {
flags |= COMPOSITE_SPANS_INPLACE_HINT;
if (trapezoid_span_inplace(op, src, dst, maskFormat,