diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 16:49:22 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-14 16:49:22 +0000 |
commit | d568221710959cf7d783e6ff0fb80fb43a231124 (patch) | |
tree | 8d6f039393294c6ffac8533639afdebe5d68bfc1 /cfb/cfbpolypnt.c | |
parent | 9508a382f8a9f241dab097d921b6d290c1c3a776 (diff) |
XFree86 4.3.0.1
Diffstat (limited to 'cfb/cfbpolypnt.c')
-rw-r--r-- | cfb/cfbpolypnt.c | 62 |
1 files changed, 56 insertions, 6 deletions
diff --git a/cfb/cfbpolypnt.c b/cfb/cfbpolypnt.c index bf2217fb1..d8b781397 100644 --- a/cfb/cfbpolypnt.c +++ b/cfb/cfbpolypnt.c @@ -1,3 +1,4 @@ +/* $XFree86: xc/programs/Xserver/cfb/cfbpolypnt.c,v 3.6 2001/12/14 19:59:24 dawes Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -58,6 +59,10 @@ in this Software without prior written authorization from The Open Group. } \ } +#if PSZ == 24 +# include "cfbrrop24.h" +#endif + void cfbPolyPoint(pDrawable, pGC, mode, npt, pptInit) DrawablePtr pDrawable; @@ -68,24 +73,31 @@ cfbPolyPoint(pDrawable, pGC, mode, npt, pptInit) { register INT32 pt; register INT32 c1, c2; - register unsigned long ClipMask = 0x80008000; - register unsigned long xor; + register CARD32 ClipMask = 0x80008000; + register CfbBits xor; #ifdef PIXEL_ADDR register PixelType *addrp; register int npwidth; +#if PSZ != 24 PixelType *addrpt; +#endif #else - register unsigned long *addrl; + register CfbBits *addrl; register int nlwidth; register int xoffset; - unsigned long *addrlt; + CfbBits *addrlt; +#endif +#if PSZ == 24 + RROP_DECLARE + register int xtmp; + register PixelType *p; #endif register INT32 *ppt; RegionPtr cclip; int nbox; register int i; register BoxPtr pbox; - unsigned long and; + CfbBits and; int rop = pGC->alu; int off; cfbPrivGCPtr devPriv; @@ -95,7 +107,7 @@ cfbPolyPoint(pDrawable, pGC, mode, npt, pptInit) rop = devPriv->rop; if (rop == GXnoop) return; - cclip = devPriv->pCompositeClip; + cclip = pGC->pCompositeClip; xor = devPriv->xor; if ((mode == CoordModePrevious) && (npt > 1)) { @@ -109,13 +121,27 @@ cfbPolyPoint(pDrawable, pGC, mode, npt, pptInit) off -= (off & 0x8000) << 1; #ifdef PIXEL_ADDR cfbGetPixelWidthAndPointer(pDrawable, npwidth, addrp); +#if PSZ == 24 + addrp = addrp + pDrawable->y * npwidth; +#else addrp = addrp + pDrawable->y * npwidth + pDrawable->x; +#endif if (rop == GXcopy) { +#if PSZ == 24 + RROP_COPY_SETUP(xor) +#endif if (!(npwidth & (npwidth - 1))) { npwidth = ffs(npwidth) - 1; +#if PSZ == 24 + PointLoop( + xtmp = pDrawable->x + intToX(pt); + p = addrp + (intToY(pt) << npwidth) + ((xtmp * 3) >>2); + RROP_SOLID24_COPY(p, xtmp)) +#else PointLoop(*(addrp + (intToY(pt) << npwidth) + intToX(pt)) = xor;) +#endif } #ifdef sun else if (npwidth == 1152) @@ -126,25 +152,49 @@ cfbPolyPoint(pDrawable, pGC, mode, npt, pptInit) #endif else { +#if PSZ == 24 + PointLoop( + xtmp = pDrawable->x + intToX(pt); + p = addrp + intToY(pt) * npwidth + ((xtmp * 3) >> 2); + RROP_SOLID24_COPY(p, xtmp)) +#else PointLoop(*(addrp + intToY(pt) * npwidth + intToX(pt)) = xor;) +#endif } } else { and = devPriv->and; +#if PSZ == 24 + RROP_SET_SETUP(xor, and) + PointLoop( + xtmp = pDrawable->x + intToX(pt); + p = addrp + intToY(pt) * npwidth + ((xtmp * 3) >> 2); + RROP_SOLID24_SET(p, xtmp)) +#else PointLoop( addrpt = addrp + intToY(pt) * npwidth + intToX(pt); *addrpt = DoRRop (*addrpt, and, xor);) +#endif } #else /* !PIXEL_ADDR */ cfbGetLongWidthAndPointer(pDrawable, nlwidth, addrl); addrl = addrl + pDrawable->y * nlwidth + (pDrawable->x >> PWSH); xoffset = pDrawable->x & PIM; and = devPriv->and; +#if PSZ == 24 PointLoop( addrlt = addrl + intToY(pt) * nlwidth + ((intToX(pt) + xoffset) >> PWSH); *addrlt = DoRRop (*addrlt, and | ~cfbmask[(intToX(pt) + xoffset) & PIM], xor & cfbmask[(intToX(pt) + xoffset) & PIM]); ) +#else + PointLoop( addrlt = addrl + intToY(pt) * nlwidth + + ((intToX(pt) + xoffset) >> PWSH); + *addrlt = DoRRop (*addrlt, + and | ~cfbmask[((intToX(pt) + xoffset) & 3)<<1], + xor & cfbmask[((intToX(pt) + xoffset) & 3)<<1]); + ) +#endif #endif /* PIXEL_ADDR */ } |