diff --git a/src/sna/fb/fbpoint.c b/src/sna/fb/fbpoint.c index d3f796e6..e3974fca 100644 --- a/src/sna/fb/fbpoint.c +++ b/src/sna/fb/fbpoint.c @@ -26,26 +26,19 @@ #define DOTS fbDots8 #define BITS BYTE -#define BITS2 CARD16 -#define BITS4 CARD32 #include "fbpointbits.h" #undef BITS -#undef BITS2 -#undef BITS4 #undef DOTS #define DOTS fbDots16 #define BITS CARD16 -#define BITS2 CARD32 #include "fbpointbits.h" #undef BITS -#undef BITS2 #undef DOTS #define DOTS fbDots32 #define BITS CARD32 #include "fbpointbits.h" -#undef ARC #undef BITS #undef DOTS @@ -93,16 +86,16 @@ fbPolyPoint(DrawablePtr drawable, GCPtr gc, int xorg, int yorg, int xoff, int yoff, FbBits and, FbBits xor); - FbBits and, xor; - DBG(("%s x %d\n", __FUNCTION__, n)); + DBG(("%s x %d, clip=[(%d, %d), (%d, %d)]x%d\n", __FUNCTION__, n, + gc->pCompositeClip->extents.x1, gc->pCompositeClip->extents.y1, + gc->pCompositeClip->extents.x2, gc->pCompositeClip->extents.y2, + RegionNumRects(gc->pCompositeClip))); if (mode == CoordModePrevious) fbFixCoordModePrevious(n, pt); fbGetDrawable(drawable, dst, dstStride, dstBpp, dstXoff, dstYoff); - and = fb_gc(gc)->and; - xor = fb_gc(gc)->xor; dots = fbDots; switch (dstBpp) { case 8: @@ -116,5 +109,6 @@ fbPolyPoint(DrawablePtr drawable, GCPtr gc, break; } dots(dst, dstStride, dstBpp, gc->pCompositeClip, pt, n, - drawable->x, drawable->y, dstXoff, dstYoff, and, xor); + drawable->x, drawable->y, dstXoff, dstYoff, + fb_gc(gc)->and, fb_gc(gc)->xor); } diff --git a/src/sna/fb/fbpointbits.h b/src/sna/fb/fbpointbits.h index 40a25c68..2d71c1d2 100644 --- a/src/sna/fb/fbpointbits.h +++ b/src/sna/fb/fbpointbits.h @@ -38,14 +38,13 @@ DOTS(FbBits * dst, BITS band = (BITS) and; FbStride bitsStride = dstStride * (sizeof(FbBits) / sizeof(BITS)); - bits += bitsStride * (yorg + yoff) + (xorg + xoff); - if (region->data == NULL) { INT32 ul = coordToInt(region->extents.x1 - xorg, region->extents.y1 - yorg); INT32 lr = coordToInt(region->extents.x2 - xorg - 1, region->extents.y2 - yorg - 1); + bits += bitsStride * (yorg + yoff) + (xorg + xoff); if (and == 0) { while (npt >= 2) { union { @@ -82,23 +81,24 @@ DOTS(FbBits * dst, } } } else { + bits += bitsStride * yoff + xoff; if (and == 0) { while (npt--) { uint32_t pt = *pts++; - if (RegionContainsPoint(region, - intToX(pt), intToY(pt), - NULL)) { - BITS *point = bits + intToY(pt) * bitsStride + intToX(pt); + int x = intToX(pt) + xorg; + int y = intToY(pt) + yorg; + if (RegionContainsPoint(region, x, y, NULL)) { + BITS *point = bits + y * bitsStride + x; WRITE(point, bxor); } } } else { while (npt--) { uint32_t pt = *pts++; - if (RegionContainsPoint(region, - intToX(pt), intToY(pt), - NULL)) { - BITS *point = bits + intToY(pt) * bitsStride + intToX(pt); + int x = intToX(pt) + xorg; + int y = intToY(pt) + yorg; + if (RegionContainsPoint(region, x, y, NULL)) { + BITS *point = bits + y * bitsStride + x; RROP(point, band, bxor); } }