diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-11-01 14:30:14 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-11-01 14:30:14 +0000 |
commit | 5da329735ca79517a326aee002685bf33e8db861 (patch) | |
tree | 13aa081e3a2a58717fd19af5160119c8f56d55c2 /src/sna/fb | |
parent | 0d93b0ef343a635512c3835c797c469c17a7b584 (diff) |
sna: Process all clip boxes when rastering segments
The macro still had buried returns which were no longer valid after the
translation to handle clipping. They needed to be breaks from the inner
most loops to the outer clip box instead.
Reported-by: Clemens Eisserer <linuxhippy@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=70802
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/fb')
-rw-r--r-- | src/sna/fb/fbline.c | 14 | ||||
-rw-r--r-- | src/sna/fb/fblinebits.h | 15 |
2 files changed, 21 insertions, 8 deletions
diff --git a/src/sna/fb/fbline.c b/src/sna/fb/fbline.c index 04d5343c..e134e23e 100644 --- a/src/sna/fb/fbline.c +++ b/src/sna/fb/fbline.c @@ -122,8 +122,11 @@ fbPolyLine(DrawablePtr drawable, GCPtr gc, int mode, int n, DDXPointPtr pt) { void (*raster)(DrawablePtr, GCPtr, int mode, int n, DDXPointPtr pt); - DBG(("%s x %d, width=%d, fill=%d, line=%d\n", - __FUNCTION__, n, gc->lineWidth, gc->fillStyle, gc->lineStyle)); + DBG(("%s x %d, width=%d, fill=%d [solid? %d], line=%d [solid? %d], bpp=%d\n", + __FUNCTION__, n, gc->lineWidth, + gc->fillStyle, gc->fillStyle == FillSolid, + gc->lineStyle, gc->lineStyle == LineSolid, + drawable->bitsPerPixel)); if (gc->lineWidth == 0) { raster = fbZeroLine; @@ -154,8 +157,11 @@ fbPolySegment(DrawablePtr drawable, GCPtr gc, int n, xSegment *seg) { void (*raster)(DrawablePtr drawable, GCPtr gc, int n, xSegment * seg); - DBG(("%s x %d, width=%d, fill=%d, line=%d\n", - __FUNCTION__, n, gc->lineWidth, gc->fillStyle, gc->lineStyle)); + DBG(("%s x %d, width=%d, fill=%d [solid? %d], line=%d [solid? %d], bpp=%d\n", + __FUNCTION__, n, gc->lineWidth, + gc->fillStyle, gc->fillStyle == FillSolid, + gc->lineStyle, gc->lineStyle == LineSolid, + drawable->bitsPerPixel)); if (gc->lineWidth == 0) { raster = fbZeroSegment; diff --git a/src/sna/fb/fblinebits.h b/src/sna/fb/fblinebits.h index db315d81..67e98e58 100644 --- a/src/sna/fb/fblinebits.h +++ b/src/sna/fb/fblinebits.h @@ -53,8 +53,9 @@ POLYLINE(DrawablePtr drawable, GCPtr gc, int mode, int n_0, DDXPointPtr pt_0) fbGetDrawable(drawable, dst, dstStride, dstBpp, dstXoff, dstYoff); bitsStride = dstStride * (sizeof(FbBits) / sizeof(BITS)); - bitsBase = - ((BITS *) dst) + (yoff + dstYoff) * bitsStride + (xoff + dstXoff); + bitsBase = ((BITS *) dst) + (yoff + dstYoff) * bitsStride + (xoff + dstXoff); + + DBG(("%s: processing %ld clip boxes\n", __FUNCTION__, (long)(last_clip - clip))); do { INT32 *pt = (INT32 *)pt_0; int n = n_0; @@ -63,6 +64,8 @@ POLYLINE(DrawablePtr drawable, GCPtr gc, int mode, int n_0, DDXPointPtr pt_0) INT32 ul = coordToInt(clip->x1 - xoff, clip->y1 - yoff); INT32 lr = coordToInt(clip->x2 - xoff - 1, clip->y2 - yoff - 1); + DBG(("%s: clip box=(%d, %d), (%d, %d)\n", __FUNCTION__, clip->x1, clip->y1, clip->x2, clip->y2)); + pt1 = *pt++; n--; pt2 = *pt++; n--; for (;;) { @@ -73,7 +76,7 @@ POLYLINE(DrawablePtr drawable, GCPtr gc, int mode, int n_0, DDXPointPtr pt_0) intToX(pt2) + xoff, intToY(pt2) + yoff, n == 0 && gc->capStyle != CapNotLast, &dashoffset); if (!n) - return; + goto next_clip; pt1 = pt2; pt2 = *pt++; @@ -125,7 +128,7 @@ POLYLINE(DrawablePtr drawable, GCPtr gc, int mode, int n_0, DDXPointPtr pt_0) pt2 != *((INT32 *)pt_0)) { RROP(bits, and, xor); } - return; + goto next_clip; } pt1 = pt2; pt2 = *pt++; @@ -135,6 +138,7 @@ POLYLINE(DrawablePtr drawable, GCPtr gc, int mode, int n_0, DDXPointPtr pt_0) } } } +next_clip: (void)clip; } while (++clip != last_clip); } @@ -167,12 +171,15 @@ POLYSEGMENT(DrawablePtr drawable, GCPtr gc, int n_0, xSegment *seg_0) bitsBase = ((BITS *) dst) + (yoff + dstYoff) * bitsStride + (xoff + dstXoff); + DBG(("%s: processing %ld clip boxes\n", __FUNCTION__, (long)(last_clip - clip))); do { INT32 ul = coordToInt(clip->x1 - xoff, clip->y1 - yoff); INT32 lr = coordToInt(clip->x2 - xoff - 1, clip->y2 - yoff - 1); uint64_t *pt = (uint64_t *)seg_0; int n = n_0; + DBG(("%s: clip box=(%d, %d), (%d, %d)\n", __FUNCTION__, clip->x1, clip->y1, clip->x2, clip->y2)); + while (n--) { union { int32_t pt32[2]; |