static void fbBresFillDash(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x1, int y1, int e, int e1, int e3, int len) { FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); FbDashDeclare; int dashlen; Bool even; Bool doOdd; Bool doBg; Pixel fg, bg; fg = pGC->fgPixel; bg = pGC->bgPixel; /* whether to fill the odd dashes */ doOdd = pGC->lineStyle == LineDoubleDash; /* whether to switch fg to bg when filling odd dashes */ doBg = doOdd && (pGC->fillStyle == FillSolid || pGC->fillStyle == FillStippled); /* compute current dash position */ FbDashInit(pGC, pPriv, dashOffset, dashlen, even); while (len--) { if (even || doOdd) { if (doBg) { if (even) fbSetFg(pDrawable, pGC, fg); else fbSetFg(pDrawable, pGC, bg); } fbFill(pDrawable, pGC, x1, y1, 1, 1); } if (axis == X_AXIS) { x1 += signdx; e += e1; if (e >= 0) { e += e3; y1 += signdy; } } else { y1 += signdy; e += e1; if (e >= 0) { e += e3; x1 += signdx; } } FbDashStep(dashlen, even); } if (doBg) fbSetFg(pDrawable, pGC, fg); }
static void fbBresFillDash(DrawablePtr drawable, GCPtr gc, int dashOffset, int sdx, int sdy, int axis, int x1, int y1, int e, int e1, int e3, int len) { FbGCPrivPtr pgc = fb_gc(gc); FbDashDeclare; int dashlen; bool even; bool doOdd; bool doBg; Pixel fg, bg; fg = gc->fgPixel; bg = gc->bgPixel; /* whether to fill the odd dashes */ doOdd = gc->lineStyle == LineDoubleDash; /* whether to switch fg to bg when filling odd dashes */ doBg = doOdd && (gc->fillStyle == FillSolid || gc->fillStyle == FillStippled); /* compute current dash position */ FbDashInit(gc, pgc, dashOffset, dashlen, even); while (len--) { if (even || doOdd) { if (doBg) { if (even) fbSetFg(drawable, gc, fg); else fbSetFg(drawable, gc, bg); } fbFill(drawable, gc, x1, y1, 1, 1); } if (axis == X_AXIS) { x1 += sdx; e += e1; if (e >= 0) { e += e3; y1 += sdy; } } else { y1 += sdy; e += e1; if (e >= 0) { e += e3; x1 += sdx; } } FbDashStep(dashlen, even); } if (doBg) fbSetFg(drawable, gc, fg); }
static void fbBresDash(DrawablePtr drawable, GCPtr gc, int dashOffset, int sdx, int sdy, int axis, int x1, int y1, int e, int e1, int e3, int len) { FbStip *dst; FbStride stride; int bpp; int dx, dy; FbGCPrivPtr pgc = fb_gc(gc); FbStip and = (FbStip) pgc->and; FbStip xor = (FbStip) pgc->xor; FbStip bgand = (FbStip) pgc->bgand; FbStip bgxor = (FbStip) pgc->bgxor; FbStip mask, mask0; FbDashDeclare; int dashlen; bool even; bool doOdd; fbGetStipDrawable(drawable, dst, stride, bpp, dx, dy); doOdd = gc->lineStyle == LineDoubleDash; FbDashInit(gc, pgc, dashOffset, dashlen, even); dst += ((y1 + dy) * stride); x1 = (x1 + dx) * bpp; dst += x1 >> FB_STIP_SHIFT; x1 &= FB_STIP_MASK; mask0 = FbStipMask(0, bpp); mask = FbStipRight(mask0, x1); if (sdx < 0) mask0 = FbStipRight(mask0, FB_STIP_UNIT - bpp); if (sdy < 0) stride = -stride; while (len--) { if (even) WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, mask)); else if (doOdd) WRITE(dst, FbDoMaskRRop(READ(dst), bgand, bgxor, mask)); if (axis == X_AXIS) { mask = fbBresShiftMask(mask, sdx, bpp); if (!mask) { dst += sdx; mask = mask0; } e += e1; if (e >= 0) { dst += stride; e += e3; } } else { dst += stride; e += e1; if (e >= 0) { e += e3; mask = fbBresShiftMask(mask, sdx, bpp); if (!mask) { dst += sdx; mask = mask0; } } } FbDashStep(dashlen, even); } }
static void fbBresDash(DrawablePtr pDrawable, GCPtr pGC, int dashOffset, int signdx, int signdy, int axis, int x1, int y1, int e, int e1, int e3, int len) { FbStip *dst; FbStride dstStride; int dstBpp; int dstXoff, dstYoff; FbGCPrivPtr pPriv = fbGetGCPrivate(pGC); FbStip and = (FbStip) pPriv->and; FbStip xor = (FbStip) pPriv->xor; FbStip bgand = (FbStip) pPriv->bgand; FbStip bgxor = (FbStip) pPriv->bgxor; FbStip mask, mask0; FbDashDeclare; int dashlen; Bool even; Bool doOdd; fbGetStipDrawable(pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); doOdd = pGC->lineStyle == LineDoubleDash; FbDashInit(pGC, pPriv, dashOffset, dashlen, even); dst += ((y1 + dstYoff) * dstStride); x1 = (x1 + dstXoff) * dstBpp; dst += x1 >> FB_STIP_SHIFT; x1 &= FB_STIP_MASK; mask0 = FbStipMask(0, dstBpp); mask = FbStipRight(mask0, x1); if (signdx < 0) mask0 = FbStipRight(mask0, FB_STIP_UNIT - dstBpp); if (signdy < 0) dstStride = -dstStride; while (len--) { if (even) WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, mask)); else if (doOdd) WRITE(dst, FbDoMaskRRop(READ(dst), bgand, bgxor, mask)); if (axis == X_AXIS) { mask = fbBresShiftMask(mask, signdx, dstBpp); if (!mask) { dst += signdx; mask = mask0; } e += e1; if (e >= 0) { dst += dstStride; e += e3; } } else { dst += dstStride; e += e1; if (e >= 0) { e += e3; mask = fbBresShiftMask(mask, signdx, dstBpp); if (!mask) { dst += signdx; mask = mask0; } } } FbDashStep(dashlen, even); } fbFinishAccess(pDrawable); }