(*XAAStippleScanlineFuncMSBFirst[funcNo])(dstPtr, (CARD32 *)srcPtr, 0, w, dwords);
StippleTab[funcNo](dstPtr, (CARD32 *)srcPtr, 0, w, dwords);
ApmCacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix){    APMDECL(pScrn);    int		w = pPix->drawable.width, W = (w + 31) & ~31;    int		h = pPix->drawable.height;    int		i, j, dwords, mem, width, funcNo;    FBAreaPtr	draw;    struct ApmStippleCacheRec	*pCache;    unsigned char	*srcPtr;    CARD32		*dstPtr;    for (i = 0; i < APM_CACHE_NUMBER; i++)	if ((pApm->apmCache[i].apmStippleCache.serialNumber == pPix->drawable.serialNumber)		&& pApm->apmCache[i].apmStippleCached &&		(pApm->apmCache[i].apmStippleCache.fg == -1) &&		(pApm->apmCache[i].apmStippleCache.bg == -1)) {	    pApm->apmCache[i].apmStippleCache.trans_color = -1;	    return &pApm->apmCache[i].apmStippleCache;	}    if ((i = ++pApm->apmCachePtr) >= APM_CACHE_NUMBER)	i = pApm->apmCachePtr = 0;    pCache = &pApm->apmCache[i];    if (pCache->apmStippleCached) {	pCache->apmStippleCached = FALSE;	xf86FreeOffscreenArea(pCache->area);    }    draw = xf86AllocateLinearOffscreenArea(pApm->pScreen, (W * h + 7) / 8,				    (pApm->CurrentLayout.mask32 + 1) << 1,				    ApmMoveStipple, ApmRemoveStipple, pCache);    if (!draw)	return NULL;	/* Let's hope this will never happen... */    pCache->area = draw;    pCache->apmStippleCache.serialNumber = pPix->drawable.serialNumber;    pCache->apmStippleCache.trans_color =	pCache->apmStippleCache.bg =	pCache->apmStippleCache.fg = -1;    pCache->apmStippleCache.orig_w = w;    pCache->apmStippleCache.orig_h = h;    pCache->apmStippleCache.x = draw->box.x1;    pCache->apmStippleCache.y = draw->box.y1 + ((pCache - pApm->apmCache) + 1) * pApm->CurrentLayout.Scanlines;    mem = ((draw->box.x2 - draw->box.x1) * (draw->box.y2 - draw->box.y1) *			pScrn->bitsPerPixel) / (W * h);    width = 2;    while (width * width <= mem)	width++;    width--;    pCache->apmStippleCache.w = (width * W + pScrn->bitsPerPixel - 1) /			pScrn->bitsPerPixel;    pCache->apmStippleCache.h = ((draw->box.x2 - draw->box.x1) *			(draw->box.y2 - draw->box.y1)) /			pCache->apmStippleCache.w;    pCache->apmStippleCached = TRUE;    if (w < 32) {	if (w & (w - 1))	funcNo = 1;	else			funcNo = 0;    } else			funcNo = 2;    dstPtr = ((CARD32 *)pApm->FbBase) + (draw->box.x1 +			draw->box.y1*pApm->CurrentLayout.bytesPerScanline) / 4;    j = 0;    dwords = (pCache->apmStippleCache.w * pScrn->bitsPerPixel) / 32;    while (j + h <= pCache->apmStippleCache.h) {	srcPtr = (unsigned char *)pPix->devPrivate.ptr;	for (i = h; --i >= 0; ) {	    (*XAAStippleScanlineFuncMSBFirst[funcNo])(dstPtr, (CARD32 *)srcPtr, 0, w, dwords);	    srcPtr += pPix->devKind;	    dstPtr += dwords;	}	j += h;    }    srcPtr = (unsigned char *)pPix->devPrivate.ptr;    for (i = pCache->apmStippleCache.h - j ; --i >= 0; ) {	(*XAAStippleScanlineFuncMSBFirst[funcNo])(dstPtr, (CARD32 *)srcPtr, 0, w, dwords);	srcPtr += pPix->devKind;	dstPtr += dwords;    }    return &pCache->apmStippleCache;}