Index: xc/ChangeLog =================================================================== RCS file: /cvs/xorg/xc/ChangeLog,v retrieving revision 1.679 diff -u -2 -0 -r1.679 ChangeLog --- xc/ChangeLog 14 Jan 2005 06:20:17 -0000 1.679 +++ xc/ChangeLog 14 Jan 2005 08:25:55 -0000 @@ -1,20 +1,58 @@ +2005-01-14 Roland Mainz + * xc/programs/Xserver/afb/afbbres.c + * xc/programs/Xserver/afb/afbbresd.c + * xc/programs/Xserver/afb/afbclip.c + * xc/programs/Xserver/afb/afbhrzvert.c + * xc/programs/Xserver/afb/afbline.c + * xc/programs/Xserver/afb/afbmodule.c + * xc/programs/Xserver/afb/afbpixmap.c + * xc/programs/Xserver/afb/afbpolypnt.c + * xc/programs/Xserver/afb/afbpushpxl.c + * xc/programs/Xserver/afb/afbtegblt.c + * xc/programs/Xserver/cfb/Imakefile.inc + * xc/programs/Xserver/cfb/cfballpriv.c + * xc/programs/Xserver/cfb/cfbbitblt.c + * xc/programs/Xserver/cfb/cfbcppl.c + * xc/programs/Xserver/cfb/cfbgc.c + * xc/programs/Xserver/cfb/cfbglblt8.c + * xc/programs/Xserver/cfb/cfbmap.h + * xc/programs/Xserver/cfb/cfbpixmap.c + * xc/programs/Xserver/cfb/cfbscrinit.c + * xc/programs/Xserver/cfb/cfbtab.h + * xc/programs/Xserver/cfb/cfbteblt8.c + * xc/programs/Xserver/cfb/cfbunmap.h + * xc/programs/Xserver/mfb/maskbits.c + * xc/programs/Xserver/mfb/maskbits.h + * xc/programs/Xserver/mfb/mergerop.h + * xc/programs/Xserver/mfb/mfb.h + * xc/programs/Xserver/mfb/mfbclip.c + * xc/programs/Xserver/mfb/mfbfont.c + * xc/programs/Xserver/mfb/mfbgc.c + * xc/programs/Xserver/mfb/mfbmisc.c + * xc/programs/Xserver/mfb/mfbpushpxl.c + * xc/programs/Xserver/XpConfig/Imakefile + Bugzilla #1114 (https://bugs.freedesktop.org/show_bug.cgi?id=1114) + attachment #667 (https://bugs.freedesktop.org/attachment.cgi?id=667): + Convert afb and cfb{,16,24,32} to be dlloader-friendly. + Patch by Adam Jackson . + 2005-01-14 Adam Jackson * programs/Xserver/hw/xfree86/drivers/sunleo/Imakefile: * programs/Xserver/hw/xfree86/drivers/sunleo/leo_accel.c: * programs/Xserver/hw/xfree86/drivers/sunleo/leo_bcopy.c: * programs/Xserver/hw/xfree86/drivers/sunleo/leo_checks.c: * programs/Xserver/hw/xfree86/drivers/sunleo/leo_driver.c: * programs/Xserver/hw/xfree86/drivers/sunleo/leo_frect.c: * programs/Xserver/hw/xfree86/drivers/sunleo/leo_frectsp.c: * programs/Xserver/hw/xfree86/drivers/sunleo/leo_fspans.c: * programs/Xserver/hw/xfree86/drivers/sunleo/leo_fspanssp.c: * programs/Xserver/hw/xfree86/drivers/sunleo/leo_gc.c: * programs/Xserver/hw/xfree86/drivers/sunleo/leo_gc.h: * programs/Xserver/hw/xfree86/drivers/sunleo/leo_glyph.c: * programs/Xserver/hw/xfree86/drivers/sunleo/leo_stubs.c: Bug #1259: Convert sunleo(4) to fb. 2005-01-14 Adam Jackson * programs/Xserver/hw/xfree86/drivers/sunffb/ffb_accel.c: Index: xc/programs/Xserver/afb/afbbres.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/afb/afbbres.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 afbbres.c --- xc/programs/Xserver/afb/afbbres.c 23 Apr 2004 18:59:39 -0000 1.2 +++ xc/programs/Xserver/afb/afbbres.c 14 Jan 2005 08:26:10 -0000 @@ -62,65 +62,65 @@ void afbBresS(addrlbase, nlwidth, sizeDst, depthDst, signdx, signdy, axis, x1, y1, e, e1, e2, len, rrops) PixelType *addrlbase; /* pointer to base of bitmap */ int nlwidth; /* width in longwords of bitmap */ int sizeDst; int depthDst; int signdx, signdy; /* signs of directions */ int axis; /* major axis (Y_AXIS or X_AXIS) */ int x1, y1; /* initial point */ register int e; /* error accumulator */ register int e1; /* bresenham increments */ int e2; int len; /* length of line */ unsigned char *rrops; { register int yinc; /* increment to next scanline, in bytes */ register PixelType *addrl; /* bitmask long pointer */ register PixelType bit; /* current bit being set/cleared/etc. */ - PixelType leftbit = mask[0]; /* leftmost bit to process in new word */ - PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */ + PixelType leftbit = mfbGetmask(0); /* leftmost bit to process in new word */ + PixelType rightbit = mfbGetmask(PPW-1); /* rightmost bit to process in new word */ register int e3 = e2-e1; PixelType tmp; int saveE; int saveLen; int d; /* point to longword containing first point */ yinc = signdy * nlwidth; e = e-e1; /* to make looping easier */ if (!len) return; saveLen = len; saveE = e; for (d = 0; d < depthDst; d++) { addrl = afbScanline(addrlbase, x1, y1, nlwidth); addrlbase += sizeDst; /* @@@ NEXT PLANE @@@ */ len = saveLen; e = saveE; - bit = mask[x1 & PIM]; + bit = mfbGetmask(x1 & PIM); switch (rrops[d]) { case RROP_BLACK: if (axis == X_AXIS) { if (signdx > 0) { tmp = *addrl; for (;;) { tmp &= ~bit; if (!--len) break; bit = SCRRIGHT(bit,1); e += e1; if (e >= 0) { *addrl = tmp; afbScanlineInc(addrl, yinc); e += e3; if (!bit) { bit = leftbit; addrl ++; } Index: xc/programs/Xserver/afb/afbbresd.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/afb/afbbresd.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 afbbresd.c --- xc/programs/Xserver/afb/afbbresd.c 23 Apr 2004 18:59:39 -0000 1.2 +++ xc/programs/Xserver/afb/afbbresd.c 14 Jan 2005 08:26:10 -0000 @@ -76,73 +76,73 @@ int *pdashOffset; /* offset into current dash */ int isDoubleDash; PixelType *addrlbase; /* pointer to base of bitmap */ int nlwidth; /* width in longwords of bitmap */ int sizeDst; int depthDst; int signdx, signdy; /* signs of directions */ int axis; /* major axis (Y_AXIS or X_AXIS) */ int x1, y1; /* initial point */ register int e; /* error accumulator */ register int e1; /* bresenham increments */ int e2; int len; /* length of line */ unsigned char *rrops; unsigned char *bgrrops; { register int yinc; /* increment to next scanline, in bytes */ register PixelType *addrl; register int e3 = e2-e1; register unsigned long bit; - PixelType leftbit = mask[0]; /* leftmost bit to process in new word */ - PixelType rightbit = mask[PPW-1]; /* rightmost bit to process in new word */ + PixelType leftbit = mfbGetmask(0); /* leftmost bit to process in new word */ + PixelType rightbit = mfbGetmask(PPW-1); /* rightmost bit to process in new word */ int dashIndex; int dashOffset; int dashRemaining; int rop; int fgrop; int bgrop; int saveE; int saveLen; int d; dashOffset = *pdashOffset; dashIndex = *pdashIndex; dashRemaining = pDash[dashIndex] - dashOffset; /* point to longword containing first point */ yinc = signdy * nlwidth; e = e-e1; /* to make looping easier */ saveE = e; saveLen = len; for (d = 0; d < depthDst; d++) { addrl = afbScanline(addrlbase, x1, y1, nlwidth); addrlbase += sizeDst; /* @@@ NEXT PLANE @@@ */ fgrop = rrops[d]; bgrop = bgrrops[d]; e = saveE; len = saveLen; - bit = mask[x1 & PIM]; + bit = mfbGetmask(x1 & PIM); rop = fgrop; if (!isDoubleDash) bgrop = -1; if (dashIndex & 1) rop = bgrop; if (axis == X_AXIS) { if (signdx > 0) { while(len--) { if (rop == RROP_BLACK) *addrl &= ~bit; else if (rop == RROP_WHITE) *addrl |= bit; else if (rop == RROP_INVERT) *addrl ^= bit; e += e1; if (e >= 0) { afbScanlineInc(addrl, yinc); e += e3; Index: xc/programs/Xserver/afb/afbclip.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/afb/afbclip.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 afbclip.c --- xc/programs/Xserver/afb/afbclip.c 23 Apr 2004 18:59:39 -0000 1.2 +++ xc/programs/Xserver/afb/afbclip.c 14 Jan 2005 08:26:10 -0000 @@ -85,41 +85,41 @@ /* Convert bitmap clip mask into clipping region. * First, goes through each line and makes boxes by noting the transitions * from 0 to 1 and 1 to 0. * Then it coalesces the current line with the previous if they have boxes * at the same X coordinates. */ RegionPtr afbPixmapToRegion(pPix) PixmapPtr pPix; { register RegionPtr pReg; register PixelType *pw, w; register int ib; int width, h, base, rx1 = 0, crects; PixelType *pwLineEnd; int irectPrevStart, irectLineStart; register BoxPtr prectO, prectN; BoxPtr FirstRect, rects, prectLineStart; Bool fInBox, fSame; - register PixelType mask0 = mask[0]; + register PixelType mask0 = mfbGetmask(0); PixelType *pwLine; int nWidth; pReg = REGION_CREATE(pPix->drawable.pScreen, NULL, 1); if(!pReg) return NullRegion; FirstRect = REGION_BOXPTR(pReg); rects = FirstRect; pwLine = (PixelType *) pPix->devPrivate.ptr; nWidth = pPix->devKind / PGSZB; width = pPix->drawable.width; pReg->extents.x1 = width - 1; pReg->extents.x2 = 0; irectPrevStart = -1; for(h = 0; h < pPix->drawable.height; h++) { pw = pwLine; pwLine += nWidth; irectLineStart = rects - FirstRect; Index: xc/programs/Xserver/afb/afbhrzvert.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/afb/afbhrzvert.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 afbhrzvert.c --- xc/programs/Xserver/afb/afbhrzvert.c 23 Apr 2004 18:59:39 -0000 1.2 +++ xc/programs/Xserver/afb/afbhrzvert.c 14 Jan 2005 08:26:11 -0000 @@ -169,39 +169,39 @@ { register PixelType *addrl; register PixelType bitmask; int saveLen; int d; if (len < 0) { nlwidth = -nlwidth; len = -len; } saveLen = len; for (d = 0; d < depthDst; d++) { addrl = afbScanline(pbase, x1, y1, nlwidth); pbase += sizeDst; /* @@@ NEXT PLANE @@@ */ len = saveLen; switch (rrops[d]) { case RROP_BLACK: - bitmask = rmask[x1 & PIM]; + bitmask = mfbGetrmask(x1 & PIM); Duff(len, *addrl &= bitmask; afbScanlineInc(addrl, nlwidth) ); break; case RROP_WHITE: - bitmask = mask[x1 & PIM]; + bitmask = mfbGetmask(x1 & PIM); Duff(len, *addrl |= bitmask; afbScanlineInc(addrl, nlwidth) ); break; case RROP_INVERT: - bitmask = mask[x1 & PIM]; + bitmask = mfbGetmask(x1 & PIM); Duff(len, *addrl ^= bitmask; afbScanlineInc(addrl, nlwidth) ); break; case RROP_NOP: break; } /* switch */ } /* for (d = ...) */ } Index: xc/programs/Xserver/afb/afbline.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/afb/afbline.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 afbline.c --- xc/programs/Xserver/afb/afbline.c 23 Apr 2004 18:59:39 -0000 1.2 +++ xc/programs/Xserver/afb/afbline.c 14 Jan 2005 08:26:11 -0000 @@ -384,47 +384,47 @@ /* paint the last point if the end style isn't CapNotLast. (Assume that a projecting, butt, or round cap that is one pixel wide is the same as the single pixel of the endpoint.) */ if ((pGC->capStyle != CapNotLast) && ((ppt->x + xorg != pptInit->x + pDrawable->x) || (ppt->y + yorg != pptInit->y + pDrawable->y) || (ppt == pptInit + 1))) { nbox = nboxInit; pbox = pboxInit; while (nbox--) { if ((x2 >= pbox->x1) && (y2 >= pbox->y1) && (x2 < pbox->x2) && (y2 < pbox->y2)) { for (d = 0; d < depthDst; d++) { addrl = afbScanline(addrlBase, x2, y2, nlwidth); addrlBase += sizeDst; /* @@@ NEXT PLANE @@@ */ switch(rrops[d]) { case RROP_BLACK: - *addrl &= rmask[x2 & PIM]; + *addrl &= mfbGetrmask(x2 & PIM); break; case RROP_WHITE: - *addrl |= mask[x2 & PIM]; + *addrl |= mfbGetmask(x2 & PIM); break; case RROP_INVERT: - *addrl ^= mask[x2 & PIM]; + *addrl ^= mfbGetmask(x2 & PIM); break; case RROP_NOP: break; } /* switch */ } /* for (d = ...) */ break; } else pbox++; } } #endif } /* * Draw dashed 1-pixel lines. */ void #ifdef POLYSEGMENT afbSegmentSD(pDrawable, pGC, nseg, pSeg) @@ -662,41 +662,41 @@ ((ppt->x + xorg != pptInit->x + pDrawable->x) || (ppt->y + yorg != pptInit->y + pDrawable->y) || (ppt == pptInit + 1))) { nbox = nboxInit; pbox = pboxInit; while (nbox--) { if ((x2 >= pbox->x1) && (y2 >= pbox->y1) && (x2 < pbox->x2) && (y2 < pbox->y2)) { int rop; for (d = 0; d < depthDst; d++) { addrl = afbScanline(addrlBase, x2, y2, nlwidth); addrlBase += sizeDst; /* @@@ NEXT PLANE @@@ */ rop = rrops[d]; if (dashIndex & 1) rop = bgrrops[d]; switch (rop) { case RROP_BLACK: - *addrl &= rmask[x2 & PIM]; + *addrl &= mfbGetrmask(x2 & PIM); break; case RROP_WHITE: - *addrl |= mask[x2 & PIM]; + *addrl |= mfbGetmask(x2 & PIM); break; case RROP_INVERT: - *addrl ^= mask[x2 & PIM]; + *addrl ^= mfbGetmask(x2 & PIM); break; case RROP_NOP: break; } } /* for (d = ...) */ break; } else pbox++; } } #endif } Index: xc/programs/Xserver/afb/afbmodule.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/afb/afbmodule.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 afbmodule.c --- xc/programs/Xserver/afb/afbmodule.c 23 Apr 2004 18:59:39 -0000 1.2 +++ xc/programs/Xserver/afb/afbmodule.c 14 Jan 2005 08:26:11 -0000 @@ -13,37 +13,47 @@ * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * Except as contained in this notice, the name of the XFree86 Project 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 * XFree86 Project. */ #ifdef XFree86LOADER #include "xf86Module.h" #include "afb.h" +static MODULESETUPPROTO(afbSetup); + static XF86ModuleVersionInfo VersRec = { "afb", MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, XORG_VERSION_CURRENT, 1, 0, 0, ABI_CLASS_ANSIC, /* Only need the ansic layer */ ABI_ANSIC_VERSION, MOD_CLASS_NONE, {0,0,0,0} /* signature, to be patched into the file by a tool */ }; -XF86ModuleData afbModuleData = { &VersRec, NULL, NULL }; +XF86ModuleData afbModuleData = { &VersRec, afbSetup, NULL }; + +static pointer +afbSetup(pointer module, pointer opts, int *errmaj, int *errmin) +{ + /* This modules requires mfb, so load it */ + return LoadSubModule(module, "mfb", NULL, NULL, NULL, NULL, + errmaj, errmin); +} #endif Index: xc/programs/Xserver/afb/afbpixmap.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/afb/afbpixmap.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 afbpixmap.c --- xc/programs/Xserver/afb/afbpixmap.c 23 Apr 2004 18:59:39 -0000 1.2 +++ xc/programs/Xserver/afb/afbpixmap.c 14 Jan 2005 08:26:11 -0000 @@ -147,41 +147,41 @@ void afbPadPixmap(pPixmap) PixmapPtr pPixmap; { register int width = pPixmap->drawable.width; register int h; register PixelType mask; register PixelType *p; register PixelType bits; /* real pattern bits */ register int i; int d; int rep; /* repeat count for pattern */ if (width >= PPW) return; rep = PPW/width; if (rep*width != PPW) return; - mask = endtab[width]; + mask = mfbGetendtab(width); p = (PixelType *)(pPixmap->devPrivate.ptr); for (d = 0; d < pPixmap->drawable.depth; d++) { for (h = 0; h < pPixmap->drawable.height; h++) { *p &= mask; bits = *p; for(i = 1; i < rep; i++) { bits = SCRRIGHT(bits, width); *p |= bits; } p++; /* @@@ NEXT PLANE @@@ */ } } pPixmap->drawable.width = PPW; } /* Rotates pixmap pPix by w pixels to the right on the screen. Assumes that * words are PPW bits wide, and that the least significant bit appears on the * left. @@ -189,41 +189,41 @@ void afbXRotatePixmap(pPix, rw) PixmapPtr pPix; register int rw; { register PixelType *pw, *pwFinal; register PixelType t; if (pPix == NullPixmap) return; pw = (PixelType *)pPix->devPrivate.ptr; rw %= (int)pPix->drawable.width; if (rw < 0) rw += (int)pPix->drawable.width; if(pPix->drawable.width == PPW) { pwFinal = pw + pPix->drawable.height * pPix->drawable.depth; while(pw < pwFinal) { t = *pw; *pw++ = SCRRIGHT(t, rw) | - (SCRLEFT(t, (PPW-rw)) & endtab[rw]); + (SCRLEFT(t, (PPW-rw)) & mfbGetendtab(rw)); } } else { /* We no longer do this. Validate doesn't try to rotate odd-size * tiles or stipples. afbUnnaturalFS works directly off * the unrotate tile/stipple in the GC */ ErrorF("X internal error: trying to rotate odd-sized pixmap.\n"); } } /* Rotates pixmap pPix by h lines. Assumes that h is always less than pPix->height works on any width. */ void afbYRotatePixmap(pPix, rh) register PixmapPtr pPix; int rh; { Index: xc/programs/Xserver/afb/afbpolypnt.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/afb/afbpolypnt.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 afbpolypnt.c --- xc/programs/Xserver/afb/afbpolypnt.c 23 Apr 2004 18:59:39 -0000 1.2 +++ xc/programs/Xserver/afb/afbpolypnt.c 14 Jan 2005 08:26:11 -0000 @@ -96,49 +96,49 @@ rrops = pGCPriv->rrops; if ((mode == CoordModePrevious) && (npt > 1)) for (ppt = pptInit + 1, nptTmp = npt - 1; --nptTmp >= 0; ppt++) { ppt->x += (ppt-1)->x; ppt->y += (ppt-1)->y; } nbox = REGION_NUM_RECTS(pGC->pCompositeClip); pbox = REGION_RECTS(pGC->pCompositeClip); for (; --nbox >= 0; pbox++) for (d = 0, pBase = pBaseSave; d < depthDst; d++, pBase += sizeDst) { /* @@@ NEXT PLANE @@@ */ addrl = pBase; switch (rrops[d]) { case RROP_BLACK: for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) { x = ppt->x + pDrawable->x; y = ppt->y + pDrawable->y; if ((x >= pbox->x1) && (x < pbox->x2) && (y >= pbox->y1) && (y < pbox->y2)) - *afbScanline(addrl, x, y, nlwidth) &= rmask[x & PIM]; + *afbScanline(addrl, x, y, nlwidth) &= mfbGetrmask(x & PIM); } break; case RROP_WHITE: for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) { x = ppt->x + pDrawable->x; y = ppt->y + pDrawable->y; if ((x >= pbox->x1) && (x < pbox->x2) && (y >= pbox->y1) && (y < pbox->y2)) - *afbScanline(addrl, x, y, nlwidth) |= mask[x & PIM]; + *afbScanline(addrl, x, y, nlwidth) |= mfbGetmask(x & PIM); } break; case RROP_INVERT: for (ppt = pptInit, nptTmp = npt; --nptTmp >= 0; ppt++) { x = ppt->x + pDrawable->x; y = ppt->y + pDrawable->y; if ((x >= pbox->x1) && (x < pbox->x2) && (y >= pbox->y1) && (y < pbox->y2)) - *afbScanline(addrl, x, y, nlwidth) ^= mask[x & PIM]; + *afbScanline(addrl, x, y, nlwidth) ^= mfbGetmask(x & PIM); } break; case RROP_NOP: break; } /* switch */ } /* for (d = ...) */ } Index: xc/programs/Xserver/afb/afbpushpxl.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/afb/afbpushpxl.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 afbpushpxl.c --- xc/programs/Xserver/afb/afbpushpxl.c 23 Apr 2004 18:59:39 -0000 1.2 +++ xc/programs/Xserver/afb/afbpushpxl.c 14 Jan 2005 08:26:11 -0000 @@ -167,71 +167,71 @@ register int ipt; /* index into above arrays */ Bool fInBox; DDXPointRec pt[NPT]; int width[NPT]; /* Now scan convert the pixmap and use the result to call fillspans in * in the drawable with the original GC */ ipt = 0; dxDivPPW = dx/PPW; for (h = 0; h < dy; h++) { pw = (PixelType *) (((char *)(pBitMap->devPrivate.ptr))+(h * pBitMap->devKind)); pwLineStart = pw; /* Process all words which are fully in the pixmap */ fInBox = FALSE; pwEnd = pwLineStart + dxDivPPW; while(pw < pwEnd) { w = *pw; - mask = endtab[1]; + mask = mfbGetendtab(1); for(ib = 0; ib < PPW; ib++) { if(w & mask) { if(!fInBox) { pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg; pt[ipt].y = h + yOrg; /* start new box */ fInBox = TRUE; } } else { if(fInBox) { width[ipt] = ((pw - pwLineStart) << PWSH) + ib + xOrg - pt[ipt].x; if (++ipt >= NPT) { (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt, width, TRUE); ipt = 0; } /* end box */ fInBox = FALSE; } } mask = SCRRIGHT(mask, 1); } pw++; } ibEnd = dx & PIM; if(ibEnd) { /* Process final partial word on line */ w = *pw; - mask = endtab[1]; + mask = mfbGetendtab(1); for(ib = 0; ib < ibEnd; ib++) { if(w & mask) { if(!fInBox) { /* start new box */ pt[ipt].x = ((pw - pwLineStart) << PWSH) + ib + xOrg; pt[ipt].y = h + yOrg; fInBox = TRUE; } } else { if(fInBox) { /* end box */ width[ipt] = ((pw - pwLineStart) << PWSH) + ib + xOrg - pt[ipt].x; if (++ipt >= NPT) { (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt, width, TRUE); ipt = 0; } fInBox = FALSE; } Index: xc/programs/Xserver/afb/afbtegblt.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/afb/afbtegblt.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 afbtegblt.c --- xc/programs/Xserver/afb/afbtegblt.c 23 Apr 2004 18:59:39 -0000 1.2 +++ xc/programs/Xserver/afb/afbtegblt.c 14 Jan 2005 08:26:11 -0000 @@ -279,41 +279,41 @@ compute which is the first glyph inside the left edge, and the last one inside the right edge draw a fractional first glyph, using only the rows we know are in draw all the whole glyphs, using the appropriate rows draw any pieces of the last glyph, using the right rows this way, the code would take advantage of knowing that all glyphs are the same height and don't overlap. one day... */ afbImageGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); case rgnOUT: return; } pdstBase = afbScanlineDeltaNoBankSwitch(pdstBase, ypos, widthDst); widthGlyphs = widthGlyph * PGSZB; #ifdef USE_LEFTBITS - glyphMask = endtab[widthGlyph]; + glyphMask = mfbGetendtab(widthGlyph); glyphBytes = GLYPHWIDTHBYTESPADDED(*ppci); #endif if (nglyph >= PGSZB && widthGlyphs <= PPW) { while (nglyph >= PGSZB) { nglyph -= PGSZB; xoff1 = xpos & PIM; xoff2 = widthGlyph; xoff3 = xoff2 + widthGlyph; xoff4 = xoff3 + widthGlyph; #if PPW == 64 xoff5 = xoff4 + widthGlyph; xoff6 = xoff5 + widthGlyph; xoff7 = xoff6 + widthGlyph; xoff8 = xoff7 + widthGlyph; #endif /* PPW */ schar1 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++)); schar2 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++)); schar3 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++)); schar4 = (glyphPointer)FONTGLYPHBITS(pglyphBase,(*ppci++)); Index: xc/programs/Xserver/cfb/Imakefile.inc =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/cfb/Imakefile.inc,v retrieving revision 1.3 diff -u -2 -0 -r1.3 Imakefile.inc --- xc/programs/Xserver/cfb/Imakefile.inc 26 Apr 2004 02:39:58 -0000 1.3 +++ xc/programs/Xserver/cfb/Imakefile.inc 14 Jan 2005 08:26:12 -0000 @@ -48,67 +48,68 @@ STIPPLEOBJ = stipsprc32.o stipsprcte32.o STIPPLEDEF = -DHAS_STIPPLE_CODE #endif #endif #endif #ifdef SparcArchitecture # if DoLoadableServer && MakeDllModules # define SharedAsmDefines -DSHAREDCODE # else # define SharedAsmDefines /**/ # endif ASMDEFINES = AsmDefines SharedAsmDefines #endif #if defined(IHaveModules) XFMODSRC = cfbmodule.c XFMODOBJ = cfbmodule.o #endif +XCOMM THIS IS STUPID #if !(defined(IHaveModules) && defined(LinkDirectory)) CFBCMAP = cfbcmap.o #endif SRCS = cfbgc.c cfbrrop.c cfbwindow.c \ cfbpntwin.c cfbmskbits.c cfbpixmap.c cfbbitblt.c \ cfbfillsp.c cfbsetsp.c cfbscrinit.c cfballpriv.c \ cfbgetsp.c cfbfillrct.c \ cfbsolidC.c cfbsolidX.c cfbsolidG.c \ cfbtileoddC.c cfbtileoddG.c cfbtile32C.c cfbtile32G.c \ cfbcmap.c cfbzerarcC.c cfbzerarcX.c cfbzerarcG.c \ cfbfillarcC.c cfbfillarcG.c \ cfbigblt8.c cfbglblt8.c cfbtegblt.c cfbbstore.c \ cfbbltC.c cfbbltX.c cfbbltO.c cfbbltG.c \ cfbpolypnt.c \ cfbbres.c cfbline.c cfbhrzvert.c cfbbresd.c cfbimage.c cfbseg.c \ cfb8lineCO.c cfb8lineX.c cfb8lineG.c cfb8lineCP.c \ cfb8segC.c cfb8segX.c cfb8segG.c cfb8segCS.c \ cfbply1rctC.c cfbply1rctG.c cfbcppl.c $(PSZSRCS) $(XFMODSRC) OBJS = cfbgc.o cfbrrop.o cfbwindow.o \ cfbgetsp.o cfbfillrct.o \ cfbsolidC.o cfbsolidX.o cfbsolidG.o \ cfbtileoddC.o cfbtileoddG.o cfbtile32C.o cfbtile32G.o \ cfbfillsp.o cfbsetsp.o cfbscrinit.o cfballpriv.o \ cfbpntwin.o cfbmskbits.o cfbpixmap.o \ - $(CFBCMAP) cfbzerarcC.o cfbzerarcX.o cfbzerarcG.o \ + cfbcmap.o cfbzerarcC.o cfbzerarcX.o cfbzerarcG.o \ cfbfillarcC.o cfbfillarcG.o \ cfbigblt8.o cfbglblt8.o cfbtegblt.o cfbbstore.o \ cfbpolypnt.o \ cfbbres.o cfbline.o cfbhrzvert.o cfbbresd.o cfbimage.o cfbseg.o \ cfb8lineCO.o cfb8lineX.o cfb8lineG.o cfb8lineCP.o \ cfb8segCS.o cfb8segX.o cfb8segG.o cfb8segC.o \ cfbbitblt.o cfbbltC.o cfbbltX.o cfbbltO.o cfbbltG.o \ cfbply1rctC.o cfbply1rctG.o cfbcppl.o $(PSZOBJS) $(STIPPLEOBJ) \ $(XFMODOBJ) #if (defined(XFree86Version) || defined(XorgVersion)) PLATFORMDEFS = -DXFREE86 #endif #if BuildLowMem LMDEFINES = -ULOWMEMFTPT #endif INCLUDES = -I$(SERVERSRC)/cfb -I$(SERVERSRC)/mfb -I$(SERVERSRC)/mi \ -I$(SERVERSRC)/cfb24 -I$(SERVERSRC)/include -I$(XINCLUDESRC) \ Index: xc/programs/Xserver/cfb/cfballpriv.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/cfb/cfballpriv.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 cfballpriv.c --- xc/programs/Xserver/cfb/cfballpriv.c 23 Apr 2004 19:00:12 -0000 1.2 +++ xc/programs/Xserver/cfb/cfballpriv.c 14 Jan 2005 08:26:12 -0000 @@ -25,41 +25,41 @@ * * Author: Keith Packard, MIT X Consortium */ /* $XFree86: xc/programs/Xserver/cfb/cfballpriv.c,v 1.11 2001/01/30 22:06:15 tsi Exp $ */ #include "X.h" #include "Xmd.h" #include "servermd.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "resource.h" #include "colormap.h" #include "colormapst.h" #include "cfb.h" #include "mi.h" #include "mistruct.h" #include "dix.h" #include "cfbmskbits.h" #include "mibstore.h" -#if PSZ==8 +#if 1 || PSZ==8 int cfbWindowPrivateIndex; int cfbGCPrivateIndex; #endif #ifdef CFB_NEED_SCREEN_PRIVATE int cfbScreenPrivateIndex = -1; static unsigned long cfbGeneration = 0; #endif Bool cfbAllocatePrivates(pScreen, window_index, gc_index) ScreenPtr pScreen; int *window_index, *gc_index; { if (!window_index || !gc_index || (*window_index == -1 && *gc_index == -1)) { if (!mfbAllocatePrivates(pScreen, &cfbWindowPrivateIndex, &cfbGCPrivateIndex)) return FALSE; Index: xc/programs/Xserver/cfb/cfbbitblt.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/cfb/cfbbitblt.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 cfbbitblt.c --- xc/programs/Xserver/cfb/cfbbitblt.c 23 Apr 2004 19:00:12 -0000 1.2 +++ xc/programs/Xserver/cfb/cfbbitblt.c 14 Jan 2005 08:26:13 -0000 @@ -956,49 +956,49 @@ { src = GetBitGroup (tmp); *pdst = RRopPixels (*pdst, src); pdst++; NextBitGroup(tmp); } if (endmask) { src = GetBitGroup (tmp); *pdst = MaskRRopPixels (*pdst, src, endmask); } } } /* end copy one row */ } /* end alu is non-copy-mode case */ } /* end iteration over region boxes */ } #else /* PSZ == 8 */ #define mfbmaskbits(x, w, startmask, endmask, nlw) \ - startmask = starttab[(x)&0x1f]; \ - endmask = endtab[((x)+(w)) & 0x1f]; \ + startmask = mfbGetstarttab((x)&0x1f); \ + endmask = mfbGetendtab(((x)+(w)) & 0x1f); \ if (startmask) \ nlw = (((w) - (32 - ((x)&0x1f))) >> 5); \ else \ nlw = (w) >> 5; #define mfbmaskpartialbits(x, w, mask) \ - mask = partmasks[(x)&0x1f][(w)&0x1f]; + mask = mfbGetpartmasks((x)&0x1f,(w)&0x1f); #define LeftMost 0 #define StepBit(bit, inc) ((bit) += (inc)) #define GetBits(psrc, nBits, curBit, bitPos, bits) {\ bits = 0; \ while (nBits--) \ { \ bits |= ((*psrc++ >> bitPos) & 1) << curBit; \ StepBit (curBit, 1); \ } \ } /******************************************************************/ static void #if PSZ == 16 cfbCopyPlane1to16 #endif @@ -1372,41 +1372,41 @@ cfb8CheckOpaqueStipple (pGC->alu, pGC->fgPixel, pGC->bgPixel, pGC->planemask); #else FgPixel = pGC->fgPixel; BgPixel = pGC->bgPixel; #endif ret = cfbCopyPlaneExpand (pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, doCopyPlaneExpand, bitPlane); } else ret = miHandleExposures (pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, bitPlane); } else if (pSrcDrawable->bitsPerPixel == PSZ && pDstDrawable->bitsPerPixel == 1) { int oldalu; oldalu = pGC->alu; if ((pGC->fgPixel & 1) == 0 && (pGC->bgPixel&1) == 1) - pGC->alu = InverseAlu[pGC->alu]; + pGC->alu = mfbGetInverseAlu(pGC->alu); else if ((pGC->fgPixel & 1) == (pGC->bgPixel & 1)) pGC->alu = mfbReduceRop(pGC->alu, pGC->fgPixel); ret = cfbCopyPlaneReduce(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, cfbCopyPlaneNto1, bitPlane); pGC->alu = oldalu; } else if (pSrcDrawable->bitsPerPixel == PSZ && pDstDrawable->bitsPerPixel == PSZ) { PixmapPtr pBitmap; ScreenPtr pScreen = pSrcDrawable->pScreen; GCPtr pGC1; pBitmap = (*pScreen->CreatePixmap) (pScreen, width, height, 1); if (!pBitmap) return NULL; pGC1 = GetScratchGC (1, pScreen); if (!pGC1) { (*pScreen->DestroyPixmap) (pBitmap); Index: xc/programs/Xserver/cfb/cfbcppl.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/cfb/cfbcppl.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 cfbcppl.c --- xc/programs/Xserver/cfb/cfbcppl.c 23 Apr 2004 19:00:12 -0000 1.2 +++ xc/programs/Xserver/cfb/cfbcppl.c 14 Jan 2005 08:26:13 -0000 @@ -228,49 +228,49 @@ curBit = LeftMost; GetBits (psrc, i, curBit, bitPos, bits); *pdst = MROP_SOLID(bits, *pdst); pdst++; } if (endmask) { i = niEnd; curBit = bitEnd; GetBits (psrc, i, curBit, bitPos, bits); *pdst = MROP_MASK (bits, *pdst, endmask); } } } } } #else /* PSZ == 8 */ #define mfbmaskbits(x, w, startmask, endmask, nlw) \ - startmask = starttab[(x)&0x1f]; \ - endmask = endtab[((x)+(w)) & 0x1f]; \ + startmask = mfbGetstarttab((x)&0x1f); \ + endmask = mfbGetendtab(((x)+(w)) & 0x1f); \ if (startmask) \ nlw = (((w) - (32 - ((x)&0x1f))) >> 5); \ else \ nlw = (w) >> 5; #define mfbmaskpartialbits(x, w, mask) \ - mask = partmasks[(x)&0x1f][(w)&0x1f]; + mask = mfbGetpartmasks((x)&0x1f,(w)&0x1f); #define LeftMost 0 #define StepBit(bit, inc) ((bit) += (inc)) #if PSZ == 24 #define GetBits(psrc, nBits, curBit, bitPos, bits) {\ bits = 0; \ while (nBits--) \ { \ if (bitPos < 8) \ { \ bits |= ((*psrc++ >> bitPos) & 1) << curBit; \ psrc += 2; \ } \ else if (bitPos < 16) \ { \ psrc++; \ bits |= ((*psrc++ >> (bitPos - 8)) & 1) << curBit; \ psrc++; \ Index: xc/programs/Xserver/cfb/cfbgc.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/cfb/cfbgc.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 cfbgc.c --- xc/programs/Xserver/cfb/cfbgc.c 23 Apr 2004 19:00:12 -0000 1.2 +++ xc/programs/Xserver/cfb/cfbgc.c 14 Jan 2005 08:26:13 -0000 @@ -68,45 +68,47 @@ #include "cfb8bit.h" #if PSZ == 8 # define useTEGlyphBlt cfbTEGlyphBlt8 #else # ifdef WriteBitGroup # define useTEGlyphBlt cfbImageGlyphBlt8 # else # define useTEGlyphBlt cfbTEGlyphBlt # endif #endif #ifdef WriteBitGroup # define useImageGlyphBlt cfbImageGlyphBlt8 # define usePolyGlyphBlt cfbPolyGlyphBlt8 #else # define useImageGlyphBlt miImageGlyphBlt # define usePolyGlyphBlt miPolyGlyphBlt #endif +void cfbUnPushPixels (GCPtr, PixmapPtr, DrawablePtr, int, int, int, int); + #ifdef FOUR_BIT_CODE # define usePushPixels cfbPushPixels8 #else #ifndef LOWMEMFTPT -# define usePushPixels mfbPushPixels +# define usePushPixels cfbUnPushPixels #else # define usePushPixels miPushPixels #endif /* ifndef LOWMEMFTPT */ #endif #ifdef PIXEL_ADDR # define ZeroPolyArc cfbZeroPolyArcSS8Copy #else # define ZeroPolyArc miZeroPolyArc #endif GCFuncs cfbGCFuncs = { cfbValidateGC, miChangeGC, miCopyGC, miDestroyGC, miChangeClip, miDestroyClip, miCopyClip, }; @@ -267,40 +269,48 @@ if (devPriv->oneRect) return &cfbNonTEOps1Rect; else return &cfbNonTEOps; #endif } return 0; } Bool cfbCreateGC(pGC) register GCPtr pGC; { cfbPrivGC *pPriv; if (PixmapWidthPaddingInfo[pGC->depth].padPixelsLog2 == LOG2_BITMAP_PAD) return (mfbCreateGC(pGC)); pGC->clientClip = NULL; pGC->clientClipType = CT_NONE; + if (cfbNonTEOps.PushPixels == cfbUnPushPixels) + { + cfbTEOps1Rect.PushPixels = mfbPushPixelsWeak(); + cfbNonTEOps1Rect.PushPixels = mfbPushPixelsWeak(); + cfbTEOps.PushPixels = mfbPushPixelsWeak(); + cfbNonTEOps.PushPixels = mfbPushPixelsWeak(); + } + /* * some of the output primitives aren't really necessary, since they * will be filled in ValidateGC because of dix/CreateGC() setting all * the change bits. Others are necessary because although they depend * on being a color frame buffer, they don't change */ pGC->ops = &cfbNonTEOps; pGC->funcs = &cfbGCFuncs; /* cfb wants to translate before scan conversion */ pGC->miTranslate = 1; pPriv = cfbGetGCPrivate(pGC); pPriv->rop = pGC->alu; pPriv->oneRect = FALSE; pGC->fExpose = TRUE; pGC->freeCompClip = FALSE; pGC->pRotatedPixmap = (PixmapPtr) NULL; return TRUE; @@ -750,42 +760,56 @@ pGC->ops->FillSpans = cfb8OpaqueStipple32FS; else #endif pGC->ops->FillSpans = cfbUnnaturalStippleFS; break; default: FatalError("cfbValidateGC: illegal fillStyle\n"); } } /* end of new_fillspans */ if (new_fillarea) { #ifndef FOUR_BIT_CODE pGC->ops->PolyFillRect = miPolyFillRect; if (pGC->fillStyle == FillSolid || pGC->fillStyle == FillTiled) { pGC->ops->PolyFillRect = cfbPolyFillRect; } #endif #ifdef FOUR_BIT_CODE #ifndef LOWMEMFTPT - pGC->ops->PushPixels = mfbPushPixels; + pGC->ops->PushPixels = mfbPushPixelsWeak(); #else pGC->ops->PushPixels = miPushPixels; #endif /* ifndef LOWMEMFTPT */ if (pGC->fillStyle == FillSolid && devPriv->rop == GXcopy) pGC->ops->PushPixels = cfbPushPixels8; #endif pGC->ops->PolyFillArc = miPolyFillArc; if (pGC->fillStyle == FillSolid) { switch (devPriv->rop) { case GXcopy: pGC->ops->PolyFillArc = cfbPolyFillArcSolidCopy; break; default: pGC->ops->PolyFillArc = cfbPolyFillArcSolidGeneral; break; } } } } + +/* + * this is never called, it just exists to have its address + * taken in mfbCreateGC. + */ +static void +cfbUnPushPixels (pGC, pBitmap, pDrawable, dx, dy, xOrg, yOrg) + GCPtr pGC; + PixmapPtr pBitmap; + DrawablePtr pDrawable; + int dx, dy, xOrg, yOrg; +{ + return; +} Index: xc/programs/Xserver/cfb/cfbglblt8.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/cfb/cfbglblt8.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 cfbglblt8.c --- xc/programs/Xserver/cfb/cfbglblt8.c 23 Apr 2004 19:00:12 -0000 1.2 +++ xc/programs/Xserver/cfb/cfbglblt8.c 14 Jan 2005 08:26:13 -0000 @@ -47,41 +47,40 @@ #define BOX_OVERLAP(box1, box2, xoffset, yoffset) \ ((box1)->x1 <= ((int) (box2)->x2 + (xoffset)) && \ ((int) (box2)->x1 + (xoffset)) <= (box1)->x2 && \ (box1)->y1 <= ((int) (box2)->y2 + (yoffset)) && \ ((int) (box2)->y1 + (yoffset)) <= (box1)->y2) #define BOX_CONTAINS(box1, box2, xoffset, yoffset) \ ((box1)->x1 <= ((int) (box2)->x1 + (xoffset)) && \ ((int) (box2)->x2 + (xoffset)) <= (box1)->x2 && \ (box1)->y1 <= ((int) (box2)->y1 + (yoffset)) && \ ((int) (box2)->y2 + (yoffset)) <= (box1)->y2) #if defined(FOUR_BIT_CODE) || defined(WriteBitGroup) && !defined(GLYPHROP) #if GLYPHPADBYTES != 4 #define USE_LEFTBITS #endif #ifdef USE_LEFTBITS typedef unsigned char *glyphPointer; -extern CfbBits endtab[]; #define GlyphBits(bits,width,dst) getleftbits(bits,width,dst); \ (dst) &= widthMask; \ (bits) += widthGlyph; #define GlyphBitsS(bits,width,dst,off) GlyphBits(bits,width,dst); \ dst = BitRight (dst, off); #else typedef CARD32 *glyphPointer; #define GlyphBits(bits,width,dst) dst = *bits++; #define GlyphBitsS(bits,width,dst,off) dst = BitRight(*bits++, off); #endif #ifdef GLYPHROP #define cfbPolyGlyphBlt8 cfbPolyGlyphRop8 #define cfbPolyGlyphBlt8Clipped cfbPolyGlyphRop8Clipped #undef WriteBitGroup #define WriteBitGroup(dst,pixel,bits) RRopBitGroup(dst,bits) @@ -234,41 +233,41 @@ dstLine = pdstBase + (y - pci->metrics.ascent) * widthDst + (xoff >> PWSH); #endif x += pci->metrics.characterWidth; if ((hTmp = pci->metrics.descent + pci->metrics.ascent)) { #if PSZ == 24 xoff &= 0x03; #else xoff &= PIM; #endif /* PSZ == 24 */ #ifdef STIPPLE STIPPLE(dstLine,glyphBits,pixel,bwidthDst,hTmp,xoff); #else #ifdef USE_STIPPLE_CODE (*stipple)(dstLine,glyphBits,pixel,bwidthDst,hTmp,xoff); #else #ifdef USE_LEFTBITS w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing; widthGlyph = PADGLYPHWIDTHBYTES(w); - widthMask = endtab[w]; + widthMask = mfbGetendtab(w); #endif do { dst = dstLine; dstLine = (CfbBits *) (((char *) dstLine) + bwidthDst); GlyphBits(glyphBits, w, c) WriteBitGroup(dst, pixel, GetBitGroup(BitRight(c,xoff))); dst += DST_INC; c = BitLeft(c,PGSZB - xoff); while (c) { WriteBitGroup(dst, pixel, GetBitGroup(c)); NextBitGroup(c); dst += DST_INC; } } while (--hTmp); #endif /* USE_STIPPLE_CODE else */ #endif /* STIPPLE else */ } } } @@ -363,41 +362,41 @@ w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing; xG = x + pci->metrics.leftSideBearing; yG = y - pci->metrics.ascent; x += pci->metrics.characterWidth; if ((hTmp = pci->metrics.descent + pci->metrics.ascent)) { #if PSZ == 24 dstLine = pdstBase + yG * widthDst + ((xG>> 2)*3); /* never use (xG*3)>>2 */ #else dstLine = pdstBase + yG * widthDst + (xG >> PWSH); #endif #if PSZ == 24 xoff = xG & 3; #else xoff = xG & PIM; #endif #ifdef USE_LEFTBITS w = pci->metrics.rightSideBearing - pci->metrics.leftSideBearing; widthGlyph = PADGLYPHWIDTHBYTES(w); - widthMask = endtab[w]; + widthMask = mfbGetendtab(w); #endif switch (cfb8ComputeClipMasks32 (pBox, numRects, xG, yG, w, hTmp, clips)) { case rgnPART: #ifdef USE_LEFTBITS cTmp = clips; do { dst = dstLine; dstLine = (CfbBits *) (((char *) dstLine) + bwidthDst); GlyphBits(glyphBits, w, c) c &= *cTmp++; if (c) { WriteBitGroup(dst, pixel, GetBitGroup(BitRight(c,xoff))); c = BitLeft(c,PGSZB - xoff); dst += DST_INC; while (c) { WriteBitGroup(dst, pixel, GetBitGroup(c)); NextBitGroup(c); Index: xc/programs/Xserver/cfb/cfbmap.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/cfb/cfbmap.h,v retrieving revision 1.2 diff -u -2 -0 -r1.2 cfbmap.h --- xc/programs/Xserver/cfb/cfbmap.h 23 Apr 2004 19:00:12 -0000 1.2 +++ xc/programs/Xserver/cfb/cfbmap.h 14 Jan 2005 08:26:13 -0000 @@ -77,87 +77,94 @@ #undef cfbFillBoxTile32 #undef cfbFillBoxTile32sCopy #undef cfbFillBoxTile32sGeneral #undef cfbFillBoxTileOdd #undef cfbFillBoxTileOddCopy #undef cfbFillBoxTileOddGeneral #undef cfbFillPoly1RectCopy #undef cfbFillPoly1RectGeneral #undef cfbFillRectSolidCopy #undef cfbFillRectSolidGeneral #undef cfbFillRectSolidXor #undef cfbFillRectTile32Copy #undef cfbFillRectTile32General #undef cfbFillRectTileOdd #undef cfbFillSpanTile32sCopy #undef cfbFillSpanTile32sGeneral #undef cfbFillSpanTileOddCopy #undef cfbFillSpanTileOddGeneral #undef cfbFinishScreenInit #undef cfbGCFuncs +#undef cfbGCPrivateIndex #undef cfbGetImage #undef cfbGetScreenPixmap #undef cfbGetSpans #undef cfbHorzS #undef cfbImageGlyphBlt8 +#undef cfbInitializeColormap +#undef cfbInstallColormap #undef cfbLineSD #undef cfbLineSS +#undef cfbListInstalledColormaps #undef cfbMapWindow #undef cfbMatchCommon #undef cfbNonTEOps #undef cfbNonTEOps1Rect #undef cfbPadPixmap #undef cfbPaintWindow #undef cfbPolyFillArcSolidCopy #undef cfbPolyFillArcSolidGeneral #undef cfbPolyFillRect #undef cfbPolyGlyphBlt8 #undef cfbPolyGlyphRop8 #undef cfbPolyPoint #undef cfbPositionWindow #undef cfbPutImage #undef cfbReduceRasterOp +#undef cfbResolveColor #undef cfbRestoreAreas #undef cfbSaveAreas #undef cfbScreenInit #undef cfbScreenPrivateIndex #undef cfbSegmentSD #undef cfbSegmentSS #undef cfbSetScanline #undef cfbSetScreenPixmap #undef cfbSetSpans #undef cfbSetupScreen #undef cfbSolidSpansCopy #undef cfbSolidSpansGeneral #undef cfbSolidSpansXor #undef cfbStippleStack #undef cfbStippleStackTE #undef cfbTEGlyphBlt #undef cfbTEOps #undef cfbTEOps1Rect #undef cfbTile32FSCopy #undef cfbTile32FSGeneral +#undef cfbUninstallColormap #undef cfbUnmapWindow #undef cfbUnnaturalStippleFS #undef cfbUnnaturalTileFS #undef cfbValidateGC #undef cfbVertS +#undef cfbWindowPrivateIndex #undef cfbXRotatePixmap #undef cfbYRotatePixmap #undef cfbZeroPolyArcSS8Copy #undef cfbZeroPolyArcSS8General #undef cfbZeroPolyArcSS8Xor #undef cfbendpartial #undef cfbendtab #undef cfbmask #undef cfbrmask #undef cfbstartpartial #undef cfbstarttab #endif /* a losing vendor cpp dumps core if we define CFBNAME in terms of CATNAME */ #if PSZ != 8 #if PSZ == 32 #if !defined(UNIXCPP) || defined(ANSICPP) #define CFBNAME(subname) cfb32##subname @@ -246,80 +253,87 @@ #define cfbFillBoxTile32 CFBNAME(FillBoxTile32) #define cfbFillBoxTile32sCopy CFBNAME(FillBoxTile32sCopy) #define cfbFillBoxTile32sGeneral CFBNAME(FillBoxTile32sGeneral) #define cfbFillBoxTileOdd CFBNAME(FillBoxTileOdd) #define cfbFillBoxTileOddCopy CFBNAME(FillBoxTileOddCopy) #define cfbFillBoxTileOddGeneral CFBNAME(FillBoxTileOddGeneral) #define cfbFillPoly1RectCopy CFBNAME(FillPoly1RectCopy) #define cfbFillPoly1RectGeneral CFBNAME(FillPoly1RectGeneral) #define cfbFillRectSolidCopy CFBNAME(FillRectSolidCopy) #define cfbFillRectSolidGeneral CFBNAME(FillRectSolidGeneral) #define cfbFillRectSolidXor CFBNAME(FillRectSolidXor) #define cfbFillRectTile32Copy CFBNAME(FillRectTile32Copy) #define cfbFillRectTile32General CFBNAME(FillRectTile32General) #define cfbFillRectTileOdd CFBNAME(FillRectTileOdd) #define cfbFillSpanTile32sCopy CFBNAME(FillSpanTile32sCopy) #define cfbFillSpanTile32sGeneral CFBNAME(FillSpanTile32sGeneral) #define cfbFillSpanTileOddCopy CFBNAME(FillSpanTileOddCopy) #define cfbFillSpanTileOddGeneral CFBNAME(FillSpanTileOddGeneral) #define cfbFinishScreenInit CFBNAME(FinishScreenInit) #define cfbGCFuncs CFBNAME(GCFuncs) +#define cfbGCPrivateIndex CFBNAME(GCPrivateIndex) #define cfbGetImage CFBNAME(GetImage) #define cfbGetScreenPixmap CFBNAME(GetScreenPixmap) #define cfbGetSpans CFBNAME(GetSpans) #define cfbHorzS CFBNAME(HorzS) #define cfbImageGlyphBlt8 CFBNAME(ImageGlyphBlt8) +#define cfbInitializeColormap CFBNAME(InitializeColormap) +#define cfbInstallColormap CFBNAME(InstallColormap) #define cfbLineSD CFBNAME(LineSD) #define cfbLineSS CFBNAME(LineSS) +#define cfbListInstalledColormaps CFBNAME(ListInstalledColormaps) #define cfbMapWindow CFBNAME(MapWindow) #define cfbMatchCommon CFBNAME(MatchCommon) #define cfbNonTEOps CFBNAME(NonTEOps) #define cfbNonTEOps1Rect CFBNAME(NonTEOps1Rect) #define cfbPadPixmap CFBNAME(PadPixmap) #define cfbPaintWindow CFBNAME(PaintWindow) #define cfbPolyFillArcSolidCopy CFBNAME(PolyFillArcSolidCopy) #define cfbPolyFillArcSolidGeneral CFBNAME(PolyFillArcSolidGeneral) #define cfbPolyFillRect CFBNAME(PolyFillRect) #define cfbPolyGlyphBlt8 CFBNAME(PolyGlyphBlt8) #define cfbPolyGlyphRop8 CFBNAME(PolyGlyphRop8) #define cfbPolyPoint CFBNAME(PolyPoint) #define cfbPositionWindow CFBNAME(PositionWindow) #define cfbPutImage CFBNAME(PutImage) #define cfbReduceRasterOp CFBNAME(ReduceRasterOp) +#define cfbResolveColor CFBNAME(ResolveColor) #define cfbRestoreAreas CFBNAME(RestoreAreas) #define cfbSaveAreas CFBNAME(SaveAreas) #define cfbScreenInit CFBNAME(ScreenInit) #define cfbScreenPrivateIndex CFBNAME(ScreenPrivateIndex) #define cfbSegmentSD CFBNAME(SegmentSD) #define cfbSegmentSS CFBNAME(SegmentSS) #define cfbSetScanline CFBNAME(SetScanline) #define cfbSetScreenPixmap CFBNAME(SetScreenPixmap) #define cfbSetSpans CFBNAME(SetSpans) #define cfbSetupScreen CFBNAME(SetupScreen) #define cfbSolidSpansCopy CFBNAME(SolidSpansCopy) #define cfbSolidSpansGeneral CFBNAME(SolidSpansGeneral) #define cfbSolidSpansXor CFBNAME(SolidSpansXor) #define cfbStippleStack CFBNAME(StippleStack) #define cfbStippleStackTE CFBNAME(StippleStackTE) #define cfbTEGlyphBlt CFBNAME(TEGlyphBlt) #define cfbTEOps CFBNAME(TEOps) #define cfbTEOps1Rect CFBNAME(TEOps1Rect) #define cfbTile32FSCopy CFBNAME(Tile32FSCopy) #define cfbTile32FSGeneral CFBNAME(Tile32FSGeneral) +#define cfbUninstallColormap CFBNAME(UninstallColormap) #define cfbUnmapWindow CFBNAME(UnmapWindow) #define cfbUnnaturalStippleFS CFBNAME(UnnaturalStippleFS) #define cfbUnnaturalTileFS CFBNAME(UnnaturalTileFS) #define cfbValidateGC CFBNAME(ValidateGC) #define cfbVertS CFBNAME(VertS) +#define cfbWindowPrivateIndex CFBNAME(WindowPrivateIndex) #define cfbXRotatePixmap CFBNAME(XRotatePixmap) #define cfbYRotatePixmap CFBNAME(YRotatePixmap) #define cfbZeroPolyArcSS8Copy CFBNAME(ZeroPolyArcSSCopy) #define cfbZeroPolyArcSS8General CFBNAME(ZeroPolyArcSSGeneral) #define cfbZeroPolyArcSS8Xor CFBNAME(ZeroPolyArcSSXor) #define cfbendpartial CFBNAME(endpartial) #define cfbendtab CFBNAME(endtab) #define cfbmask CFBNAME(mask) #define cfbrmask CFBNAME(rmask) #define cfbstartpartial CFBNAME(startpartial) #define cfbstarttab CFBNAME(starttab) #endif /* PSZ != 8 */ Index: xc/programs/Xserver/cfb/cfbpixmap.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/cfb/cfbpixmap.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 cfbpixmap.c --- xc/programs/Xserver/cfb/cfbpixmap.c 23 Apr 2004 19:00:12 -0000 1.2 +++ xc/programs/Xserver/cfb/cfbpixmap.c 14 Jan 2005 08:26:13 -0000 @@ -43,42 +43,40 @@ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ /* $XFree86: xc/programs/Xserver/cfb/cfbpixmap.c,v 1.4 2001/01/17 22:36:36 dawes Exp $ */ /* pixmap management written by drewry, september 1986 on a monchrome device, a pixmap is a bitmap. */ #include "Xmd.h" #include "servermd.h" #include "scrnintstr.h" #include "pixmapstr.h" #include "mi.h" #include "cfb.h" #include "cfbmskbits.h" -extern CfbBits endtab[]; - PixmapPtr cfbCreatePixmap (pScreen, width, height, depth) ScreenPtr pScreen; int width; int height; int depth; { PixmapPtr pPixmap; int datasize; int paddedWidth; paddedWidth = PixmapBytePad(width, depth); datasize = height * paddedWidth; pPixmap = AllocatePixmap(pScreen, datasize); if (!pPixmap) return NullPixmap; pPixmap->drawable.type = DRAWABLE_PIXMAP; pPixmap->drawable.class = 0; pPixmap->drawable.pScreen = pScreen; pPixmap->drawable.depth = depth; @@ -143,41 +141,41 @@ */ void cfbPadPixmap(pPixmap) PixmapPtr pPixmap; { register int width = (pPixmap->drawable.width) * (pPixmap->drawable.bitsPerPixel); register int h; register CfbBits mask; register CfbBits *p; register CfbBits bits; /* real pattern bits */ register int i; int rep; /* repeat count for pattern */ if (width >= PGSZ) return; rep = PGSZ/width; if (rep*width != PGSZ) return; - mask = endtab[width]; + mask = mfbGetendtab(width); p = (CfbBits *)(pPixmap->devPrivate.ptr); for (h=0; h < pPixmap->drawable.height; h++) { *p &= mask; bits = *p; for(i=1; i>= width; #else bits <<= width; #endif *p |= bits; } p++; } pPixmap->drawable.width = PGSZ/(pPixmap->drawable.bitsPerPixel); } Index: xc/programs/Xserver/cfb/cfbscrinit.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/cfb/cfbscrinit.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 cfbscrinit.c --- xc/programs/Xserver/cfb/cfbscrinit.c 23 Apr 2004 19:00:12 -0000 1.2 +++ xc/programs/Xserver/cfb/cfbscrinit.c 14 Jan 2005 08:26:13 -0000 @@ -82,66 +82,66 @@ ColormapPtr pColormap, int ndef, xColorItem * pdef) { /* NOOP */ } Bool cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width) register ScreenPtr pScreen; pointer pbits; /* pointer to screen bitmap */ int xsize, ysize; /* in pixels */ int dpix, dpiy; /* dots per inch */ int width; /* pixel width of frame buffer */ { if (!cfbAllocatePrivates(pScreen, (int *) 0, (int *) 0)) return FALSE; pScreen->defColormap = FakeClientID(0); /* let CreateDefColormap do whatever it wants for pixels */ pScreen->blackPixel = pScreen->whitePixel = (Pixel) 0; - pScreen->QueryBestSize = mfbQueryBestSize; + pScreen->QueryBestSize = mfbQueryBestSizeWeak(); /* SaveScreen */ pScreen->GetImage = cfbGetImage; pScreen->GetSpans = cfbGetSpans; pScreen->CreateWindow = cfbCreateWindow; pScreen->DestroyWindow = cfbDestroyWindow; pScreen->PositionWindow = cfbPositionWindow; pScreen->ChangeWindowAttributes = cfbChangeWindowAttributes; pScreen->RealizeWindow = cfbMapWindow; pScreen->UnrealizeWindow = cfbUnmapWindow; pScreen->PaintWindowBackground = cfbPaintWindow; pScreen->PaintWindowBorder = cfbPaintWindow; pScreen->CopyWindow = cfbCopyWindow; pScreen->CreatePixmap = cfbCreatePixmap; pScreen->DestroyPixmap = cfbDestroyPixmap; - pScreen->RealizeFont = mfbRealizeFont; - pScreen->UnrealizeFont = mfbUnrealizeFont; + pScreen->RealizeFont = mfbRealizeFontWeak(); + pScreen->UnrealizeFont = mfbUnrealizeFontWeak(); pScreen->CreateGC = cfbCreateGC; pScreen->CreateColormap = cfbInitializeColormap; pScreen->DestroyColormap = DestroyColormapNoop; pScreen->InstallColormap = cfbInstallColormap; pScreen->UninstallColormap = cfbUninstallColormap; pScreen->ListInstalledColormaps = cfbListInstalledColormaps; pScreen->StoreColors = StoreColorsNoop; pScreen->ResolveColor = cfbResolveColor; - pScreen->BitmapToRegion = mfbPixmapToRegion; + pScreen->BitmapToRegion = mfbPixmapToRegionWeak(); mfbRegisterCopyPlaneProc (pScreen, cfbCopyPlane); return TRUE; } #ifdef CFB_NEED_SCREEN_PRIVATE Bool cfbCreateScreenResources(pScreen) ScreenPtr pScreen; { Bool retval; pointer oldDevPrivate = pScreen->devPrivate; pScreen->devPrivate = pScreen->devPrivates[cfbScreenPrivateIndex].ptr; retval = miCreateScreenResources(pScreen); pScreen->devPrivates[cfbScreenPrivateIndex].ptr = pScreen->devPrivate; pScreen->devPrivate = oldDevPrivate; return retval; } #endif Index: xc/programs/Xserver/cfb/cfbtab.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/cfb/cfbtab.h,v retrieving revision 1.2 diff -u -2 -0 -r1.2 cfbtab.h --- xc/programs/Xserver/cfb/cfbtab.h 23 Apr 2004 19:00:12 -0000 1.2 +++ xc/programs/Xserver/cfb/cfbtab.h 14 Jan 2005 08:26:13 -0000 @@ -1,10 +1,12 @@ /* $XFree86$ */ #ifndef _CFBTAB_H_ #define _CFBTAB_H_ /* prototypes */ +#if 0 extern int starttab[32], endtab[32]; extern unsigned int partmasks[32][32]; +#endif #endif /* _CFBTAB_H_ */ Index: xc/programs/Xserver/cfb/cfbteblt8.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/cfb/cfbteblt8.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 cfbteblt8.c --- xc/programs/Xserver/cfb/cfbteblt8.c 23 Apr 2004 19:00:12 -0000 1.2 +++ xc/programs/Xserver/cfb/cfbteblt8.c 14 Jan 2005 08:26:14 -0000 @@ -143,41 +143,40 @@ #define GetBits3U GetBits2U Get1Bits (char3, tmpSrc) \ c |= BitRight(tmpSrc, xoff3); #define GetBits4S GetBits3S Get1Bits (char4, tmpSrc) \ c |= BitRight(tmpSrc, xoff4); #define GetBits4L GetBits3L Get1Bits (char4, tmpSrc) \ c |= BitRight(tmpSrc, xoff4); #define GetBits4U GetBits3U Get1Bits (char4, tmpSrc) \ c |= BitRight(tmpSrc, xoff4); #define GetBits5S GetBits4S Get1Bits (char5, tmpSrc) \ c |= BitRight(tmpSrc, xoff5); #define GetBits5L GetBits4L Get1Bits (char5, tmpSrc) \ c |= BitRight(tmpSrc, xoff5); #define GetBits5U GetBits4U Get1Bits (char5, tmpSrc) \ c |= BitRight(tmpSrc, xoff5); #endif #ifdef USE_LEFTBITS -extern CfbBits endtab[]; #define IncChar(c) (c = (glyphPointer) (((char *) c) + glyphBytes)) #define Get1Bits(ch,dst) glyphbits (ch, widthGlyph, glyphMask, dst); \ IncChar (ch); #define glyphbits(bits,width,mask,dst) getleftbits(bits,width,dst); \ dst &= mask; #define WGetBitsL Get1Bits(leftChar,c); \ c = BitLeft (c, lshift); #define WGetBits1S Get1Bits (char1, c) \ c = BitRight (c, xoff1); #define WGetBits1L WGetBitsL Get1Bits (char1, tmpSrc) \ c |= BitRight (tmpSrc, xoff1); #define WGetBits1U Get1Bits (char1, c) #else #define WGetBitsL GetBitsL #define WGetBits1S GetBits1S @@ -391,41 +390,41 @@ } if (!cfb8CheckPixels (pGC->fgPixel, pGC->bgPixel)) cfb8SetPixels (pGC->fgPixel, pGC->bgPixel); leftChar = 0; cfbGetLongWidthAndPointer(pDrawable, widthDst, pdstBase) #if NGLYPHS == 2 widthGlyphs = widthGlyph << 1; #else #if NGLYPHS == 4 widthGlyphs = widthGlyph << 2; #else widthGlyphs = widthGlyph * NGLYPHS; #endif #endif #ifdef USE_LEFTBITS - glyphMask = endtab[widthGlyph]; + glyphMask = mfbGetendtab(widthGlyph); glyphBytes = GLYPHWIDTHBYTESPADDED(*ppci); #endif pdstBase += y * widthDst; #ifdef DO_COMMON if (widthGlyphs <= 32) #endif while (nglyph >= NGLYPHS) { nglyph -= NGLYPHS; hTmp = h; dstLine = pdstBase + (x >> PWSH); xoff1 = x & PIM; char1 = (glyphPointer) FONTGLYPHBITS(pglyphBase, *ppci++); char2 = (glyphPointer) FONTGLYPHBITS(pglyphBase, *ppci++); #ifdef ALL_LEFTBITS xoff2 = xoff1 + widthGlyph; #endif #if NGLYPHS >= 3 char3 = (glyphPointer) FONTGLYPHBITS(pglyphBase, *ppci++); Index: xc/programs/Xserver/cfb/cfbunmap.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/cfb/cfbunmap.h,v retrieving revision 1.1.1.2 diff -u -2 -0 -r1.1.1.2 cfbunmap.h --- xc/programs/Xserver/cfb/cfbunmap.h 25 Nov 2003 19:28:27 -0000 1.1.1.2 +++ xc/programs/Xserver/cfb/cfbunmap.h 14 Jan 2005 08:26:14 -0000 @@ -76,78 +76,85 @@ #undef cfbFillBoxTile32 #undef cfbFillBoxTile32sCopy #undef cfbFillBoxTile32sGeneral #undef cfbFillBoxTileOdd #undef cfbFillBoxTileOddCopy #undef cfbFillBoxTileOddGeneral #undef cfbFillPoly1RectCopy #undef cfbFillPoly1RectGeneral #undef cfbFillRectSolidCopy #undef cfbFillRectSolidGeneral #undef cfbFillRectSolidXor #undef cfbFillRectTile32Copy #undef cfbFillRectTile32General #undef cfbFillRectTileOdd #undef cfbFillSpanTile32sCopy #undef cfbFillSpanTile32sGeneral #undef cfbFillSpanTileOddCopy #undef cfbFillSpanTileOddGeneral #undef cfbFinishScreenInit #undef cfbGCFuncs +#undef cfbGCPrivateIndex #undef cfbGetImage #undef cfbGetScreenPixmap #undef cfbGetSpans #undef cfbHorzS #undef cfbImageGlyphBlt8 +#undef cfbInitializeColormap +#undef cfbInstallColormap #undef cfbLineSD #undef cfbLineSS +#undef cfbListInstalledColormaps #undef cfbMapWindow #undef cfbMatchCommon #undef cfbNonTEOps #undef cfbNonTEOps1Rect #undef cfbPadPixmap #undef cfbPaintWindow #undef cfbPolyFillArcSolidCopy #undef cfbPolyFillArcSolidGeneral #undef cfbPolyFillRect #undef cfbPolyGlyphBlt8 #undef cfbPolyGlyphRop8 #undef cfbPolyPoint #undef cfbPositionWindow #undef cfbPutImage #undef cfbReduceRasterOp +#undef cfbResolveColor #undef cfbRestoreAreas #undef cfbSaveAreas #undef cfbScreenInit #undef cfbScreenPrivateIndex #undef cfbSegmentSD #undef cfbSegmentSS #undef cfbSetScanline #undef cfbSetScreenPixmap #undef cfbSetSpans #undef cfbSetupScreen #undef cfbSolidSpansCopy #undef cfbSolidSpansGeneral #undef cfbSolidSpansXor #undef cfbStippleStack #undef cfbStippleStackTE #undef cfbTEGlyphBlt #undef cfbTEOps #undef cfbTEOps1Rect #undef cfbTile32FSCopy #undef cfbTile32FSGeneral +#undef cfbUninstallColormap #undef cfbUnmapWindow #undef cfbUnnaturalStippleFS #undef cfbUnnaturalTileFS #undef cfbValidateGC #undef cfbVertS +#undef cfbWindowPrivateIndex #undef cfbXRotatePixmap #undef cfbYRotatePixmap #undef cfbZeroPolyArcSS8Copy #undef cfbZeroPolyArcSS8General #undef cfbZeroPolyArcSS8Xor #undef cfbendpartial #undef cfbendtab #undef cfbmask #undef cfbrmask #undef cfbstartpartial #undef cfbstarttab Index: xc/programs/Xserver/mfb/maskbits.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/mfb/maskbits.c,v retrieving revision 1.3 diff -u -2 -0 -r1.3 maskbits.c --- xc/programs/Xserver/mfb/maskbits.c 30 Jul 2004 20:30:57 -0000 1.3 +++ xc/programs/Xserver/mfb/maskbits.c 14 Jan 2005 08:26:17 -0000 @@ -1036,22 +1036,26 @@ mergeRopRec mergeRopBits[16] = { { O,O,O,O, }, /* clear 0x0 0 */ { I,O,O,O, }, /* and 0x1 src AND dst */ { I,O,I,O, }, /* andReverse 0x2 src AND NOT dst */ { O,O,I,O, }, /* copy 0x3 src */ { I,I,O,O, }, /* andInverted 0x4 NOT src AND dst */ { O,I,O,O, }, /* noop 0x5 dst */ { O,I,I,O, }, /* xor 0x6 src XOR dst */ { I,I,I,O, }, /* or 0x7 src OR dst */ { I,I,I,I, }, /* nor 0x8 NOT src AND NOT dst */ { O,I,I,I, }, /* equiv 0x9 NOT src XOR dst */ { O,I,O,I, }, /* invert 0xa NOT dst */ { I,I,O,I, }, /* orReverse 0xb src OR NOT dst */ { O,O,I,I, }, /* copyInverted 0xc NOT src */ { I,O,I,I, }, /* orInverted 0xd NOT src OR dst */ { I,O,O,I, }, /* nand 0xe NOT src OR NOT dst */ { O,O,O,I, }, /* set 0xf 1 */ }; +mergeRopPtr mergeGetRopBits(int i) { + return &mergeRopBits[i]; +} + #undef O #undef I Index: xc/programs/Xserver/mfb/maskbits.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/mfb/maskbits.h,v retrieving revision 1.3 diff -u -2 -0 -r1.3 maskbits.h --- xc/programs/Xserver/mfb/maskbits.h 30 Jul 2004 20:30:57 -0000 1.3 +++ xc/programs/Xserver/mfb/maskbits.h 14 Jan 2005 08:26:17 -0000 @@ -379,41 +379,41 @@ * * putbits gets it iff it is not already defined with FASTPUTBITS above. * u_putbits gets it if we have FASTPUTBITS (putbits) from above and have not * overridden the NO_3_60_CG4 flag. */ #define slo_putbits(src, x, w, pdst) \ { \ register int n = (x)+(w)-PPW; \ \ if (n <= 0) \ { \ register PixelType tmpmask; \ maskpartialbits((x), (w), tmpmask); \ *(pdst) = (*(pdst) & ~tmpmask) | \ (SCRRIGHT(src, x) & tmpmask); \ } \ else \ { \ register int d = PPW-(x); \ - *(pdst) = (*(pdst) & endtab[x]) | (SCRRIGHT((src), x)); \ + *(pdst) = (*(pdst) & mfbGetendtab(x)) | (SCRRIGHT((src), x)); \ (pdst)[1] = ((pdst)[1] & mfbGetstarttab(n)) | \ (SCRLEFT(src, d) & mfbGetendtab(n)); \ } \ } #if defined(putbits) && !defined(NO_3_60_CG4) #define u_putbits(src, x, w, pdst) slo_putbits(src, x, w, pdst) #else #define u_putbits(src, x, w, pdst) putbits(src, x, w, pdst) #endif #if !defined(putbits) #define putbits(src, x, w, pdst) slo_putbits(src, x, w, pdst) #endif /* Now if we have not gotten any really good bitfield macros, try some * moderately fast macros. Alas, I don't know how to do asm instructions * without gcc. */ Index: xc/programs/Xserver/mfb/mergerop.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/mfb/mergerop.h,v retrieving revision 1.2 diff -u -2 -0 -r1.2 mergerop.h --- xc/programs/Xserver/mfb/mergerop.h 23 Apr 2004 19:54:25 -0000 1.2 +++ xc/programs/Xserver/mfb/mergerop.h 14 Jan 2005 08:26:17 -0000 @@ -22,113 +22,114 @@ 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. * * Author: Keith Packard, MIT X Consortium */ /* $XFree86: xc/programs/Xserver/mfb/mergerop.h,v 3.13 2001/10/28 03:34:13 tsi Exp $ */ #ifndef _MERGEROP_H_ #define _MERGEROP_H_ #ifndef GXcopy #include "X.h" #endif typedef struct _mergeRopBits { MfbBits ca1, cx1, ca2, cx2; } mergeRopRec, *mergeRopPtr; extern mergeRopRec mergeRopBits[16]; +extern mergeRopPtr mergeGetRopBits(int i); #if defined(PPW) && defined(PGSZ) && (PPW != PGSZ) /* cfb */ #define DeclareMergeRop() MfbBits _ca1 = 0, _cx1 = 0, _ca2 = 0, _cx2 = 0; #define DeclarePrebuiltMergeRop() MfbBits _cca, _ccx; #if PSZ == 24 /* both for PGSZ == 32 and 64 */ #define DeclareMergeRop24() \ MfbBits _ca1u[4], _cx1u[4], _ca2u[4], _cx2u[4]; /* int _unrollidx[3]={0,0,1,2};*/ #define DeclarePrebuiltMergeRop24() MfbBits _ccau[4], _ccxu[4]; #endif /* PSZ == 24 */ #else /* mfb */ #define DeclareMergeRop() MfbBits _ca1 = 0, _cx1 = 0, _ca2 = 0, _cx2 = 0; #define DeclarePrebuiltMergeRop() MfbBits _cca, _ccx; #endif #if defined(PPW) && defined(PGSZ) && (PPW != PGSZ) /* cfb */ #define InitializeMergeRop(alu,pm) {\ MfbBits _pm; \ mergeRopPtr _bits; \ _pm = PFILL(pm); \ - _bits = &mergeRopBits[alu]; \ + _bits = mergeGetRopBits(alu); \ _ca1 = _bits->ca1 & _pm; \ _cx1 = _bits->cx1 | ~_pm; \ _ca2 = _bits->ca2 & _pm; \ _cx2 = _bits->cx2 & _pm; \ } #if PSZ == 24 #if (BITMAP_BIT_ORDER == MSBFirst) #define InitializeMergeRop24(alu,pm) {\ register int i; \ register MfbBits _pm = (pm) & 0xFFFFFF; \ - mergeRopPtr _bits = &mergeRopBits[alu]; \ + mergeRopPtr _bits = mergeGetRopBits(alu); \ MfbBits _bits_ca1 = _bits->ca1; \ MfbBits _bits_cx1 = _bits->cx1; \ MfbBits _bits_ca2 = _bits->ca2; \ MfbBits _bits_cx2 = _bits->cx2; \ _pm = (_pm << 8) | (_pm >> 16); \ for(i = 0; i < 4; i++){ \ _ca1u[i] = _bits_ca1 & _pm; \ _cx1u[i] = _bits_cx1 | ~_pm; \ _ca2u[i] = _bits_ca2 & _pm; \ _cx2u[i] = _bits_cx2 & _pm; \ _pm = (_pm << 16)|(_pm >> 8); \ } \ } #else /*(BITMAP_BIT_ORDER == LSBFirst)*/ #define InitializeMergeRop24(alu,pm) {\ register int i; \ register MfbBits _pm = (pm) & cfbmask[0]; \ - mergeRopPtr _bits = &mergeRopBits[alu]; \ + mergeRopPtr _bits = mergeGetRopBits(alu); \ MfbBits _bits_ca1 = _bits->ca1 & cfbmask[0]; \ MfbBits _bits_cx1 = _bits->cx1 & cfbmask[0]; \ MfbBits _bits_ca2 = _bits->ca2 & cfbmask[0]; \ MfbBits _bits_cx2 = _bits->cx2 & cfbmask[0]; \ _pm |= (_pm << 24); \ _bits_ca1 |= (_bits->ca1 << 24); \ _bits_cx1 |= (_bits->cx1 << 24); \ _bits_ca2 |= (_bits->ca2 << 24); \ _bits_cx2 |= (_bits->cx2 << 24); \ for(i = 0; i < 4; i++){ \ _ca1u[i] = _bits_ca1 & _pm; \ _cx1u[i] = _bits_cx1 | ~_pm; \ _ca2u[i] = _bits_ca2 & _pm; \ _cx2u[i] = _bits_cx2 & _pm; \ _pm = (_pm << 16)|(_pm >> 8); \ } \ } #endif /*(BITMAP_BIT_ORDER == MSBFirst)*/ #endif /* PSZ == 24 */ #else /* mfb */ #define InitializeMergeRop(alu,pm) {\ mergeRopPtr _bits; \ - _bits = &mergeRopBits[alu]; \ + _bits = mergeGetRopBits(alu); \ _ca1 = _bits->ca1; \ _cx1 = _bits->cx1; \ _ca2 = _bits->ca2; \ _cx2 = _bits->cx2; \ } #endif /* AND has higher precedence than XOR */ #define DoMergeRop(src, dst) \ (((dst) & (((src) & _ca1) ^ _cx1)) ^ (((src) & _ca2) ^ _cx2)) #define DoMergeRop24u(src, dst, i) \ (((dst) & (((src) & _ca1u[i]) ^ _cx1u[i])) ^ (((src) & _ca2u[i]) ^ _cx2u[i])) #define DoMaskMergeRop24(src, dst, mask, index) {\ register int idx = ((index) & 3)<< 1; \ MfbBits _src0 = (src);\ MfbBits _src1 = (_src0 & _ca1) ^ _cx1; \ MfbBits _src2 = (_src0 & _ca2) ^ _cx2; \ @@ -311,41 +312,41 @@ (dst)--; \ } #define MROP_MASK(src,dst,mask) (((src) & (mask)) | (dst)) #define MROP_MASK24(src,dst,mask,index) {\ register int idx = ((index) & 3)<< 1; \ MfbBits _src = (src); \ *(dst) |= (((_src &(mask))<>cfb24Shift[idx])&cfbmask[idx]); \ (dst)--; \ } #define MROP_NAME(prefix) MROP_NAME_CAT(prefix,Or) #endif #if (MROP) == (Mcopy|Mxor|MandReverse|Mor) #define MROP_DECLARE() MfbBits _ca1 = 0, _cx1 = 0; #define MROP_DECLARE_REG() register MROP_DECLARE() #define MROP_INITIALIZE(alu,pm) { \ mergeRopPtr _bits; \ - _bits = &mergeRopBits[alu]; \ + _bits = mergeGetRopBits(alu); \ _ca1 = _bits->ca1; \ _cx1 = _bits->cx1; \ } #define MROP_SOLID(src,dst) \ (((dst) & (((src) & _ca1) ^ _cx1)) ^ (src)) #define MROP_MASK(src,dst,mask) \ (((dst) & ((((src) & _ca1) ^ _cx1)) | (~(mask)) ^ ((src) & (mask)))) #define MROP_NAME(prefix) MROP_NAME_CAT(prefix,CopyXorAndReverseOr) #define MROP_PREBUILD(src) PrebuildMergeRop(src) #define MROP_PREBUILT_DECLARE() DeclarePrebuiltMergeRop() #define MROP_PREBUILT_SOLID(src,dst) DoPrebuiltMergeRop(dst) #define MROP_PREBUILT_SOLID24(src,dst,index) DoPrebuiltMergeRop24(dst,index) #define MROP_PREBUILT_MASK(src,dst,mask) DoMaskPrebuiltMergeRop(dst,mask) #define MROP_PREBUILT_MASK24(src,dst,mask,index) DoMaskPrebuiltMergeRop24(dst,mask,index) #endif #if (MROP) == 0 #if !defined(PSZ) || (PSZ != 24) #define MROP_DECLARE() DeclareMergeRop() #define MROP_DECLARE_REG() register DeclareMergeRop() Index: xc/programs/Xserver/mfb/mfb.h =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/mfb/mfb.h,v retrieving revision 1.3 diff -u -2 -0 -r1.3 mfb.h --- xc/programs/Xserver/mfb/mfb.h 30 Jul 2004 20:30:57 -0000 1.3 +++ xc/programs/Xserver/mfb/mfb.h 14 Jan 2005 08:26:18 -0000 @@ -47,41 +47,41 @@ ******************************************************************/ /* $Xorg: mfb.h,v 1.4 2001/02/09 02:05:18 xorgcvs Exp $ */ #if !defined(_MFB_H_) || defined(MFB_PROTOTYPES_ONLY) #ifndef MFB_PROTOTYPES_ONLY #define _MFB_H_ #endif /* Monochrome Frame Buffer definitions written by drewry, september 1986 */ #include "pixmap.h" #include "region.h" #include "gc.h" #include "colormap.h" #include "miscstruct.h" #include "mibstore.h" extern int InverseAlu[]; - +extern int mfbGetInverseAlu(int i); /* warning: PixelType definition duplicated in maskbits.h */ #ifndef PixelType #define PixelType CARD32 #endif /* PixelType */ #ifndef MfbBits #define MfbBits CARD32 #endif /* mfbbitblt.c */ extern void mfbDoBitblt( DrawablePtr /*pSrc*/, DrawablePtr /*pDst*/, int /*alu*/, RegionPtr /*prgnDst*/, DDXPointPtr /*pptSrc*/ ); extern RegionPtr mfbCopyArea( @@ -212,40 +212,47 @@ extern void mfbSaveAreas( PixmapPtr /*pPixmap*/, RegionPtr /*prgnSave*/, int /*xorg*/, int /*yorg*/, WindowPtr /*pWin*/ ); extern void mfbRestoreAreas( PixmapPtr /*pPixmap*/, RegionPtr /*prgnRestore*/, int /*xorg*/, int /*yorg*/, WindowPtr /*pWin*/ ); /* mfbclip.c */ extern RegionPtr mfbPixmapToRegion( PixmapPtr /*pPix*/ ); + +#ifndef MFB_PROTOTYPES_ONLY +typedef RegionPtr (*mfbPixmapToRegionProc)(PixmapPtr); + +extern mfbPixmapToRegionProc *mfbPixmapToRegionWeak(void); +#endif + /* mfbcmap.c */ extern int mfbListInstalledColormaps( ScreenPtr /*pScreen*/, Colormap * /*pmaps*/ ); extern void mfbInstallColormap( ColormapPtr /*pmap*/ ); extern void mfbUninstallColormap( ColormapPtr /*pmap*/ ); extern void mfbResolveColor( unsigned short * /*pred*/, unsigned short * /*pgreen*/, unsigned short * /*pblue*/, VisualPtr /*pVisual*/ @@ -354,40 +361,49 @@ extern void mfbUnnaturalStippleFS( DrawablePtr /*pDrawable*/, GCPtr/*pGC*/, int /*nInit*/, DDXPointPtr /*pptInit*/, int * /*pwidthInit*/, int /*fSorted*/ ); /* mfbfont.c */ extern Bool mfbRealizeFont( ScreenPtr /*pscr*/, FontPtr /*pFont*/ ); extern Bool mfbUnrealizeFont( ScreenPtr /*pscr*/, FontPtr /*pFont*/ ); + +#ifndef MFB_PROTOTYPES_ONLY +typedef void (*mfbRealizeFontProc)(ScreenPtr, FontPtr); +typedef void (*mfbUnrealizeFontProc)(ScreenPtr, FontPtr); + +extern mfbRealizeFontProc *mfbRealizeFontWeak(void); +extern mfbUnrealizeFontProc *mfbUnrealizeFontWeak(void); +#endif + /* mfbgc.c */ extern Bool mfbCreateGC( GCPtr /*pGC*/ ); extern void mfbValidateGC( GCPtr /*pGC*/, unsigned long /*changes*/, DrawablePtr /*pDrawable*/ ); extern int mfbReduceRop( int /*alu*/, Pixel /*src*/ ); /* mfbgetsp.c */ extern void mfbGetSpans( @@ -473,40 +489,48 @@ int /*npt*/, DDXPointPtr /*pptInit*/ ); extern void mfbLineSD( DrawablePtr /*pDrawable*/, GCPtr /*pGC*/, int /*mode*/, int /*npt*/, DDXPointPtr /*pptInit*/ ); /* mfbmisc.c */ extern void mfbQueryBestSize( int /*class*/, unsigned short * /*pwidth*/, unsigned short * /*pheight*/, ScreenPtr /*pScreen*/ ); + +#ifndef MFB_PROTOTYPES_ONLY +typedef void (*mfbQueryBestSizeProc)(int, unsigned short *, unsigned short *, + ScreenPtr); + +extern mfbQueryBestSizeProc *mfbQueryBestSizeWeak(void); +#endif + /* mfbpablack.c */ extern void mfbSolidBlackArea( DrawablePtr /*pDraw*/, int /*nbox*/, BoxPtr /*pbox*/, int /*alu*/, PixmapPtr /*nop*/ ); extern void mfbStippleBlackArea( DrawablePtr /*pDraw*/, int /*nbox*/, BoxPtr /*pbox*/, int /*alu*/, PixmapPtr /*pstipple*/ ); /* mfbpainv.c */ extern void mfbSolidInvertArea( @@ -663,40 +687,48 @@ extern void mfbSolidPP( GCPtr /*pGC*/, PixmapPtr /*pBitMap*/, DrawablePtr /*pDrawable*/, int /*dx*/, int /*dy*/, int /*xOrg*/, int /*yOrg*/ ); extern void mfbPushPixels( GCPtr /*pGC*/, PixmapPtr /*pBitMap*/, DrawablePtr /*pDrawable*/, int /*dx*/, int /*dy*/, int /*xOrg*/, int /*yOrg*/ ); + +#ifndef MFB_PROTOTYPES_ONLY +typedef void (*mfbPushPixelsProc)(GCPtr, PixmapPtr, DrawablePtr, int, int, + int, int); + +extern mfbPushPixelsProc *mfbPushPixelsWeak(void); +#endif + /* mfbscrclse.c */ extern Bool mfbCloseScreen( int /*index*/, ScreenPtr /*pScreen*/ ); /* mfbscrinit.c */ extern Bool mfbAllocatePrivates( ScreenPtr /*pScreen*/, int * /*pWinIndex*/, int * /*pGCIndex*/ ); extern Bool mfbScreenInit( ScreenPtr /*pScreen*/, pointer /*pbits*/, int /*xsize*/, int /*ysize*/, int /*dpix*/, Index: xc/programs/Xserver/mfb/mfbclip.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/mfb/mfbclip.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 mfbclip.c --- xc/programs/Xserver/mfb/mfbclip.c 23 Apr 2004 19:54:25 -0000 1.2 +++ xc/programs/Xserver/mfb/mfbclip.c 14 Jan 2005 08:26:18 -0000 @@ -251,20 +251,26 @@ irectPrevStart = irectLineStart; } if (!pReg->data->numRects) pReg->extents.x1 = pReg->extents.x2 = 0; else { pReg->extents.y1 = REGION_BOXPTR(pReg)->y1; pReg->extents.y2 = REGION_END(pReg)->y2; if (pReg->data->numRects == 1) { xfree(pReg->data); pReg->data = (RegDataPtr)NULL; } } #ifdef DEBUG if (!miValidRegion(pReg)) FatalError("Assertion failed file %s, line %d: expr\n", __FILE__, __LINE__); #endif return(pReg); } + +mfbPixmapToRegionProc * +mfbPixmapToRegionWeak(void) +{ + return mfbPixmapToRegion; +} Index: xc/programs/Xserver/mfb/mfbfont.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/mfb/mfbfont.c,v retrieving revision 1.1.1.1 diff -u -2 -0 -r1.1.1.1 mfbfont.c --- xc/programs/Xserver/mfb/mfbfont.c 14 Nov 2003 16:48:57 -0000 1.1.1.1 +++ xc/programs/Xserver/mfb/mfbfont.c 14 Jan 2005 08:26:18 -0000 @@ -45,28 +45,40 @@ */ /* $Xorg: mfbfont.c,v 1.4 2001/02/09 02:05:18 xorgcvs Exp $ */ #include "X.h" #include "Xmd.h" #include "Xproto.h" #include "mfb.h" #include "fontstruct.h" #include "dixfontstr.h" #include "scrnintstr.h" /*ARGSUSED*/ Bool mfbRealizeFont( pscr, pFont) ScreenPtr pscr; FontPtr pFont; { return (TRUE); } +mfbRealizeFontProc * +mfbRealizeFontWeak(void) +{ + return mfbRealizeFont; +} + /*ARGSUSED*/ Bool mfbUnrealizeFont( pscr, pFont) ScreenPtr pscr; FontPtr pFont; { return (TRUE); } + +mfbUnrealizeFontProc * +mfbUnrealizeFontWeak(void) +{ + return mfbUnrealizeFont; +} Index: xc/programs/Xserver/mfb/mfbgc.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/mfb/mfbgc.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 mfbgc.c --- xc/programs/Xserver/mfb/mfbgc.c 23 Apr 2004 19:54:25 -0000 1.2 +++ xc/programs/Xserver/mfb/mfbgc.c 14 Jan 2005 08:26:18 -0000 @@ -1437,40 +1437,46 @@ /* table to map alu(src, dst) to alu(~src, dst) */ int InverseAlu[16] = { GXclear, GXandInverted, GXnor, GXcopyInverted, GXand, GXnoop, GXequiv, GXorInverted, GXandReverse, GXxor, GXinvert, GXnand, GXcopy, GXor, GXorReverse, GXset }; +int mfbGetInverseAlu(i) + int i; +{ + return InverseAlu[i]; +} + int mfbReduceRop(alu, src) register int alu; register Pixel src; { int rop = 0; if ((src & 1) == 0) /* src is black */ { switch(alu) { case GXclear: rop = RROP_BLACK; break; case GXand: rop = RROP_BLACK; break; case GXandReverse: rop = RROP_BLACK; break; case GXcopy: Index: xc/programs/Xserver/mfb/mfbmisc.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/mfb/mfbmisc.c,v retrieving revision 1.1.1.1 diff -u -2 -0 -r1.1.1.1 mfbmisc.c --- xc/programs/Xserver/mfb/mfbmisc.c 14 Nov 2003 16:48:57 -0000 1.1.1.1 +++ xc/programs/Xserver/mfb/mfbmisc.c 14 Jan 2005 08:26:18 -0000 @@ -72,20 +72,25 @@ break; case TileShape: case StippleShape: width = *pwidth; if (!width) break; /* Return the closes power of two not less than what they gave me */ test = 0x80000000; /* Find the highest 1 bit in the width given */ while(!(test & width)) test >>= 1; /* If their number is greater than that, bump up to the next * power of two */ if((test - 1) & width) test <<= 1; *pwidth = test; /* We don't care what height they use */ break; } } +mfbQueryBestSizeProc * +mfbQueryBestSizeWeak(void) +{ + return mfbQueryBestSize; +} Index: xc/programs/Xserver/mfb/mfbpushpxl.c =================================================================== RCS file: /cvs/xorg/xc/programs/Xserver/mfb/mfbpushpxl.c,v retrieving revision 1.2 diff -u -2 -0 -r1.2 mfbpushpxl.c --- xc/programs/Xserver/mfb/mfbpushpxl.c 23 Apr 2004 19:54:25 -0000 1.2 +++ xc/programs/Xserver/mfb/mfbpushpxl.c 14 Jan 2005 08:26:18 -0000 @@ -259,20 +259,25 @@ mask = SCRRIGHT(mask, 1); } } /* If scanline ended with last bit set, end the box */ if(fInBox) { width[ipt] = dx + xOrg - pt[ipt].x; if (++ipt >= NPT) { (*pGC->ops->FillSpans)(pDrawable, pGC, NPT, pt, width, TRUE); ipt = 0; } } } /* Flush any remaining spans */ if (ipt) { (*pGC->ops->FillSpans)(pDrawable, pGC, ipt, pt, width, TRUE); } } + +mfbPushPixelsProc *mfbPushPixelsWeak(void) +{ + return mfbPushPixels; +}