pxAddLineC(sp, &pxp, x1, y2, x1, y1, gcPriv->fgPixel);
pxAddLineC(sp, &pxp, x1, y2, x1, y1, gcPriv->fgFill);
pxPolylinesD( pDrawable, pGC, mode, npt, pptInit)    DrawablePtr pDrawable;    GCPtr pGC;    int mode;		/* Origin or Previous */    int npt;		/* number of points */    DDXPointPtr pptInit;#endif{    int nboxInit;    int nbox;    BoxPtr pboxInit;    BoxPtr pbox;#ifndef _POLYSEGMENT    DDXPointPtr ppt;	/* pointer to list of translated points */#endif    pxPacket pxp;    unsigned int oc1;		/* outcode of point 1 */    unsigned int oc2;		/* outcode of point 2 */    int xorg, yorg;		/* origin of window */    int adx;		/* abs values of dx and dy */    int ady;    int signdx;		/* sign of dx and dy */    int signdy;    int e, e1, e2;		/* bresenham error and increments */    int len;			/* length of segment */    int axis;			/* major axis */    int octant;    unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);    int x1, x2, y1, y2;    RegionPtr cclip;    unsigned char   *pDash;    int		    dashOffset;    int		    numInDashList;    int		    dashIndex;    int		    isDoubleDash;    int		    unclippedlen;    pxPrivGCPtr     gcPriv;    pxScreenPrivPtr sp;    u_int32_t       *pb;#ifdef _POLYSEGMENT    int dashIndexTmp;    int dashOffsetTmp;#endif#ifdef _POLYSEGMENT    PX_TRACE("pxPolySegmentD");#else    PX_TRACE("pxPolyLinesD");#endif    gcPriv = pxGetGCPrivate(pGC);    sp = gcPriv->sp;    pb = pxPacketStart(sp, &pxp, 5, 3);    pb[0] = STAMP_CMD_LINES | STAMP_RGB_FLAT | STAMP_LW_PERPACKET;    pb[1] = gcPriv->pmask;    pb[2] = 0;    pb[3] = gcPriv->umet;    pb[4] = 4;    cclip = cfbGetCompositeClip(pGC);    pboxInit = REGION_RECTS(cclip);    nboxInit = REGION_NUM_RECTS(cclip);    /* compute initial dash values */         pDash = (unsigned char *) pGC->dash;    numInDashList = pGC->numInDashList;    isDoubleDash = (pGC->lineStyle == LineDoubleDash);    dashIndex = 0;    dashOffset = 0;    miStepDash ((int)pGC->dashOffset, &dashIndex, pDash,		numInDashList, &dashOffset);    xorg = pDrawable->x;    yorg = pDrawable->y;#ifdef _POLYSEGMENT    while (nseg--)#else    ppt = pptInit;    x2 = ppt->x + xorg;    y2 = ppt->y + yorg;    while(--npt)#endif    {	nbox = nboxInit;	pbox = pboxInit;#ifdef _POLYSEGMENT	x1 = pSeg->x1 + xorg;	y1 = pSeg->y1 + yorg;	x2 = pSeg->x2 + xorg;	y2 = pSeg->y2 + yorg;	pSeg++;#else	x1 = x2;	y1 = y2;	++ppt;	if (mode == CoordModePrevious)	{	    xorg = x1;	    yorg = y1;	}	x2 = ppt->x + xorg;	y2 = ppt->y + yorg;#endif	CalcLineDeltas(x1, y1, x2, y2, adx, ady, signdx, signdy, 1, 1, octant);	if (adx > ady)	{	    axis = X_AXIS;	    e1 = ady << 1;	    e2 = e1 - (adx << 1);	    e = e1 - adx;	    unclippedlen = adx;	}	else	{	    axis = Y_AXIS;	    e1 = adx << 1;	    e2 = e1 - (ady << 1);	    e = e1 - ady;	    unclippedlen = ady;	    SetYMajorOctant(octant);	}	FIXUP_ERROR(e, octant, bias);	/* we have bresenham parameters and two points.	   all we have to do now is clip and draw.	*/	while(nbox--)	{	    oc1 = 0;	    oc2 = 0;	    OUTCODES(oc1, x1, y1, pbox);	    OUTCODES(oc2, x2, y2, pbox);	    if ((oc1 | oc2) == 0)	    {#ifdef _POLYSEGMENT		if (pGC->capStyle != CapNotLast)		    unclippedlen++;		dashIndexTmp = dashIndex;		dashOffsetTmp = dashOffset;		pxBresD(sp, &pxp, gcPriv,		      &dashIndexTmp, pDash, numInDashList,		      &dashOffsetTmp, isDoubleDash,		      signdx, signdy, axis, x1, y1,		      e, e1, e2, unclippedlen);		break;#else		pxBresD(sp, &pxp, gcPriv,		      &dashIndex, pDash, numInDashList,		      &dashOffset, isDoubleDash,		      signdx, signdy, axis, x1, y1,		      e, e1, e2, unclippedlen);		goto dontStep;#endif	    }	    else if (oc1 & oc2)	    {		pbox++;	    }	    else /* have to clip */	    {		int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2;		int clip1 = 0, clip2 = 0;		int clipdx, clipdy;		int err;		int dashIndexTmp, dashOffsetTmp;				if (miZeroClipLine(pbox->x1, pbox->y1, pbox->x2-1,				   pbox->y2-1,				   &new_x1, &new_y1, &new_x2, &new_y2,				   adx, ady, &clip1, &clip2,				   octant, bias, oc1, oc2) == -1)		{		    pbox++;		    continue;		}		dashIndexTmp = dashIndex;		dashOffsetTmp = dashOffset;		if (clip1)		{		    int dlen;    		    if (axis == X_AXIS)			dlen = abs(new_x1 - x1);		    else			dlen = abs(new_y1 - y1);		    miStepDash (dlen, &dashIndexTmp, pDash,				numInDashList, &dashOffsetTmp);		}				if (axis == X_AXIS)		    len = abs(new_x2 - new_x1);		else		    len = abs(new_y2 - new_y1);#ifdef _POLYSEGMENT		if (clip2 != 0 || pGC->capStyle != CapNotLast)		    len++;#else		len += (clip2 != 0);#endif		if (len)		{		    /* unwind bresenham error term to first point */		    if (clip1)		    {			clipdx = abs(new_x1 - x1);			clipdy = abs(new_y1 - y1);			if (axis == X_AXIS)			    err = e+((clipdy*e2) + ((clipdx-clipdy)*e1));			else			    err = e+((clipdx*e2) + ((clipdy-clipdx)*e1));		    }		    else			err = e;		    pxBresD(sp, &pxp, gcPriv,		        &dashIndexTmp, pDash, numInDashList,			&dashOffsetTmp, isDoubleDash,			signdx, signdy, axis, new_x1, new_y1,			err, e1, e2, len);		}		pbox++;	    }	} /* while (nbox--) */#ifndef _POLYSEGMENT	/*	 * walk the dash list around to the next line	 */	miStepDash (unclippedlen, &dashIndex, pDash,		    numInDashList, &dashOffset);dontStep:	;#endif    } /* while (nline--) */#ifndef _POLYSEGMENT    /* paint the last point if the end style isn't CapNotLast.       (Assume that a projecting, butt, or round cap that is one        pixel wide is the same as the single pixel of the endpoint.)    */    if ((pGC->capStyle != CapNotLast) &&        ((dashIndex & 1) == 0 || isDoubleDash) &&	((ppt->x + xorg != pptInit->x + pDrawable->x) ||	 (ppt->y + yorg != pptInit->y + pDrawable->y) ||	 (ppt == pptInit + 1)))    {	nbox = nboxInit;	pbox = pboxInit;	while (nbox--)	{	    if ((x2 >= pbox->x1) &&		(y2 >= pbox->y1) &&		(x2 <  pbox->x2) &&		(y2 <  pbox->y2))	    {		if (dashIndex & 1)		    pxAddLineC(sp, &pxp, x1, y2, x1, y1, gcPriv->fgPixel);		else		    pxAddLineC(sp, &pxp, x2, y2, x2, y2, gcPriv->bgPixel);		break;	    }	    else		pbox++;	}    }#endif    pxPacketFlush(sp, &pxp);}