From 053bd5bf2425aed44e1c2bb981d98ee5171211a0 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 14 May 2012 12:08:09 +0100 Subject: [PATCH] sna: Use the correct storage for box_from_seg Fixes regression from 3aa98289e3a2 with clipped segments. As we clipped the empty box rather than the segment, we never drew any outlines. Signed-off-by: Chris Wilson --- src/sna/sna_accel.c | 16 ++++------------ src/sna/sna_trapezoids.c | 2 +- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 776cba35..ab26dd08 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -6918,7 +6918,7 @@ sna_poly_segment_blt(DrawablePtr drawable, nbox = ARRAY_SIZE(boxes); n -= nbox; do { - box_from_seg(b, seg, gc); + box_from_seg(b, seg++, gc); if (b->y2 > b->y1 && b->x2 > b->x1) { b->x1 += dx; b->x2 += dx; @@ -6926,7 +6926,6 @@ sna_poly_segment_blt(DrawablePtr drawable, b->y2 += dy; b++; } - seg++; } while (--nbox); if (b != boxes) { @@ -6943,10 +6942,7 @@ sna_poly_segment_blt(DrawablePtr drawable, nbox = ARRAY_SIZE(boxes); n -= nbox; do { - box_from_seg(b, seg, gc); - if (b->y2 > b->y1 && b->x2 > b->x1) - b++; - seg++; + box_from_seg(b++, seg++, gc); } while (--nbox); if (b != boxes) { @@ -6972,7 +6968,7 @@ sna_poly_segment_blt(DrawablePtr drawable, do { BoxRec box; - box_from_seg(b, seg, gc); + box_from_seg(&box, seg++, gc); box.x1 += drawable->x; box.x2 += drawable->x; box.y1 += drawable->y; @@ -6998,12 +6994,10 @@ sna_poly_segment_blt(DrawablePtr drawable, } } } - - seg++; } while (--n); } else { do { - box_from_seg(b, seg, gc); + box_from_seg(b, seg++, gc); b->x1 += drawable->x; b->x2 += drawable->x; b->y1 += drawable->y; @@ -7020,8 +7014,6 @@ sna_poly_segment_blt(DrawablePtr drawable, b = boxes; } } - - seg++; } while (--n); } RegionUninit(&clip); diff --git a/src/sna/sna_trapezoids.c b/src/sna/sna_trapezoids.c index 8d5594d7..357c4c49 100644 --- a/src/sna/sna_trapezoids.c +++ b/src/sna/sna_trapezoids.c @@ -2475,7 +2475,7 @@ trapezoids_fallback(CARD8 op, PicturePtr src, PicturePtr dst, depth = maskFormat->depth; if (depth == 1) { format = PIXMAN_a1; - } else if (depth < 8) { + } else if (depth <= 4) { format = PIXMAN_a4; depth = 4; } else