v03i005: Purdue speedups to R3 server, Release 2, Part03/04
Mike Wexler
mikew at wyse.wyse.com
Wed Feb 1 05:57:16 AEST 1989
Submitted-by: spaf at purdue.edu (Gene Spafford)
Posting-number: Volume 3, Issue 5
Archive-name: p2speedups/part03
# Purdue/Purdue+ patches, part 3 of 4
# Shar archive. Give the following as input to /bin/sh
# Packed Sun Jan 22 19:39:54 EST 1989 by spaf at uther.cs.purdue.edu
#
# This archive contains:
# mfbbitblt.c.patch
# mfbbres.c.patch
# mfbfillsp.c.patch
# mfbgetsp.c.patch
# mfbpolypnt.c.patch
# mfbwindow.c.patch
#
#
echo x - mfbbitblt.c.patch
sed 's/^X//' >mfbbitblt.c.patch <<'*-*-END-of-mfbbitblt.c.patch-*-*'
X*** /tmp/,RCSt1a00705 Fri Jan 20 21:38:40 1989
X--- ./ddx/mfb/mfbbitblt.c Fri Jan 20 17:02:58 1989
X***************
X*** 1,3 ****
X--- 1,4 ----
X+ /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
X /***********************************************************
X Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
X and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
X***************
X*** 51,57 ****
X go do the multiple rectangle copies
X do graphics exposures
X */
X!
X RegionPtr
X mfbCopyArea(pSrcDrawable, pDstDrawable,
X pGC, srcx, srcy, width, height, dstx, dsty)
X--- 52,76 ----
X go do the multiple rectangle copies
X do graphics exposures
X */
X! /* #ifdef PURDUE!!!!
X! ** Optimized for drawing pixmaps into windows, especially when drawing into
X! ** unobscured windows. Calls to the general-purpose region code were
X! ** replaced with rectangle-to-rectangle clipping comparisions. This is
X! ** possible, since the pixmap is a single rectangle. In an unobscured
X! ** window, the destination clip is also a single rectangle, and region
X! ** code can be avoided entirely. This is a big savings, since the region
X! ** code uses XAlloc() and makes many function calls.
X! **
X! ** In addition, if source is a pixmap, there is no need to call the
X! ** expensive miHandleExposures() routine. Instead, we simply return NULL.
X! **
X! ** Previously, drawing a pixmap into an unobscured window executed at least
X! ** 8 XAlloc()'s, 30 function calls, and hundreds of lines of code.
X! **
X! ** Now, the same operation requires no XAlloc()'s, no region function calls,
X! ** and much less overhead. Nice for drawing lots of small pixmaps.
X! */
X!
X RegionPtr
X mfbCopyArea(pSrcDrawable, pDstDrawable,
X pGC, srcx, srcy, width, height, dstx, dsty)
X***************
X*** 62,68 ****
X--- 81,89 ----
X int width, height;
X int dstx, dsty;
X {
X+ #ifndef PURDUE
X BoxRec srcBox;
X+ #endif PURDUE
X RegionPtr prgnSrcClip; /* may be a new region, or just a copy */
X int realSrcClip = 0; /* non-0 if we've created a src clip */
X
X***************
X*** 76,81 ****
X--- 97,109 ----
X xRectangle origSource;
X DDXPointRec origDest;
X
X+ #ifdef PURDUE
X+ RegionRec fastRegion; /* special region for clipping to 1 box */
X+ BoxRec fastBox;
X+ int fastClip = 0; /* for fast clipping with pixmap source */
X+ int fastExpose = 0; /* for fast exposures with pixmap source */
X+ #endif PURDUE
X+
X origSource.x = srcx;
X origSource.y = srcy;
X origSource.width = width;
X***************
X*** 93,98 ****
X--- 121,127 ----
X prgnSrcClip = ((mfbPrivGC *)(pGC->devPriv))->pCompositeClip;
X }
X else
X+ #ifndef PURDUE
X {
X BoxRec box;
X
X***************
X*** 104,109 ****
X--- 133,163 ----
X prgnSrcClip = (*pGC->pScreen->RegionCreate)(&box, 1);
X realSrcClip = 1;
X }
X+ #else PURDUE
X+ {
X+ /* Pixmap sources generate simple exposure events */
X+ fastExpose = 1;
X+
X+ /* Pixmap is just one clipping rectangle so we can avoid
X+ allocating a full-blown region. */
X+ fastClip = 1;
X+
X+ fastBox.x1 = srcx;
X+ fastBox.y1 = srcy;
X+ fastBox.x2 = srcx + width;
X+ fastBox.y2 = srcy + height;
X+
X+ /* Left and top are already clipped, so clip right and bottom */
X+ if (fastBox.x2 > ((PixmapPtr)pSrcDrawable)->width)
X+ fastBox.x2 = ((PixmapPtr)pSrcDrawable)->width;
X+ if (fastBox.y2 > ((PixmapPtr)pSrcDrawable)->height)
X+ fastBox.y2 = ((PixmapPtr)pSrcDrawable)->height;
X+
X+ /* Initialize the fast region */
X+ fastRegion.numRects = 1;
X+ fastRegion.rects = &fastBox;
X+ }
X+ #endif PURDUE
X }
X else
X {
X***************
X*** 128,146 ****
X }
X }
X
X! srcBox.x1 = srcx;
X! srcBox.y1 = srcy;
X! srcBox.x2 = srcx + width;
X! srcBox.y2 = srcy + height;
X
X! prgnDst = (*pGC->pScreen->RegionCreate)(&srcBox, 1);
X! (*pGC->pScreen->Intersect)(prgnDst, prgnDst, prgnSrcClip);
X!
X if (pDstDrawable->type == DRAWABLE_WINDOW)
X {
X if (!((WindowPtr)pDstDrawable)->realized)
X {
X! (*pGC->pScreen->RegionDestroy)(prgnDst);
X if (realSrcClip)
X (*pGC->pScreen->RegionDestroy)(prgnSrcClip);
X return NULL;
X--- 182,211 ----
X }
X }
X
X! #ifdef PURDUE
X! /* Don't create a source region if we are doing a fast clip */
X! if (!fastClip)
X! #endif PURDUE
X! {
X! BoxRec srcBox;
X
X! srcBox.x1 = srcx;
X! srcBox.y1 = srcy;
X! srcBox.x2 = srcx + width;
X! srcBox.y2 = srcy + height;
X!
X! prgnDst = (*pGC->pScreen->RegionCreate)(&srcBox, 1);
X! (*pGC->pScreen->Intersect)(prgnDst, prgnDst, prgnSrcClip);
X! }
X!
X if (pDstDrawable->type == DRAWABLE_WINDOW)
X {
X if (!((WindowPtr)pDstDrawable)->realized)
X {
X! #ifdef PURDUE
X! if (!fastClip)
X! #endif
X! (*pGC->pScreen->RegionDestroy)(prgnDst);
X if (realSrcClip)
X (*pGC->pScreen->RegionDestroy)(prgnSrcClip);
X return NULL;
X***************
X*** 152,169 ****
X dx = srcx - dstx;
X dy = srcy - dsty;
X
X /* clip the shape of the dst to the destination composite clip */
X (*pGC->pScreen->TranslateRegion)(prgnDst, -dx, -dy);
X (*pGC->pScreen->Intersect)(prgnDst,
X! prgnDst,
X! ((mfbPrivGC *)(pGC->devPriv))->pCompositeClip);
X
X if (prgnDst->numRects)
X {
X if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL( prgnDst->numRects *
X sizeof(DDXPointRec))))
X {
X! (*pGC->pScreen->RegionDestroy)(prgnDst);
X if (realSrcClip)
X (*pGC->pScreen->RegionDestroy)(prgnSrcClip);
X return NULL;
X--- 217,292 ----
X dx = srcx - dstx;
X dy = srcy - dsty;
X
X+ #ifndef PURDUE
X /* clip the shape of the dst to the destination composite clip */
X (*pGC->pScreen->TranslateRegion)(prgnDst, -dx, -dy);
X (*pGC->pScreen->Intersect)(prgnDst,
X! prgnDst,
X! ((mfbPrivGC *)(pGC->devPriv))->pCompositeClip);
X
X+ #else PURDUE
X+ /* Translate and clip the dst to the destination composite clip */
X+ if (fastClip)
X+ {
X+ /* Translate the region directly */
X+ fastBox.x1 -= dx;
X+ fastBox.x2 -= dx;
X+ fastBox.y1 -= dy;
X+ fastBox.y2 -= dy;
X+
X+ /* If the destination composite clip is one rectangle we can
X+ do the clip directly. Otherwise we have to create a full
X+ blown region and call intersect */
X+ if (((mfbPrivGC *)(pGC->devPriv))->pCompositeClip->numRects == 1)
X+ {
X+ BoxPtr pBox = ((mfbPrivGC *)(pGC->devPriv))->pCompositeClip->rects;
X+
X+ if (fastBox.x1 < pBox->x1) fastBox.x1 = pBox->x1;
X+ if (fastBox.x2 > pBox->x2) fastBox.x2 = pBox->x2;
X+ if (fastBox.y1 < pBox->y1) fastBox.y1 = pBox->y1;
X+ if (fastBox.y2 > pBox->y2) fastBox.y2 = pBox->y2;
X+
X+ /* Check to see if the region is empty */
X+ if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2)
X+ fastRegion.numRects = 0;
X+
X+ /* Use the fast region for all future computation.
X+ The following code insures that RegionDestroy is not
X+ called on it. */
X+ prgnDst = &fastRegion;
X+ }
X+ else
X+ {
X+ /* We must turn off fastClip now, since we must create
X+ a full blown region. It is intersected with the
X+ composite clip below. */
X+ fastClip = 0;
X+ prgnDst = (*pGC->pScreen->RegionCreate)(&fastBox,1);
X+ }
X+ }
X+ else
X+ {
X+ (*pGC->pScreen->TranslateRegion)(prgnDst, -dx, -dy);
X+ }
X+
X+ if (!fastClip)
X+ {
X+ (*pGC->pScreen->Intersect)(prgnDst,
X+ prgnDst,
X+ ((mfbPrivGC *)(pGC->devPriv))->pCompositeClip);
X+ }
X+ #endif PURDUE
X+
X+ /* Do bit blitting */
X if (prgnDst->numRects)
X {
X if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL( prgnDst->numRects *
X sizeof(DDXPointRec))))
X {
X! #ifdef PURDUE
X! if (!fastClip)
X! #endif PURDUE
X! (*pGC->pScreen->RegionDestroy)(prgnDst);
X if (realSrcClip)
X (*pGC->pScreen->RegionDestroy)(prgnSrcClip);
X return NULL;
X***************
X*** 182,195 ****
X }
X
X prgnExposed = NULL;
X! if (((mfbPrivGC *)(pGC->devPriv))->fExpose)
X! prgnExposed =
X! miHandleExposures(pSrcDrawable, pDstDrawable, pGC,
X! origSource.x, origSource.y,
X! origSource.width, origSource.height,
X! origDest.x, origDest.y, 0);
X!
X! (*pGC->pScreen->RegionDestroy)(prgnDst);
X if (realSrcClip)
X (*pGC->pScreen->RegionDestroy)(prgnSrcClip);
X return prgnExposed;
X--- 305,327 ----
X }
X
X prgnExposed = NULL;
X! if (((mfbPrivGC *)(pGC->devPriv))->fExpose) {
X! #ifdef PURDUE
X! /* Pixmap sources generate a NoExposed (we return NULL to do this) */
X! if (!fastExpose)
X! #endif PURDUE
X! prgnExposed =
X! miHandleExposures(pSrcDrawable, pDstDrawable, pGC,
X! origSource.x, origSource.y,
X! origSource.width, origSource.height,
X! origDest.x, origDest.y, 0);
X! }
X! #ifdef PURDUE
X!
X! /* Destroy any created regions */
X! if (!fastClip)
X! #endif PURDUE
X! (*pGC->pScreen->RegionDestroy)(prgnDst);
X if (realSrcClip)
X (*pGC->pScreen->RegionDestroy)(prgnSrcClip);
X return prgnExposed;
X***************
X*** 243,248 ****
X--- 375,382 ----
X } \
X }
X
X+ #ifndef PURDUE
X+
X #define longRop(alu,from,to,count) \
X { \
X switch (count & 7) { \
X***************
X*** 267,273 ****
X } \
X }
X
X-
X #define getunalignedword(psrc, x, dst) \
X { \
X int m; \
X--- 401,406 ----
X***************
X*** 276,281 ****
X--- 409,437 ----
X (SCRRIGHT(*((psrc)+1), m) & starttab[m]); \
X }
X
X+ #else /* PURDUE */
X+ #define longRop(alu,from,to,count) \
X+ while (count--) \
X+ { \
X+ DoRop(*to, alu, *from++, *to); to++; \
X+ }
X+
X+ #ifdef FASTGETBITS
X+ #define getunalignedword(psrc, x, dst) { \
X+ register int _tmp; \
X+ FASTGETBITS(psrc, x, 32, _tmp); \
X+ dst = _tmp; \
X+ }
X+ #else
X+ #define getunalignedword(psrc, x, dst) \
X+ { \
X+ dst = (SCRLEFT((unsigned) *(psrc), (x))) | \
X+ (SCRRIGHT((unsigned) *((psrc)+1), 32-(x))); \
X+ }
X+ #endif /* FASTGETBITS */
X+
X+ #endif /* PURDUE */
X+
X mfbDoBitblt(pSrcDrawable, pDstDrawable, alu, prgnDst, pptSrc)
X DrawablePtr pSrcDrawable;
X DrawablePtr pDstDrawable;
X***************
X*** 491,498 ****
X--- 647,658 ----
X
X while(h--)
X {
X+ #ifndef PURDUE
X getbits(psrc, srcBit, w, tmpSrc)
X putbits(tmpSrc, dstBit, w, pdst)
X+ #else
X+ getandputbits(psrc, srcBit, dstBit, w, pdst)
X+ #endif /* PURDUE */
X pdst += widthDst;
X psrc += widthSrc;
X }
X***************
X*** 524,531 ****
X--- 684,696 ----
X
X if (startmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, (pptSrc->x & 0x1f), nstart, tmpSrc)
X putbits(tmpSrc, (pbox->x1 & 0x1f), nstart, pdst)
X+ #else
X+ getandputbits(psrc, (pptSrc->x & 0x1f),
X+ (pbox->x1 & 0x1f), nstart, pdst)
X+ #endif /* PURDUE */
X pdst++;
X if (srcStartOver)
X psrc++;
X***************
X*** 552,559 ****
X--- 717,728 ----
X
X if (endmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, xoffSrc, nend, tmpSrc)
X putbits(tmpSrc, 0, nend, pdst)
X+ #else
X+ getandputbits0(psrc, xoffSrc, nend, pdst);
X+ #endif /* PURDUE */
X }
X
X pdstLine += widthDst;
X***************
X*** 577,588 ****
X--- 746,766 ----
X
X if (endmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, xoffSrc, nend, tmpSrc)
X putbits(tmpSrc, 0, nend, pdst)
X+ #else
X+ getandputbits0(psrc, xoffSrc, nend, pdst);
X+ #endif
X }
X
X+ #ifndef PURDUE
X nl = nlMiddle + 1;
X while (--nl)
X+ #else
X+ nl = nlMiddle;
X+ while (nl--)
X+ #endif /* PURDUE */
X {
X --psrc;
X getunalignedword (psrc, xoffSrc, *--pdst)
X***************
X*** 593,600 ****
X--- 771,782 ----
X if (srcStartOver)
X --psrc;
X --pdst;
X+ #ifndef PURDUE
X getbits(psrc, (pptSrc->x & 0x1f), nstart, tmpSrc)
X putbits(tmpSrc, (pbox->x1 & 0x1f), nstart, pdst)
X+ #else
X+ getandputbits(psrc, (pptSrc->x & 0x1f), (pbox->x1 & 0x1f), nstart, pdst)
X+ #endif /* PURDUE */
X }
X
X pdstLine += widthDst;
X***************
X*** 639,646 ****
X--- 821,832 ----
X
X while(h--)
X {
X+ #ifndef PURDUE
X getbits(psrc, srcBit, w, tmpSrc)
X putbitsrop(tmpSrc, dstBit, w, pdst, alu)
X+ #else
X+ getandputrop(psrc, srcBit, dstBit, w, pdst, alu)
X+ #endif /* PURDUE */
X pdst += widthDst;
X psrc += widthSrc;
X }
X***************
X*** 672,680 ****
X--- 858,871 ----
X
X if (startmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, (pptSrc->x & 0x1f), nstart, tmpSrc)
X putbitsrop(tmpSrc, (pbox->x1 & 0x1f), nstart, pdst,
X alu)
X+ #else
X+ getandputrop(psrc, (pptSrc->x & 0x1f),
X+ (pbox->x1 & 0x1f), nstart, pdst, alu)
X+ #endif /* PURDUE */
X pdst++;
X if (srcStartOver)
X psrc++;
X***************
X*** 694,700 ****
X--- 885,896 ----
X while (--nl)
X {
X getunalignedword (psrc, xoffSrc, tmpSrc)
X+ #ifndef PURDUE
X *pdst++ = DoRop (alu, tmpSrc, *pdst);
X+ #else
X+ DoRop (*pdst, alu, tmpSrc, *pdst);
X+ pdst++;
X+ #endif
X psrc++;
X }
X }
X***************
X*** 701,708 ****
X--- 897,908 ----
X
X if (endmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, xoffSrc, nend, tmpSrc)
X putbitsrop(tmpSrc, 0, nend, pdst, alu)
X+ #else
X+ getandputrop0(psrc, xoffSrc, nend, pdst, alu);
X+ #endif /* PURDUE */
X }
X
X pdstLine += widthDst;
X***************
X*** 726,733 ****
X--- 926,937 ----
X
X if (endmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, xoffSrc, nend, tmpSrc)
X putbitsrop(tmpSrc, 0, nend, pdst, alu)
X+ #else
X+ getandputrop0(psrc, xoffSrc, nend, pdst, alu);
X+ #endif /* PURDUE */
X }
X
X nl = nlMiddle + 1;
X***************
X*** 736,742 ****
X--- 940,950 ----
X --psrc;
X --pdst;
X getunalignedword(psrc, xoffSrc, tmpSrc)
X+ #ifndef PURDUE
X *pdst = DoRop(alu, tmpSrc, *pdst);
X+ #else
X+ DoRop(*pdst, alu, tmpSrc, *pdst);
X+ #endif /* PURDUE */
X }
X
X if (startmask)
X***************
X*** 744,752 ****
X--- 952,965 ----
X if (srcStartOver)
X --psrc;
X --pdst;
X+ #ifndef PURDUE
X getbits(psrc, (pptSrc->x & 0x1f), nstart, tmpSrc)
X putbitsrop(tmpSrc, (pbox->x1 & 0x1f), nstart, pdst,
X alu)
X+ #else
X+ getandputrop(psrc, (pptSrc->x & 0x1f),
X+ (pbox->x1 & 0x1f), nstart, pdst, alu)
X+ #endif /* PURDUE */
X }
X
X pdstLine += widthDst;
*-*-END-of-mfbbitblt.c.patch-*-*
echo x - mfbbres.c.patch
sed 's/^X//' >mfbbres.c.patch <<'*-*-END-of-mfbbres.c.patch-*-*'
X*** /tmp/,RCSt1a01536 Wed Jan 18 23:15:06 1989
X--- ddx/mfb/mfbbres.c Tue Jan 17 23:39:13 1989
X***************
X*** 1,3 ****
X--- 1,4 ----
X+ /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
X /***********************************************************
X Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
X and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
X***************
X*** 34,40 ****
X--- 35,47 ----
X
X mfbBresS(rop, addrl, nlwidth, signdx, signdy, axis, x1, y1, e, e1, e2, len)
X int rop; /* a reduced rasterop */
X+
X+ #ifdef PURDUE
X+ unsigned int *addrl; /* pointer to base of bitmap */
X+ #else
X register int *addrl; /* pointer to base of bitmap */
X+ #endif
X+
X int nlwidth; /* width in longwords of bitmap */
X int signdx, signdy; /* signs of directions */
X int axis; /* major axis (Y_AXIS or X_AXIS) */
X***************
X*** 42,50 ****
X--- 49,79 ----
X register int e; /* error accumulator */
X register int e1; /* bresenham increments */
X int e2;
X+
X+ #ifdef PURDUE
X+ unsigned int len; /* length of line */
X+ #else
X register int len; /* length of line */
X+ #endif
X+
X {
X
X+ #ifdef PURDUE
X+ register int yinc; /* increment to next scanline, in bytes */
X+ register unsigned char *addrb; /* bitmask long pointer
X+ * cast to char pointer */
X+ register unsigned int bit; /* current bit being set/cleared/etc. */
X+ unsigned int leftbit = mask[0]; /* leftmost bit to process in new word */
X+ unsigned int rightbit = mask[31]; /* rightmost bit to process in new word */
X+
X+ register int e3 = e2-e1;
X+
X+ /* point to longword containing first point */
X+ addrb = (unsigned char *)(addrl + (y1 * nlwidth) + (x1 >> 5));
X+ yinc = signdy * nlwidth * 4; /* 4 == sizeof(int) */
X+ e = e-e1; /* to make looping easier */
X+ bit = mask[x1 & 31];
X+ #else
X register int yinc; /* increment to next scanline */
X register int addrb; /* bitmask */
X
X***************
X*** 52,57 ****
X--- 81,87 ----
X addrl = addrl + (y1 * nlwidth) + (x1 >> 5);
X addrb = x1&0x1f;
X yinc = signdy * nlwidth;
X+ #endif
X
X if (rop == RROP_BLACK)
X {
X***************
X*** 59,64 ****
X--- 89,108 ----
X {
X if (signdx > 0)
X {
X+ #ifdef PURDUE
X+ while(len--)
X+ {
X+ *(unsigned long *)addrb &= ~bit;
X+ e += e1;
X+ if (e >= 0)
X+ {
X+ addrb += yinc;
X+ e += e3;
X+ }
X+ bit = SCRRIGHT(bit,1);
X+ if (!bit) { bit = leftbit;addrb += 4; }
X+ }
X+ #else
X while(len--)
X {
X *addrl &= rmask[addrb];
X***************
X*** 76,84 ****
X--- 120,143 ----
X }
X addrb++;
X }
X+ #endif
X }
X else
X {
X+ #ifdef PURDUE
X+ while(len--)
X+ {
X+ *(unsigned long *)addrb &= ~bit;
X+ e += e1;
X+ if (e >= 0)
X+ {
X+ addrb += yinc;
X+ e += e3;
X+ }
X+ bit = SCRLEFT(bit,1);
X+ if (!bit) { bit = rightbit;addrb -= 4; }
X+ }
X+ #else
X while(len--)
X {
X *addrl &= rmask[addrb];
X***************
X*** 96,101 ****
X--- 155,161 ----
X }
X addrb--;
X }
X+ #endif
X }
X } /* if X_AXIS */
X else
X***************
X*** 102,107 ****
X--- 162,181 ----
X {
X if (signdx > 0)
X {
X+ #ifdef PURDUE
X+ while(len--)
X+ {
X+ *(unsigned long *)addrb &= ~bit;
X+ e += e1;
X+ if (e >= 0)
X+ {
X+ bit = SCRRIGHT(bit,1);
X+ if (!bit) { bit = leftbit;addrb += 4; }
X+ e += e3;
X+ }
X+ addrb += yinc;
X+ }
X+ #else
X while(len--)
X {
X *addrl &= rmask[addrb];
X***************
X*** 119,127 ****
X--- 193,216 ----
X }
X addrl += yinc;
X }
X+ #endif
X }
X else
X {
X+ #ifdef PURDUE
X+ while(len--)
X+ {
X+ *(unsigned long *)addrb &= ~bit;
X+ e += e1;
X+ if (e >= 0)
X+ {
X+ bit = SCRLEFT(bit,1);
X+ if (!bit) { bit = rightbit;addrb -= 4; }
X+ e += e3;
X+ }
X+ addrb += yinc;
X+ }
X+ #else
X while(len--)
X {
X *addrl &= rmask[addrb];
X***************
X*** 139,144 ****
X--- 228,234 ----
X }
X addrl += yinc;
X }
X+ #endif
X }
X } /* else Y_AXIS */
X }
X***************
X*** 148,153 ****
X--- 238,257 ----
X {
X if (signdx > 0)
X {
X+ #ifdef PURDUE
X+ while(len--)
X+ {
X+ *(unsigned long *)addrb |= bit;
X+ e += e1;
X+ if (e >= 0)
X+ {
X+ addrb += yinc;
X+ e += e3;
X+ }
X+ bit = SCRRIGHT(bit,1);
X+ if (!bit) { bit = leftbit;addrb += 4; }
X+ }
X+ #else
X while(len--)
X {
X *addrl |= mask[addrb];
X***************
X*** 165,174 ****
X }
X addrb++;
X }
X }
X else
X {
X! while(len--)
X {
X *addrl |= mask[addrb];
X if (e <= 0)
X--- 269,293 ----
X }
X addrb++;
X }
X+ #endif
X }
X else
X {
X! #ifdef PURDUE
X! while(len--)
X! {
X! *(unsigned long *)addrb |= bit;
X! e += e1;
X! if (e >= 0)
X! {
X! addrb += yinc;
X! e += e3;
X! }
X! bit = SCRLEFT(bit,1);
X! if (!bit) { bit = rightbit;addrb -= 4; }
X! }
X! #else
X! while(len--)
X {
X *addrl |= mask[addrb];
X if (e <= 0)
X***************
X*** 185,190 ****
X--- 304,310 ----
X }
X addrb--;
X }
X+ #endif
X }
X } /* if X_AXIS */
X else
X***************
X*** 191,196 ****
X--- 311,330 ----
X {
X if (signdx > 0)
X {
X+ #ifdef PURDUE
X+ while(len--)
X+ {
X+ *(unsigned long *)addrb |= bit;
X+ e += e1;
X+ if (e >= 0)
X+ {
X+ bit = SCRRIGHT(bit,1);
X+ if (!bit) { bit = leftbit;addrb += 4; }
X+ e += e3;
X+ }
X+ addrb += yinc;
X+ }
X+ #else
X while(len--)
X {
X *addrl |= mask[addrb];
X***************
X*** 208,216 ****
X--- 342,365 ----
X }
X addrl += yinc;
X }
X+ #endif
X }
X else
X {
X+ #ifdef PURDUE
X+ while(len--)
X+ {
X+ *(unsigned long *)addrb |= bit;
X+ e += e1;
X+ if (e >= 0)
X+ {
X+ bit = SCRLEFT(bit,1);
X+ if (!bit) { bit = rightbit;addrb -= 4; }
X+ e += e3;
X+ }
X+ addrb += yinc;
X+ }
X+ #else
X while(len--)
X {
X *addrl |= mask[addrb];
X***************
X*** 228,233 ****
X--- 377,383 ----
X }
X addrl += yinc;
X }
X+ #endif
X }
X } /* else Y_AXIS */
X }
X***************
X*** 237,242 ****
X--- 387,406 ----
X {
X if (signdx > 0)
X {
X+ #ifdef PURDUE
X+ while(len--)
X+ {
X+ *(unsigned long *)addrb ^= bit;
X+ e += e1;
X+ if (e >= 0)
X+ {
X+ addrb += yinc;
X+ e += e3;
X+ }
X+ bit = SCRRIGHT(bit,1);
X+ if (!bit) { bit = leftbit;addrb += 4; }
X+ }
X+ #else
X while(len--)
X {
X *addrl ^= mask[addrb];
X***************
X*** 254,262 ****
X--- 418,441 ----
X }
X addrb++;
X }
X+ #endif
X }
X else
X {
X+ #ifdef PURDUE
X+ while(len--)
X+ {
X+ *(unsigned long *)addrb ^= bit;
X+ e += e1;
X+ if (e >= 0)
X+ {
X+ addrb += yinc;
X+ e += e3;
X+ }
X+ bit = SCRLEFT(bit,1);
X+ if (!bit) { bit = rightbit;addrb -= 4; }
X+ }
X+ #else
X while(len--)
X {
X *addrl ^= mask[addrb];
X***************
X*** 274,279 ****
X--- 453,459 ----
X }
X addrb--;
X }
X+ #endif
X }
X } /* if X_AXIS */
X else
X***************
X*** 280,285 ****
X--- 460,479 ----
X {
X if (signdx > 0)
X {
X+ #ifdef PURDUE
X+ while(len--)
X+ {
X+ *(unsigned long *)addrb ^= bit;
X+ e += e1;
X+ if (e >= 0)
X+ {
X+ bit = SCRRIGHT(bit,1);
X+ if (!bit) { bit = leftbit;addrb += 4; }
X+ e += e3;
X+ }
X+ addrb += yinc;
X+ }
X+ #else
X while(len--)
X {
X *addrl ^= mask[addrb];
X***************
X*** 297,305 ****
X--- 491,514 ----
X }
X addrl += yinc;
X }
X+ #endif
X }
X else
X {
X+ #ifdef PURDUE
X+ while(len--)
X+ {
X+ *(unsigned long *)addrb ^= bit;
X+ e += e1;
X+ if (e >= 0)
X+ {
X+ bit = SCRLEFT(bit,1);
X+ if (!bit) { bit = rightbit;addrb -= 4; }
X+ e += e3;
X+ }
X+ addrb += yinc;
X+ }
X+ #else
X while(len--)
X {
X *addrl ^= mask[addrb];
X***************
X*** 317,322 ****
X--- 526,532 ----
X }
X addrl += yinc;
X }
X+ #endif
X }
X } /* else Y_AXIS */
X }
*-*-END-of-mfbbres.c.patch-*-*
echo x - mfbfillsp.c.patch
sed 's/^X//' >mfbfillsp.c.patch <<'*-*-END-of-mfbfillsp.c.patch-*-*'
X*** /tmp/,RCSt1a00702 Fri Jan 20 21:38:34 1989
X--- ./ddx/mfb/mfbfillsp.c Fri Jan 20 17:05:40 1989
X***************
X*** 1,3 ****
X--- 1,4 ----
X+ /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
X /***********************************************************
X Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
X and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
X***************
X*** 123,130 ****
X--- 124,135 ----
X maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
X if (startmask)
X *addrl++ &= ~startmask;
X+ #ifndef PURDUE
X while (nlmiddle--)
X *addrl++ = 0x0;
X+ #else
X+ Duff (nlmiddle, *addrl++ = 0x0);
X+ #endif
X if (endmask)
X *addrl &= ~endmask;
X }
X***************
X*** 207,214 ****
X--- 212,223 ----
X maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
X if (startmask)
X *addrl++ |= startmask;
X+ #ifndef PURDUE
X while (nlmiddle--)
X *addrl++ = 0xffffffff;
X+ #else
X+ Duff (nlmiddle, *addrl++ = 0xffffffff);
X+ #endif
X if (endmask)
X *addrl |= endmask;
X }
X***************
X*** 291,298 ****
X--- 300,311 ----
X maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
X if (startmask)
X *addrl++ ^= startmask;
X+ #ifndef PURDUE
X while (nlmiddle--)
X *addrl++ ^= 0xffffffff;
X+ #else
X+ Duff (nlmiddle, *addrl++ ^= 0xffffffff);
X+ #endif /* PURDUE */
X if (endmask)
X *addrl ^= endmask;
X }
X***************
X*** 382,389 ****
X--- 395,406 ----
X maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
X if (startmask)
X *addrl++ |= (src & startmask);
X+ #ifndef PURDUE
X while (nlmiddle--)
X *addrl++ |= src;
X+ #else
X+ Duff (nlmiddle, *addrl++ |= src);
X+ #endif /* PURDUE */
X if (endmask)
X *addrl |= (src & endmask);
X }
X***************
X*** 472,479 ****
X--- 489,500 ----
X maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
X if (startmask)
X *addrl++ &= ~(src & startmask);
X+ #ifndef PURDUE
X while (nlmiddle--)
X *addrl++ &= ~src;
X+ #else
X+ Duff (nlmiddle, *addrl++ &= ~src);
X+ #endif /* PURDUE */
X if (endmask)
X *addrl &= ~(src & endmask);
X }
X***************
X*** 562,569 ****
X--- 583,594 ----
X maskbits(ppt->x, *pwidth, startmask, endmask, nlmiddle);
X if (startmask)
X *addrl++ ^= (src & startmask);
X+ #ifndef PURDUE
X while (nlmiddle--)
X *addrl++ ^= src;
X+ #else
X+ Duff(nlmiddle, *addrl++ ^= src);
X+ #endif /* PURDUE */
X if (endmask)
X *addrl ^= (src & endmask);
X }
X***************
X*** 852,859 ****
X--- 877,888 ----
X */
X w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_UNIT);
X endinc = rem / BITMAP_SCANLINE_UNIT;
X+ #ifndef PURDUE
X getbits(psrc + endinc, rem & 0x1f, w, tmpSrc);
X putbitsrop(tmpSrc, (x & 0x1f), w, pdst, rop);
X+ #else
X+ getandputrop((psrc+endinc), (rem&0x1f), (x & 0x1f), w, pdst, rop);
X+ #endif
X if((x & 0x1f) + w >= 0x20)
X pdst++;
X }
X***************
X*** 860,867 ****
X--- 889,900 ----
X else if(((x & 0x1f) + w) < 32)
X {
X /* doing < 32 bits is easy, and worth special-casing */
X+ #ifndef PURDUE
X getbits(psrc, 0, w, tmpSrc);
X putbitsrop(tmpSrc, x & 0x1f, w, pdst, rop);
X+ #else
X+ putbitsrop(*psrc, x & 0x1f, w, pdst, rop);
X+ #endif
X }
X else
X {
X***************
X*** 883,890 ****
X--- 916,927 ----
X
X if(startmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, 0, nstart, tmpSrc);
X putbitsrop(tmpSrc, (x & 0x1f), nstart, pdst, rop);
X+ #else
X+ putbitsrop(*psrc, (x & 0x1f), nstart, pdst, rop);
X+ #endif /* PURDUE */
X pdst++;
X if(srcStartOver)
X psrc++;
X***************
X*** 892,906 ****
X--- 929,951 ----
X
X while(nlMiddle--)
X {
X+ #ifndef PURDUE
X getbits(psrc, nstart, 32, tmpSrc);
X *pdst = DoRop(rop, tmpSrc, *pdst);
X+ #else /* PURDUE */
X+ getandputrop0(psrc, nstart, 32, pdst, rop);
X+ #endif /* PURDUE */
X pdst++;
X psrc++;
X }
X if(endmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, nstart, nend, tmpSrc);
X putbitsrop(tmpSrc, 0, nend, pdst, rop);
X+ #else
X+ getandputrop0(psrc, nstart, nend, pdst, rop);
X+ #endif /* PURDUE */
X }
X }
X x += w;
X***************
X*** 1013,1020 ****
X */
X w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_UNIT);
X endinc = rem / BITMAP_SCANLINE_UNIT;
X getbits(psrc + endinc, rem & 0x1f, w, tmpSrc);
X! putbitsrrop(tmpSrc, (x & 0x1f), w, pdst, rop);
X if((x & 0x1f) + w >= 0x20)
X pdst++;
X }
X--- 1058,1070 ----
X */
X w = min(min(tileWidth - rem, width), BITMAP_SCANLINE_UNIT);
X endinc = rem / BITMAP_SCANLINE_UNIT;
X+ #ifndef PURDUE
X getbits(psrc + endinc, rem & 0x1f, w, tmpSrc);
X! putbitsrop(tmpSrc, (x & 0x1f), w, pdst, rop);
X! #else
X! getandputrop((psrc + endinc), (rem & 0x1f), (x & 0x1f),
X! w, pdst, rop)
X! #endif
X if((x & 0x1f) + w >= 0x20)
X pdst++;
X }
X***************
X*** 1022,1029 ****
X--- 1072,1083 ----
X else if(((x & 0x1f) + w) < 32)
X {
X /* doing < 32 bits is easy, and worth special-casing */
X+ #ifndef PURDUE
X getbits(psrc, 0, w, tmpSrc);
X putbitsrrop(tmpSrc, x & 0x1f, w, pdst, rop);
X+ #else
X+ putbitsrrop(*psrc, x & 0x1f, w, pdst, rop);
X+ #endif /* PURDUE */
X }
X else
X {
X***************
X*** 1045,1052 ****
X--- 1099,1110 ----
X
X if(startmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, 0, nstart, tmpSrc);
X putbitsrrop(tmpSrc, (x & 0x1f), nstart, pdst, rop);
X+ #else
X+ putbitsrrop(*psrc, (x & 0x1f), nstart, pdst, rop);
X+ #endif
X pdst++;
X if(srcStartOver)
X psrc++;
X***************
X*** 1054,1068 ****
X--- 1112,1134 ----
X
X while(nlMiddle--)
X {
X+ #ifndef PURDUE
X getbits(psrc, nstart, 32, tmpSrc);
X *pdst = DoRRop(rop, tmpSrc, *pdst);
X+ #else
X+ getandputrrop0(psrc, nstart, 32, pdst, rop);
X+ #endif
X pdst++;
X psrc++;
X }
X if(endmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, nstart, nend, tmpSrc);
X putbitsrrop(tmpSrc, 0, nend, pdst, rop);
X+ #else
X+ getandputrrop0(psrc, nstart, nend, pdst, rop);
X+ #endif /* PURDUE */
X }
X }
X x += w;
*-*-END-of-mfbfillsp.c.patch-*-*
echo x - mfbgetsp.c.patch
sed 's/^X//' >mfbgetsp.c.patch <<'*-*-END-of-mfbgetsp.c.patch-*-*'
X*** /tmp/,RCSt1a01554 Wed Jan 18 23:15:20 1989
X--- ddx/mfb/mfbgetsp.c Tue Jan 17 23:39:29 1989
X***************
X*** 1,3 ****
X--- 1,4 ----
X+ /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
X /***********************************************************
X Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
X and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
X***************
X*** 110,117 ****
X--- 111,122 ----
X
X if (srcBit + w <= 32)
X {
X+ #ifndef PURDUE
X getbits(psrc, srcBit, w, tmpSrc);
X putbits(tmpSrc, 0, w, pdst);
X+ #else
X+ getandputbits0(psrc, srcBit, w, pdst);
X+ #endif /* PURDUE */
X pdst++;
X }
X else
X***************
X*** 127,138 ****
X--- 132,150 ----
X srcStartOver = srcBit + nstart > 31;
X if (startmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, srcBit, nstart, tmpSrc);
X putbits(tmpSrc, 0, nstart, pdst);
X+ #else
X+ getandputbits0(psrc, srcBit, nstart, pdst);
X+ #endif /* PURDUE */
X if(srcStartOver)
X psrc++;
X }
X nl = nlMiddle;
X+ #if defined(PURDUE) && defined(FASTPUTBITS)
X+ Duff(nl, putbits(*psrc, nstart, 32, pdst); psrc++; pdst++;);
X+ #else
X while (nl--)
X {
X tmpSrc = *psrc;
X***************
X*** 140,149 ****
X--- 152,166 ----
X psrc++;
X pdst++;
X }
X+ #endif
X if (endmask)
X {
X+ #ifndef PURDUE
X getbits(psrc, 0, nend, tmpSrc);
X putbits(tmpSrc, nstart, nend, pdst);
X+ #else
X+ putbits(*psrc, nstart, nend, pdst);
X+ #endif /* PURDUE */
X if(nstart + nend > 32)
X pdst++;
X }
*-*-END-of-mfbgetsp.c.patch-*-*
echo x - mfbpolypnt.c.patch
sed 's/^X//' >mfbpolypnt.c.patch <<'*-*-END-of-mfbpolypnt.c.patch-*-*'
X*** /tmp/,RCSt1a01574 Wed Jan 18 23:15:33 1989
X--- ddx/mfb/mfbpolypnt.c Tue Jan 17 23:39:46 1989
X***************
X*** 1,3 ****
X--- 1,4 ----
X+ /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
X /***********************************************************
X Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
X and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
X***************
X*** 102,112 ****
X--- 103,117 ----
X nptTmp = npt;
X if (mode == CoordModeOrigin)
X {
X+ #ifndef PURDUE
X while(nptTmp--)
X {
X ppt->x += xorg;
X ppt++->y += yorg;
X }
X+ #else
X+ Duff(nptTmp, ppt->x += xorg; ppt++->y += yorg );
X+ #endif
X }
X else
X {
X***************
X*** 113,118 ****
X--- 118,124 ----
X ppt->x += xorg;
X ppt->y += yorg;
X nptTmp--;
X+ #ifndef PURDUE
X while(nptTmp--)
X {
X ppt++;
X***************
X*** 119,124 ****
X--- 125,133 ----
X ppt->x += (ppt-1)->x;
X ppt->y += (ppt-1)->y;
X }
X+ #else
X+ Duff(nptTmp, ppt++; ppt->x += (ppt-1)->x; ppt->y += (ppt-1)->y);
X+ #endif
X }
X
X ppt = pptInit;
*-*-END-of-mfbpolypnt.c.patch-*-*
echo x - mfbwindow.c.patch
sed 's/^X//' >mfbwindow.c.patch <<'*-*-END-of-mfbwindow.c.patch-*-*'
X*** /tmp/,RCSt1a01591 Wed Jan 18 23:15:43 1989
X--- ddx/mfb/mfbwindow.c Tue Jan 17 23:39:59 1989
X***************
X*** 1,4 ****
X--- 1,5 ----
X /* $XConsortium: mfbwindow.c,v 1.10 88/10/20 20:02:34 keith Exp $ */
X+ /* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
X /***********************************************************
X Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
X and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
X***************
X*** 190,200 ****
X--- 191,206 ----
X return;
X ppt = pptSrc;
X
X+ #ifndef PURDUE
X for (i=0; i<nbox; i++, ppt++, pbox++)
X {
X ppt->x = pbox->x1 + dx;
X ppt->y = pbox->y1 + dy;
X }
X+ #else
X+ i = nbox;
X+ Duff(i, ppt->x = pbox->x1 + dx; ppt->y = pbox->y1 + dy; ppt++; pbox++);
X+ #endif /* PURDUE */
X
X mfbDoBitblt(pwinRoot, pwinRoot, GXcopy, prgnDst, pptSrc);
X DEALLOCATE_LOCAL(pptSrc);
*-*-END-of-mfbwindow.c.patch-*-*
exit
--
Mike Wexler(wyse!mikew) Phone: (408)433-1000 x1330
Moderator of comp.sources.x
More information about the Comp.sources.x
mailing list