diff options
Diffstat (limited to 'xc/programs/Xserver/cfb')
35 files changed, 525 insertions, 481 deletions
diff --git a/xc/programs/Xserver/cfb/cfb.h b/xc/programs/Xserver/cfb/cfb.h index 255b1f129..ac1bf6593 100644 --- a/xc/programs/Xserver/cfb/cfb.h +++ b/xc/programs/Xserver/cfb/cfb.h @@ -27,11 +27,12 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfb.h,v 3.20 1999/12/13 02:13:06 robin Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfb.h,v 3.23 2000/02/12 03:39:19 dawes Exp $ */ #if !defined(__CFB_H__) || defined(CFB_PROTOTYPES_ONLY) #include "X.h" +#include "globals.h" #include "pixmap.h" #include "region.h" #include "gc.h" @@ -44,6 +45,10 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "cfbmap.h" +#ifndef CfbBits +#define CfbBits CARD32 +#endif + #ifndef CFB_PROTOTYPES_ONLY #define __CFB_H__ /* @@ -62,7 +67,7 @@ typedef struct { unsigned char ropOpStip; /* rop for opaque stipple */ /* this value is ropFillArea in mfb, usurped for cfb */ unsigned char oneRect; /* drawable has one clip rect */ - unsigned long xor, and; /* reduced rop values */ + CfbBits xor, and; /* reduced rop values */ } cfbPrivGC; typedef cfbPrivGC *cfbPrivGCPtr; @@ -75,7 +80,7 @@ typedef cfbPrivGC *cfbPrivGCPtr; /* way to carry RROP info around */ typedef struct { unsigned char rop; - unsigned long xor, and; + CfbBits xor, and; } cfbRRopRec, *cfbRRopPtr; /* private field of window */ @@ -96,15 +101,15 @@ typedef struct { extern int cfbSetStipple( int /*alu*/, - unsigned long /*fg*/, - unsigned long /*planemask*/ + CfbBits /*fg*/, + CfbBits /*planemask*/ ); extern int cfbSetOpaqueStipple( int /*alu*/, - unsigned long /*fg*/, - unsigned long /*bg*/, - unsigned long /*planemask*/ + CfbBits /*fg*/, + CfbBits /*bg*/, + CfbBits /*planemask*/ ); extern int cfbComputeClipMasks32( @@ -426,9 +431,9 @@ extern void cfbDoBitbltXor( extern void cfbBresS( int /*rop*/, - unsigned long /*and*/, - unsigned long /*xor*/, - unsigned long * /*addrl*/, + CfbBits /*and*/, + CfbBits /*xor*/, + CfbBits * /*addrl*/, int /*nlwidth*/, int /*signdx*/, int /*signdy*/, @@ -449,7 +454,7 @@ extern void cfbBresD( int /*numInDashList*/, int * /*pdashOffset*/, int /*isDoubleDash*/, - unsigned long * /*addrl*/, + CfbBits * /*addrl*/, int /*nlwidth*/, int /*signdx*/, int /*signdy*/, @@ -665,11 +670,11 @@ extern void cfbPolyGlyphRop8( ); /* cfbhrzvert.c */ -extern int cfbHorzS( +extern void cfbHorzS( int /*rop*/, - unsigned long /*and*/, - unsigned long /*xor*/, - unsigned long * /*addrl*/, + CfbBits /*and*/, + CfbBits /*xor*/, + CfbBits * /*addrl*/, int /*nlwidth*/, int /*x1*/, int /*y1*/, @@ -678,9 +683,9 @@ extern int cfbHorzS( extern void cfbVertS( int /*rop*/, - unsigned long /*and*/, - unsigned long /*xor*/, - unsigned long * /*addrl*/, + CfbBits /*and*/, + CfbBits /*xor*/, + CfbBits * /*addrl*/, int /*nlwidth*/, int /*x1*/, int /*y1*/, @@ -866,10 +871,10 @@ extern void cfb8FillRectStippledUnnatural( extern int cfbReduceRasterOp( int /*rop*/, - unsigned long /*fg*/, - unsigned long /*pm*/, - unsigned long * /*andp*/, - unsigned long * /*xorp*/ + CfbBits /*fg*/, + CfbBits /*pm*/, + CfbBits * /*andp*/, + CfbBits * /*xorp*/ ); /* cfbscrinit.c */ @@ -933,7 +938,7 @@ extern void cfbSegmentSD( ); /* cfbsetsp.c */ -extern int cfbSetScanline( +extern void cfbSetScanline( int /*y*/, int /*xOrigin*/, int /*xStart*/, @@ -1239,7 +1244,7 @@ extern int cfbScreenPrivateIndex; #define cfbGetPixelWidth(pDrawable) cfbGetTypedWidth(pDrawable, PixelType) -#define cfbGetLongWidth(pDrawable) cfbGetTypedWidth(pDrawable, unsigned long) +#define cfbGetLongWidth(pDrawable) cfbGetTypedWidth(pDrawable, CfbBits) #define cfbGetTypedWidthAndPointer(pDrawable, width, pointer, wtype, ptype) {\ PixmapPtr _pPix; \ @@ -1255,7 +1260,7 @@ extern int cfbScreenPrivateIndex; cfbGetTypedWidthAndPointer(pDrawable, width, pointer, unsigned char, unsigned char) #define cfbGetLongWidthAndPointer(pDrawable, width, pointer) \ - cfbGetTypedWidthAndPointer(pDrawable, width, pointer, unsigned long, unsigned long) + cfbGetTypedWidthAndPointer(pDrawable, width, pointer, CfbBits, CfbBits) #define cfbGetPixelWidthAndPointer(pDrawable, width, pointer) \ cfbGetTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType) @@ -1267,7 +1272,7 @@ extern int cfbScreenPrivateIndex; } #define cfbGetWindowLongWidthAndPointer(pWin, width, pointer) \ - cfbGetWindowTypedWidthAndPointer(pWin, width, pointer, unsigned long, unsigned long) + cfbGetWindowTypedWidthAndPointer(pWin, width, pointer, CfbBits, CfbBits) #define cfbGetWindowByteWidthAndPointer(pWin, width, pointer) \ cfbGetWindowTypedWidthAndPointer(pWin, width, pointer, unsigned char, unsigned char) @@ -1275,6 +1280,18 @@ extern int cfbScreenPrivateIndex; #define cfbGetWindowPixelWidthAndPointer(pDrawable, width, pointer) \ cfbGetWindowTypedWidthAndPointer(pDrawable, width, pointer, PixelType, PixelType) +/* + * XFree86 empties the root BorderClip when the VT is inactive, + * here's a macro which uses that to disable GetImage and GetSpans + */ +#define cfbWindowEnabled(pWin) \ + REGION_NOTEMPTY((pWin)->drawable.pScreen, \ + &WindowTable[(pWin)->drawable.pScreen->myNum]->borderClip) + +#define cfbDrawableEnabled(pDrawable) \ + ((pDrawable)->type == DRAWABLE_PIXMAP ? \ + TRUE : cfbWindowEnabled((WindowPtr) pDrawable)) + /* Macros which handle a coordinate in a single register */ /* Most compilers will convert divide by 65536 into a shift, if signed diff --git a/xc/programs/Xserver/cfb/cfb8bit.c b/xc/programs/Xserver/cfb/cfb8bit.c index 6f01d1d73..1b96e36b5 100644 --- a/xc/programs/Xserver/cfb/cfb8bit.c +++ b/xc/programs/Xserver/cfb/cfb8bit.c @@ -22,6 +22,7 @@ other dealings in this Software without prior written authorization from The Open Group. */ +/* $XFree86: xc/programs/Xserver/cfb/cfb8bit.c,v 1.3 2000/02/12 05:43:17 dawes Exp $ */ /* * cfb8bit.c @@ -189,11 +190,11 @@ PixelGroup cfb8StippleAnd[NUM_MASKS], cfb8StippleXor[NUM_MASKS]; int cfb8SetStipple (alu, fg, planemask) int alu; -unsigned long fg, planemask; +CfbBits fg, planemask; { - unsigned long and, xor, rrop; + CfbBits and, xor, rrop; int s; - unsigned long c; + CfbBits c; cfb8StippleMode = FillStippled; cfb8StippleAlu = alu; @@ -218,11 +219,11 @@ unsigned long fg, planemask; int cfb8SetOpaqueStipple (alu, fg, bg, planemask) int alu; -unsigned long fg, bg, planemask; +CfbBits fg, bg, planemask; { - unsigned long andfg, xorfg, andbg, xorbg, rropfg, rropbg; + CfbBits andfg, xorfg, andbg, xorbg, rropfg, rropbg; int s; - unsigned long c; + CfbBits c; cfb8StippleMode = FillOpaqueStippled; cfb8StippleAlu = alu; @@ -367,7 +368,7 @@ cfb8ComputeClipMasks32 (pBox, numRects, x, y, w, h, clips) { int yBand, yBandBot; int ch; - unsigned long clip; + CfbBits clip; int partIN = FALSE, partOUT = FALSE; int result; diff --git a/xc/programs/Xserver/cfb/cfb8bit.h b/xc/programs/Xserver/cfb/cfb8bit.h index a6ee778d8..8f60b92e8 100644 --- a/xc/programs/Xserver/cfb/cfb8bit.h +++ b/xc/programs/Xserver/cfb/cfb8bit.h @@ -7,7 +7,7 @@ * are used for depths other than 8. Perhaps the file should be * renamed. dpw */ -/* $XFree86: xc/programs/Xserver/cfb/cfb8bit.h,v 3.3 1998/10/04 09:37:34 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfb8bit.h,v 3.4 2000/02/12 03:39:20 dawes Exp $ */ /* @@ -1545,17 +1545,17 @@ extern PixelGroup cfb8BitLenMasks[PGSZ]; extern int cfb8SetStipple ( #if NeedFunctionPrototypes int /*alu*/, - unsigned long /*fg*/, - unsigned long /*planemask*/ + CfbBits /*fg*/, + CfbBits /*planemask*/ #endif ); extern int cfb8SetOpaqueStipple ( #if NeedFunctionPrototypes int /*alu*/, - unsigned long /*fg*/, - unsigned long /*bg*/, - unsigned long /*planemask*/ + CfbBits /*fg*/, + CfbBits /*bg*/, + CfbBits /*planemask*/ #endif ); diff --git a/xc/programs/Xserver/cfb/cfb8line.c b/xc/programs/Xserver/cfb/cfb8line.c index a9a866f19..c3a205e8e 100644 --- a/xc/programs/Xserver/cfb/cfb8line.c +++ b/xc/programs/Xserver/cfb/cfb8line.c @@ -21,7 +21,7 @@ in this Software without prior written authorization from The Open Group. * * Author: Keith Packard, MIT X Consortium * - * $XFree86: xc/programs/Xserver/cfb/cfb8line.c,v 3.10 1999/03/28 15:32:11 dawes Exp $ + * $XFree86: xc/programs/Xserver/cfb/cfb8line.c,v 3.11 2000/02/12 03:39:20 dawes Exp $ * Jeff Anton'x fixes: cfb8line.c 97/02/07 */ @@ -144,8 +144,8 @@ in this Software without prior written authorization from The Open Group. #if RROP == GXcopy #define body_rop \ - addrp = (PixelType *)((unsigned long)addrb & ~0x03); \ - switch((unsigned long)addrb & 3){ \ + addrp = (PixelType *)((CfbBits)addrb & ~0x03); \ + switch((CfbBits)addrb & 3){ \ case 0: \ *addrp = (*addrp & 0xFF000000)|(piQxelXor[0] & 0xFFFFFF); \ break; \ @@ -164,8 +164,8 @@ in this Software without prior written authorization from The Open Group. #endif #if RROP == GXxor #define body_rop \ - addrp = (PixelType *)((unsigned long)addrb & ~0x03); \ - switch((unsigned long)addrb & 3){ \ + addrp = (PixelType *)((CfbBits)addrb & ~0x03); \ + switch((CfbBits)addrb & 3){ \ case 0: \ *addrp ^= piQxelXor[0] & 0xFFFFFF; \ break; \ @@ -184,8 +184,8 @@ in this Software without prior written authorization from The Open Group. #endif #if RROP == GXand #define body_rop \ - addrp = (PixelType *)((unsigned long)addrb & ~0x03); \ - switch((unsigned long)addrb & 3){ \ + addrp = (PixelType *)((CfbBits)addrb & ~0x03); \ + switch((CfbBits)addrb & 3){ \ case 0: \ *addrp &= piQxelAnd[0] | 0xFF000000; \ break; \ @@ -204,8 +204,8 @@ in this Software without prior written authorization from The Open Group. #endif #if RROP == GXor #define body_rop \ - addrp = (PixelType *)((unsigned long)addrb & ~0x03); \ - switch((unsigned long)addrb & 3){ \ + addrp = (PixelType *)((CfbBits)addrb & ~0x03); \ + switch((CfbBits)addrb & 3){ \ case 0: \ *addrp |= piQxelOr[0] & 0xFFFFFF; \ break; \ @@ -224,8 +224,8 @@ in this Software without prior written authorization from The Open Group. #endif #if RROP == GXset #define body_rop \ - addrp = (PixelType *)((unsigned long)addrb & ~0x03); \ - switch((unsigned long)addrb & 3){ \ + addrp = (PixelType *)((CfbBits)addrb & ~0x03); \ + switch((CfbBits)addrb & 3){ \ case 0: \ *addrp = (*addrp & (piQxelAnd[0]|0xFF000000)) \ ^ (piQxelXor[0] & 0xFFFFFF); \ @@ -394,7 +394,7 @@ FUNC_NAME(cfb8LineSS1Rect) (pDrawable, pGC, mode, npt, pptInit, pptInitOrig, addrLineEnd = addr + WIDTH_MUL(_y1, nwidth); xOffset = xBase + _x1; addrb = (char *)addrLineEnd + xOffset * 3; - addrp = (PixelType *)((unsigned long)addrb & ~0x03); + addrp = (PixelType *)((CfbBits)addrb & ~0x03); #else addrp = addr + WIDTH_MUL(_y1, nwidth) + _x1; #endif @@ -420,7 +420,7 @@ FUNC_NAME(cfb8LineSS1Rect) (pDrawable, pGC, mode, npt, pptInit, pptInitOrig, addrLineEnd = addr + WIDTH_MUL(Y2, nwidth); xOffset = xBase + X2; addrb = (char *)addrLineEnd + xOffset * 3; - addrp = (PixelType *)((unsigned long)addrb & ~0x03); + addrp = (PixelType *)((CfbBits)addrb & ~0x03); #else addrp = addr + WIDTH_MUL(Y2, nwidth) + X2; #endif @@ -441,7 +441,7 @@ FUNC_NAME(cfb8LineSS1Rect) (pDrawable, pGC, mode, npt, pptInit, pptInitOrig, addrLineEnd = addr + WIDTH_MUL(y1_or_e1, nwidth); xOffset = xBase + x1_or_len; addrb = (char *)addrLineEnd + xOffset * 3; - addrp = (PixelType *)((unsigned long)addrb & ~0x03); + addrp = (PixelType *)((CfbBits)addrb & ~0x03); #else addrp = addr + WIDTH_MUL(y1_or_e1, nwidth) + x1_or_len; #endif @@ -547,10 +547,10 @@ FUNC_NAME(cfb8LineSS1Rect) (pDrawable, pGC, mode, npt, pptInit, pptInitOrig, #if PSZ == 24 if (stepmajor == 1 || stepmajor == -1){ stepmajor3 = stepmajor * 3; - stepminor3 = stepminor * sizeof (long); + stepminor3 = stepminor * sizeof (CfbBits); majordx = stepmajor; minordx = 0; } else { - stepmajor3 = stepmajor * sizeof (long); + stepmajor3 = stepmajor * sizeof (CfbBits); stepminor3 = stepminor * 3; majordx = 0; minordx = stepminor; } @@ -641,7 +641,7 @@ FUNC_NAME(cfb8LineSS1Rect) (pDrawable, pGC, mode, npt, pptInit, pptInitOrig, #endif #endif #if PSZ == 24 - addrp = (PixelType *)((unsigned long)addrb & ~0x03); + addrp = (PixelType *)((CfbBits)addrb & ~0x03); #endif } #undef body @@ -894,9 +894,9 @@ FUNC_NAME(cfb8LineSS1Rect) (pDrawable, pGC, mode, npt, pptInit, pptInitOrig, { maskpartialbits(y1_or_e1, x1_or_len, e) #ifdef __sparc__ - RROP_SOLID_MASK_lu((unsigned long *) addrp, e); + RROP_SOLID_MASK_lu((CfbBits *) addrp, e); #else - RROP_SOLID_MASK((unsigned long *) addrp, e); + RROP_SOLID_MASK((CfbBits *) addrp, e); #endif } } @@ -905,7 +905,7 @@ FUNC_NAME(cfb8LineSS1Rect) (pDrawable, pGC, mode, npt, pptInit, pptInitOrig, maskbits(y1_or_e1, x1_or_len, e, e3, x1_or_len) if (e) { - RROP_SOLID_MASK((unsigned long *) addrp, e); + RROP_SOLID_MASK((CfbBits *) addrp, e); addrp += PPW; } #ifdef __sparc__ @@ -915,9 +915,9 @@ FUNC_NAME(cfb8LineSS1Rect) (pDrawable, pGC, mode, npt, pptInit, pptInitOrig, #endif if (e3) #ifdef __sparc__ - RROP_SOLID_MASK_lu((unsigned long *) addrp, e3); + RROP_SOLID_MASK_lu((CfbBits *) addrp, e3); #else - RROP_SOLID_MASK((unsigned long *) addrp, e3); + RROP_SOLID_MASK((CfbBits *) addrp, e3); #endif } #endif /* PSZ == 24 */ @@ -1088,8 +1088,8 @@ cfb8SegmentSS1Rect (pDrawable, pGC, nseg, pSegInit) int nseg; xSegment *pSegInit; { - int (*func)(); - void (*clip)(); + int (*func)(DrawablePtr, GCPtr, int, xSegment *); + void (*clip)(DrawablePtr, GCPtr, int, int, int, int, BoxPtr, Bool); int drawn; cfbPrivGCPtr devPriv; @@ -1152,8 +1152,10 @@ cfb8LineSS1Rect (pDrawable, pGC, mode, npt, pptInit) int npt; DDXPointPtr pptInit; { - int (*func)(); - void (*clip)(); + int (*func)(DrawablePtr, GCPtr, int, int, + DDXPointPtr, DDXPointPtr, + int *, int *, int *, int *); + void (*clip)(DrawablePtr, GCPtr, int, int, int, int, BoxPtr, Bool); int drawn; cfbPrivGCPtr devPriv; int x1, y1, x2, y2; @@ -1377,9 +1379,9 @@ RROP_NAME (cfb8ClippedLine) (pDrawable, pGC, x1, y1, x2, y2, boxp, shorten) addrb = (char *)addrLineEnd + x1 * 3; if (stepx == 1 || stepx == -1){ stepx3 = stepx * 3; - stepy3 = stepy * sizeof (long); + stepy3 = stepy * sizeof (CfbBits); } else { - stepx3 = stepx * sizeof (long); + stepx3 = stepx * sizeof (CfbBits); stepy3 = stepy * 3; } #else diff --git a/xc/programs/Xserver/cfb/cfbbitblt.c b/xc/programs/Xserver/cfb/cfbbitblt.c index 448536f7d..d52efb763 100644 --- a/xc/programs/Xserver/cfb/cfbbitblt.c +++ b/xc/programs/Xserver/cfb/cfbbitblt.c @@ -2,7 +2,7 @@ * cfb copy area */ -/* $XFree86: xc/programs/Xserver/cfb/cfbbitblt.c,v 1.7 1999/10/13 04:20:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbbitblt.c,v 1.10 2000/02/12 03:39:21 dawes Exp $ */ /* @@ -128,7 +128,13 @@ cfbBitBlt (pSrcDrawable, pDstDrawable, { if (pGC->subWindowMode == IncludeInferiors) { - if (!((WindowPtr) pSrcDrawable)->parent) + /* + * XFree86 DDX empties the border clip when the + * VT is inactive + */ + if (!((WindowPtr) pSrcDrawable)->parent && + REGION_NOTEMPTY (pSrcDrawable->pScreen, + &((WindowPtr) pSrcDrawable)->borderClip)) { /* * special case bitblt from root window in @@ -394,22 +400,22 @@ cfbCopyPlane1to8 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask, b int width, height; /* in pixels, unpadded, of box being copied */ int xoffSrc; /* bit # in leftmost word of row from which copying starts */ int xoffDst; /* byte # in leftmost word of row from which copying starts */ - unsigned long *psrcBase, *pdstBase; /* start of drawable's pixel data */ + CfbBits *psrcBase, *pdstBase; /* start of drawable's pixel data */ int widthSrc; /* # of groups of 32 pixels (1 bit/pixel) in src bitmap*/ int widthDst; /* # of groups of 4 pixels (8 bits/pixel) in dst */ - unsigned long *psrcLine, *pdstLine; /* steps a row at a time thru src/dst; + CfbBits *psrcLine, *pdstLine; /* steps a row at a time thru src/dst; * may point into middle of row */ - register unsigned long *psrc, *pdst; /* steps within the row */ - register unsigned long bits, tmp; /* bits from source */ + register CfbBits *psrc, *pdst; /* steps within the row */ + register CfbBits bits, tmp; /* bits from source */ register int leftShift; register int rightShift; - unsigned long startmask; /* left edge pixel mask */ - unsigned long endmask; /* right edge pixel mask */ + CfbBits startmask; /* left edge pixel mask */ + CfbBits endmask; /* right edge pixel mask */ register int nlMiddle; /* number of words in middle of the row to draw */ register int nl; int firstoff; int secondoff; - unsigned long src; + CfbBits src; int nbox; /* number of boxes in region to copy */ BoxPtr pbox; /* steps thru boxes in region */ int pixelsRemainingOnRightEdge; /* # pixels to be drawn on a row after @@ -547,11 +553,11 @@ cfbCopyPlane1to8 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask, b # define FirstStep(c) c = BitLeft (c, 8); #else /* 0x3c is 0xf << 2 (4 bits, long word) */ -# define StoreBits(o,c) StorePixels(pdst,o,*((unsigned long *)\ +# define StoreBits(o,c) StorePixels(pdst,o,*((CfbBits *)\ (((char *) cfb8Pixels) + (c & 0x3c)))) # define StoreRopBits(o,c) StoreRopPixels(pdst,o, \ - *((unsigned long *) (((char *) cfb8StippleAnd) + (c & 0x3c))), \ - *((unsigned long *) (((char *) cfb8StippleXor) + (c & 0x3c)))) + *((CfbBits *) (((char *) cfb8StippleAnd) + (c & 0x3c))), \ + *((CfbBits *) (((char *) cfb8StippleXor) + (c & 0x3c)))) # define FirstStep(c) c = BitLeft (c, 2); #endif /* PGSZ */ #endif /* BITMAP_BIT_ORDER */ @@ -732,7 +738,7 @@ cfbCopyPlane1to32 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, int srcx, srcy, dstx, dsty; int width, height; int xoffSrc; - unsigned long *psrcBase, *pdstBase; + CfbBits *psrcBase, *pdstBase; int widthSrc, widthDst; unsigned int *psrcLine; register unsigned int *psrc; @@ -787,8 +793,8 @@ cfbCopyPlane1to32 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, /* must explicitly ask for "int" widths, as code below expects it */ /* on some machines (Alpha), "long" and "int" are not the same size */ - cfbGetTypedWidthAndPointer (pSrcDrawable, widthSrc, psrcBase, int, unsigned long) - cfbGetTypedWidthAndPointer (pDstDrawable, widthDst, pdstBase, int, unsigned long) + cfbGetTypedWidthAndPointer (pSrcDrawable, widthSrc, psrcBase, int, CfbBits) + cfbGetTypedWidthAndPointer (pDstDrawable, widthDst, pdstBase, int, CfbBits) #if PSZ == 16 widthDst <<= 1; @@ -1066,6 +1072,8 @@ RegionPtr cfbCopyPlane(pSrcDrawable, pDstDrawable, extern RegionPtr miHandleExposures(); void (*doBitBlt)(); +#if IMAGE_BYTE_ORDER == LSBFirst + if (pSrcDrawable->bitsPerPixel == 1 && pDstDrawable->bitsPerPixel == PSZ) { if (bitPlane == 1) @@ -1145,6 +1153,7 @@ RegionPtr cfbCopyPlane(pSrcDrawable, pDstDrawable, dstx, dsty, bitPlane); } else +#endif ret = miCopyPlane (pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, bitPlane); return ret; diff --git a/xc/programs/Xserver/cfb/cfbblt.c b/xc/programs/Xserver/cfb/cfbblt.c index 3e0cc4b8f..6987c7fc6 100644 --- a/xc/programs/Xserver/cfb/cfbblt.c +++ b/xc/programs/Xserver/cfb/cfbblt.c @@ -1,7 +1,7 @@ /* * cfb copy area */ -/* $XFree86: xc/programs/Xserver/cfb/cfbblt.c,v 3.8 1999/12/13 02:13:07 robin Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbblt.c,v 3.9 2000/02/12 03:39:22 dawes Exp $ */ /* @@ -121,7 +121,7 @@ MROP_NAME(cfbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc, planemask) DDXPointPtr pptSrc; unsigned long planemask; { - unsigned long *psrcBase, *pdstBase; + CfbBits *psrcBase, *pdstBase; /* start of src and dst bitmaps */ int widthSrc, widthDst; /* add to get to same position in next line */ @@ -137,20 +137,20 @@ MROP_NAME(cfbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc, planemask) int xdir; /* 1 = left right, -1 = right left/ */ int ydir; /* 1 = top down, -1 = bottom up */ - unsigned long *psrcLine, *pdstLine; + CfbBits *psrcLine, *pdstLine; /* pointers to line with current src and dst */ - register unsigned long *psrc;/* pointer to current src longword */ - register unsigned long *pdst;/* pointer to current dst longword */ + register CfbBits *psrc;/* pointer to current src longword */ + register CfbBits *pdst;/* pointer to current dst longword */ MROP_DECLARE_REG() /* following used for looping through a line */ - unsigned long startmask, endmask; /* masks for writing ends of dst */ + CfbBits startmask, endmask; /* masks for writing ends of dst */ int nlMiddle; /* whole longwords in dst */ int xoffSrc, xoffDst, xoffEnd; register int leftShift, rightShift; - register unsigned long bits; - register unsigned long bits1; + register CfbBits bits; + register CfbBits bits1; register int nl; /* temp copy of nlMiddle */ /* place to store full source word */ @@ -416,7 +416,7 @@ MROP_NAME(cfbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc, planemask) #endif #ifdef DO_UNALIGNED_BITBLT nl = xoffSrc - xoffDst; - psrcLine = (unsigned long *) + psrcLine = (CfbBits *) (((unsigned char *) psrcLine) + nl); #else #if PSZ == 24 && MROP == 0 @@ -702,7 +702,7 @@ pdst++; #else nl = xoffSrc - xoffDst; #endif - psrcLine = (unsigned long *) + psrcLine = (CfbBits *) (((unsigned char *) psrcLine) + nl); #else #if PSZ == 24 && MROP == 0 diff --git a/xc/programs/Xserver/cfb/cfbbres.c b/xc/programs/Xserver/cfb/cfbbres.c index dc24de690..0da47ac3e 100644 --- a/xc/programs/Xserver/cfb/cfbbres.c +++ b/xc/programs/Xserver/cfb/cfbbres.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbbres.c,v 3.2 1998/10/04 09:37:37 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbbres.c,v 3.3 2000/02/12 03:39:22 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -58,8 +58,8 @@ void cfbBresS(rop, and, xor, addrl, nlwidth, signdx, signdy, axis, x1, y1, e, e1, e2, len) int rop; - unsigned long and, xor; - unsigned long *addrl; /* pointer to base of bitmap */ + CfbBits and, xor; + CfbBits *addrl; /* pointer to base of bitmap */ int nlwidth; /* width in longwords of bitmap */ register int signdx; int signdy; /* signs of directions */ @@ -72,7 +72,7 @@ cfbBresS(rop, and, xor, addrl, nlwidth, signdx, signdy, axis, x1, y1, e, e1, { register int e3 = e2-e1; #if PSZ == 24 - unsigned long piQxelXor[3],piQxelAnd[3]; + CfbBits piQxelXor[3],piQxelAnd[3]; char *addrb; int nlwidth3, signdx3; #endif @@ -100,7 +100,7 @@ cfbBresS(rop, and, xor, addrl, nlwidth, signdx, signdy, axis, x1, y1, e, e1, nlwidth = -nlwidth; e = e-e1; /* to make looping easier */ #if PSZ == 24 - nlwidth3 = nlwidth * sizeof (long); + nlwidth3 = nlwidth * sizeof (CfbBits); signdx3 = signdx * 3; #endif @@ -226,8 +226,8 @@ cfbBresS(rop, and, xor, addrl, nlwidth, signdx, signdy, axis, x1, y1, e, e1, } } #else /* !PIXEL_ADDR */ - register unsigned long tmp, bit; - unsigned long leftbit, rightbit; + register CfbBits tmp, bit; + CfbBits leftbit, rightbit; /* point to longword containing first point */ #if PSZ == 24 diff --git a/xc/programs/Xserver/cfb/cfbbresd.c b/xc/programs/Xserver/cfb/cfbbresd.c index 0046a93b7..92792d5f2 100644 --- a/xc/programs/Xserver/cfb/cfbbresd.c +++ b/xc/programs/Xserver/cfb/cfbbresd.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbbresd.c,v 3.2 1998/10/04 09:37:37 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbbresd.c,v 3.3 2000/02/12 03:39:23 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -61,7 +61,7 @@ cfbBresD(rrops, int numInDashList; /* total length of dash list */ int *pdashOffset; /* offset into current dash */ int isDoubleDash; - unsigned long *addrl; /* pointer to base of bitmap */ + CfbBits *addrl; /* pointer to base of bitmap */ int nlwidth; /* width in longwords of bitmap */ int signdx, signdy; /* signs of directions */ int axis; /* major axis (Y_AXIS or X_AXIS) */ @@ -78,11 +78,11 @@ cfbBresD(rrops, int dashIndex; int dashOffset; int dashRemaining; - unsigned long xorFg, andFg, xorBg, andBg; + CfbBits xorFg, andFg, xorBg, andBg; Bool isCopy; int thisDash; #if PSZ == 24 - unsigned long xorPiQxlFg[3], andPiQxlFg[3], xorPiQxlBg[3], andPiQxlBg[3]; + CfbBits xorPiQxlFg[3], andPiQxlFg[3], xorPiQxlBg[3], andPiQxlBg[3]; char *addrb; int signdx3, signdy3; #endif @@ -159,7 +159,7 @@ cfbBresD(rrops, signdy *= nlwidth; #if PSZ == 24 signdx3 = signdx * 3; - signdy3 = signdy * sizeof (long); + signdy3 = signdy * sizeof (CfbBits); #endif if (axis == Y_AXIS) { @@ -179,8 +179,8 @@ cfbBresD(rrops, { #if PSZ == 24 #define body_copy(pix) { \ - addrp = (PixelType *)((unsigned long)addrb & ~0x03); \ - switch((unsigned long)addrb & 3){ \ + addrp = (PixelType *)((CfbBits)addrb & ~0x03); \ + switch((CfbBits)addrb & 3){ \ case 0: \ *addrp = (*addrp & 0xFF000000)|((pix)[0] & 0xFFFFFF); \ break; \ @@ -228,8 +228,8 @@ cfbBresD(rrops, else { #define body_set(and, xor) { \ - addrp = (PixelType *)((unsigned long)addrb & ~0x03); \ - switch((unsigned long)addrb & 3){ \ + addrp = (PixelType *)((CfbBits)addrb & ~0x03); \ + switch((CfbBits)addrb & 3){ \ case 0: \ *addrp = (*addrp & ((and)[0]|0xFF000000)) ^ ((xor)[0] & 0xFFFFFF); \ break; \ @@ -275,8 +275,8 @@ cfbBresD(rrops, } #else /* !PIXEL_ADDR */ { - register unsigned long tmp; - unsigned long startbit, bit; + register CfbBits tmp; + CfbBits startbit, bit; /* point to longword containing first point */ #if PSZ == 24 diff --git a/xc/programs/Xserver/cfb/cfbcmap.c b/xc/programs/Xserver/cfb/cfbcmap.c index c9a19af5a..65a65ad66 100644 --- a/xc/programs/Xserver/cfb/cfbcmap.c +++ b/xc/programs/Xserver/cfb/cfbcmap.c @@ -27,7 +27,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbcmap.c,v 3.11 1999/04/11 13:10:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbcmap.c,v 3.12 2000/02/12 03:39:23 dawes Exp $ */ #include "X.h" @@ -36,71 +36,62 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "colormapst.h" #include "resource.h" #include "micmap.h" +#include "cfb.h" int -cfbListInstalledColormaps(pScreen, pmaps) - ScreenPtr pScreen; - Colormap *pmaps; +cfbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps) { return miListInstalledColormaps(pScreen, pmaps); } void -cfbInstallColormap(pmap) - ColormapPtr pmap; +cfbInstallColormap(ColormapPtr pmap) { miInstallColormap(pmap); } void -cfbUninstallColormap(pmap) - ColormapPtr pmap; +cfbUninstallColormap(ColormapPtr pmap) { miUninstallColormap(pmap); } void -cfbResolveColor(pred, pgreen, pblue, pVisual) - unsigned short *pred, *pgreen, *pblue; - register VisualPtr pVisual; +cfbResolveColor(unsigned short *pred, + unsigned short *pgreen, + unsigned short *pblue, + VisualPtr pVisual) { miResolveColor(pred, pgreen, pblue, pVisual); } Bool -cfbInitializeColormap(pmap) - register ColormapPtr pmap; +cfbInitializeColormap(ColormapPtr pmap) { return miInitializeColormap(pmap); } int -cfbExpandDirectColors (pmap, ndef, indefs, outdefs) - ColormapPtr pmap; - int ndef; - xColorItem *indefs, *outdefs; +cfbExpandDirectColors (ColormapPtr pmap, int ndef, + xColorItem *indefs, xColorItem *outdefs) { return miExpandDirectColors(pmap, ndef, indefs, outdefs); } Bool -cfbCreateDefColormap(pScreen) - ScreenPtr pScreen; +cfbCreateDefColormap(ScreenPtr pScreen) { return miCreateDefColormap(pScreen); } void -cfbClearVisualTypes() +cfbClearVisualTypes(void) { miClearVisualTypes(); } Bool -cfbSetVisualTypes (depth, visuals, bitsPerRGB) - int depth; - int visuals; - int bitsPerRGB; +cfbSetVisualTypes (int depth, int visuals, int bitsPerRGB) { return miSetVisualTypes(depth, visuals, bitsPerRGB, -1); } @@ -112,14 +103,14 @@ cfbSetVisualTypes (depth, visuals, bitsPerRGB) */ Bool -cfbInitVisuals (visualp, depthp, nvisualp, ndepthp, rootDepthp, defaultVisp, sizes, bitsPerRGB) - VisualPtr *visualp; - DepthPtr *depthp; - int *nvisualp, *ndepthp; - int *rootDepthp; - VisualID *defaultVisp; - unsigned long sizes; - int bitsPerRGB; +cfbInitVisuals (VisualPtr *visualp, + DepthPtr *depthp, + int *nvisualp, + int *ndepthp, + int *rootDepthp, + VisualID *defaultVisp, + unsigned long sizes, + int bitsPerRGB) { return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp, defaultVisp, sizes, bitsPerRGB, -1); diff --git a/xc/programs/Xserver/cfb/cfbcppl.c b/xc/programs/Xserver/cfb/cfbcppl.c index f0df8583e..29bc3cb63 100644 --- a/xc/programs/Xserver/cfb/cfbcppl.c +++ b/xc/programs/Xserver/cfb/cfbcppl.c @@ -21,7 +21,7 @@ in this Software without prior written authorization from The Open Group. * * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/cfb/cfbcppl.c,v 1.2 1999/09/04 09:14:13 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbcppl.c,v 1.4 2000/02/12 03:39:23 dawes Exp $ */ #include "X.h" #include "Xmd.h" @@ -56,6 +56,10 @@ cfbCopyImagePlane (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask) cfbCopyPlane16to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, (unsigned long) ~0L, planemask); #endif +#if PSZ == 24 + cfbCopyPlane24to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, + (unsigned long) ~0L, planemask); +#endif #if PSZ == 32 cfbCopyPlane32to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, (unsigned long) ~0L, planemask); @@ -101,7 +105,7 @@ cfbCopyPlane8to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask, b register int i; register int curBit; register int bitPos; - register unsigned long bits; + register CfbBits bits; register PixelType *pdst; PixelType startmask, endmask; int niStart, niEnd; @@ -303,8 +307,8 @@ cfbCopyPlane32to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, unsigned long bitPlane; { int srcx, srcy, dstx, dsty, width, height; - unsigned long *psrcBase; - unsigned long *pdstBase; + CfbBits *psrcBase; + CfbBits *pdstBase; int widthSrc, widthDst; #if PSZ == 16 unsigned short *psrcLine; @@ -341,8 +345,8 @@ cfbCopyPlane32to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, /* must explicitly ask for "int" widths, as code below expects it */ /* on some machines (Alpha), "long" and "int" are not the same size */ - cfbGetTypedWidthAndPointer (pSrcDrawable, widthSrc, psrcBase, int, unsigned long) - cfbGetTypedWidthAndPointer (pDstDrawable, widthDst, pdstBase, int, unsigned long) + cfbGetTypedWidthAndPointer (pSrcDrawable, widthSrc, psrcBase, int, CfbBits) + cfbGetTypedWidthAndPointer (pDstDrawable, widthDst, pdstBase, int, CfbBits) #if PSZ == 16 widthSrc <<= 1; diff --git a/xc/programs/Xserver/cfb/cfbfillarc.c b/xc/programs/Xserver/cfb/cfbfillarc.c index d51498681..246c3967d 100644 --- a/xc/programs/Xserver/cfb/cfbfillarc.c +++ b/xc/programs/Xserver/cfb/cfbfillarc.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbfillarc.c,v 3.2 1998/10/04 09:37:39 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbfillarc.c,v 3.3 2000/02/12 03:39:24 dawes Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -54,15 +54,15 @@ RROP_NAME(cfbFillEllipseSolid) (pDraw, pGC, arc) #if PSZ == 24 unsigned char *addrlt, *addrlb; #else - unsigned long *addrlt, *addrlb; + CfbBits *addrlt, *addrlb; #endif - register unsigned long *addrl; + register CfbBits *addrl; register int n; int nlwidth; RROP_DECLARE register int xpos; register int slw; - unsigned long startmask, endmask; + CfbBits startmask, endmask; int nlmiddle; #if PSZ == 24 register int pidx; @@ -93,11 +93,11 @@ RROP_NAME(cfbFillEllipseSolid) (pDraw, pGC, arc) xpos = xorg - x; #if PSZ == 24 xpos3 = (xpos * 3) & ~0x03; - addrl = (unsigned long *)((char *)addrlt + xpos3); + addrl = (CfbBits *)((char *)addrlt + xpos3); if (slw == 1){ RROP_SOLID24(addrl, xpos); if (miFillArcLower(slw)){ - addrl = (unsigned long *)((char *)addrlb + xpos3); + addrl = (CfbBits *)((char *)addrlb + xpos3); RROP_SOLID24(addrl, xpos); } continue; @@ -122,7 +122,7 @@ RROP_NAME(cfbFillEllipseSolid) (pDraw, pGC, arc) RROP_SOLID_MASK(addrl, endmask, pidx); if (!miFillArcLower(slw)) continue; - addrl = (unsigned long *)((char *)addrlb + xpos3); + addrl = (CfbBits *)((char *)addrlb + xpos3); pidx = xpos; if (startmask){ RROP_SOLID_MASK(addrl, startmask, pidx-1); @@ -183,7 +183,7 @@ RROP_NAME(cfbFillEllipseSolid) (pDraw, pGC, arc) #define FILLSPAN(xl,xr,addr) \ if (xr >= xl){ \ n = xr - xl + 1; \ - addrl = (unsigned long *)((char *)addr + ((xl * 3) & ~0x03)); \ + addrl = (CfbBits *)((char *)addr + ((xl * 3) & ~0x03)); \ if (n <= 1){ \ if (n) \ RROP_SOLID24(addrl, xl); \ @@ -263,13 +263,13 @@ RROP_NAME(cfbFillArcSliceSolid)(pDraw, pGC, arc) #if PSZ == 24 unsigned char *addrlt, *addrlb; #else - unsigned long *addrlt, *addrlb; + CfbBits *addrlt, *addrlb; #endif - register unsigned long *addrl; + register CfbBits *addrl; register int n; int nlwidth; RROP_DECLARE - unsigned long startmask, endmask; + CfbBits startmask, endmask; #if PSZ == 24 register int pidx; #endif /* PSZ == 24 */ diff --git a/xc/programs/Xserver/cfb/cfbfillrct.c b/xc/programs/Xserver/cfb/cfbfillrct.c index 7ba885aaf..8154a3852 100644 --- a/xc/programs/Xserver/cfb/cfbfillrct.c +++ b/xc/programs/Xserver/cfb/cfbfillrct.c @@ -1,7 +1,7 @@ /* * Fill rectangles. */ -/* $XFree86: xc/programs/Xserver/cfb/cfbfillrct.c,v 3.5 1999/03/14 03:21:31 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbfillrct.c,v 3.6 2000/02/12 03:39:24 dawes Exp $ */ /* @@ -66,7 +66,7 @@ cfbFillRectTileOdd (pDrawable, pGC, nBox, pBox) BoxPtr pBox; { int xrot, yrot; - void (*fill)(); + void (*fill)(DrawablePtr, int, BoxPtr, PixmapPtr, int, int, int, unsigned long); xrot = pDrawable->x + pGC->patOrg.x; yrot = pDrawable->y + pGC->patOrg.y; @@ -113,7 +113,7 @@ cfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit) BoxRec stackRects[NUM_STACK_RECTS]; cfbPrivGC *priv; int numRects; - void (*BoxFill)(); + void (*BoxFill)(DrawablePtr, GCPtr, int, BoxPtr); int n; int xorg, yorg; diff --git a/xc/programs/Xserver/cfb/cfbfillsp.c b/xc/programs/Xserver/cfb/cfbfillsp.c index d295d4f9c..4d2b6542f 100644 --- a/xc/programs/Xserver/cfb/cfbfillsp.c +++ b/xc/programs/Xserver/cfb/cfbfillsp.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbfillsp.c,v 3.3 1998/10/04 09:37:40 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbfillsp.c,v 3.4 2000/02/12 03:39:24 dawes Exp $ */ /************************************************************ Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. @@ -149,7 +149,7 @@ int fSorted; int n; /* number of spans to fill */ register DDXPointPtr ppt; /* pointer to list of start points */ register int *pwidth; /* pointer to list of n widths */ - void (*fill)(); + void (*fill)(DrawablePtr, int, DDXPointPtr, int *, PixmapPtr, int, int, int, unsigned long); int xrot, yrot; if (!(pGC->planemask)) @@ -218,21 +218,21 @@ int fSorted; int *pwidth; /* pointer to list of n widths */ int *pwidthFree;/* copies of the pointers to free */ DDXPointPtr pptFree; - unsigned long *pdstBase; /* pointer to start of bitmap */ + CfbBits *pdstBase; /* pointer to start of bitmap */ int nlwDst; /* width in longwords of bitmap */ - register unsigned long *pdst; /* pointer to current word in bitmap */ + register CfbBits *pdst; /* pointer to current word in bitmap */ PixmapPtr pStipple; /* pointer to stipple we want to fill with */ int nlw; int x, y, w, xrem, xSrc, ySrc; int stwidth, stippleWidth; int stippleHeight; - register unsigned long bits, inputBits; + register CfbBits bits, inputBits; register int partBitsLeft; int nextPartBits; int bitsLeft, bitsWhole; - unsigned long *srcTemp, *srcStart; - unsigned long *psrcBase; - unsigned long startmask, endmask; + CfbBits *srcTemp, *srcStart; + CfbBits *psrcBase; + CfbBits startmask, endmask; if (pGC->fillStyle == FillStippled) cfb8CheckStipple (pGC->alu, pGC->fgPixel, pGC->planemask); @@ -275,7 +275,7 @@ int fSorted; stwidth = pStipple->devKind >> PWSH; stippleWidth = pStipple->drawable.width; stippleHeight = pStipple->drawable.height; - psrcBase = (unsigned long *) pStipple->devPrivate.ptr; + psrcBase = (CfbBits *) pStipple->devPrivate.ptr; /* * The Target: @@ -407,20 +407,20 @@ int fSorted; register DDXPointPtr ppt; /* pointer to list of start points */ register int *pwidth; /* pointer to list of n widths */ int iline; /* first line of tile to use */ - unsigned long *addrlBase; /* pointer to start of bitmap */ + CfbBits *addrlBase; /* pointer to start of bitmap */ int nlwidth; /* width in longwords of bitmap */ - register unsigned long *pdst; /* pointer to current word in bitmap */ + register CfbBits *pdst; /* pointer to current word in bitmap */ PixmapPtr pStipple; /* pointer to stipple we want to fill with */ register int w; int width, x, xrem, xSrc, ySrc; - unsigned long tmpSrc, tmpDst1, tmpDst2; + CfbBits tmpSrc, tmpDst1, tmpDst2; int stwidth, stippleWidth; - unsigned long *psrcS; + CfbBits *psrcS; int rop, stiprop; int stippleHeight; int *pwidthFree; /* copies of the pointers to free */ DDXPointPtr pptFree; - unsigned long fgfill, bgfill; + CfbBits fgfill, bgfill; if (!(pGC->planemask)) return; @@ -498,7 +498,7 @@ int fSorted; iline = (ppt->y - ySrc) % stippleHeight; x = ppt->x; pdst = addrlBase + (ppt->y * nlwidth); - psrcS = (unsigned long *) pStipple->devPrivate.ptr + (iline * stwidth); + psrcS = (CfbBits *) pStipple->devPrivate.ptr + (iline * stwidth); if (*pwidth) { @@ -506,8 +506,8 @@ int fSorted; while(width > 0) { int xtemp, tmpx; - register unsigned long *ptemp; - register unsigned long *pdsttmp; + register CfbBits *ptemp; + register CfbBits *pdsttmp; /* * Do a stripe through the stipple & destination w pixels * wide. w is not more than: @@ -532,7 +532,7 @@ int fSorted; #endif xtemp = (xrem & MFB_PIM); - ptemp = (unsigned long *)(psrcS + (xrem >> MFB_PWSH)); + ptemp = (CfbBits *)(psrcS + (xrem >> MFB_PWSH)); #if PSZ == 24 tmpx = x & 3; pdsttmp = pdst + ((x * 3)>>2); @@ -609,23 +609,23 @@ cfb8Stipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) int n; /* number of spans to fill */ DDXPointPtr ppt; /* pointer to list of start points */ int *pwidth; /* pointer to list of n widths */ - unsigned long *src; /* pointer to bits in stipple, if needed */ + CfbBits *src; /* pointer to bits in stipple, if needed */ int stippleHeight; /* height of the stipple */ PixmapPtr stipple; int nlwDst; /* width in longwords of the dest pixmap */ int x,y,w; /* current span */ - unsigned long startmask; - unsigned long endmask; - register unsigned long *dst; /* pointer to bits we're writing */ + CfbBits startmask; + CfbBits endmask; + register CfbBits *dst; /* pointer to bits we're writing */ register int nlw; - unsigned long *dstTmp; + CfbBits *dstTmp; int nlwTmp; - unsigned long *pbits; /* pointer to start of pixmap */ - register unsigned long xor; - register unsigned long mask; - register unsigned long bits; /* bits from stipple */ + CfbBits *pbits; /* pointer to start of pixmap */ + register CfbBits xor; + register CfbBits mask; + register CfbBits bits; /* bits from stipple */ int wEnd; int *pwidthFree; /* copies of the pointers to free */ @@ -651,7 +651,7 @@ cfb8Stipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) ppt, pwidth, fSorted); stipple = pGC->pRotatedPixmap; - src = (unsigned long *)stipple->devPrivate.ptr; + src = (CfbBits *)stipple->devPrivate.ptr; stippleHeight = stipple->drawable.height; cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits) @@ -822,23 +822,23 @@ cfb8OpaqueStipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) int n; /* number of spans to fill */ DDXPointPtr ppt; /* pointer to list of start points */ int *pwidth; /* pointer to list of n widths */ - unsigned long *src; /* pointer to bits in stipple, if needed */ + CfbBits *src; /* pointer to bits in stipple, if needed */ int stippleHeight; /* height of the stipple */ PixmapPtr stipple; int nlwDst; /* width in longwords of the dest pixmap */ int x,y,w; /* current span */ - unsigned long startmask; - unsigned long endmask; - register unsigned long *dst; /* pointer to bits we're writing */ + CfbBits startmask; + CfbBits endmask; + register CfbBits *dst; /* pointer to bits we're writing */ register int nlw; - unsigned long *dstTmp; + CfbBits *dstTmp; int nlwTmp; - unsigned long *pbits; /* pointer to start of pixmap */ - register unsigned long xor; - register unsigned long mask; - register unsigned long bits; /* bits from stipple */ + CfbBits *pbits; /* pointer to start of pixmap */ + register CfbBits xor; + register CfbBits mask; + register CfbBits bits; /* bits from stipple */ int wEnd; int *pwidthFree; /* copies of the pointers to free */ @@ -866,7 +866,7 @@ cfb8OpaqueStipple32FS (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) ppt, pwidth, fSorted); stipple = pGC->pRotatedPixmap; - src = (unsigned long *)stipple->devPrivate.ptr; + src = (CfbBits *)stipple->devPrivate.ptr; stippleHeight = stipple->drawable.height; cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits) diff --git a/xc/programs/Xserver/cfb/cfbgc.c b/xc/programs/Xserver/cfb/cfbgc.c index 510e345d3..ae3f17f03 100644 --- a/xc/programs/Xserver/cfb/cfbgc.c +++ b/xc/programs/Xserver/cfb/cfbgc.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbgc.c,v 1.3 1998/10/04 09:37:41 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbgc.c,v 1.4 2000/02/12 03:39:25 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -536,7 +536,7 @@ cfbValidateGC(pGC, changes, pDrawable) { GCOps *newops; - if (newops = cfbMatchCommon (pGC, devPriv)) + if ((newops = cfbMatchCommon (pGC, devPriv))) { if (pGC->ops->devPrivate.val) miDestroyGCOps (pGC->ops); diff --git a/xc/programs/Xserver/cfb/cfbgetsp.c b/xc/programs/Xserver/cfb/cfbgetsp.c index acaaa06ae..a23806cb8 100644 --- a/xc/programs/Xserver/cfb/cfbgetsp.c +++ b/xc/programs/Xserver/cfb/cfbgetsp.c @@ -41,7 +41,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbgetsp.c,v 3.4 1998/10/04 09:37:43 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbgetsp.c,v 3.6 2000/02/12 03:39:25 dawes Exp $ */ #include "X.h" #include "Xmd.h" @@ -100,6 +100,12 @@ cfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart) FatalError("cfbGetSpans: invalid depth\n"); } + /* + * XFree86 DDX empties the root borderClip when the VT is + * switched away; this checks for that case + */ + if (!cfbDrawableEnabled(pDrawable)) + return; cfbGetLongWidthAndPointer (pDrawable, widthSrc, psrcBase) @@ -110,7 +116,7 @@ cfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart) tmpSrc = *((PixelType *)(psrcBase + (ppt->y * widthSrc)) + ppt->x); #if BITMAP_BIT_ORDER == MSBFirst - tmpSrc <<= (sizeof (unsigned long) - sizeof (PixelType)) * 8; + tmpSrc <<= (sizeof (CfbBits) - sizeof (PixelType)) * 8; #endif *pdstStart = tmpSrc; return; @@ -122,7 +128,7 @@ cfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart) while(ppt < pptLast) { #if PSZ == 24 - xEnd = min(ppt->x + *pwidth, widthSrc * sizeof(long) / 3); + xEnd = min(ppt->x + *pwidth, widthSrc * sizeof(CfbBits) / 3); w = xEnd - ppt->x; psrc = psrcBase + ppt->y * widthSrc; srcBit = ppt->x; @@ -146,7 +152,7 @@ cfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart) psrc = (PixelGroup *)((unsigned long)psrcb & ~0x03); getbits24(psrc, tmpSrc, srcBit); pdst = (PixelGroup *)((unsigned long)pdstb & ~0x03); - putbits24(tmpSrc, nstart, PPW, pdst, ~((unsigned long)0), xIndex); + putbits24(tmpSrc, nstart, PPW, pdst, ~((CfbBits)0), xIndex); srcBit++; psrcb += 3; xIndex++; @@ -157,7 +163,7 @@ cfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart) if (srcBit + w <= PPW) { getbits(psrc, srcBit, w, tmpSrc); - putbits(tmpSrc, 0, w, pdst, ~((unsigned long)0)); + putbits(tmpSrc, 0, w, pdst, ~((CfbBits)0)); pdst++; } else @@ -168,7 +174,7 @@ cfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart) { nstart = PPW - srcBit; getbits(psrc, srcBit, nstart, tmpSrc); - putbits(tmpSrc, 0, nstart, pdst, ~((unsigned long)0)); + putbits(tmpSrc, 0, nstart, pdst, ~((CfbBits)0)); if(srcBit + nstart >= PPW) psrc++; } @@ -176,7 +182,7 @@ cfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart) while (nl--) { tmpSrc = *psrc; - putbits(tmpSrc, nstart, PPW, pdst, ~((unsigned long)0)); + putbits(tmpSrc, nstart, PPW, pdst, ~((CfbBits)0)); psrc++; pdst++; } @@ -184,7 +190,7 @@ cfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart) { nend = xEnd & PIM; getbits(psrc, 0, nend, tmpSrc); - putbits(tmpSrc, nstart, nend, pdst, ~((unsigned long)0)); + putbits(tmpSrc, nstart, nend, pdst, ~((CfbBits)0)); } pdst = pdstNext; } diff --git a/xc/programs/Xserver/cfb/cfbglblt8.c b/xc/programs/Xserver/cfb/cfbglblt8.c index 5c0ab74f5..ae5b75605 100644 --- a/xc/programs/Xserver/cfb/cfbglblt8.c +++ b/xc/programs/Xserver/cfb/cfbglblt8.c @@ -19,7 +19,7 @@ Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. */ -/* $XFree86: xc/programs/Xserver/cfb/cfbglblt8.c,v 3.2 1998/10/04 09:37:43 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbglblt8.c,v 3.3 2000/02/12 03:39:26 dawes Exp $ */ /* * Poly glyph blt. Accepts an arbitrary font <= 32 bits wide, in Copy mode @@ -60,7 +60,7 @@ in this Software without prior written authorization from The Open Group. #ifdef USE_LEFTBITS typedef unsigned char *glyphPointer; -extern unsigned long endtab[]; +extern CfbBits endtab[]; #define GlyphBits(bits,width,dst) getleftbits(bits,width,dst); \ (dst) &= widthMask; \ @@ -118,18 +118,18 @@ cfbPolyGlyphBlt8 (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) CharInfoPtr *ppci; /* array of character info */ pointer pglyphBase; /* start of array of glyphs */ { - register unsigned long c; + register CfbBits c; #ifndef GLYPHROP - register unsigned long pixel; + register CfbBits pixel; #endif - register unsigned long *dst; + register CfbBits *dst; register glyphPointer glyphBits; register int xoff; FontPtr pfont = pGC->font; CharInfoPtr pci; - unsigned long *dstLine; - unsigned long *pdstBase; + CfbBits *dstLine; + CfbBits *pdstBase; int hTmp; int bwidthDst; int widthDst; @@ -142,7 +142,7 @@ cfbPolyGlyphBlt8 (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) BoxPtr extents; #ifdef USE_LEFTBITS int widthGlyph; - unsigned long widthMask; + CfbBits widthMask; #endif #ifndef STIPPLE #ifdef USE_STIPPLE_CODE @@ -209,7 +209,7 @@ cfbPolyGlyphBlt8 (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) pixel = cfbGetGCPrivate(pGC)->xor; #endif - cfbGetTypedWidthAndPointer (pDrawable, bwidthDst, pdstBase, char, unsigned long) + cfbGetTypedWidthAndPointer (pDrawable, bwidthDst, pdstBase, char, CfbBits) widthDst = bwidthDst / PGSZB; while (nglyph--) @@ -244,7 +244,7 @@ cfbPolyGlyphBlt8 (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) #endif do { dst = dstLine; - dstLine = (unsigned long *) (((char *) dstLine) + bwidthDst); + dstLine = (CfbBits *) (((char *) dstLine) + bwidthDst); GlyphBits(glyphBits, w, c) WriteBitGroup(dst, pixel, GetBitGroup(BitRight(c,xoff))); dst += DST_INC; @@ -271,19 +271,19 @@ cfbPolyGlyphBlt8Clipped (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) CharInfoPtr *ppci; /* array of character info */ unsigned char *pglyphBase; /* start of array of glyphs */ { - register unsigned long c; + register CfbBits c; #ifndef GLYPHROP - register unsigned long pixel; + register CfbBits pixel; #endif - register unsigned long *dst; + register CfbBits *dst; register glyphPointer glyphBits; register int xoff; - unsigned long c1; + CfbBits c1; CharInfoPtr pci; FontPtr pfont = pGC->font; - unsigned long *dstLine; - unsigned long *pdstBase; + CfbBits *dstLine; + CfbBits *pdstBase; CARD32 *cTmp, *clips; int maxAscent, maxDescent; int minLeftBearing; @@ -299,11 +299,11 @@ cfbPolyGlyphBlt8Clipped (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) RegionPtr pRegion; int yBand; #ifdef GLYPHROP - unsigned long bits; + CfbBits bits; #endif #ifdef USE_LEFTBITS int widthGlyph; - unsigned long widthMask; + CfbBits widthMask; #endif #ifdef GLYPHROP @@ -312,7 +312,7 @@ cfbPolyGlyphBlt8Clipped (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) pixel = cfbGetGCPrivate(pGC)->xor; #endif - cfbGetTypedWidthAndPointer (pDrawable, bwidthDst, pdstBase, char, unsigned long) + cfbGetTypedWidthAndPointer (pDrawable, bwidthDst, pdstBase, char, CfbBits) widthDst = bwidthDst / PGSZB; maxAscent = FONTMAXBOUNDS(pfont,ascent); @@ -373,7 +373,7 @@ cfbPolyGlyphBlt8Clipped (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) cTmp = clips; do { dst = dstLine; - dstLine = (unsigned long *) (((char *) dstLine) + bwidthDst); + dstLine = (CfbBits *) (((char *) dstLine) + bwidthDst); GlyphBits(glyphBits, w, c) c &= *cTmp++; if (c) @@ -413,7 +413,7 @@ cfbPolyGlyphBlt8Clipped (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) #else do { dst = dstLine; - dstLine = (unsigned long *) (((char *) dstLine) + bwidthDst); + dstLine = (CfbBits *) (((char *) dstLine) + bwidthDst); GlyphBits(glyphBits, w, c) if (c) { diff --git a/xc/programs/Xserver/cfb/cfbhrzvert.c b/xc/programs/Xserver/cfb/cfbhrzvert.c index e10afaffe..8af14c873 100644 --- a/xc/programs/Xserver/cfb/cfbhrzvert.c +++ b/xc/programs/Xserver/cfb/cfbhrzvert.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbhrzvert.c,v 3.3 1998/10/04 09:37:44 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbhrzvert.c,v 3.4 2000/02/12 03:39:26 dawes Exp $ */ /*********************************************************** Copyright 1987,1998 The Open Group @@ -55,22 +55,23 @@ SOFTWARE. /* horizontal solid line abs(len) > 1 */ +void cfbHorzS(rop, and, xor, addrl, nlwidth, x1, y1, len) register int rop; -register unsigned long and; -register unsigned long xor; -register unsigned long *addrl; /* pointer to base of bitmap */ +register CfbBits and; +register CfbBits xor; +register CfbBits *addrl; /* pointer to base of bitmap */ int nlwidth; /* width in longwords of bitmap */ int x1; /* initial point */ int y1; int len; /* length of line */ { register int nlmiddle; - register unsigned long startmask; - register unsigned long endmask; + register CfbBits startmask; + register CfbBits endmask; #if PSZ == 24 int leftIndex, rightIndex, xOffset; - unsigned long piQxelAnd[3], piQxelXor[3]; + CfbBits piQxelAnd[3], piQxelXor[3]; piQxelAnd[0] = (and & 0xFFFFFF) | ((and<<24) & 0xFF000000); piQxelAnd[1] = ((and>>8) & 0xFFFF)| ((and<<16) & 0xFFFF0000); piQxelAnd[2] = ((and<<8) & 0xFFFFFF00) | ((and>>16) & 0xFF); @@ -329,15 +330,15 @@ int len; /* length of line */ void cfbVertS(rop, and, xor, addrl, nlwidth, x1, y1, len) int rop; -register unsigned long and, xor; -register unsigned long *addrl; /* pointer to base of bitmap */ +register CfbBits and, xor; +register CfbBits *addrl; /* pointer to base of bitmap */ register int nlwidth; /* width in longwords of bitmap */ int x1, y1; /* initial point */ register int len; /* length of line */ { #if PSZ == 24 int xIdx; - unsigned long and2, xor2, offset, mask, mask2; + CfbBits and2, xor2, offset, mask, mask2; #endif #ifdef PIXEL_ADDR register PixelType *bits = (PixelType *) addrl; diff --git a/xc/programs/Xserver/cfb/cfbimage.c b/xc/programs/Xserver/cfb/cfbimage.c index 629108e31..e06a8da35 100644 --- a/xc/programs/Xserver/cfb/cfbimage.c +++ b/xc/programs/Xserver/cfb/cfbimage.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbimage.c,v 1.7 1999/08/21 13:48:15 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbimage.c,v 1.10 2000/02/12 03:39:26 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -88,9 +88,9 @@ cfbPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage) } else { - unsigned long oldFg, oldBg; + CfbBits oldFg, oldBg; XID gcv[3]; - unsigned long oldPlanemask; + CfbBits oldPlanemask; unsigned long i; long bytesPer; @@ -148,6 +148,12 @@ cfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine) return; } pScreen = pDrawable->pScreen; + /* + * XFree86 DDX empties the root borderClip when the VT is + * switched away; this checks for that case + */ + if (!cfbDrawableEnabled (pDrawable)) + return; if (format == ZPixmap) { pPixmap = GetScratchPixmapHeader(pScreen, w, h, @@ -171,6 +177,9 @@ cfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine) } else { + +#if IMAGE_BYTE_ORDER == LSBFirst + pPixmap = GetScratchPixmapHeader(pScreen, w, h, /*depth*/ 1, /*bpp*/ 1, BitmapBytePad(w), (pointer)pdstLine); if (!pPixmap) @@ -187,5 +196,8 @@ cfbGetImage(pDrawable, sx, sy, w, h, format, planeMask, pdstLine) &ptSrc, planeMask); REGION_UNINIT(pScreen, &rgnDst); FreeScratchPixmapHeader(pPixmap); +#else + miGetImage (pDrawable, sx, sy, w, h, format, planeMask, pdstLine); +#endif } } diff --git a/xc/programs/Xserver/cfb/cfbline.c b/xc/programs/Xserver/cfb/cfbline.c index cfffb9195..5f2f1b0c3 100644 --- a/xc/programs/Xserver/cfb/cfbline.c +++ b/xc/programs/Xserver/cfb/cfbline.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbline.c,v 3.2 1998/10/04 09:37:45 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbline.c,v 3.3 2000/02/12 03:39:27 dawes Exp $ */ /*********************************************************** Copyright 1987, 1998 The Open Group @@ -111,7 +111,7 @@ cfbLineSS (pDrawable, pGC, mode, npt, pptInit) unsigned int oc1; /* outcode of point 1 */ unsigned int oc2; /* outcode of point 2 */ - unsigned long *addrl; /* address of destination pixmap */ + CfbBits *addrl; /* address of destination pixmap */ int nlwidth; /* width in longwords of destination pixmap */ int xorg, yorg; /* origin of window */ @@ -131,7 +131,7 @@ cfbLineSS (pDrawable, pGC, mode, npt, pptInit) register int x1, x2; RegionPtr cclip; cfbPrivGCPtr devPriv; - unsigned long xor, and; + CfbBits xor, and; int alu; devPriv = cfbGetGCPrivate(pGC); @@ -425,8 +425,8 @@ cfbLineSS (pDrawable, pGC, mode, npt, pptInit) (x2 < pbox->x2) && (y2 < pbox->y2)) { - unsigned long mask; - unsigned long scrbits; + CfbBits mask; + CfbBits scrbits; #if PSZ == 24 mask = cfbmask[(x2 & 3)<<1]; @@ -478,7 +478,7 @@ cfbLineSD( pDrawable, pGC, mode, npt, pptInit) register unsigned int oc1; /* outcode of point 1 */ register unsigned int oc2; /* outcode of point 2 */ - unsigned long *addrl; /* address of destination pixmap */ + CfbBits *addrl; /* address of destination pixmap */ int nlwidth; /* width in longwords of destination pixmap */ int xorg, yorg; /* origin of window */ @@ -726,7 +726,7 @@ dontStep: ; (x2 < pbox->x2) && (y2 < pbox->y2)) { - unsigned long mask; + CfbBits mask; int pix; pix = 0; diff --git a/xc/programs/Xserver/cfb/cfbmskbits.h b/xc/programs/Xserver/cfb/cfbmskbits.h index 8655715cc..f309e4587 100644 --- a/xc/programs/Xserver/cfb/cfbmskbits.h +++ b/xc/programs/Xserver/cfb/cfbmskbits.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbmskbits.h,v 3.7 1998/12/20 11:57:29 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbmskbits.h,v 3.8 2000/02/12 03:39:27 dawes Exp $ */ /************************************************************ Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. @@ -100,6 +100,10 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. * parameter to the putbits and putbitsrop macros that is the plane * mask. * ========================================================================== + * + * Keith Packard (keithp@suse.com) + * 64bit code is no longer supported; it requires DIX support + * for repadding images which significantly impacts performance */ /* @@ -113,20 +117,20 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. /* * PixelGroup is the data type used to operate on groups of pixels. - * We typedef it here to unsigned long with the assumption that you - * want to manipulate as many pixels at a time as you can. If unsigned - * long is not appropriate for your server, define it to something else + * We typedef it here to CARD32 with the assumption that you + * want to manipulate 32 bits worth of pixels at a time as you can. If CARD32 + * is not appropriate for your server, define it to something else * before including this file. In this case you will also have to define * PGSZB to the size in bytes of PixelGroup. */ #ifndef PixelGroup -typedef unsigned long PixelGroup; -#ifdef LONG64 -#define PGSZB 8 -#else +#define PixelGroup CARD32 #define PGSZB 4 -#endif /* LONG64 */ #endif /* PixelGroup */ + +#ifndef CfbBits +#define CfbBits CARD32 +#endif #define PGSZ (PGSZB << 3) #define PPW (PGSZ/PSZ) @@ -557,8 +561,8 @@ if ( ((x)+(w)) <= PPW) \ } \ else \ { \ - unsigned long m; \ - unsigned long n; \ + unsigned int m; \ + unsigned int n; \ PixelGroup pm = PFILL(planemask); \ m = PPW-(x); \ n = (w) - m; \ @@ -616,8 +620,8 @@ if ( ((x)+(w)) <= PPW) \ } \ else \ { \ - unsigned long m; \ - unsigned long n; \ + CfbBits m; \ + CfbBits n; \ PixelGroup t1, t2; \ PixelGroup pm; \ PFILL2(planemask, pm); \ @@ -813,19 +817,23 @@ if ((x) + (w) <= PPW) {\ #define getstipplepixels24(psrcstip,xt,ones,psrcpix,destpix,stipindex) \ { \ PixelGroup q, srcpix, srcstip; \ - unsigned long src; \ + CfbBits src; \ register unsigned int stipidx; \ q = *(psrcstip) >> (xt); \ q = ((ones) ? q : ~q) & 1; \ *(destpix) = (*(psrcpix)) & QuartetPixelMaskTable[q]; \ } #else /* BITMAP_BIT_ORDER == LSB */ + +/* this must load 32 bits worth; for most machines, thats an int */ +#define CfbFetchUnaligned(x) ldl_u(x) + #define getstipplepixels( psrcstip, xt, w, ones, psrcpix, destpix ) \ { \ PixelGroup q; \ - q = ldq_u(psrcstip) >> (xt); \ + q = CfbFetchUnaligned(psrcstip) >> (xt); \ if ( ((xt)+(w)) > (PPW*PSZ) ) \ - q |= (ldq_u((psrcstip)+1)) << ((PPW*PSZ)-(xt)); \ + q |= (CfbFetchUnaligned((psrcstip)+1)) << ((PPW*PSZ)-(xt)); \ q = QuartetBitsTable[(w)] & ((ones) ? q : ~q); \ *(destpix) = (*(psrcpix)) & QuartetPixelMaskTable[q]; \ } @@ -834,7 +842,7 @@ if ((x) + (w) <= PPW) {\ #define getstipplepixels24( psrcstip,xt,w,ones,psrcpix,destpix,stipindex,srcindex,dstindex) \ { \ PixelGroup q, srcpix, srcstip; \ - unsigned long src; \ + CfbBits src; \ register unsigned int sidx; \ register unsigned int didx; \ register unsigned int stipidx; \ @@ -870,7 +878,7 @@ if ((x) + (w) <= PPW) {\ #define getstipplepixels24(psrcstip,xt,ones,psrcpix,destpix,stipindex) \ { \ PixelGroup q, srcpix, srcstip; \ - unsigned long src; \ + CfbBits src; \ register unsigned int stipidx; \ q = *(psrcstip) >> (xt); \ q = ((ones) ? q : ~q) & 1; \ diff --git a/xc/programs/Xserver/cfb/cfbpixmap.c b/xc/programs/Xserver/cfb/cfbpixmap.c index 71099be76..a0af31843 100644 --- a/xc/programs/Xserver/cfb/cfbpixmap.c +++ b/xc/programs/Xserver/cfb/cfbpixmap.c @@ -41,6 +41,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ +/* $XFree86: xc/programs/Xserver/cfb/cfbpixmap.c,v 1.3 2000/02/12 05:43:17 dawes Exp $ */ /* pixmap management written by drewry, september 1986 @@ -55,7 +56,7 @@ SOFTWARE. #include "cfb.h" #include "cfbmskbits.h" -extern unsigned long endtab[]; +extern CfbBits endtab[]; PixmapPtr cfbCreatePixmap (pScreen, width, height, depth) @@ -142,9 +143,9 @@ cfbPadPixmap(pPixmap) { register int width = (pPixmap->drawable.width) * (pPixmap->drawable.bitsPerPixel); register int h; - register unsigned long mask; - register unsigned long *p; - register unsigned long bits; /* real pattern bits */ + register CfbBits mask; + register CfbBits *p; + register CfbBits bits; /* real pattern bits */ register int i; int rep; /* repeat count for pattern */ @@ -157,7 +158,7 @@ cfbPadPixmap(pPixmap) mask = endtab[width]; - p = (unsigned long *)(pPixmap->devPrivate.ptr); + p = (CfbBits *)(pPixmap->devPrivate.ptr); for (h=0; h < pPixmap->drawable.height; h++) { *p &= mask; @@ -226,8 +227,8 @@ cfbXRotatePixmap(pPix, rw) PixmapPtr pPix; register int rw; { - register unsigned long *pw, *pwFinal; - register unsigned long t; + register CfbBits *pw, *pwFinal; + register CfbBits t; int rot; if (pPix == NullPixmap) @@ -243,7 +244,7 @@ cfbXRotatePixmap(pPix, rw) ErrorF("cfbXRotatePixmap: unsupported bitsPerPixel %d\n", ((DrawablePtr) pPix)->bitsPerPixel); return; } - pw = (unsigned long *)pPix->devPrivate.ptr; + pw = (CfbBits *)pPix->devPrivate.ptr; modulus (rw, (int) pPix->drawable.width, rot); if(pPix->drawable.width == PPW) { @@ -259,25 +260,25 @@ cfbXRotatePixmap(pPix, rw) { ErrorF("cfb internal error: trying to rotate odd-sized pixmap.\n"); #ifdef notdef - register unsigned long *pwTmp; + register CfbBits *pwTmp; int size, tsize; tsize = PixmapBytePad(pPix->drawable.width - rot, pPix->drawable.depth); - pwTmp = (unsigned long *) ALLOCATE_LOCAL(pPix->drawable.height * tsize); + pwTmp = (CfbBits *) ALLOCATE_LOCAL(pPix->drawable.height * tsize); if (!pwTmp) return; /* divide pw (the pixmap) in two vertically at (w - rot) and swap */ tsize >>= 2; size = pPix->devKind >> SIZE0F(PixelGroup); - cfbQuickBlt((long *)pw, (long *)pwTmp, + cfbQuickBlt((CfbBits *)pw, (CfbBits *)pwTmp, 0, 0, 0, 0, (int)pPix->drawable.width - rot, (int)pPix->drawable.height, size, tsize); - cfbQuickBlt((long *)pw, (long *)pw, + cfbQuickBlt((CfbBits *)pw, (CfbBits *)pw, (int)pPix->drawable.width - rot, 0, 0, 0, rot, (int)pPix->drawable.height, size, size); - cfbQuickBlt((long *)pwTmp, (long *)pw, + cfbQuickBlt((CfbBits *)pwTmp, (CfbBits *)pw, 0, 0, rot, 0, (int)pPix->drawable.width - rot, (int)pPix->drawable.height, tsize, size); diff --git a/xc/programs/Xserver/cfb/cfbply1rct.c b/xc/programs/Xserver/cfb/cfbply1rct.c index 29f6e0d79..50512cc09 100644 --- a/xc/programs/Xserver/cfb/cfbply1rct.c +++ b/xc/programs/Xserver/cfb/cfbply1rct.c @@ -21,7 +21,7 @@ in this Software without prior written authorization from The Open Group. * * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/cfb/cfbply1rct.c,v 3.5 1998/10/04 09:37:47 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbply1rct.c,v 3.6 2000/02/12 03:39:28 dawes Exp $ */ #include "X.h" @@ -47,9 +47,9 @@ RROP_NAME(cfbFillPoly1Rect) (pDrawable, pGC, shape, mode, count, ptsIn) { cfbPrivGCPtr devPriv; int nwidth; - unsigned long *addrl, *addr; + CfbBits *addrl, *addr; #if PSZ == 24 - unsigned long startmask, endmask; + CfbBits startmask, endmask; register int pidx; #endif int maxy; @@ -69,7 +69,7 @@ RROP_NAME(cfbFillPoly1Rect) (pDrawable, pGC, shape, mode, count, ptsIn) int sign1, sign2; int h; int l, r; - unsigned long mask, bits = ~((unsigned long)0); + CfbBits mask, bits = ~((CfbBits)0); int nmiddle; RROP_DECLARE @@ -168,9 +168,9 @@ RROP_NAME(cfbFillPoly1Rect) (pDrawable, pGC, shape, mode, count, ptsIn) return; } -#define AddrYPlus(a,y) (unsigned long *) (((unsigned char *) (a)) + (y) * nwidth) +#define AddrYPlus(a,y) (CfbBits *) (((unsigned char *) (a)) + (y) * nwidth) - cfbGetTypedWidthAndPointer(pDrawable, nwidth, addrl, unsigned char, unsigned long); + cfbGetTypedWidthAndPointer(pDrawable, nwidth, addrl, unsigned char, CfbBits); addrl = AddrYPlus(addrl,y + pDrawable->y); origin = intToX(origin); vertex2p = vertex1p; @@ -275,7 +275,7 @@ RROP_NAME(cfbFillPoly1Rect) (pDrawable, pGC, shape, mode, count, ptsIn) #endif /* PGSZ */ #if PSZ == 24 - addr = (unsigned long *)((char *)addrl + ((l * 3) & ~0x03)); + addr = (CfbBits *)((char *)addrl + ((l * 3) & ~0x03)); #else /* PSZ == 24 */ #if PWSH > LWRD_SHIFT l = l >> (PWSH - LWRD_SHIFT); @@ -283,7 +283,7 @@ RROP_NAME(cfbFillPoly1Rect) (pDrawable, pGC, shape, mode, count, ptsIn) #if PWSH < LWRD_SHIFT l = l << (LWRD_SHIFT - PWSH); #endif - addr = (unsigned long *) (((char *) addrl) + l); + addr = (CfbBits *) (((char *) addrl) + l); #endif /* PSZ == 24 */ #if PSZ == 24 if (nmiddle <= 1){ diff --git a/xc/programs/Xserver/cfb/cfbpntwin.c b/xc/programs/Xserver/cfb/cfbpntwin.c index 410c7c61c..34196d2ee 100644 --- a/xc/programs/Xserver/cfb/cfbpntwin.c +++ b/xc/programs/Xserver/cfb/cfbpntwin.c @@ -41,7 +41,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbpntwin.c,v 3.2 1999/05/15 06:24:50 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbpntwin.c,v 3.3 2000/02/12 03:39:28 dawes Exp $ */ #include "X.h" @@ -219,18 +219,18 @@ cfbFillBoxSolid (pDrawable, nBox, pBox, pixel) BoxPtr pBox; unsigned long pixel; { - unsigned long *pdstBase; + CfbBits *pdstBase; int widthDst; register int h; - register unsigned long rrop_xor; - register unsigned long *pdst; - register unsigned long leftMask, rightMask; + register CfbBits rrop_xor; + register CfbBits *pdst; + register CfbBits leftMask, rightMask; int nmiddle; register int m; int w; #if PSZ == 24 int leftIndex, rightIndex; - unsigned long piQxelArray[3], xOffset, *pdstULC; /*upper left corner*/ + CfbBits piQxelArray[3], xOffset, *pdstULC; /*upper left corner*/ piQxelArray[0] = (pixel&0xFFFFFF) | ((pixel&0xFF)<<24); piQxelArray[1] = ((pixel&0xFFFF00)>>8) | ((pixel&0xFFFF)<<16); @@ -467,29 +467,29 @@ cfbFillBoxTile32 (pDrawable, nBox, pBox, tile) BoxPtr pBox; /* pointer to list of boxes to fill */ PixmapPtr tile; /* rotated, expanded tile */ { - register unsigned long rrop_xor; - register unsigned long *pdst; + register CfbBits rrop_xor; + register CfbBits *pdst; register int m; - unsigned long *psrc; + CfbBits *psrc; int tileHeight; int widthDst; int w; int h; - register unsigned long leftMask; - register unsigned long rightMask; + register CfbBits leftMask; + register CfbBits rightMask; int nmiddle; int y; int srcy; - unsigned long *pdstBase; + CfbBits *pdstBase; #if PSZ == 24 int leftIndex, rightIndex; - unsigned long piQxelArray[3], xOffset, *pdstULC; + CfbBits piQxelArray[3], xOffset, *pdstULC; #endif tileHeight = tile->drawable.height; - psrc = (unsigned long *)tile->devPrivate.ptr; + psrc = (CfbBits *)tile->devPrivate.ptr; cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase); diff --git a/xc/programs/Xserver/cfb/cfbpolypnt.c b/xc/programs/Xserver/cfb/cfbpolypnt.c index bed909018..41a071412 100644 --- a/xc/programs/Xserver/cfb/cfbpolypnt.c +++ b/xc/programs/Xserver/cfb/cfbpolypnt.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbpolypnt.c,v 3.2 1998/10/04 09:37:48 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbpolypnt.c,v 3.3 2000/02/12 03:39:29 dawes Exp $ */ /************************************************************ Copyright 1989, 1998 The Open Group @@ -69,17 +69,17 @@ 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; PixelType *addrpt; #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 @@ -91,7 +91,7 @@ cfbPolyPoint(pDrawable, pGC, mode, npt, pptInit) int nbox; register int i; register BoxPtr pbox; - unsigned long and; + CfbBits and; int rop = pGC->alu; int off; cfbPrivGCPtr devPriv; diff --git a/xc/programs/Xserver/cfb/cfbpush8.c b/xc/programs/Xserver/cfb/cfbpush8.c index c5bd22309..408732f66 100644 --- a/xc/programs/Xserver/cfb/cfbpush8.c +++ b/xc/programs/Xserver/cfb/cfbpush8.c @@ -2,7 +2,7 @@ * Push Pixels for 8 bit displays. */ -/* $XFree86: xc/programs/Xserver/cfb/cfbpush8.c,v 1.3 1998/10/04 09:37:49 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbpush8.c,v 1.4 2000/02/12 03:39:29 dawes Exp $ */ /* @@ -49,17 +49,17 @@ cfbPushPixels8 (pGC, pBitmap, pDrawable, dx, dy, xOrg, yOrg) DrawablePtr pDrawable; int dx, dy, xOrg, yOrg; { - register unsigned long *src, *dst; - register unsigned long pixel; - register unsigned long c, bits; - unsigned long *pdstLine, *psrcLine; - unsigned long *pdstBase; + register CfbBits *src, *dst; + register CfbBits pixel; + register CfbBits c, bits; + CfbBits *pdstLine, *psrcLine; + CfbBits *pdstBase; int srcWidth; int dstWidth; int xoff; int nBitmapLongs, nPixmapLongs; int nBitmapTmp, nPixmapTmp; - unsigned long rightMask; + CfbBits rightMask; BoxRec bbox; cfbPrivGCPtr devPriv; @@ -83,7 +83,7 @@ cfbPushPixels8 (pGC, pBitmap, pDrawable, dx, dy, xOrg, yOrg) cfbGetLongWidthAndPointer (pDrawable, dstWidth, pdstBase) - psrcLine = (unsigned long *) pBitmap->devPrivate.ptr; + psrcLine = (CfbBits *) pBitmap->devPrivate.ptr; srcWidth = (int) pBitmap->devKind >> PWSH; pixel = devPriv->xor; diff --git a/xc/programs/Xserver/cfb/cfbrctstp8.c b/xc/programs/Xserver/cfb/cfbrctstp8.c index 66b52f6bf..4cb43ee67 100644 --- a/xc/programs/Xserver/cfb/cfbrctstp8.c +++ b/xc/programs/Xserver/cfb/cfbrctstp8.c @@ -1,7 +1,7 @@ /* * Fill 32 bit stippled rectangles for 8 bit frame buffers */ -/* $XFree86: xc/programs/Xserver/cfb/cfbrctstp8.c,v 3.2 1998/10/04 09:37:49 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbrctstp8.c,v 3.3 2000/02/12 03:39:29 dawes Exp $ */ /* Copyright 1989, 1998 The Open Group @@ -53,25 +53,25 @@ cfb8FillRectOpaqueStippled32 (pDrawable, pGC, nBox, pBox) int nBox; /* number of boxes to fill */ register BoxPtr pBox; /* pointer to list of boxes to fill */ { - unsigned long *src; + CfbBits *src; int stippleHeight; int nlwDst; /* width in longwords of the dest pixmap */ int w; /* width of current box */ register int h; /* height of current box */ - unsigned long startmask; - unsigned long endmask; /* masks for reggedy bits at either end of line */ + CfbBits startmask; + CfbBits endmask; /* masks for reggedy bits at either end of line */ int nlwMiddle; /* number of longwords between sides of boxes */ register int nlw; /* loop version of nlwMiddle */ - unsigned long *dstLine; - register unsigned long *dst; /* pointer to bits we're writing */ - unsigned long *dstTmp; + CfbBits *dstLine; + register CfbBits *dst; /* pointer to bits we're writing */ + CfbBits *dstTmp; int y; /* current scan line */ - unsigned long *pbits;/* pointer to start of pixmap */ - register unsigned long bits; /* bits from stipple */ + CfbBits *pbits;/* pointer to start of pixmap */ + register CfbBits bits; /* bits from stipple */ int rot, lastStop, i; - register unsigned long xor, and; + register CfbBits xor, and; PixmapPtr stipple; int wEnd; @@ -80,7 +80,7 @@ cfb8FillRectOpaqueStippled32 (pDrawable, pGC, nBox, pBox) cfb8CheckOpaqueStipple(pGC->alu, pGC->fgPixel, pGC->bgPixel, pGC->planemask); stippleHeight = stipple->drawable.height; - src = (unsigned long *)stipple->devPrivate.ptr; + src = (CfbBits *)stipple->devPrivate.ptr; cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits) @@ -244,12 +244,12 @@ cfb8FillRectTransparentStippled32 (pDrawable, pGC, nBox, pBox) { int x, y, w, h; int nlwMiddle, nlwDst, nlwTmp; - unsigned long startmask, endmask; - register unsigned long *dst; - unsigned long *dstLine, *pbits, *dstTmp; - unsigned long *src; - register unsigned long xor; - register unsigned long bits, mask; + CfbBits startmask, endmask; + register CfbBits *dst; + CfbBits *dstLine, *pbits, *dstTmp; + CfbBits *src; + register CfbBits xor; + register CfbBits bits, mask; int rot; int wEnd; cfbPrivGCPtr devPriv; @@ -259,7 +259,7 @@ cfb8FillRectTransparentStippled32 (pDrawable, pGC, nBox, pBox) devPriv = cfbGetGCPrivate(pGC); stipple = pGC->pRotatedPixmap; - src = (unsigned long *)stipple->devPrivate.ptr; + src = (CfbBits *)stipple->devPrivate.ptr; stippleHeight = stipple->drawable.height; cfb8CheckStipple (pGC->alu, pGC->fgPixel, pGC->planemask); @@ -460,8 +460,8 @@ cfb8FillRectStippledUnnatural (pDrawable, pGC, nBox, pBox) int nBox; register BoxPtr pBox; { - unsigned long *pdstBase; /* pointer to start of bitmap */ - unsigned long *pdstLine; /* current destination line */ + CfbBits *pdstBase; /* pointer to start of bitmap */ + CfbBits *pdstLine; /* current destination line */ int nlwDst; /* width in longwords of bitmap */ PixmapPtr pStipple; /* pointer to stipple we want to fill with */ int nlwMiddle; @@ -469,14 +469,14 @@ cfb8FillRectStippledUnnatural (pDrawable, pGC, nBox, pBox) int x, y, w, h, xrem, xSrc, ySrc; int stwidth, stippleWidth; int stippleHeight; - register unsigned long bits, inputBits; + register CfbBits bits, inputBits; register int partBitsLeft; int nextPartBits; int bitsLeft, bitsWhole; - register unsigned long *pdst; /* pointer to current word in bitmap */ - unsigned long *srcTemp, *srcStart; - unsigned long *psrcBase; - unsigned long startmask, endmask; + register CfbBits *pdst; /* pointer to current word in bitmap */ + CfbBits *srcTemp, *srcStart; + CfbBits *psrcBase; + CfbBits startmask, endmask; if (pGC->fillStyle == FillStippled) cfb8CheckStipple (pGC->alu, pGC->fgPixel, pGC->planemask); @@ -501,7 +501,7 @@ cfb8FillRectStippledUnnatural (pDrawable, pGC, nBox, pBox) stwidth = pStipple->devKind >> PWSH; stippleWidth = pStipple->drawable.width; stippleHeight = pStipple->drawable.height; - psrcBase = (unsigned long *) pStipple->devPrivate.ptr; + psrcBase = (CfbBits *) pStipple->devPrivate.ptr; /* * The Target: diff --git a/xc/programs/Xserver/cfb/cfbrrop.c b/xc/programs/Xserver/cfb/cfbrrop.c index 2a2533ee6..653e495b2 100644 --- a/xc/programs/Xserver/cfb/cfbrrop.c +++ b/xc/programs/Xserver/cfb/cfbrrop.c @@ -21,6 +21,7 @@ in this Software without prior written authorization from The Open Group. * * Author: Keith Packard, MIT X Consortium */ +/* $XFree86: xc/programs/Xserver/cfb/cfbrrop.c,v 1.3 2000/02/12 05:43:18 dawes Exp $ */ /* cfb reduced rasterop computations */ @@ -119,10 +120,10 @@ in this Software without prior written authorization from The Open Group. int cfbReduceRasterOp (rop, fg, pm, andp, xorp) int rop; - unsigned long fg, pm; - unsigned long *andp, *xorp; + CfbBits fg, pm; + CfbBits *andp, *xorp; { - unsigned long and, xor; + CfbBits and, xor; int rrop; fg = PFILL (fg); diff --git a/xc/programs/Xserver/cfb/cfbrrop.h b/xc/programs/Xserver/cfb/cfbrrop.h index b23dd491e..a1598f60a 100644 --- a/xc/programs/Xserver/cfb/cfbrrop.h +++ b/xc/programs/Xserver/cfb/cfbrrop.h @@ -22,7 +22,7 @@ in this Software without prior written authorization from The Open Group. * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/cfb/cfbrrop.h,v 3.4 1999/03/28 15:32:11 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbrrop.h,v 3.5 2000/02/12 03:39:30 dawes Exp $ */ #ifndef GXcopy #include "X.h" @@ -37,8 +37,8 @@ in this Software without prior written authorization from The Open Group. #if RROP == GXcopy #if PSZ == 24 -#define RROP_DECLARE register unsigned long rrop_xor; \ - unsigned long piQxelXor[3], spiQxelXor[8]; +#define RROP_DECLARE register CfbBits rrop_xor; \ + CfbBits piQxelXor[3], spiQxelXor[8]; #define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor; \ spiQxelXor[0] = rrop_xor & 0xFFFFFF; \ spiQxelXor[2] = rrop_xor << 24; \ @@ -64,7 +64,7 @@ in this Software without prior written authorization from The Open Group. (*(dst) = (*(dst) & ~(mask))|(piQxelXor[(idx)] & (mask))) #else #define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor; -#define RROP_DECLARE register unsigned long rrop_xor; +#define RROP_DECLARE register CfbBits rrop_xor; #define RROP_SOLID(dst) (*(dst) = (rrop_xor)) #define RROP_SOLID_MASK(dst,mask) (*(dst) = (*(dst) & ~(mask)) | ((rrop_xor) & (mask))) #define RROP_SOLID_lu(dst) stq_u(rrop_xor, dst) @@ -75,8 +75,8 @@ in this Software without prior written authorization from The Open Group. #if RROP == GXxor #if PSZ == 24 -#define RROP_DECLARE register unsigned long rrop_xor; \ - unsigned long piQxelXor[3], spiQxelXor[8]; +#define RROP_DECLARE register CfbBits rrop_xor; \ + CfbBits piQxelXor[3], spiQxelXor[8]; #define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor; \ spiQxelXor[0] = rrop_xor & 0xFFFFFF; \ spiQxelXor[2] = rrop_xor << 24; \ @@ -99,7 +99,7 @@ in this Software without prior written authorization from The Open Group. #define RROP_SOLID_MASK(dst,mask,idx) \ (*(dst) ^= (piQxelXor[(idx)] & (mask))) #else -#define RROP_DECLARE register unsigned long rrop_xor; +#define RROP_DECLARE register CfbBits rrop_xor; #define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor; #define RROP_SOLID(dst) (*(dst) ^= (rrop_xor)) #define RROP_SOLID_MASK(dst,mask) (*(dst) ^= ((rrop_xor) & (mask))) @@ -111,8 +111,8 @@ in this Software without prior written authorization from The Open Group. #if RROP == GXand #if PSZ == 24 -#define RROP_DECLARE register unsigned long rrop_and; \ - unsigned long piQxelAnd[3], spiQxelAnd[6]; +#define RROP_DECLARE register CfbBits rrop_and; \ + CfbBits piQxelAnd[3], spiQxelAnd[6]; #define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; \ spiQxelAnd[0] = (rrop_and & 0xFFFFFF) | 0xFF000000; \ spiQxelAnd[2] = (rrop_and << 24) | 0xFFFFFF; \ @@ -146,7 +146,7 @@ in this Software without prior written authorization from The Open Group. #define RROP_SOLID_MASK(dst,mask,idx) \ (*(dst) &= (piQxelAnd[(idx)] | ~(mask))) #else -#define RROP_DECLARE register unsigned long rrop_and; +#define RROP_DECLARE register CfbBits rrop_and; #define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; #define RROP_SOLID(dst) (*(dst) &= (rrop_and)) #define RROP_SOLID_MASK(dst,mask) (*(dst) &= ((rrop_and) | ~(mask))) @@ -156,8 +156,8 @@ in this Software without prior written authorization from The Open Group. #if RROP == GXor #if PSZ == 24 -#define RROP_DECLARE register unsigned long rrop_or; \ - unsigned long piQxelOr[3], spiQxelOr[6]; +#define RROP_DECLARE register CfbBits rrop_or; \ + CfbBits piQxelOr[3], spiQxelOr[6]; #define RROP_FETCH_GCPRIV(devPriv) rrop_or = (devPriv)->xor; \ spiQxelOr[0] = rrop_or & 0xFFFFFF; \ spiQxelOr[1] = rrop_or << 24; \ @@ -191,7 +191,7 @@ in this Software without prior written authorization from The Open Group. #define RROP_SOLID_MASK(dst,mask,idx) \ (*(dst) |= (piQxelOr[(idx)] & (mask))) #else -#define RROP_DECLARE register unsigned long rrop_or; +#define RROP_DECLARE register CfbBits rrop_or; #define RROP_FETCH_GCPRIV(devPriv) rrop_or = (devPriv)->xor; #define RROP_SOLID(dst) (*(dst) |= (rrop_or)) #define RROP_SOLID_MASK(dst,mask) (*(dst) |= ((rrop_or) & (mask))) @@ -209,8 +209,8 @@ in this Software without prior written authorization from The Open Group. #if RROP == GXset #if PSZ == 24 -#define RROP_DECLARE register unsigned long rrop_and, rrop_xor; \ - unsigned long piQxelAnd[3], piQxelXor[3], spiQxelAnd[6], spiQxelXor[6]; +#define RROP_DECLARE register CfbBits rrop_and, rrop_xor; \ + CfbBits piQxelAnd[3], piQxelXor[3], spiQxelAnd[6], spiQxelXor[6]; #define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; \ rrop_xor = (devPriv)->xor; \ spiQxelXor[0] = rrop_xor & 0xFFFFFF; \ @@ -254,7 +254,7 @@ in this Software without prior written authorization from The Open Group. #define RROP_SOLID_MASK(dst,mask,idx) \ (*(dst) = DoMaskRRop (*(dst), piQxelAnd[(idx)], piQxelXor[(idx)], (mask))) #else -#define RROP_DECLARE register unsigned long rrop_and, rrop_xor; +#define RROP_DECLARE register CfbBits rrop_and, rrop_xor; #define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; \ rrop_xor = (devPriv)->xor; #define RROP_SOLID(dst) (*(dst) = DoRRop (*(dst), rrop_and, rrop_xor)) @@ -305,25 +305,25 @@ in this Software without prior written authorization from The Open Group. #define RROP_SPAN(pdst,nmiddle) {\ int part = (nmiddle) & RROP_UNROLL_MASK; \ (nmiddle) >>= RROP_UNROLL_SHIFT; \ - (pdst) += part * (sizeof (unsigned long) / sizeof (*pdst)); \ + (pdst) += part * (sizeof (CfbBits) / sizeof (*pdst)); \ switch (part) {\ - RROP_UNROLL_CASE((unsigned long *) (pdst)) \ + RROP_UNROLL_CASE((CfbBits *) (pdst)) \ } \ while (--(nmiddle) >= 0) { \ - (pdst) += RROP_UNROLL * (sizeof (unsigned long) / sizeof (*pdst)); \ - RROP_UNROLL_LOOP((unsigned long *) (pdst)) \ + (pdst) += RROP_UNROLL * (sizeof (CfbBits) / sizeof (*pdst)); \ + RROP_UNROLL_LOOP((CfbBits *) (pdst)) \ } \ } #else #define RROP_SPAN(pdst,nmiddle) \ while (--(nmiddle) >= 0) { \ - RROP_SOLID((unsigned long *) (pdst)); \ - (pdst) += sizeof (unsigned long) / sizeof (*pdst); \ + RROP_SOLID((CfbBits *) (pdst)); \ + (pdst) += sizeof (CfbBits) / sizeof (*pdst); \ } #define RROP_SPAN_lu(pdst,nmiddle) \ while (--(nmiddle) >= 0) { \ - RROP_SOLID_lu((unsigned long *) (pdst)); \ - (pdst) += sizeof (unsigned long) / sizeof (*pdst); \ + RROP_SOLID_lu((CfbBits *) (pdst)); \ + (pdst) += sizeof (CfbBits) / sizeof (*pdst); \ } #endif diff --git a/xc/programs/Xserver/cfb/cfbscrinit.c b/xc/programs/Xserver/cfb/cfbscrinit.c index 5579608b7..1cc8a768f 100644 --- a/xc/programs/Xserver/cfb/cfbscrinit.c +++ b/xc/programs/Xserver/cfb/cfbscrinit.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/cfb/cfbscrinit.c,v 1.17 1998/12/20 11:57:29 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbscrinit.c,v 1.18 2000/02/12 03:39:31 dawes Exp $ */ /************************************************************ Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. @@ -80,8 +80,6 @@ cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width) int dpix, dpiy; /* dots per inch */ int width; /* pixel width of frame buffer */ { - int i; - if (!cfbAllocatePrivates(pScreen, (int *) 0, (int *) 0)) return FALSE; pScreen->defColormap = FakeClientID(0); @@ -142,7 +140,6 @@ cfbFinishScreenInit(pScreen, pbits, xsize, ysize, dpix, dpiy, width) int dpix, dpiy; /* dots per inch */ int width; /* pixel width of frame buffer */ { - int i, j; #ifdef CFB_NEED_SCREEN_PRIVATE pointer oldDevPrivate; #endif diff --git a/xc/programs/Xserver/cfb/cfbsetsp.c b/xc/programs/Xserver/cfb/cfbsetsp.c index a9f3652ff..b98188da7 100644 --- a/xc/programs/Xserver/cfb/cfbsetsp.c +++ b/xc/programs/Xserver/cfb/cfbsetsp.c @@ -41,7 +41,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbsetsp.c,v 3.1 1998/10/04 09:37:51 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbsetsp.c,v 3.2 2000/02/12 03:39:31 dawes Exp $ */ #include "X.h" #include "Xmd.h" @@ -64,6 +64,7 @@ SOFTWARE. * boxes, we may not want to start grabbing bits at psrc but at some offset * further on.) */ +void cfbSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst, planemask) int y; int xOrigin; /* where this scanline starts */ @@ -183,7 +184,7 @@ cfbSetSpans(pDrawable, pGC, pcharsrc, ppt, pwidth, nspans, fSorted) int fSorted; { unsigned int *psrc = (unsigned int *)pcharsrc; - unsigned long *pdstBase; /* start of dst bitmap */ + CfbBits *pdstBase; /* start of dst bitmap */ int widthDst; /* width of bitmap in words */ register BoxPtr pbox, pboxLast, pboxTest; register DDXPointPtr pptLast; diff --git a/xc/programs/Xserver/cfb/cfbsolid.c b/xc/programs/Xserver/cfb/cfbsolid.c index db1efe99d..4a7749ed4 100644 --- a/xc/programs/Xserver/cfb/cfbsolid.c +++ b/xc/programs/Xserver/cfb/cfbsolid.c @@ -21,7 +21,7 @@ in this Software without prior written authorization from The Open Group. * * Author: Keith Packard, MIT X Consortium */ -/* $XFree86: xc/programs/Xserver/cfb/cfbsolid.c,v 3.3 1998/10/04 13:23:58 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbsolid.c,v 3.4 2000/02/12 03:39:31 dawes Exp $ */ #include "X.h" @@ -114,10 +114,10 @@ RROP_NAME(cfbFillRectSolid) (pDrawable, pGC, nBox, pBox) BoxPtr pBox; { register int m; - register unsigned long *pdst; + register CfbBits *pdst; RROP_DECLARE - register unsigned long leftMask, rightMask; - unsigned long *pdstBase, *pdstRect; + register CfbBits leftMask, rightMask; + CfbBits *pdstBase, *pdstRect; int nmiddle; int h; int w; @@ -661,9 +661,9 @@ RROP_NAME(cfbFillRectSolid) (pDrawable, pGC, nBox, pBox) #endif #if RROP == GXset *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]); - *pdst++; + pdst++; *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF); - *pdst++; + pdst++; #endif break; case 3: @@ -758,14 +758,14 @@ RROP_NAME(cfbSolidSpans) (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) int *pwidthInit; /* pointer to list of n widths */ int fSorted; { - unsigned long *pdstBase; + CfbBits *pdstBase; int widthDst; RROP_DECLARE - register unsigned long *pdst; + register CfbBits *pdst; register int nlmiddle; - register unsigned long startmask, endmask; + register CfbBits startmask, endmask; register int w; int x; @@ -1238,9 +1238,9 @@ RROP_NAME(cfbSolidSpans) (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) #endif #if RROP == GXset *pdst = DoRRop((*pdst), piQxelAnd[0], piQxelXor[0]); - *pdst++; + pdst++; *pdst = DoMaskRRop((*pdst), piQxelAnd[1], piQxelXor[1], 0xFFFF); - *pdst++; + pdst++; #endif break; case 3: diff --git a/xc/programs/Xserver/cfb/cfbteblt8.c b/xc/programs/Xserver/cfb/cfbteblt8.c index 25a2b8b28..8ad7e578e 100644 --- a/xc/programs/Xserver/cfb/cfbteblt8.c +++ b/xc/programs/Xserver/cfb/cfbteblt8.c @@ -3,6 +3,7 @@ * 8 bit displays, in Copy mode with no clipping. */ +/* $XFree86: xc/programs/Xserver/cfb/cfbteblt8.c,v 1.3 2000/02/12 05:43:18 dawes Exp $ */ /* Copyright 1989, 1998 The Open Group @@ -155,7 +156,7 @@ typedef unsigned int *glyphPointer; #endif #ifdef USE_LEFTBITS -extern unsigned long endtab[]; +extern CfbBits endtab[]; #define IncChar(c) (c = (glyphPointer) (((char *) c) + glyphBytes)) @@ -309,7 +310,7 @@ extern unsigned long endtab[]; #define StoreBits(o) StorePixels(o,cfb8Pixels[(c) & PGSZBMSK]); #define FirstStep Step #else /* PGSZ == 32 */ -#define StoreBits(o) StorePixels(o,*((unsigned long *) (((char *) cfb8Pixels) + (c & 0x3c)))); +#define StoreBits(o) StorePixels(o,*((CfbBits *) (((char *) cfb8Pixels) + (c & 0x3c)))); #define FirstStep c = BitLeft (c, 2); #endif /* PGSZ */ #endif /* BITMAP_BIT_ORDER */ @@ -324,9 +325,9 @@ CFBTEGBLT8 (pDrawable, pGC, xInit, yInit, nglyph, ppci, pglyphBase) CharInfoPtr *ppci; /* array of character info */ pointer pglyphBase; /* start of array of glyphs */ { - register unsigned long c; - register unsigned long *dst; - register unsigned long leftMask, rightMask; + register CfbBits c; + register CfbBits *dst; + register CfbBits leftMask, rightMask; register int hTmp; register int xoff1; register glyphPointer char1; @@ -345,9 +346,9 @@ CFBTEGBLT8 (pDrawable, pGC, xInit, yInit, nglyph, ppci, pglyphBase) #endif FontPtr pfont = pGC->font; - unsigned long *dstLine; + CfbBits *dstLine; glyphPointer oldRightChar; - unsigned long *pdstBase; + CfbBits *pdstBase; glyphPointer leftChar; int widthDst, widthLeft; int widthGlyph; @@ -358,8 +359,8 @@ CFBTEGBLT8 (pDrawable, pGC, xInit, yInit, nglyph, ppci, pglyphBase) int lshift; int widthGlyphs; #ifdef USE_LEFTBITS - register unsigned long glyphMask; - register unsigned long tmpSrc; + register CfbBits glyphMask; + register CfbBits tmpSrc; register int glyphBytes; #endif diff --git a/xc/programs/Xserver/cfb/cfbtegblt.c b/xc/programs/Xserver/cfb/cfbtegblt.c index 460d9a1d6..7d82356b0 100644 --- a/xc/programs/Xserver/cfb/cfbtegblt.c +++ b/xc/programs/Xserver/cfb/cfbtegblt.c @@ -41,7 +41,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/Xserver/cfb/cfbtegblt.c,v 3.2 1998/10/04 09:37:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbtegblt.c,v 3.3 2000/02/12 03:39:32 dawes Exp $ */ #include "X.h" #include "Xmd.h" @@ -89,7 +89,7 @@ cfbTEGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) { FontPtr pfont = pGC->font; int widthDst; - unsigned long *pdstBase; /* pointer to longword with top row + CfbBits *pdstBase; /* pointer to longword with top row of current glyph */ int w; /* width of glyph and char */ @@ -99,12 +99,12 @@ cfbTEGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) register unsigned char *pglyph; int widthGlyph; - register unsigned long *pdst;/* pointer to current longword in dst */ + register CfbBits *pdst;/* pointer to current longword in dst */ int hTmp; /* counter for height */ BoxRec bbox; /* for clipping */ register int wtmp,xtemp,width; - unsigned long bgfill,fgfill,*ptemp,tmpDst1,tmpDst2,*pdtmp; + CfbBits bgfill,fgfill,*ptemp,tmpDst1,tmpDst2,*pdtmp; int tmpx; #if PSZ == 24 int xIndex; @@ -185,9 +185,9 @@ cfbTEGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) #endif #if PSZ == 24 - ptemp = (unsigned long *)(pglyph + ((xtemp *3)>> 2)); + ptemp = (CfbBits *)(pglyph + ((xtemp *3)>> 2)); #else - ptemp = (unsigned long *)(pglyph + (xtemp >> MFB_PWSH)); + ptemp = (CfbBits *)(pglyph + (xtemp >> MFB_PWSH)); #endif #if PSZ == 24 getstipplepixels24(ptemp,xtemp,0,&bgfill,&tmpDst1, xtemp); @@ -198,12 +198,12 @@ cfbTEGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase) #endif { - unsigned long tmpDst = tmpDst1 | tmpDst2; + CfbBits tmpDst = tmpDst1 | tmpDst2; #if PSZ == 24 - unsigned long *pdsttmp = pdst + ((x*3) >> 2); + CfbBits *pdsttmp = pdst + ((x*3) >> 2); putbits24(tmpDst,tmpx,w,pdsttmp,pGC->planemask,x); #else - unsigned long *pdsttmp = pdst + (x >> PWSH); + CfbBits *pdsttmp = pdst + (x >> PWSH); putbits(tmpDst,tmpx,w,pdsttmp,pGC->planemask); #endif } diff --git a/xc/programs/Xserver/cfb/cfbtile32.c b/xc/programs/Xserver/cfb/cfbtile32.c index 8b454226a..54c94d791 100644 --- a/xc/programs/Xserver/cfb/cfbtile32.c +++ b/xc/programs/Xserver/cfb/cfbtile32.c @@ -2,7 +2,7 @@ * Fill 32 bit tiled rectangles. Used by both PolyFillRect and PaintWindow. * no depth dependencies. */ -/* $XFree86: xc/programs/Xserver/cfb/cfbtile32.c,v 3.2 1998/10/04 09:37:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbtile32.c,v 3.3 2000/02/12 03:39:33 dawes Exp $ */ /* @@ -212,33 +212,33 @@ MROP_NAME(cfbFillRectTile32) (pDrawable, pGC, nBox, pBox) int nBox; /* number of boxes to fill */ BoxPtr pBox; /* pointer to list of boxes to fill */ { - register unsigned long srcpix; - unsigned long *psrc; /* pointer to bits in tile, if needed */ + register CfbBits srcpix; + CfbBits *psrc; /* pointer to bits in tile, if needed */ int tileHeight; /* height of the tile */ int nlwDst; /* width in longwords of the dest pixmap */ int w; /* width of current box */ register int h; /* height of current box */ - register unsigned long startmask; - register unsigned long endmask; /* masks for reggedy bits at either end of line */ + register CfbBits startmask; + register CfbBits endmask; /* masks for reggedy bits at either end of line */ int nlwMiddle; /* number of longwords between sides of boxes */ int nlwExtra; /* to get from right of box to left of next span */ register int nlw; /* loop version of nlwMiddle */ - register unsigned long *p; /* pointer to bits we're writing */ + register CfbBits *p; /* pointer to bits we're writing */ int y; /* current scan line */ int srcy; /* current tile position */ - unsigned long *pbits;/* pointer to start of pixmap */ + CfbBits *pbits;/* pointer to start of pixmap */ PixmapPtr tile; /* rotated, expanded tile */ MROP_DECLARE_REG() MROP_PREBUILT_DECLARE() #if PSZ == 24 - unsigned long xtmp; + CfbBits xtmp; #endif tile = pGC->pRotatedPixmap; tileHeight = tile->drawable.height; - psrc = (unsigned long *)tile->devPrivate.ptr; + psrc = (CfbBits *)tile->devPrivate.ptr; MROP_INITIALIZE(pGC->alu, pGC->planemask); @@ -327,25 +327,25 @@ MROP_NAME(cfbTile32FS)(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) int n; /* number of spans to fill */ DDXPointPtr ppt; /* pointer to list of start points */ int *pwidth;/* pointer to list of n widths */ - unsigned long *pbits; /* pointer to start of bitmap */ + CfbBits *pbits; /* pointer to start of bitmap */ int nlwDst; /* width in longwords of bitmap */ - register unsigned long *p; /* pointer to current longword in bitmap */ + register CfbBits *p; /* pointer to current longword in bitmap */ register int w; /* current span width */ register int nlw; register int x; - register unsigned long startmask; - register unsigned long endmask; - register unsigned long srcpix; + register CfbBits startmask; + register CfbBits endmask; + register CfbBits srcpix; int y; int *pwidthFree;/* copies of the pointers to free */ DDXPointPtr pptFree; PixmapPtr tile; - unsigned long *psrc; /* pointer to bits in tile */ + CfbBits *psrc; /* pointer to bits in tile */ int tileHeight;/* height of the tile */ MROP_DECLARE_REG () MROP_PREBUILT_DECLARE() #if PSZ == 24 - unsigned long xtmp; + CfbBits xtmp; #endif n = nInit * miFindMaxBand( cfbGetCompositeClip(pGC) ); @@ -365,7 +365,7 @@ MROP_NAME(cfbTile32FS)(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted) tile = pGC->pRotatedPixmap; tileHeight = tile->drawable.height; - psrc = (unsigned long *)tile->devPrivate.ptr; + psrc = (CfbBits *)tile->devPrivate.ptr; MROP_INITIALIZE(pGC->alu, pGC->planemask); diff --git a/xc/programs/Xserver/cfb/cfbtileodd.c b/xc/programs/Xserver/cfb/cfbtileodd.c index 24406a74d..548236383 100644 --- a/xc/programs/Xserver/cfb/cfbtileodd.c +++ b/xc/programs/Xserver/cfb/cfbtileodd.c @@ -2,7 +2,7 @@ * Fill odd tiled rectangles and spans. * no depth dependencies. */ -/* $XFree86: xc/programs/Xserver/cfb/cfbtileodd.c,v 3.2 1999/01/23 09:55:38 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/cfb/cfbtileodd.c,v 3.3 2000/02/12 03:39:33 dawes Exp $ */ /* @@ -43,17 +43,9 @@ in this Software without prior written authorization from The Open Group. #include "mergerop.h" #if PSZ == 24 -#if PGSZ == 32 #define LEFTSHIFT_AMT (3) -#else /* PGSZ == 64 */ -#define LEFTSHIFT_AMT (4 - PWSH) -#endif /* PGSZ */ #else /* PSZ != 24 */ -#if PGSZ == 32 #define LEFTSHIFT_AMT (5 - PWSH) -#else /* PGSZ == 64 */ -#define LEFTSHIFT_AMT (6 - PWSH) -#endif /* PGSZ */ #endif /* PSZ == 24*/ #define LastTileBits {\ @@ -132,8 +124,8 @@ MROP_NAME(cfbFillBoxTileOdd) (pDrawable, nBox, pBox, tile, xrot, yrot, alu, plan int widthDst; /* width in longwords of the dest pixmap */ int w; /* width of current box */ int h; /* height of current box */ - unsigned long startmask; - unsigned long endmask;/* masks for reggedy bits at either end of line */ + CfbBits startmask; + CfbBits endmask;/* masks for reggedy bits at either end of line */ int nlwMiddle; /* number of longwords between sides of boxes */ int nlwSrc; /* number of whole longwords in source */ @@ -145,23 +137,23 @@ MROP_NAME(cfbFillBoxTileOdd) (pDrawable, nBox, pBox, tile, xrot, yrot, alu, plan MROP_DECLARE_REG() - unsigned long *pdstBase; /* pointer to start of dest */ - unsigned long *pDstLine; /* poitner to start of dest box */ - unsigned long *pSrcBase; /* pointer to start of source */ - unsigned long *pSrcLine; /* pointer to start of source line */ - register unsigned long *pDst; - register unsigned long *pSrc; - register unsigned long bits, tmp; + CfbBits *pdstBase; /* pointer to start of dest */ + CfbBits *pDstLine; /* poitner to start of dest box */ + CfbBits *pSrcBase; /* pointer to start of source */ + CfbBits *pSrcLine; /* pointer to start of source line */ + register CfbBits *pDst; + register CfbBits *pSrc; + register CfbBits bits, tmp; register int nlwPart; int xoffStart, xoff; int leftShiftStart, rightShiftStart, nlwSrcStart; - unsigned long tileEndMask; + CfbBits tileEndMask; int tileEndLeftShift, tileEndRightShift; int xoffStep; int tileEndPart; int needFirst; - unsigned long narrow[2]; - unsigned long narrowMask; + CfbBits narrow[2]; + CfbBits narrowMask; int narrowShift; Bool narrowTile; @@ -179,7 +171,7 @@ MROP_NAME(cfbFillBoxTileOdd) (pDrawable, nBox, pBox, tile, xrot, yrot, alu, plan widthSrc = 2; narrowTile = TRUE; } - pSrcBase = (unsigned long *)tile->devPrivate.ptr; + pSrcBase = (CfbBits *)tile->devPrivate.ptr; cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase) @@ -389,8 +381,8 @@ MROP_NAME(cfbFillSpanTileOdd) (pDrawable, n, ppt, pwidth, tile, xrot, yrot, alu, int widthDst; /* width in longwords of the dest pixmap */ int w; /* width of current span */ - unsigned long startmask; - unsigned long endmask; /* masks for reggedy bits at either end of line */ + CfbBits startmask; + CfbBits endmask; /* masks for reggedy bits at either end of line */ int nlwSrc; /* number of whole longwords in source */ register int nlw; /* loop version of nlwMiddle */ @@ -401,23 +393,23 @@ MROP_NAME(cfbFillSpanTileOdd) (pDrawable, n, ppt, pwidth, tile, xrot, yrot, alu, MROP_DECLARE_REG() - unsigned long *pdstBase; /* pointer to start of dest */ - unsigned long *pDstLine; /* poitner to start of dest box */ - unsigned long *pSrcBase; /* pointer to start of source */ - unsigned long *pSrcLine; /* pointer to start of source line */ - register unsigned long *pDst; - register unsigned long *pSrc; - register unsigned long bits, tmp; + CfbBits *pdstBase; /* pointer to start of dest */ + CfbBits *pDstLine; /* poitner to start of dest box */ + CfbBits *pSrcBase; /* pointer to start of source */ + CfbBits *pSrcLine; /* pointer to start of source line */ + register CfbBits *pDst; + register CfbBits *pSrc; + register CfbBits bits, tmp; register int nlwPart; int xoffStart, xoff; int leftShiftStart, rightShiftStart, nlwSrcStart; - unsigned long tileEndMask; + CfbBits tileEndMask; int tileEndLeftShift, tileEndRightShift; int xoffStep; int tileEndPart; int needFirst; - unsigned long narrow[2]; - unsigned long narrowMask; + CfbBits narrow[2]; + CfbBits narrowMask; int narrowShift; Bool narrowTile; @@ -435,7 +427,7 @@ MROP_NAME(cfbFillSpanTileOdd) (pDrawable, n, ppt, pwidth, tile, xrot, yrot, alu, widthSrc = 2; narrowTile = TRUE; } - pSrcBase = (unsigned long *)tile->devPrivate.ptr; + pSrcBase = (CfbBits *)tile->devPrivate.ptr; cfbGetLongWidthAndPointer (pDrawable, widthDst, pdstBase) @@ -635,8 +627,8 @@ MROP_NAME(cfbFillBoxTile32s) (pDrawable, nBox, pBox, tile, xrot, yrot, alu, plan int widthDst; /* width in longwords of the dest pixmap */ int w; /* width of current box */ int h; /* height of current box */ - unsigned long startmask; - unsigned long endmask;/* masks for reggedy bits at either end of line */ + CfbBits startmask; + CfbBits endmask;/* masks for reggedy bits at either end of line */ int nlMiddle; /* number of longwords between sides of boxes */ register int nl; /* loop version of nlMiddle */ @@ -649,19 +641,19 @@ MROP_NAME(cfbFillBoxTile32s) (pDrawable, nBox, pBox, tile, xrot, yrot, alu, plan MROP_DECLARE_REG() - unsigned long *pdstBase; /* pointer to start of dest */ - unsigned long *pdstLine; /* poitner to start of dest box */ - unsigned long *psrcBase; /* pointer to start of source */ - unsigned long *psrcLine; /* pointer to fetch point of source */ - unsigned long *psrcStart; /* pointer to start of source line */ - register unsigned long *pdst; - register unsigned long *psrc; - register unsigned long bits, bits1; + CfbBits *pdstBase; /* pointer to start of dest */ + CfbBits *pdstLine; /* poitner to start of dest box */ + CfbBits *psrcBase; /* pointer to start of source */ + CfbBits *psrcLine; /* pointer to fetch point of source */ + CfbBits *psrcStart; /* pointer to start of source line */ + register CfbBits *pdst; + register CfbBits *psrc; + register CfbBits bits, bits1; register int nlTemp; MROP_INITIALIZE (alu, planemask) - psrcBase = (unsigned long *)tile->devPrivate.ptr; + psrcBase = (CfbBits *)tile->devPrivate.ptr; tileHeight = tile->drawable.height; tileWidth = tile->drawable.width; #if PSZ == 24 @@ -946,8 +938,8 @@ MROP_NAME(cfbFillSpanTile32s) (pDrawable, n, ppt, pwidth, tile, xrot, yrot, alu, int widthDst; /* width in longwords of the dest pixmap */ int w; /* width of current box */ - unsigned long startmask; - unsigned long endmask;/* masks for reggedy bits at either end of line */ + CfbBits startmask; + CfbBits endmask;/* masks for reggedy bits at either end of line */ int nlMiddle; /* number of longwords between sides of boxes */ register int nl; /* loop version of nlMiddle */ @@ -960,19 +952,19 @@ MROP_NAME(cfbFillSpanTile32s) (pDrawable, n, ppt, pwidth, tile, xrot, yrot, alu, MROP_DECLARE_REG() - unsigned long *pdstBase; /* pointer to start of dest */ - unsigned long *pdstLine; /* poitner to start of dest box */ - unsigned long *psrcBase; /* pointer to start of source */ - unsigned long *psrcLine; /* pointer to fetch point of source */ - unsigned long *psrcStart; /* pointer to start of source line */ - register unsigned long *pdst; - register unsigned long *psrc; - register unsigned long bits, bits1; + CfbBits *pdstBase; /* pointer to start of dest */ + CfbBits *pdstLine; /* poitner to start of dest box */ + CfbBits *psrcBase; /* pointer to start of source */ + CfbBits *psrcLine; /* pointer to fetch point of source */ + CfbBits *psrcStart; /* pointer to start of source line */ + register CfbBits *pdst; + register CfbBits *psrc; + register CfbBits bits, bits1; register int nlTemp; MROP_INITIALIZE (alu, planemask) - psrcBase = (unsigned long *)tile->devPrivate.ptr; + psrcBase = (CfbBits *)tile->devPrivate.ptr; tileHeight = tile->drawable.height; tileWidth = tile->drawable.width; #if PSZ == 24 |