diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-05 12:12:22 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-05 12:12:22 +0000 |
commit | a42111ff94911d5fad34e6dbac8aa4a11b2d8032 (patch) | |
tree | 14b2a8f76e57149d68500dd6e3caac9f4221aafe /src | |
parent | 4c6ccbd46a1681c73382b79a0246f7d8cb097606 (diff) |
sna/trapezoids: Try creating the trapezoids mask inplace if not using spans
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_trapezoids.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c index 2a48e3db..42cebb9d 100644 --- a/src/sna/sna_trapezoids.c +++ b/src/sna/sna_trapezoids.c @@ -3213,7 +3213,8 @@ tor_blt_add_clipped_mono(struct sna *sna, static bool trapezoid_span_inplace(CARD8 op, PicturePtr src, PicturePtr dst, PictFormatPtr maskFormat, INT16 src_x, INT16 src_y, - int ntrap, xTrapezoid *traps) + int ntrap, xTrapezoid *traps, + bool fallback) { struct tor tor; struct inplace inplace; @@ -3246,9 +3247,11 @@ trapezoid_span_inplace(CARD8 op, PicturePtr src, PicturePtr dst, } switch (op) { - case PictOpSrc: case PictOpIn: case PictOpAdd: + if (!fallback && is_gpu(dst->pDrawable)) + return false; + case PictOpSrc: break; default: DBG(("%s: fallback -- can not perform op [%d] in place\n", @@ -3265,7 +3268,8 @@ trapezoid_span_inplace(CARD8 op, PicturePtr src, PicturePtr dst, do { /* XXX unwind errors? */ if (!trapezoid_span_inplace(op, src, dst, NULL, - src_x, src_y, 1, traps++)) + src_x, src_y, 1, traps++, + fallback)) return false; } while (--ntrap); return true; @@ -3355,7 +3359,7 @@ trapezoid_span_inplace(CARD8 op, PicturePtr src, PicturePtr dst, region.data = NULL; if (!sna_drawable_move_region_to_cpu(dst->pDrawable, ®ion, - MOVE_WRITE)) + op == PictOpSrc ? MOVE_WRITE : MOVE_WRITE | MOVE_READ)) return true; pixmap = get_drawable_pixmap(dst->pDrawable); @@ -3622,13 +3626,19 @@ sna_composite_trapezoids(CARD8 op, xSrc, ySrc, ntrap, traps)) return; + if (trapezoid_span_inplace(op, src, dst, maskFormat, + xSrc, ySrc, ntrap, traps, + false)) + return; + if (trapezoid_mask_converter(op, src, dst, maskFormat, xSrc, ySrc, ntrap, traps)) return; fallback: if (trapezoid_span_inplace(op, src, dst, maskFormat, - xSrc, ySrc, ntrap, traps)) + xSrc, ySrc, ntrap, traps, + true)) return; if (trapezoid_span_fallback(op, src, dst, maskFormat, |