summaryrefslogtreecommitdiff
path: root/cfb
diff options
context:
space:
mode:
Diffstat (limited to 'cfb')
-rw-r--r--cfb/cfb.h30
-rw-r--r--cfb/cfb8bit.h8
-rw-r--r--cfb/cfb8line.c14
-rw-r--r--cfb/cfbbitblt.c604
-rw-r--r--cfb/cfbblt.c23
-rw-r--r--cfb/cfbcppl.c68
-rw-r--r--cfb/cfbfillarc.c22
-rw-r--r--cfb/cfbfillsp.c9
-rw-r--r--cfb/cfbgetsp.c8
-rw-r--r--cfb/cfbglblt8.c34
-rw-r--r--cfb/cfbmap.h4
-rw-r--r--cfb/cfbmskbits.h6
-rw-r--r--cfb/cfbply1rct.c29
-rw-r--r--cfb/cfbpntwin.c6
-rw-r--r--cfb/cfbrrop.h14
-rw-r--r--cfb/cfbscrinit.c20
-rw-r--r--cfb/cfbsetsp.c16
-rw-r--r--cfb/cfbsolid.c4
-rw-r--r--cfb/cfbtab.h10
-rw-r--r--cfb/cfbtegblt.c20
-rw-r--r--cfb/cfbtile32.c20
-rw-r--r--cfb/cfbtileodd.c34
-rw-r--r--cfb/cfbunmap.h3
-rw-r--r--cfb/cfbwindow.c5
-rw-r--r--cfb/cfbzerarc.c13
25 files changed, 839 insertions, 185 deletions
diff --git a/cfb/cfb.h b/cfb/cfb.h
index 731b7684a..b7d027905 100644
--- a/cfb/cfb.h
+++ b/cfb/cfb.h
@@ -27,7 +27,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
THE USE OR PERFORMANCE OF THIS SOFTWARE.
********************************************************/
-/* $XFree86: xc/programs/Xserver/cfb/cfb.h,v 3.27 2001/01/30 22:06:15 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfb.h,v 3.30 2003/07/19 13:22:27 tsi Exp $ */
#if !defined(__CFB_H__) || defined(CFB_PROTOTYPES_ONLY)
@@ -336,8 +336,31 @@ extern RegionPtr cfbBitBlt(
int /*alu*/,
RegionPtr /*prgnDst*/,
DDXPointPtr /*pptSrc*/,
+ unsigned long /*planemask*/
+ ),
+ unsigned long /*bitPlane*/
+);
+
+#define cfbCopyPlaneExpand cfbBitBlt
+
+extern RegionPtr cfbCopyPlaneReduce(
+ DrawablePtr /*pSrcDrawable*/,
+ DrawablePtr /*pDstDrawable*/,
+ GCPtr /*pGC*/,
+ int /*srcx*/,
+ int /*srcy*/,
+ int /*width*/,
+ int /*height*/,
+ int /*dstx*/,
+ int /*dsty*/,
+ void (* /*doCopyPlane*/)(
+ DrawablePtr /*pSrc*/,
+ DrawablePtr /*pDst*/,
+ int /*alu*/,
+ RegionPtr /*prgnDst*/,
+ DDXPointPtr /*pptSrc*/,
unsigned long /*planemask*/,
- unsigned long /*bitPlane*/
+ unsigned long /*bitPlane*/ /* We must know which plane to reduce! */
),
unsigned long /*bitPlane*/
);
@@ -370,8 +393,7 @@ extern void cfbCopyPlane1to8(
int /*rop*/,
RegionPtr /*prgnDst*/,
DDXPointPtr /*pptSrc*/,
- unsigned long /*planemask*/,
- unsigned long /*bitPlane*/
+ unsigned long /*planemask*/
);
#endif
diff --git a/cfb/cfb8bit.h b/cfb/cfb8bit.h
index a14402b83..0c6b51925 100644
--- a/cfb/cfb8bit.h
+++ b/cfb/cfb8bit.h
@@ -7,7 +7,7 @@
* are used for depths other than 8. Perhaps the file should be
* renamed. dpw
*/
-/* $XFree86: xc/programs/Xserver/cfb/cfb8bit.h,v 3.7 2001/12/14 19:59:20 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfb8bit.h,v 3.8 2003/11/17 22:20:32 dawes Exp $ */
/*
@@ -1545,24 +1545,19 @@ extern int cfb8StippleRRop;
extern PixelGroup cfb8BitLenMasks[PGSZ];
extern int cfb8SetStipple (
-#if NeedFunctionPrototypes
int /*alu*/,
CfbBits /*fg*/,
CfbBits /*planemask*/
-#endif
);
extern int cfb8SetOpaqueStipple (
-#if NeedFunctionPrototypes
int /*alu*/,
CfbBits /*fg*/,
CfbBits /*bg*/,
CfbBits /*planemask*/
-#endif
);
extern int cfb8ComputeClipMasks32 (
-#if NeedFunctionPrototypes
BoxPtr /*pBox*/,
int /*numRects*/,
int /*x*/,
@@ -1570,5 +1565,4 @@ extern int cfb8ComputeClipMasks32 (
int /*w*/,
int /*h*/,
CARD32 * /*clips*/
-#endif
);
diff --git a/cfb/cfb8line.c b/cfb/cfb8line.c
index f06abe084..01c412b97 100644
--- a/cfb/cfb8line.c
+++ b/cfb/cfb8line.c
@@ -25,7 +25,7 @@ in this Software without prior written authorization from The Open Group.
*
* Author: Keith Packard, MIT X Consortium
*
- * $XFree86: xc/programs/Xserver/cfb/cfb8line.c,v 3.18 2002/09/18 17:11:47 tsi Exp $
+ * $XFree86: xc/programs/Xserver/cfb/cfb8line.c,v 3.19 2003/10/29 22:44:52 tsi Exp $
* Jeff Anton'x fixes: cfb8line.c 97/02/07
*/
@@ -337,9 +337,13 @@ FUNC_NAME(cfb8LineSS1Rect) (pDrawable, pGC, mode, npt, pptInit, pptInitOrig,
char *addrb;
int stepmajor3, stepminor3, majordx, minordx;
#endif
+#ifndef POLYSEGMENT
+#ifndef ORIGIN
#ifdef BUGFIX_clip
int ex_x1, ex_y1, ex_x2, ex_y2;
#endif
+#endif
+#endif
int octant;
unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
@@ -355,12 +359,16 @@ FUNC_NAME(cfb8LineSS1Rect) (pDrawable, pGC, mode, npt, pptInit, pptInitOrig,
upperleft = *((int *) &extents->x1) - c2;
lowerright = *((int *) &extents->x2) - c2 - 0x00010001;
#endif /* !PREVIOUS */
+#ifndef POLYSEGMENT
+#ifndef ORIGIN
#ifdef BUGFIX_clip
ex_x1 = extents->x1 - pDrawable->x;
ex_y1 = extents->y1 - pDrawable->y;
ex_x2 = extents->x2 - pDrawable->x;
ex_y2 = extents->y2 - pDrawable->y;
#endif
+#endif
+#endif
#if PSZ == 24
xBase = pDrawable->x;
addr += WIDTH_MUL(pDrawable->y,nwidth);
@@ -1079,6 +1087,7 @@ FUNC_NAME(cfb8LineSS1Rect) (pDrawable, pGC, mode, npt, pptInit, pptInitOrig,
# endif
}
#endif /* !POLYSEGMENT */
+ RROP_UNDECLARE;
return -1;
}
@@ -1264,7 +1273,6 @@ RROP_NAME (cfb8ClippedLine) (pDrawable, pGC, x1, y1, x2, y2, boxp, shorten)
Bool pt1_clipped, pt2_clipped;
int changex, changey, result;
#if PSZ == 24
- int xOffset;
PixelType *addrLineEnd;
char *addrb;
int stepx3, stepy3;
@@ -1382,7 +1390,6 @@ RROP_NAME (cfb8ClippedLine) (pDrawable, pGC, x1, y1, x2, y2, boxp, shorten)
RROP_FETCH_GC(pGC);
#if PSZ == 24
- xOffset = x1;
addrLineEnd = addr + (y1 * nwidth);
addrb = (char *)addrLineEnd + x1 * 3;
if (stepx == 1 || stepx == -1){
@@ -1485,6 +1492,7 @@ RROP_NAME (cfb8ClippedLine) (pDrawable, pGC, x1, y1, x2, y2, boxp, shorten)
RROP_SOLID(addrp);
#endif
#undef body
+ RROP_UNDECLARE
}
}
diff --git a/cfb/cfbbitblt.c b/cfb/cfbbitblt.c
index 595d68c66..151a50edd 100644
--- a/cfb/cfbbitblt.c
+++ b/cfb/cfbbitblt.c
@@ -2,7 +2,7 @@
* cfb copy area
*/
-/* $XFree86: xc/programs/Xserver/cfb/cfbbitblt.c,v 1.14 2001/12/14 19:59:21 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbbitblt.c,v 1.20 2003/11/10 18:21:44 tsi Exp $ */
/*
@@ -68,17 +68,23 @@ static unsigned int FgPixel, BgPixel;
# endif
#endif
+/* cfbBitBltcfb == cfbCopyPlaneExpand */
RegionPtr
-cfbBitBlt (pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty, doBitBlt, bitPlane)
- register DrawablePtr pSrcDrawable;
- register DrawablePtr pDstDrawable;
- GC *pGC;
- int srcx, srcy;
- int width, height;
- int dstx, dsty;
- void (*doBitBlt)();
- unsigned long bitPlane;
+cfbBitBlt (
+ register DrawablePtr pSrcDrawable,
+ register DrawablePtr pDstDrawable,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ void (*doBitBlt)(
+ DrawablePtr /*pSrc*/,
+ DrawablePtr /*pDst*/,
+ int /*alu*/,
+ RegionPtr /*prgnDst*/,
+ DDXPointPtr /*pptSrc*/,
+ unsigned long /*planemask*/),
+ unsigned long bitPlane)
{
RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */
Bool freeSrcClip = FALSE;
@@ -254,7 +260,7 @@ cfbBitBlt (pSrcDrawable, pDstDrawable,
/* Check to see if the region is empty */
if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2)
{
- REGION_INIT(pGC->pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pGC->pScreen, &rgnDst);
}
else
{
@@ -302,15 +308,276 @@ cfbBitBlt (pSrcDrawable, pDstDrawable,
ppt->y = pbox->y1 + dy;
}
- (*doBitBlt) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask, bitPlane);
+ (*doBitBlt) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask);
DEALLOCATE_LOCAL(pptSrc);
}
prgnExposed = NULL;
if (pGC->fExpose)
{
- extern RegionPtr miHandleExposures();
+ /* Pixmap sources generate a NoExposed (we return NULL to do this) */
+ if (!fastExpose)
+ prgnExposed =
+ miHandleExposures(pSrcDrawable, pDstDrawable, pGC,
+ origSource.x, origSource.y,
+ (int)origSource.width,
+ (int)origSource.height,
+ origDest.x, origDest.y, bitPlane);
+ }
+ REGION_UNINIT(pGC->pScreen, &rgnDst);
+ if (freeSrcClip)
+ REGION_DESTROY(pGC->pScreen, prgnSrcClip);
+ return prgnExposed;
+}
+
+
+RegionPtr
+cfbCopyPlaneReduce (
+ register DrawablePtr pSrcDrawable,
+ register DrawablePtr pDstDrawable,
+ GC *pGC,
+ int srcx, int srcy,
+ int width, int height,
+ int dstx, int dsty,
+ void (*doCopyPlane)(
+ DrawablePtr /*pSrc*/,
+ DrawablePtr /*pDst*/,
+ int /*alu*/,
+ RegionPtr /*prgnDst*/,
+ DDXPointPtr /*pptSrc*/,
+ unsigned long /*planemask*/,
+ unsigned long /*bitPlane*/),
+ unsigned long bitPlane)
+{
+ RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */
+ Bool freeSrcClip = FALSE;
+
+ RegionPtr prgnExposed;
+ RegionRec rgnDst;
+ DDXPointPtr pptSrc;
+ register DDXPointPtr ppt;
+ register BoxPtr pbox;
+ int i;
+ register int dx;
+ register int dy;
+ xRectangle origSource;
+ DDXPointRec origDest;
+ int numRects;
+ BoxRec fastBox;
+ int fastClip = 0; /* for fast clipping with pixmap source */
+ int fastExpose = 0; /* for fast exposures with pixmap source */
+
+ origSource.x = srcx;
+ origSource.y = srcy;
+ origSource.width = width;
+ origSource.height = height;
+ origDest.x = dstx;
+ origDest.y = dsty;
+
+ if ((pSrcDrawable != pDstDrawable) &&
+ pSrcDrawable->pScreen->SourceValidate)
+ {
+ (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, srcx, srcy, width, height);
+ }
+
+ srcx += pSrcDrawable->x;
+ srcy += pSrcDrawable->y;
+
+ /* clip the source */
+
+ if (pSrcDrawable->type == DRAWABLE_PIXMAP)
+ {
+ if ((pSrcDrawable == pDstDrawable) &&
+ (pGC->clientClipType == CT_NONE))
+ {
+ prgnSrcClip = cfbGetCompositeClip(pGC);
+ }
+ else
+ {
+ fastClip = 1;
+ }
+ }
+ else
+ {
+ if (pGC->subWindowMode == IncludeInferiors)
+ {
+ /*
+ * XFree86 DDX empties the border clip when the
+ * VT is inactive
+ */
+ if (!((WindowPtr) pSrcDrawable)->parent &&
+ REGION_NOTEMPTY (pSrcDrawable->pScreen,
+ &((WindowPtr) pSrcDrawable)->borderClip))
+ {
+ /*
+ * special case bitblt from root window in
+ * IncludeInferiors mode; just like from a pixmap
+ */
+ fastClip = 1;
+ }
+ else if ((pSrcDrawable == pDstDrawable) &&
+ (pGC->clientClipType == CT_NONE))
+ {
+ prgnSrcClip = cfbGetCompositeClip(pGC);
+ }
+ else
+ {
+ prgnSrcClip = NotClippedByChildren((WindowPtr)pSrcDrawable);
+ freeSrcClip = TRUE;
+ }
+ }
+ else
+ {
+ prgnSrcClip = &((WindowPtr)pSrcDrawable)->clipList;
+ }
+ }
+
+ fastBox.x1 = srcx;
+ fastBox.y1 = srcy;
+ fastBox.x2 = srcx + width;
+ fastBox.y2 = srcy + height;
+
+ /* Don't create a source region if we are doing a fast clip */
+ if (fastClip)
+ {
+ fastExpose = 1;
+ /*
+ * clip the source; if regions extend beyond the source size,
+ * make sure exposure events get sent
+ */
+ if (fastBox.x1 < pSrcDrawable->x)
+ {
+ fastBox.x1 = pSrcDrawable->x;
+ fastExpose = 0;
+ }
+ if (fastBox.y1 < pSrcDrawable->y)
+ {
+ fastBox.y1 = pSrcDrawable->y;
+ fastExpose = 0;
+ }
+ if (fastBox.x2 > pSrcDrawable->x + (int) pSrcDrawable->width)
+ {
+ fastBox.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
+ fastExpose = 0;
+ }
+ if (fastBox.y2 > pSrcDrawable->y + (int) pSrcDrawable->height)
+ {
+ fastBox.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
+ fastExpose = 0;
+ }
+ }
+ else
+ {
+ REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
+ REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip);
+ }
+
+ dstx += pDstDrawable->x;
+ dsty += pDstDrawable->y;
+
+ if (pDstDrawable->type == DRAWABLE_WINDOW)
+ {
+ if (!((WindowPtr)pDstDrawable)->realized)
+ {
+ if (!fastClip)
+ REGION_UNINIT(pGC->pScreen, &rgnDst);
+ if (freeSrcClip)
+ REGION_DESTROY(pGC->pScreen, prgnSrcClip);
+ return NULL;
+ }
+ }
+
+ dx = srcx - dstx;
+ dy = srcy - dsty;
+
+ /* Translate and clip the dst to the destination composite clip */
+ if (fastClip)
+ {
+ RegionPtr cclip;
+
+ /* Translate the region directly */
+ fastBox.x1 -= dx;
+ fastBox.x2 -= dx;
+ fastBox.y1 -= dy;
+ fastBox.y2 -= dy;
+
+ /* If the destination composite clip is one rectangle we can
+ do the clip directly. Otherwise we have to create a full
+ blown region and call intersect */
+
+ /* XXX because CopyPlane uses this routine for 8-to-1 bit
+ * copies, this next line *must* also correctly fetch the
+ * composite clip from an mfb gc
+ */
+
+ cclip = cfbGetCompositeClip(pGC);
+ if (REGION_NUM_RECTS(cclip) == 1)
+ {
+ BoxPtr pBox = REGION_RECTS(cclip);
+
+ if (fastBox.x1 < pBox->x1) fastBox.x1 = pBox->x1;
+ if (fastBox.x2 > pBox->x2) fastBox.x2 = pBox->x2;
+ if (fastBox.y1 < pBox->y1) fastBox.y1 = pBox->y1;
+ if (fastBox.y2 > pBox->y2) fastBox.y2 = pBox->y2;
+
+ /* Check to see if the region is empty */
+ if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2)
+ {
+ REGION_NULL(pGC->pScreen, &rgnDst);
+ }
+ else
+ {
+ REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
+ }
+ }
+ else
+ {
+ /* We must turn off fastClip now, since we must create
+ a full blown region. It is intersected with the
+ composite clip below. */
+ fastClip = 0;
+ REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
+ }
+ }
+ else
+ {
+ REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy);
+ }
+
+ if (!fastClip)
+ {
+ REGION_INTERSECT(pGC->pScreen, &rgnDst,
+ &rgnDst,
+ cfbGetCompositeClip(pGC));
+ }
+
+ /* Do bit blitting */
+ numRects = REGION_NUM_RECTS(&rgnDst);
+ if (numRects && width && height)
+ {
+ if(!(pptSrc = (DDXPointPtr)ALLOCATE_LOCAL(numRects *
+ sizeof(DDXPointRec))))
+ {
+ REGION_UNINIT(pGC->pScreen, &rgnDst);
+ if (freeSrcClip)
+ REGION_DESTROY(pGC->pScreen, prgnSrcClip);
+ return NULL;
+ }
+ pbox = REGION_RECTS(&rgnDst);
+ ppt = pptSrc;
+ for (i = numRects; --i >= 0; pbox++, ppt++)
+ {
+ ppt->x = pbox->x1 + dx;
+ ppt->y = pbox->y1 + dy;
+ }
+ (*doCopyPlane) (pSrcDrawable, pDstDrawable, pGC->alu, &rgnDst, pptSrc, pGC->planemask, bitPlane);
+ DEALLOCATE_LOCAL(pptSrc);
+ }
+
+ prgnExposed = NULL;
+ if (pGC->fExpose)
+ {
/* Pixmap sources generate a NoExposed (we return NULL to do this) */
if (!fastExpose)
prgnExposed =
@@ -335,21 +602,29 @@ cfbDoBitblt (pSrc, pDst, alu, prgnDst, pptSrc, planemask)
DDXPointPtr pptSrc;
unsigned long planemask;
{
- void (*blt)() = cfbDoBitbltGeneral;
+ void (*doBitBlt)(
+ DrawablePtr /*pSrc*/,
+ DrawablePtr /*pDst*/,
+ int /*alu*/,
+ RegionPtr /*prgnDst*/,
+ DDXPointPtr /*pptSrc*/,
+ unsigned long /*planemask*/)
+ = cfbDoBitbltGeneral;
+
if ((planemask & PMSK) == PMSK) {
switch (alu) {
case GXcopy:
- blt = cfbDoBitbltCopy;
+ doBitBlt = cfbDoBitbltCopy;
break;
case GXxor:
- blt = cfbDoBitbltXor;
+ doBitBlt = cfbDoBitbltXor;
break;
case GXor:
- blt = cfbDoBitbltOr;
+ doBitBlt = cfbDoBitbltOr;
break;
}
}
- (*blt) (pSrc, pDst, alu, prgnDst, pptSrc, planemask);
+ (*doBitBlt) (pSrc, pDst, alu, prgnDst, pptSrc, planemask);
}
RegionPtr
@@ -362,7 +637,13 @@ cfbCopyArea(pSrcDrawable, pDstDrawable,
int width, height;
int dstx, dsty;
{
- void (*doBitBlt) ();
+ void (*doBitBlt) (
+ DrawablePtr /*pSrc*/,
+ DrawablePtr /*pDst*/,
+ int /*alu*/,
+ RegionPtr /*prgnDst*/,
+ DDXPointPtr /*pptSrc*/,
+ unsigned long /*planemask*/);
doBitBlt = cfbDoBitbltCopy;
if (pGC->alu != GXcopy || (pGC->planemask & PMSK) != PMSK)
@@ -386,18 +667,17 @@ cfbCopyArea(pSrcDrawable, pDstDrawable,
#if PSZ == 8
void
-cfbCopyPlane1to8 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask, bitPlane)
+cfbCopyPlane1to8 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask)
DrawablePtr pSrcDrawable; /* must be a bitmap */
DrawablePtr pDstDrawable; /* must be depth 8 drawable */
int rop; /* not used; caller must call cfb8CheckOpaqueStipple
* beforehand to get cfb8StippleRRop set correctly */
- unsigned long planemask; /* to apply to destination writes */
RegionPtr prgnDst; /* region in destination to draw to;
* screen relative coords. if dest is a window;
* drawable relative if dest is a pixmap */
DDXPointPtr pptSrc; /* drawable relative src coords to copy from;
* must be one point for each box in prgnDst */
- unsigned long bitPlane; /* not used; assumed always to be 1 */
+ unsigned long planemask; /* to apply to destination writes */
{
int srcx, srcy; /* upper left corner of box being copied in source */
int dstx, dsty; /* upper left corner of box being copied in dest */
@@ -718,26 +998,23 @@ cfbCopyPlane1to8 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask, b
/******************************************************************/
-void
+static void
#if PSZ == 16
-cfbCopyPlane1to16 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
- planemask, bitPlane)
+cfbCopyPlane1to16
#endif
#if PSZ == 24
-cfbCopyPlane1to24 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
- planemask, bitPlane)
+cfbCopyPlane1to24
#endif
#if PSZ == 32
-cfbCopyPlane1to32 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
- planemask, bitPlane)
+cfbCopyPlane1to32
#endif
- DrawablePtr pSrcDrawable;
- DrawablePtr pDstDrawable;
- int rop;
- unsigned long planemask;
- RegionPtr prgnDst;
- DDXPointPtr pptSrc;
- unsigned long bitPlane;
+(
+ DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long planemask)
{
int srcx, srcy, dstx, dsty;
int width, height;
@@ -808,6 +1085,238 @@ cfbCopyPlane1to32 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
#if PSZ == 24
widthDst <<= 2;
#endif
+#if PSZ == 32
+ pdstLine = (unsigned int *)pdstBase + dsty * widthDst + dstx;
+#endif
+ xoffSrc = srcx & 0x1f;
+
+ /*
+ * compute constants for the first four bits to be
+ * copied. This avoids troubles with partial first
+ * writes, and difficult shift computation
+ */
+ leftShift = xoffSrc;
+ rightShift = 32 - leftShift;
+
+ if (rop == GXcopy && (planemask & PMSK) == PMSK)
+ {
+ while (height--)
+ {
+ psrc = psrcLine;
+ pdst = pdstLine;
+ psrcLine += widthSrc;
+ pdstLine += widthDst;
+ bits = *psrc++;
+ nl = width;
+ while (nl >= 32)
+ {
+ tmp = BitLeft(bits, leftShift);
+ bits = *psrc++;
+ if (rightShift != 32)
+ tmp |= BitRight(bits, rightShift);
+ i = 0;
+#if PSZ == 16
+ /*
+ * I've thrown in some optimization to at least write
+ * some aligned 32-bit words instead of 16-bit shorts.
+ */
+ if ((unsigned long)psrc & 2) {
+ /* Write unaligned 16-bit word at left edge. */
+ if (tmp & 0x01)
+ *pdst = fgpixel;
+ else
+ *pdst = bgpixel;
+ pdst++;
+ i++;
+ }
+ while (i <= 24)
+ {
+ unsigned tmpbits = tmp >> i;
+ *(unsigned int *)pdst = doublet[tmpbits & 0x03];
+ *(unsigned int *)(pdst + 2) =
+ doublet[(tmpbits >> 2) & 0x03];
+ *(unsigned int *)(pdst + 4) =
+ doublet[(tmpbits >> 4) & 0x03];
+ *(unsigned int *)(pdst + 6) =
+ doublet[(tmpbits >> 6) & 0x03];
+ pdst += 8; /* Advance four 32-bit words. */
+ i += 8;
+ }
+ while (i <= 30)
+ {
+ *(unsigned int *)pdst =
+ doublet[(tmp >> i) & 0x03];
+ pdst += 2; /* Advance one 32-bit word. */
+ i += 2;
+ }
+ if (i == 31) {
+ if ((tmp >> 31) & 0x01)
+ *pdst = fgpixel;
+ else
+ *pdst = bgpixel;
+ pdst++;
+ }
+#endif
+#if PSZ == 24
+ while (i < 32) {
+ if ((tmp >> i) & 0x01) {
+ *pdst = fgpixel;
+ *(pdst + 1) = fgpixel >> 8;
+ *(pdst + 2) = fgpixel >> 16;
+ }
+ else {
+ *pdst = bgpixel;
+ *(pdst + 1) = bgpixel >> 8;
+ *(pdst + 2) = bgpixel >> 16;
+ }
+ pdst += 3;
+ i++;
+ }
+#endif
+#if PSZ == 32
+ while (i <= 28) {
+ int pair;
+ pair = (tmp >> i) & 0x03;
+ *pdst = doublet[pair * 2];
+ *(pdst + 1) = doublet[pair * 2 + 1];
+ pair = (tmp >> (i + 2)) & 0x03;
+ *(pdst + 2) = doublet[pair * 2];
+ *(pdst + 3) = doublet[pair * 2 + 1];
+ pdst += 4;
+ i += 4;
+ }
+ while (i < 32) {
+ *pdst = ((tmp >> i) & 0x01) ? fgpixel : bgpixel;
+ pdst++;
+ i++;
+ }
+#endif
+ nl -= 32;
+ }
+
+ if (nl)
+ {
+ tmp = BitLeft(bits, leftShift);
+ /*
+ * better condition needed -- mustn't run
+ * off the end of the source...
+ */
+ if (rightShift != 32)
+ {
+ bits = *psrc++;
+ tmp |= BitRight (bits, rightShift);
+ }
+ i = 32;
+ while (nl--)
+ {
+ --i;
+#if PSZ == 24
+ if ((tmp >> (31 - i)) & 0x01) {
+ *pdst = fgpixel;
+ *(pdst + 1) = fgpixel >> 8;
+ *(pdst + 2) = fgpixel >> 16;
+ }
+ else {
+ *pdst = bgpixel;
+ *(pdst + 1) = bgpixel >> 8;
+ *(pdst + 2) = bgpixel >> 16;
+ }
+ pdst += 3;
+#else
+ *pdst = ((tmp >> (31 - i)) & 0x01) ? fgpixel : bgpixel;
+ pdst++;
+#endif
+ }
+ }
+ }
+ }
+ else
+ {
+ while (height--)
+ {
+ psrc = psrcLine;
+ pdst = pdstLine;
+ psrcLine += widthSrc;
+ pdstLine += widthDst;
+ bits = *psrc++;
+ nl = width;
+ while (nl >= 32)
+ {
+ tmp = BitLeft(bits, leftShift);
+ bits = *psrc++;
+ if (rightShift != 32)
+ tmp |= BitRight(bits, rightShift);
+ i = 32;
+ while (i--)
+ {
+ src = ((tmp >> (31 - i)) & 0x01) ? fgpixel : bgpixel;
+#if PSZ == 24
+ dst = *pdst;
+ dst |= (*(pdst + 1)) << 8;
+ dst |= (*(pdst + 2)) << 16;
+ DoRop (result, rop, src, dst);
+ *pdst = (dst & ~planemask) |
+ (result & planemask);
+ *(pdst+1) = ((dst & ~planemask) >> 8) |
+ ((result & planemask) >> 8);
+ *(pdst+2) = ((dst & ~planemask) >> 16) |
+ ((result & planemask) >> 16);
+ pdst += 3;
+#else
+ DoRop (result, rop, src, *pdst);
+
+ *pdst = (*pdst & ~planemask) |
+ (result & planemask);
+ pdst++;
+#endif
+ }
+ nl -= 32;
+ }
+
+ if (nl)
+ {
+ tmp = BitLeft(bits, leftShift);
+ /*
+ * better condition needed -- mustn't run
+ * off the end of the source...
+ */
+ if (rightShift != 32)
+ {
+ bits = *psrc++;
+ tmp |= BitRight (bits, rightShift);
+ }
+ i = 32;
+ while (nl--)
+ {
+ --i;
+ src = ((tmp >> (31 - i)) & 0x01) ? fgpixel : bgpixel;
+#if PSZ == 24
+ dst = *pdst;
+ dst |= (*(pdst + 1)) << 8;
+ dst |= (*(pdst + 2)) << 16;
+ DoRop (result, rop, src, dst);
+ *pdst = (dst & ~planemask) |
+ (result & planemask);
+ *(pdst+1) = ((dst & ~planemask) >> 8) |
+ ((result & planemask) >> 8);
+ *(pdst+2) = ((dst & ~planemask) >> 16) |
+ ((result & planemask) >> 16);
+ pdst += 3;
+#else
+ DoRop (result, rop, src, *pdst);
+
+ *pdst = (*pdst & ~planemask) |
+ (result & planemask);
+ pdst++;
+#endif
+ }
+ }
+ }
+ }
+ }
+}
+
+#endif /* PSZ == 8 */
nbox = REGION_NUM_RECTS(prgnDst);
pbox = REGION_RECTS(prgnDst);
@@ -1078,13 +1587,19 @@ RegionPtr cfbCopyPlane(pSrcDrawable, pDstDrawable,
#if IMAGE_BYTE_ORDER == LSBFirst
- void (*doBitBlt)();
+ void (*doCopyPlaneExpand)(
+ DrawablePtr /*pSrc*/,
+ DrawablePtr /*pDst*/,
+ int /*alu*/,
+ RegionPtr /*prgnDst*/,
+ DDXPointPtr /*pptSrc*/,
+ unsigned long /*planemask*/);
if (pSrcDrawable->bitsPerPixel == 1 && pDstDrawable->bitsPerPixel == PSZ)
{
if (bitPlane == 1)
{
- doBitBlt = cfbCopyPlane1toN;
+ doCopyPlaneExpand = cfbCopyPlane1toN;
#if PSZ == 8
cfb8CheckOpaqueStipple (pGC->alu,
pGC->fgPixel, pGC->bgPixel,
@@ -1093,8 +1608,8 @@ RegionPtr cfbCopyPlane(pSrcDrawable, pDstDrawable,
FgPixel = pGC->fgPixel;
BgPixel = pGC->bgPixel;
#endif
- ret = cfbBitBlt (pSrcDrawable, pDstDrawable,
- pGC, srcx, srcy, width, height, dstx, dsty, doBitBlt, bitPlane);
+ ret = cfbCopyPlaneExpand (pSrcDrawable, pDstDrawable,
+ pGC, srcx, srcy, width, height, dstx, dsty, doCopyPlaneExpand, bitPlane);
}
else
ret = miHandleExposures (pSrcDrawable, pDstDrawable,
@@ -1102,7 +1617,6 @@ RegionPtr cfbCopyPlane(pSrcDrawable, pDstDrawable,
}
else if (pSrcDrawable->bitsPerPixel == PSZ && pDstDrawable->bitsPerPixel == 1)
{
- extern int InverseAlu[16];
int oldalu;
oldalu = pGC->alu;
@@ -1110,7 +1624,7 @@ RegionPtr cfbCopyPlane(pSrcDrawable, pDstDrawable,
pGC->alu = InverseAlu[pGC->alu];
else if ((pGC->fgPixel & 1) == (pGC->bgPixel & 1))
pGC->alu = mfbReduceRop(pGC->alu, pGC->fgPixel);
- ret = cfbBitBlt (pSrcDrawable, pDstDrawable,
+ ret = cfbCopyPlaneReduce(pSrcDrawable, pDstDrawable,
pGC, srcx, srcy, width, height, dstx, dsty,
cfbCopyPlaneNto1, bitPlane);
pGC->alu = oldalu;
@@ -1137,7 +1651,7 @@ RegionPtr cfbCopyPlane(pSrcDrawable, pDstDrawable,
*/
ValidateGC ((DrawablePtr) pBitmap, pGC1);
/* no exposures here, scratch GC's don't get graphics expose */
- (void) cfbBitBlt (pSrcDrawable, (DrawablePtr) pBitmap,
+ cfbCopyPlaneReduce(pSrcDrawable, (DrawablePtr) pBitmap,
pGC1, srcx, srcy, width, height, 0, 0,
cfbCopyPlaneNto1, bitPlane);
#if PSZ == 8
@@ -1149,7 +1663,7 @@ RegionPtr cfbCopyPlane(pSrcDrawable, pDstDrawable,
BgPixel = pGC->bgPixel;
#endif
/* no exposures here, copy bits from inside a pixmap */
- (void) cfbBitBlt ((DrawablePtr) pBitmap, pDstDrawable, pGC,
+ cfbCopyPlaneExpand((DrawablePtr) pBitmap, pDstDrawable, pGC,
0, 0, width, height, dstx, dsty, cfbCopyPlane1toN, 1);
FreeScratchGC (pGC1);
(*pScreen->DestroyPixmap) (pBitmap);
diff --git a/cfb/cfbblt.c b/cfb/cfbblt.c
index aafe44669..5d2e084fd 100644
--- a/cfb/cfbblt.c
+++ b/cfb/cfbblt.c
@@ -1,7 +1,7 @@
/*
* cfb copy area
*/
-/* $XFree86: xc/programs/Xserver/cfb/cfbblt.c,v 3.12 2001/12/14 19:59:21 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbblt.c,v 3.14 2003/10/29 22:44:53 tsi Exp $ */
/*
@@ -118,12 +118,13 @@ Author: Keith Packard
#endif
void
-MROP_NAME(cfbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc, planemask)
- DrawablePtr pSrc, pDst;
- int alu;
- RegionPtr prgnDst;
- DDXPointPtr pptSrc;
- unsigned long planemask;
+MROP_NAME(cfbDoBitblt)(
+ DrawablePtr pSrc,
+ DrawablePtr pDst,
+ int alu,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long planemask)
{
CfbBits *psrcBase, *pdstBase;
/* start of src and dst bitmaps */
@@ -167,12 +168,8 @@ MROP_NAME(cfbDoBitblt)(pSrc, pDst, alu, prgnDst, pptSrc, planemask)
#endif
#if MROP == 0
- unsigned char *psrcBaseByte, *pdstBaseByte;
- int widthSrcBytes, widthDstBytes;
-
- cfbGetByteWidthAndPointer (pSrc, widthSrcBytes, psrcBaseByte)
-
- cfbGetByteWidthAndPointer (pDst, widthDstBytes, pdstBaseByte)
+ int widthSrcBytes = cfbGetByteWidth(pSrc);
+ int widthDstBytes = cfbGetByteWidth(pDst);
#endif
#endif
diff --git a/cfb/cfbcppl.c b/cfb/cfbcppl.c
index 20ef24e1c..ee4c18fdc 100644
--- a/cfb/cfbcppl.c
+++ b/cfb/cfbcppl.c
@@ -25,7 +25,7 @@ in this Software without prior written authorization from The Open Group.
*
* Author: Keith Packard, MIT X Consortium
*/
-/* $XFree86: xc/programs/Xserver/cfb/cfbcppl.c,v 1.6 2001/12/14 19:59:22 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbcppl.c,v 1.7 2003/07/16 01:38:37 dawes Exp $ */
#include "X.h"
#include "Xmd.h"
@@ -40,18 +40,23 @@ in this Software without prior written authorization from The Open Group.
#include "maskbits.h"
#define PSZ 8
#include "mergerop.h"
-#endif
+#else /* PSZ==8 */
+#include "cfbtab.h" /* provides starttab, endttab, partmasks */
+#endif /* PSZ==8 */
void
-cfbCopyImagePlane (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask)
- DrawablePtr pSrcDrawable;
- DrawablePtr pDstDrawable;
- int rop;
- RegionPtr prgnDst;
- DDXPointPtr pptSrc;
- unsigned long planemask;
+cfbCopyImagePlane(
+ DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long planemask)
{
+ /* note: there must be some sort of trick behind,
+ passing a planemask value with all bits set
+ whilst using the current planemask for the bitPlane value. */
#if PSZ == 8
cfbCopyPlane8to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
(unsigned long) ~0L, planemask);
@@ -90,14 +95,14 @@ cfbCopyImagePlane (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask)
}
void
-cfbCopyPlane8to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask, bitPlane)
- DrawablePtr pSrcDrawable;
- DrawablePtr pDstDrawable;
- int rop;
- RegionPtr prgnDst;
- DDXPointPtr pptSrc;
- unsigned long planemask;
- unsigned long bitPlane;
+cfbCopyPlane8to1(
+ DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long planemask,
+ unsigned long bitPlane)
{
int srcx, srcy, dstx, dsty, width, height;
unsigned char *psrcBase;
@@ -291,24 +296,22 @@ cfbCopyPlane8to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc, planemask, b
void
#if PSZ == 16
-cfbCopyPlane16to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
- planemask, bitPlane)
+cfbCopyPlane16to1
#endif
#if PSZ == 24
-cfbCopyPlane24to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
- planemask, bitPlane)
+cfbCopyPlane24to1
#endif
#if PSZ == 32
-cfbCopyPlane32to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
- planemask, bitPlane)
+cfbCopyPlane32to1
#endif
- DrawablePtr pSrcDrawable;
- DrawablePtr pDstDrawable;
- int rop;
- RegionPtr prgnDst;
- DDXPointPtr pptSrc;
- unsigned long planemask;
- unsigned long bitPlane;
+(
+ DrawablePtr pSrcDrawable,
+ DrawablePtr pDstDrawable,
+ int rop,
+ RegionPtr prgnDst,
+ DDXPointPtr pptSrc,
+ unsigned long planemask,
+ unsigned long bitPlane)
{
int srcx, srcy, dstx, dsty, width, height;
CfbBits *psrcBase;
@@ -332,7 +335,7 @@ cfbCopyPlane32to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
register int curBit;
register int bitPos;
register unsigned int bits;
- unsigned int startmask, endmask;
+ unsigned int startmask = 0, endmask = 0;
int niStart = 0, niEnd = 0;
int bitStart = 0, bitEnd = 0;
int nl, nlMiddle;
@@ -340,9 +343,6 @@ cfbCopyPlane32to1 (pSrcDrawable, pDstDrawable, rop, prgnDst, pptSrc,
BoxPtr pbox;
int result;
- extern int starttab[32], endtab[32];
- extern unsigned int partmasks[32][32];
-
if (!(planemask & 1))
return;
diff --git a/cfb/cfbfillarc.c b/cfb/cfbfillarc.c
index 9dee99476..64ec508c8 100644
--- a/cfb/cfbfillarc.c
+++ b/cfb/cfbfillarc.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbfillarc.c,v 3.5 2001/12/14 19:59:22 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbfillarc.c,v 3.7 2003/10/29 22:44:53 tsi Exp $ */
/************************************************************
Copyright 1989, 1998 The Open Group
@@ -29,7 +29,7 @@ in this Software without prior written authorization from The Open Group.
#include "X.h"
#include "Xprotostr.h"
-#include "miscstruct.h"
+#include "regionstr.h"
#include "gcstruct.h"
#include "pixmapstr.h"
#include "scrnintstr.h"
@@ -47,10 +47,10 @@ in this Software without prior written authorization from The Open Group.
#endif
static void
-RROP_NAME(cfbFillEllipseSolid) (pDraw, pGC, arc)
- DrawablePtr pDraw;
- GCPtr pGC;
- xArc *arc;
+RROP_NAME(cfbFillEllipseSolid)(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ xArc *arc)
{
STUPID int x, y, e;
STUPID int yk, xk, ym, xm, dx, dy, xorg, yorg;
@@ -181,6 +181,7 @@ RROP_NAME(cfbFillEllipseSolid) (pDraw, pGC, arc)
RROP_SOLID_MASK(addrl, endmask);
#endif /* PSZ == 24 */
}
+ RROP_UNDECLARE
}
#if PSZ == 24
@@ -254,10 +255,10 @@ RROP_NAME(cfbFillEllipseSolid) (pDraw, pGC, arc)
}
static void
-RROP_NAME(cfbFillArcSliceSolid)(pDraw, pGC, arc)
- DrawablePtr pDraw;
- GCPtr pGC;
- xArc *arc;
+RROP_NAME(cfbFillArcSliceSolid)(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ xArc *arc)
{
int yk, xk, ym, xm, dx, dy, xorg, yorg, slw;
register int x, y, e;
@@ -313,6 +314,7 @@ RROP_NAME(cfbFillArcSliceSolid)(pDraw, pGC, arc)
FILLSLICESPANS(slice.flip_bot, addrlb);
}
}
+ RROP_UNDECLARE
}
void
diff --git a/cfb/cfbfillsp.c b/cfb/cfbfillsp.c
index 9a75ac6c6..14a6a9d52 100644
--- a/cfb/cfbfillsp.c
+++ b/cfb/cfbfillsp.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbfillsp.c,v 3.7 2001/12/14 19:59:22 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbfillsp.c,v 3.8 2003/10/29 22:44:53 tsi Exp $ */
/************************************************************
Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
@@ -509,7 +509,10 @@ int fSorted;
width = *pwidth;
while(width > 0)
{
- int xtemp, tmpx;
+ int xtemp;
+#if PSZ != 32 || PPW != 1
+ int tmpx;
+#endif
register CfbBits *ptemp;
register CfbBits *pdsttmp;
/*
@@ -541,7 +544,9 @@ int fSorted;
tmpx = x & 3;
pdsttmp = pdst + ((x * 3)>>2);
#else
+#if PSZ != 32 || PPW != 1
tmpx = x & PIM;
+#endif
pdsttmp = pdst + (x>>PWSH);
#endif
switch ( pGC->fillStyle ) {
diff --git a/cfb/cfbgetsp.c b/cfb/cfbgetsp.c
index e5c55f389..737f30237 100644
--- a/cfb/cfbgetsp.c
+++ b/cfb/cfbgetsp.c
@@ -45,7 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
-/* $XFree86: xc/programs/Xserver/cfb/cfbgetsp.c,v 3.9 2001/12/14 19:59:22 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbgetsp.c,v 3.10 2003/10/29 22:44:53 tsi Exp $ */
#include "X.h"
#include "Xmd.h"
@@ -91,7 +91,9 @@ cfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart)
register int xIndex = 0;
#else
register int nstart;
+#if PSZ != 32 || PPW != 1
int nend;
+#endif
PixelGroup startmask, endmask;
int nlMiddle;
#endif
@@ -158,7 +160,7 @@ cfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart)
psrc = (PixelGroup *)((unsigned long)psrcb & ~0x03);
getbits24(psrc, tmpSrc, srcBit);
pdst = (PixelGroup *)((unsigned long)pdstb & ~0x03);
- putbits24(tmpSrc, nstart, PPW, pdst, ~((CfbBits)0), xIndex);
+ putbits24(tmpSrc, PPW, pdst, ~((CfbBits)0), xIndex);
srcBit++;
psrcb += 3;
xIndex++;
@@ -194,7 +196,9 @@ cfbGetSpans(pDrawable, wMax, ppt, pwidth, nspans, pchardstStart)
}
if (endmask)
{
+#if PSZ != 32 || PPW != 1
nend = xEnd & PIM;
+#endif
getbits(psrc, 0, nend, tmpSrc);
putbits(tmpSrc, nstart, nend, pdst, ~((CfbBits)0));
}
diff --git a/cfb/cfbglblt8.c b/cfb/cfbglblt8.c
index 5db5c1f01..60a012c28 100644
--- a/cfb/cfbglblt8.c
+++ b/cfb/cfbglblt8.c
@@ -23,7 +23,7 @@ Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
*/
-/* $XFree86: xc/programs/Xserver/cfb/cfbglblt8.c,v 3.6 2001/12/14 19:59:23 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbglblt8.c,v 3.8 2003/08/06 14:04:02 eich Exp $ */
/*
* Poly glyph blt. Accepts an arbitrary font <= 32 bits wide, in Copy mode
@@ -87,7 +87,14 @@ typedef CARD32 *glyphPointer;
#endif
-static void cfbPolyGlyphBlt8Clipped();
+static void cfbPolyGlyphBlt8Clipped(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int x,
+ int y,
+ unsigned int nglyph,
+ CharInfoPtr *ppci, /* array of character info */
+ unsigned char *pglyphBase); /* start of array of glyphs */
#if defined(HAS_STIPPLE_CODE) && !defined(GLYPHROP) && !defined(USE_LEFTBITS)
#define USE_STIPPLE_CODE
@@ -267,13 +274,14 @@ cfbPolyGlyphBlt8 (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
}
static void
-cfbPolyGlyphBlt8Clipped (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
- DrawablePtr pDrawable;
- GCPtr pGC;
- int x, y;
- unsigned int nglyph;
- CharInfoPtr *ppci; /* array of character info */
- unsigned char *pglyphBase; /* start of array of glyphs */
+cfbPolyGlyphBlt8Clipped(
+ DrawablePtr pDrawable,
+ GCPtr pGC,
+ int x,
+ int y,
+ unsigned int nglyph,
+ CharInfoPtr *ppci, /* array of character info */
+ unsigned char *pglyphBase) /* start of array of glyphs */
{
#ifndef GLYPHROP
register CfbBits pixel;
@@ -283,7 +291,7 @@ cfbPolyGlyphBlt8Clipped (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
#endif
register glyphPointer glyphBits;
register int xoff;
-#if defined(USE_LEFT_BITS) || (!defined(STIPPLE) && !defined(USE_STIPPLE_CODE))
+#if defined(USE_LEFTBITS) || (!defined(STIPPLE) && !defined(USE_STIPPLE_CODE))
register CfbBits *dst;
#endif
@@ -291,7 +299,7 @@ cfbPolyGlyphBlt8Clipped (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
FontPtr pfont = pGC->font;
CfbBits *dstLine;
CfbBits *pdstBase;
-#ifdef USE_LEFT_BITS
+#ifdef USE_LEFTBITS
CARD32 *cTmp;
#endif
CARD32 *clips;
@@ -398,7 +406,7 @@ cfbPolyGlyphBlt8Clipped (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
}
} while (--hTmp);
break;
-#else /* !USE_LEFT_BITS */
+#else /* !USE_LEFTBITS */
{
int h;
@@ -411,7 +419,7 @@ cfbPolyGlyphBlt8Clipped (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
}
glyphBits = clips;
/* fall through */
-#endif /* USE_LEFT_BITS */
+#endif /* USE_LEFTBITS */
case rgnIN:
#ifdef STIPPLE
STIPPLE(dstLine,glyphBits,pixel,bwidthDst,hTmp,xoff);
diff --git a/cfb/cfbmap.h b/cfb/cfbmap.h
index c02ddfb96..42056345a 100644
--- a/cfb/cfbmap.h
+++ b/cfb/cfbmap.h
@@ -26,7 +26,7 @@ in this Software without prior written authorization from The Open Group.
* Author: Keith Packard, MIT X Consortium
*/
-/* $XFree86: xc/programs/Xserver/cfb/cfbmap.h,v 3.11 2001/12/14 19:59:23 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbmap.h,v 3.12 2003/07/19 13:22:27 tsi Exp $ */
/*
* Map names around so that multiple depths can be supported simultaneously
@@ -59,6 +59,7 @@ in this Software without prior written authorization from The Open Group.
#undef cfbCopyImagePlane
#undef cfbCopyPixmap
#undef cfbCopyPlane
+#undef cfbCopyPlaneReduce
#undef cfbCopyRotatePixmap
#undef cfbCopyWindow
#undef cfbCreateGC
@@ -227,6 +228,7 @@ cfb can not hack PSZ yet
#define cfbCopyImagePlane CFBNAME(CopyImagePlane)
#define cfbCopyPixmap CFBNAME(CopyPixmap)
#define cfbCopyPlane CFBNAME(CopyPlane)
+#define cfbCopyPlaneReduce CFBNAME(CopyPlaneReduce)
#define cfbCopyRotatePixmap CFBNAME(CopyRotatePixmap)
#define cfbCopyWindow CFBNAME(CopyWindow)
#define cfbCreateGC CFBNAME(CreateGC)
diff --git a/cfb/cfbmskbits.h b/cfb/cfbmskbits.h
index dac519001..b7f9969dd 100644
--- a/cfb/cfbmskbits.h
+++ b/cfb/cfbmskbits.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbmskbits.h,v 3.13 2001/10/28 03:33:01 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbmskbits.h,v 3.14 2003/10/29 22:44:53 tsi Exp $ */
/************************************************************
Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
@@ -446,7 +446,7 @@ getleftbits(psrc, w, dst)
}; \
}
-#define putbits24(src, x, w, pdst, planemask, index) {\
+#define putbits24(src, w, pdst, planemask, index) {\
register PixelGroup dstpixel; \
register unsigned int idx; \
switch(idx = ((index)&3)<<1){ \
@@ -531,7 +531,7 @@ getleftbits(psrc, w, dst)
abort()
#define getbits24(psrc, dst, index) \
abort()
-#define putbits24(src, x, w, pdst, planemask, index) \
+#define putbits24(src, w, pdst, planemask, index) \
abort()
#define putbitsrop24(src, x, pdst, planemask, rop) \
abort()
diff --git a/cfb/cfbply1rct.c b/cfb/cfbply1rct.c
index e75708b96..0b14bc614 100644
--- a/cfb/cfbply1rct.c
+++ b/cfb/cfbply1rct.c
@@ -25,7 +25,7 @@ in this Software without prior written authorization from The Open Group.
*
* Author: Keith Packard, MIT X Consortium
*/
-/* $XFree86: xc/programs/Xserver/cfb/cfbply1rct.c,v 3.9 2001/12/14 19:59:24 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbply1rct.c,v 3.11 2003/10/30 14:53:39 tsi Exp $ */
#include "X.h"
@@ -76,7 +76,10 @@ RROP_NAME(cfbFillPoly1Rect) (pDrawable, pGC, shape, mode, count, ptsIn)
int step1 = 0, step2 = 0;
int sign1 = 0, sign2 = 0;
int h;
- int l, r;
+ int l;
+#if PSZ != 24 && PPW > 1
+ int r;
+#endif
int nmiddle;
RROP_DECLARE
@@ -262,13 +265,17 @@ RROP_NAME(cfbFillPoly1Rect) (pDrawable, pGC, shape, mode, count, ptsIn)
for (;;)
{
l = x1;
+#if PSZ != 24 && PPW > 1
r = x2;
+#endif
nmiddle = x2 - x1;
if (nmiddle < 0)
{
nmiddle = -nmiddle;
l = x2;
+#if PSZ != 24 && PPW > 1
r = x1;
+#endif
}
#if PPW > 1
c = l & PIM;
@@ -283,16 +290,6 @@ RROP_NAME(cfbFillPoly1Rect) (pDrawable, pGC, shape, mode, count, ptsIn)
#if PSZ == 24
addr = (CfbBits *)((char *)addrl + ((l * 3) & ~0x03));
-#else /* PSZ == 24 */
-#if PWSH > LWRD_SHIFT
- l = l >> (PWSH - LWRD_SHIFT);
-#endif
-#if PWSH < LWRD_SHIFT
- l = l << (LWRD_SHIFT - PWSH);
-#endif
- addr = (CfbBits *) (((char *) addrl) + l);
-#endif /* PSZ == 24 */
-#if PSZ == 24
if (nmiddle <= 1){
if (nmiddle)
RROP_SOLID24(addr, l);
@@ -315,6 +312,13 @@ RROP_NAME(cfbFillPoly1Rect) (pDrawable, pGC, shape, mode, count, ptsIn)
RROP_SOLID_MASK(addr, endmask, pidx);
}
#else /* PSZ == 24 */
+#if PWSH > LWRD_SHIFT
+ l = l >> (PWSH - LWRD_SHIFT);
+#endif
+#if PWSH < LWRD_SHIFT
+ l = l << (LWRD_SHIFT - PWSH);
+#endif
+ addr = (CfbBits *) (((char *) addrl) + l);
#if PPW > 1
if (c + nmiddle < PPW)
{
@@ -351,4 +355,5 @@ RROP_NAME(cfbFillPoly1Rect) (pDrawable, pGC, shape, mode, count, ptsIn)
break;
addrl = AddrYPlus (addrl, 1);
}
+ RROP_UNDECLARE
}
diff --git a/cfb/cfbpntwin.c b/cfb/cfbpntwin.c
index d21544b37..c77d01961 100644
--- a/cfb/cfbpntwin.c
+++ b/cfb/cfbpntwin.c
@@ -45,7 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
-/* $XFree86: xc/programs/Xserver/cfb/cfbpntwin.c,v 3.7 2002/09/16 18:05:31 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbpntwin.c,v 3.8 2003/10/29 22:44:53 tsi Exp $ */
#include "X.h"
@@ -226,7 +226,6 @@ cfbFillBoxSolid (pDrawable, nBox, pBox, pixel)
CfbBits *pdstBase;
int widthDst;
register int h;
- register CfbBits rrop_xor;
register CfbBits *pdst;
int nmiddle;
int w;
@@ -238,13 +237,16 @@ cfbFillBoxSolid (pDrawable, nBox, pBox, pixel)
piQxelArray[1] = ((pixel&0xFFFF00)>>8) | ((pixel&0xFFFF)<<16);
piQxelArray[2] = ((pixel&0xFFFFFF)<<8) | ((pixel&0xFF0000)>>16);
#else
+ register CfbBits rrop_xor;
register CfbBits leftMask, rightMask;
register int m;
#endif
cfbGetLongWidthAndPointer(pDrawable, widthDst, pdstBase);
+#if PSZ != 24
rrop_xor = PFILL(pixel);
+#endif
for (; nBox; nBox--, pBox++)
{
pdst = pdstBase + pBox->y1 * widthDst;
diff --git a/cfb/cfbrrop.h b/cfb/cfbrrop.h
index d6f095e6b..d8dce082c 100644
--- a/cfb/cfbrrop.h
+++ b/cfb/cfbrrop.h
@@ -26,7 +26,7 @@ in this Software without prior written authorization from The Open Group.
* Author: Keith Packard, MIT X Consortium
*/
-/* $XFree86: xc/programs/Xserver/cfb/cfbrrop.h,v 3.10 2001/12/14 19:59:24 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbrrop.h,v 3.11 2003/10/29 22:44:53 tsi Exp $ */
#ifndef GXcopy
#include "X.h"
@@ -66,11 +66,13 @@ in this Software without prior written authorization from The Open Group.
(*(dst) = piQxelXor[(idx)])
#define RROP_SOLID_MASK(dst,mask,idx) \
(*(dst) = (*(dst) & ~(mask))|(piQxelXor[(idx)] & (mask)))
+#define RROP_UNDECLARE (void)piQxelXor; (void)spiQxelXor;
#else
#define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor;
#define RROP_DECLARE register CfbBits rrop_xor;
#define RROP_SOLID(dst) (*(dst) = (rrop_xor))
#define RROP_SOLID_MASK(dst,mask) (*(dst) = (*(dst) & ~(mask)) | ((rrop_xor) & (mask)))
+#define RROP_UNDECLARE
#endif
#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,Copy)
#endif /* GXcopy */
@@ -100,11 +102,13 @@ in this Software without prior written authorization from The Open Group.
(*(dst) ^= piQxelXor[(idx)])
#define RROP_SOLID_MASK(dst,mask,idx) \
(*(dst) ^= (piQxelXor[(idx)] & (mask)))
+#define RROP_UNDECLARE (void)piQxelXor; (void)spiQxelXor;
#else
#define RROP_DECLARE register CfbBits rrop_xor;
#define RROP_FETCH_GCPRIV(devPriv) rrop_xor = (devPriv)->xor;
#define RROP_SOLID(dst) (*(dst) ^= (rrop_xor))
#define RROP_SOLID_MASK(dst,mask) (*(dst) ^= ((rrop_xor) & (mask)))
+#define RROP_UNDECLARE
#endif
#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,Xor)
#endif /* GXxor */
@@ -145,11 +149,13 @@ in this Software without prior written authorization from The Open Group.
(*(dst) &= piQxelAnd[(idx)])
#define RROP_SOLID_MASK(dst,mask,idx) \
(*(dst) &= (piQxelAnd[(idx)] | ~(mask)))
+#define RROP_UNDECLARE (void)piQxelAnd; (void)spiQxelAnd;
#else
#define RROP_DECLARE register CfbBits rrop_and;
#define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and;
#define RROP_SOLID(dst) (*(dst) &= (rrop_and))
#define RROP_SOLID_MASK(dst,mask) (*(dst) &= ((rrop_and) | ~(mask)))
+#define RROP_UNDECLARE
#endif
#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,And)
#endif /* GXand */
@@ -190,11 +196,13 @@ in this Software without prior written authorization from The Open Group.
(*(dst) |= piQxelOr[(idx)])
#define RROP_SOLID_MASK(dst,mask,idx) \
(*(dst) |= (piQxelOr[(idx)] & (mask)))
+#define RROP_UNDECLARE (void)piQxelOr; (void)spiQxelOr;
#else
#define RROP_DECLARE register CfbBits rrop_or;
#define RROP_FETCH_GCPRIV(devPriv) rrop_or = (devPriv)->xor;
#define RROP_SOLID(dst) (*(dst) |= (rrop_or))
#define RROP_SOLID_MASK(dst,mask) (*(dst) |= ((rrop_or) & (mask)))
+#define RROP_UNDECLARE
#endif
#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,Or)
#endif /* GXor */
@@ -205,6 +213,7 @@ in this Software without prior written authorization from The Open Group.
#define RROP_SOLID(dst)
#define RROP_SOLID_MASK(dst,mask)
#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,Noop)
+#define RROP_UNDECLARE
#endif /* GXnoop */
#if RROP == GXset
@@ -253,12 +262,15 @@ in this Software without prior written authorization from The Open Group.
(*(dst) = DoRRop (*(dst), piQxelAnd[(idx)], piQxelXor[(idx)]))
#define RROP_SOLID_MASK(dst,mask,idx) \
(*(dst) = DoMaskRRop (*(dst), piQxelAnd[(idx)], piQxelXor[(idx)], (mask)))
+#define RROP_UNDECLARE (void)piQxelAnd; (void)piQxelXor; \
+ (void)spiQxelAnd; (void)spiQxelXor;
#else
#define RROP_DECLARE register CfbBits rrop_and, rrop_xor;
#define RROP_FETCH_GCPRIV(devPriv) rrop_and = (devPriv)->and; \
rrop_xor = (devPriv)->xor;
#define RROP_SOLID(dst) (*(dst) = DoRRop (*(dst), rrop_and, rrop_xor))
#define RROP_SOLID_MASK(dst,mask) (*(dst) = DoMaskRRop (*(dst), rrop_and, rrop_xor, (mask)))
+#define RROP_UNDECLARE
#endif
#define RROP_NAME(prefix) RROP_NAME_CAT(prefix,General)
#endif /* GXset */
diff --git a/cfb/cfbscrinit.c b/cfb/cfbscrinit.c
index dae88ff5c..7e0d15dd4 100644
--- a/cfb/cfbscrinit.c
+++ b/cfb/cfbscrinit.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbscrinit.c,v 1.19 2001/01/17 22:36:36 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbscrinit.c,v 1.20 2003/07/16 01:38:37 dawes Exp $ */
/************************************************************
Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
@@ -72,6 +72,20 @@ cfbCloseScreen (index, pScreen)
return TRUE;
}
+static void DestroyColormapNoop(
+ ColormapPtr pColormap)
+{
+ /* NOOP */
+}
+
+static void StoreColorsNoop(
+ ColormapPtr pColormap,
+ int ndef,
+ xColorItem * pdef)
+{
+ /* NOOP */
+}
+
Bool
cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width)
register ScreenPtr pScreen;
@@ -104,11 +118,11 @@ cfbSetupScreen(pScreen, pbits, xsize, ysize, dpix, dpiy, width)
pScreen->UnrealizeFont = mfbUnrealizeFont;
pScreen->CreateGC = cfbCreateGC;
pScreen->CreateColormap = cfbInitializeColormap;
- pScreen->DestroyColormap = (void (*)())NoopDDA;
+ pScreen->DestroyColormap = DestroyColormapNoop;
pScreen->InstallColormap = cfbInstallColormap;
pScreen->UninstallColormap = cfbUninstallColormap;
pScreen->ListInstalledColormaps = cfbListInstalledColormaps;
- pScreen->StoreColors = (void (*)())NoopDDA;
+ pScreen->StoreColors = StoreColorsNoop;
pScreen->ResolveColor = cfbResolveColor;
pScreen->BitmapToRegion = mfbPixmapToRegion;
diff --git a/cfb/cfbsetsp.c b/cfb/cfbsetsp.c
index 2096d4e34..4b75c7f2c 100644
--- a/cfb/cfbsetsp.c
+++ b/cfb/cfbsetsp.c
@@ -45,7 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
-/* $XFree86: xc/programs/Xserver/cfb/cfbsetsp.c,v 3.5 2001/12/14 19:59:24 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbsetsp.c,v 3.6 2003/10/29 22:44:53 tsi Exp $ */
#include "X.h"
#include "Xmd.h"
@@ -83,7 +83,13 @@ cfbSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst, planemas
int w; /* width of scanline in bits */
register int *pdst; /* where to put the bits */
register int tmpSrc; /* scratch buffer to collect bits in */
- int dstBit; /* offset in bits from beginning of
+ int offSrc;
+ int nl;
+#if PSZ == 24
+ register char *psrcb, *pdstb;
+ register int xIndex;
+#else
+ int dstBit; /* offset in bits from beginning of
* word */
int offSrc;
int nl;
@@ -92,7 +98,9 @@ cfbSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst, planemas
register int xIndex;
#else
register int nstart; /* number of bits from first partial */
+#if PSZ != 32 || PPW != 1
register int nend; /* " " last partial word */
+#endif
int startmask, endmask, nlMiddle;
#endif
DeclareMergeRop()
@@ -110,7 +118,6 @@ cfbSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst, planemas
offSrc = (xStart - xOrigin) & PIM;
#endif
w = xEnd - xStart;
- dstBit = xStart & PIM;
#if PSZ == 24
nl = w;
@@ -125,6 +132,7 @@ cfbSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst, planemas
pdstb += 3;
}
#else /* PSZ == 24 */
+ dstBit = xStart & PIM;
if (dstBit + w <= PPW)
{
maskpartialbits(dstBit, w, startmask);
@@ -139,10 +147,12 @@ cfbSetScanline(y, xOrigin, xStart, xEnd, psrc, alu, pdstBase, widthDst, planemas
nstart = PPW - dstBit;
else
nstart = 0;
+#if PSZ != 32 || PPW != 1
if (endmask)
nend = xEnd & PIM;
else
nend = 0;
+#endif
if (startmask)
{
getbits(psrc, offSrc, nstart, tmpSrc);
diff --git a/cfb/cfbsolid.c b/cfb/cfbsolid.c
index 6d8a95692..f0a3e361e 100644
--- a/cfb/cfbsolid.c
+++ b/cfb/cfbsolid.c
@@ -25,7 +25,7 @@ in this Software without prior written authorization from The Open Group.
*
* Author: Keith Packard, MIT X Consortium
*/
-/* $XFree86: xc/programs/Xserver/cfb/cfbsolid.c,v 3.8 2002/09/16 18:05:31 eich Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbsolid.c,v 3.9 2003/10/29 22:44:53 tsi Exp $ */
#include "X.h"
@@ -771,6 +771,7 @@ RROP_NAME(cfbFillRectSolid) (pDrawable, pGC, nBox, pBox)
}
#endif
}
+ RROP_UNDECLARE
}
void
@@ -1358,4 +1359,5 @@ RROP_NAME(cfbSolidSpans) (pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
}
DEALLOCATE_LOCAL(pptFree);
DEALLOCATE_LOCAL(pwidthFree);
+ RROP_UNDECLARE
}
diff --git a/cfb/cfbtab.h b/cfb/cfbtab.h
new file mode 100644
index 000000000..5c4f1c445
--- /dev/null
+++ b/cfb/cfbtab.h
@@ -0,0 +1,10 @@
+/* $XFree86: xc/programs/Xserver/cfb/cfbtab.h,v 1.1 2003/07/16 01:38:37 dawes Exp $ */
+
+#ifndef _CFBTAB_H_
+#define _CFBTAB_H_
+
+/* prototypes */
+extern int starttab[32], endtab[32];
+extern unsigned int partmasks[32][32];
+
+#endif /* _CFBTAB_H_ */
diff --git a/cfb/cfbtegblt.c b/cfb/cfbtegblt.c
index 0cba03575..7450c7829 100644
--- a/cfb/cfbtegblt.c
+++ b/cfb/cfbtegblt.c
@@ -45,7 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
-/* $XFree86: xc/programs/Xserver/cfb/cfbtegblt.c,v 3.6 2001/12/14 19:59:25 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbtegblt.c,v 3.7 2003/10/29 22:44:53 tsi Exp $ */
#include "X.h"
#include "Xmd.h"
@@ -109,7 +109,9 @@ cfbTEGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
register int wtmp,xtemp,width;
CfbBits bgfill,fgfill,*ptemp,tmpDst1,tmpDst2,*pdtmp;
+#if PSZ != 24
int tmpx;
+#endif
xpos += pDrawable->x;
ypos += pDrawable->y;
@@ -177,23 +179,15 @@ cfbTEGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
while (width > 0)
{
#if PSZ == 24
- tmpx = x & 3;
w = 1;
+ ptemp = (CfbBits *)(pglyph + ((xtemp *3)>> 2));
+ getstipplepixels24(ptemp,xtemp,0,&bgfill,&tmpDst1, xtemp);
+ getstipplepixels24(ptemp,xtemp,1,&fgfill,&tmpDst2, xtemp);
#else
tmpx = x & PIM;
w = min(width, PPW - tmpx);
w = min(w, (PGSZ - xtemp));
-#endif
-
-#if PSZ == 24
- ptemp = (CfbBits *)(pglyph + ((xtemp *3)>> 2));
-#else
ptemp = (CfbBits *)(pglyph + (xtemp >> MFB_PWSH));
-#endif
-#if PSZ == 24
- getstipplepixels24(ptemp,xtemp,0,&bgfill,&tmpDst1, xtemp);
- getstipplepixels24(ptemp,xtemp,1,&fgfill,&tmpDst2, xtemp);
-#else
getstipplepixels(ptemp,xtemp,w,0,&bgfill,&tmpDst1);
getstipplepixels(ptemp,xtemp,w,1,&fgfill,&tmpDst2);
#endif
@@ -202,7 +196,7 @@ cfbTEGlyphBlt(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase)
CfbBits tmpDst = tmpDst1 | tmpDst2;
#if PSZ == 24
CfbBits *pdsttmp = pdst + ((x*3) >> 2);
- putbits24(tmpDst,tmpx,w,pdsttmp,pGC->planemask,x);
+ putbits24(tmpDst,w,pdsttmp,pGC->planemask,x);
#else
CfbBits *pdsttmp = pdst + (x >> PWSH);
putbits(tmpDst,tmpx,w,pdsttmp,pGC->planemask);
diff --git a/cfb/cfbtile32.c b/cfb/cfbtile32.c
index cfa3bd503..b202943e8 100644
--- a/cfb/cfbtile32.c
+++ b/cfb/cfbtile32.c
@@ -2,7 +2,7 @@
* Fill 32 bit tiled rectangles. Used by both PolyFillRect and PaintWindow.
* no depth dependencies.
*/
-/* $XFree86: xc/programs/Xserver/cfb/cfbtile32.c,v 3.6 2001/12/14 19:59:25 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbtile32.c,v 3.7 2003/10/29 22:44:53 tsi Exp $ */
/*
@@ -234,7 +234,11 @@ MROP_NAME(cfbFillRectTile32) (pDrawable, pGC, nBox, pBox)
CfbBits *pbits;/* pointer to start of pixmap */
PixmapPtr tile; /* rotated, expanded tile */
+#if MROP == 0 && PSZ == 24
+ DeclareMergeRop()
+#else
MROP_DECLARE_REG()
+#endif
MROP_PREBUILT_DECLARE()
#if PSZ == 24
CfbBits xtmp;
@@ -244,7 +248,11 @@ MROP_NAME(cfbFillRectTile32) (pDrawable, pGC, nBox, pBox)
tileHeight = tile->drawable.height;
psrc = (CfbBits *)tile->devPrivate.ptr;
+#if MROP == 0 && PSZ == 24
+ InitializeMergeRop(pGC->alu, pGC->planemask);
+#else
MROP_INITIALIZE(pGC->alu, pGC->planemask);
+#endif
cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits)
@@ -346,7 +354,11 @@ MROP_NAME(cfbTile32FS)(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
PixmapPtr tile;
CfbBits *psrc; /* pointer to bits in tile */
int tileHeight;/* height of the tile */
- MROP_DECLARE_REG ()
+#if MROP == 0 && PSZ == 24
+ DeclareMergeRop()
+#else
+ MROP_DECLARE_REG()
+#endif
MROP_PREBUILT_DECLARE()
#if PSZ == 24
CfbBits xtmp;
@@ -371,7 +383,11 @@ MROP_NAME(cfbTile32FS)(pDrawable, pGC, nInit, pptInit, pwidthInit, fSorted)
tileHeight = tile->drawable.height;
psrc = (CfbBits *)tile->devPrivate.ptr;
+#if MROP == 0 && PSZ == 24
+ InitializeMergeRop(pGC->alu, pGC->planemask);
+#else
MROP_INITIALIZE(pGC->alu, pGC->planemask);
+#endif
cfbGetLongWidthAndPointer (pDrawable, nlwDst, pbits)
diff --git a/cfb/cfbtileodd.c b/cfb/cfbtileodd.c
index 85efd614e..e372fe87d 100644
--- a/cfb/cfbtileodd.c
+++ b/cfb/cfbtileodd.c
@@ -2,7 +2,7 @@
* Fill odd tiled rectangles and spans.
* no depth dependencies.
*/
-/* $XFree86: xc/programs/Xserver/cfb/cfbtileodd.c,v 3.6 2001/12/14 19:59:25 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbtileodd.c,v 3.7 2003/10/29 22:44:53 tsi Exp $ */
/*
@@ -139,7 +139,11 @@ MROP_NAME(cfbFillBoxTileOdd) (pDrawable, nBox, pBox, tile, xrot, yrot, alu, plan
int xoffDst, xoffSrc;
int leftShift, rightShift;
+#if MROP == 0 && PSZ == 24
+ DeclareMergeRop24()
+#else
MROP_DECLARE_REG()
+#endif
CfbBits *pdstBase; /* pointer to start of dest */
CfbBits *pDstLine; /* poitner to start of dest box */
@@ -160,7 +164,11 @@ MROP_NAME(cfbFillBoxTileOdd) (pDrawable, nBox, pBox, tile, xrot, yrot, alu, plan
int narrowShift = 0;
Bool narrowTile;
+#if MROP == 0 && PSZ == 24
+ InitializeMergeRop24 (alu, planemask)
+#else
MROP_INITIALIZE (alu, planemask)
+#endif
tileHeight = tile->drawable.height;
tileWidth = tile->drawable.width;
@@ -395,7 +403,11 @@ MROP_NAME(cfbFillSpanTileOdd) (pDrawable, n, ppt, pwidth, tile, xrot, yrot, alu,
int xoffDst, xoffSrc;
int leftShift, rightShift;
+#if MROP == 0 && PSZ == 24
+ DeclareMergeRop24()
+#else
MROP_DECLARE_REG()
+#endif
CfbBits *pdstBase; /* pointer to start of dest */
CfbBits *pDstLine; /* poitner to start of dest box */
@@ -416,7 +428,11 @@ MROP_NAME(cfbFillSpanTileOdd) (pDrawable, n, ppt, pwidth, tile, xrot, yrot, alu,
int narrowShift = 0;
Bool narrowTile;
+#if MROP == 0 && PSZ == 24
+ InitializeMergeRop24 (alu, planemask)
+#else
MROP_INITIALIZE (alu, planemask)
+#endif
tileHeight = tile->drawable.height;
tileWidth = tile->drawable.width;
@@ -643,7 +659,11 @@ MROP_NAME(cfbFillBoxTile32s) (pDrawable, nBox, pBox, tile, xrot, yrot, alu, plan
int srcStart; /* number of longwords source offset at left of box */
int leftShift, rightShift;
+#if MROP == 0 && PSZ == 24
+ DeclareMergeRop24()
+#else
MROP_DECLARE_REG()
+#endif
CfbBits *pdstBase; /* pointer to start of dest */
CfbBits *pdstLine; /* poitner to start of dest box */
@@ -655,7 +675,11 @@ MROP_NAME(cfbFillBoxTile32s) (pDrawable, nBox, pBox, tile, xrot, yrot, alu, plan
register CfbBits bits, bits1;
register int nlTemp;
+#if MROP == 0 && PSZ == 24
+ InitializeMergeRop24 (alu, planemask)
+#else
MROP_INITIALIZE (alu, planemask)
+#endif
psrcBase = (CfbBits *)tile->devPrivate.ptr;
tileHeight = tile->drawable.height;
@@ -954,7 +978,11 @@ MROP_NAME(cfbFillSpanTile32s) (pDrawable, n, ppt, pwidth, tile, xrot, yrot, alu,
int srcStart; /* number of longwords source offset at left of box */
int leftShift, rightShift;
+#if MROP == 0 && PSZ == 24
+ DeclareMergeRop24()
+#else
MROP_DECLARE_REG()
+#endif
CfbBits *pdstBase; /* pointer to start of dest */
CfbBits *pdstLine; /* poitner to start of dest box */
@@ -966,7 +994,11 @@ MROP_NAME(cfbFillSpanTile32s) (pDrawable, n, ppt, pwidth, tile, xrot, yrot, alu,
register CfbBits bits, bits1;
register int nlTemp;
+#if MROP == 0 && PSZ == 24
+ InitializeMergeRop24 (alu, planemask)
+#else
MROP_INITIALIZE (alu, planemask)
+#endif
psrcBase = (CfbBits *)tile->devPrivate.ptr;
tileHeight = tile->drawable.height;
diff --git a/cfb/cfbunmap.h b/cfb/cfbunmap.h
index e94f45482..af1754c40 100644
--- a/cfb/cfbunmap.h
+++ b/cfb/cfbunmap.h
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbunmap.h,v 1.5 1999/12/13 02:13:07 robin Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbunmap.h,v 1.6 2003/07/19 13:22:28 tsi Exp $ */
/*
* Copyright (C) 1994-1998 The XFree86 Project, Inc. All Rights Reserved.
*
@@ -58,6 +58,7 @@
#undef cfbCopyImagePlane
#undef cfbCopyPixmap
#undef cfbCopyPlane
+#undef cfbCopyPlaneReduce
#undef cfbCopyRotatePixmap
#undef cfbCopyWindow
#undef cfbCreateGC
diff --git a/cfb/cfbwindow.c b/cfb/cfbwindow.c
index 244aa412b..cae13cf3c 100644
--- a/cfb/cfbwindow.c
+++ b/cfb/cfbwindow.c
@@ -45,6 +45,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
+/* $XFree86: xc/programs/Xserver/cfb/cfbwindow.c,v 1.6 2003/11/10 18:21:45 tsi Exp $ */
#include "X.h"
#include "scrnintstr.h"
@@ -54,8 +55,6 @@ SOFTWARE.
#include "regionstr.h"
#include "cfbmskbits.h"
-extern WindowPtr *WindowTable;
-
Bool
cfbCreateWindow(pWin)
WindowPtr pWin;
@@ -178,7 +177,7 @@ cfbCopyWindow(pWin, ptOldOrg, prgnSrc)
pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];
- REGION_INIT(pWin->drawable.pScreen, &rgnDst, NullBox, 0);
+ REGION_NULL(pWin->drawable.pScreen, &rgnDst);
dx = ptOldOrg.x - pWin->drawable.x;
dy = ptOldOrg.y - pWin->drawable.y;
diff --git a/cfb/cfbzerarc.c b/cfb/cfbzerarc.c
index c13e37739..3703a5105 100644
--- a/cfb/cfbzerarc.c
+++ b/cfb/cfbzerarc.c
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/cfb/cfbzerarc.c,v 3.3 2001/12/14 19:59:25 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/cfb/cfbzerarc.c,v 3.5 2003/10/29 22:44:53 tsi Exp $ */
/************************************************************
Copyright 1989, 1998 The Open Group
@@ -35,7 +35,7 @@ in this Software without prior written authorization from The Open Group.
#include "X.h"
#include "Xprotostr.h"
-#include "miscstruct.h"
+#include "regionstr.h"
#include "gcstruct.h"
#include "pixmapstr.h"
#include "scrnintstr.h"
@@ -48,10 +48,10 @@ in this Software without prior written authorization from The Open Group.
#ifdef PIXEL_ADDR
static void
-RROP_NAME(cfbZeroArcSS8) (pDraw, pGC, arc)
- DrawablePtr pDraw;
- GCPtr pGC;
- xArc *arc;
+RROP_NAME(cfbZeroArcSS8)(
+ DrawablePtr pDraw,
+ GCPtr pGC,
+ xArc *arc)
{
miZeroArcRec info;
Bool do360;
@@ -266,6 +266,7 @@ RROP_NAME(cfbZeroArcSS8) (pDraw, pGC, arc)
RROP_SOLID(yorgop - yoffset + info.xorg + x);
#endif /* PSZ == 24 */
}
+ RROP_UNDECLARE
}
void