From 2dc138922b7588515d5f2447e4b9dcdc0bef15e0 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 21 May 2010 15:05:48 -0700 Subject: [PATCH] Rename region macros to eliminate screen argument This is a combination of a huge mechanical patch and a few small fixups required to finish the job. They were reviewed separately, but because the server does not build without both pieces, I've merged them together at this time. The mechanical changes were performed by running the included 'fix-region' script over the whole tree: $ git ls-files | grep -v '^fix-' | xargs ./fix-region And then, the white space errors in the resulting patch were fixed using the provided fix-patch-whitespace script. $ sh ./fix-patch-whitespace Thanks to Jamey Sharp for the mighty fine sed-generating sed script. The hand-done changes involve removing functions from dix/region.c that duplicate inline functions in include/regionstr.h, along with their declarations in regionstr.h, mi.h and mispans.h. Reviewed-by: Jamey Sharp Signed-off-by: Keith Packard --- Xext/panoramiX.c | 36 +-- Xext/panoramiXprocs.c | 24 +- Xext/shape.c | 48 ++-- Xext/xace.c | 14 +- composite/compalloc.c | 6 +- composite/compext.c | 2 +- composite/compwindow.c | 42 ++-- damageext/damageext.c | 12 +- dix/dispatch.c | 12 +- dix/events.c | 56 ++--- dix/region.c | 144 ++++------- dix/window.c | 100 ++++---- doc/xml/Xserver-spec.xml | 40 +-- exa/exa.c | 6 +- exa/exa_accel.c | 78 +++--- exa/exa_classic.c | 8 +- exa/exa_migration_classic.c | 60 ++--- exa/exa_mixed.c | 4 +- exa/exa_render.c | 48 ++-- exa/exa_unaccel.c | 56 ++--- fb/fb.h | 2 +- fb/fb24_32.c | 8 +- fb/fbarc.c | 2 +- fb/fbbits.h | 4 +- fb/fbfill.c | 2 +- fb/fbfillrect.c | 6 +- fb/fbfillsp.c | 6 +- fb/fbgc.c | 2 +- fb/fbglyph.c | 4 +- fb/fbimage.c | 8 +- fb/fbline.c | 4 +- fb/fboverlay.c | 42 ++-- fb/fbpict.c | 6 +- fb/fbpixmap.c | 10 +- fb/fbpoint.c | 2 +- fb/fbpush.c | 4 +- fb/fbseg.c | 4 +- fb/fbsetsp.c | 4 +- fb/fbwindow.c | 14 +- fix-patch-whitespace | 4 + fix-region | 38 +++ glx/glxdri.c | 12 +- glx/glxdri2.c | 6 +- hw/dmx/dmxextension.c | 4 +- hw/dmx/dmxgc.c | 4 +- hw/dmx/dmxgcops.c | 18 +- hw/dmx/dmxpict.c | 4 +- hw/dmx/dmxpixmap.c | 18 +- hw/dmx/dmxshadow.c | 4 +- hw/dmx/dmxwindow.c | 8 +- hw/dmx/input/dmxconsole.c | 2 +- hw/kdrive/ephyr/ephyr.c | 12 +- hw/kdrive/ephyr/ephyrdriext.c | 18 +- hw/kdrive/ephyr/ephyrvideo.c | 16 +- hw/kdrive/src/kdrive.c | 20 +- hw/kdrive/src/kxv.c | 158 ++++++------ hw/xfree86/common/xf86Helper.c | 16 +- hw/xfree86/common/xf86fbman.c | 132 +++++----- hw/xfree86/common/xf86xv.c | 172 ++++++------- hw/xfree86/dri/dri.c | 36 +-- hw/xfree86/dri2/dri2.c | 8 +- hw/xfree86/modes/xf86Crtc.c | 6 +- hw/xfree86/modes/xf86Rotate.c | 18 +- hw/xfree86/shadowfb/shadow.c | 34 +-- hw/xfree86/xaa/xaaBitBlt.c | 34 +-- hw/xfree86/xaa/xaaCpyArea.c | 12 +- hw/xfree86/xaa/xaaCpyPlane.c | 12 +- hw/xfree86/xaa/xaaCpyWin.c | 14 +- hw/xfree86/xaa/xaaDashLine.c | 4 +- hw/xfree86/xaa/xaaFillArc.c | 4 +- hw/xfree86/xaa/xaaFillPoly.c | 12 +- hw/xfree86/xaa/xaaFillRect.c | 22 +- hw/xfree86/xaa/xaaImage.c | 4 +- hw/xfree86/xaa/xaaLine.c | 4 +- hw/xfree86/xaa/xaaNonTEText.c | 20 +- hw/xfree86/xaa/xaaOverlay.c | 16 +- hw/xfree86/xaa/xaaOverlayDF.c | 28 +-- hw/xfree86/xaa/xaaPCache.c | 4 +- hw/xfree86/xaa/xaaPict.c | 40 +-- hw/xfree86/xaa/xaaRect.c | 4 +- hw/xfree86/xaa/xaaSpans.c | 10 +- hw/xfree86/xaa/xaaTEText.c | 12 +- hw/xfree86/xaa/xaaWideLine.c | 4 +- hw/xfree86/xaa/xaawrap.h | 2 +- hw/xnest/Events.c | 2 +- hw/xnest/GC.c | 12 +- hw/xnest/GCOps.c | 12 +- hw/xnest/Pixmap.c | 16 +- hw/xnest/Window.c | 34 +-- hw/xquartz/darwin.c | 22 +- hw/xquartz/xpr/dri.c | 4 +- hw/xquartz/xpr/xprFrame.c | 8 +- hw/xwin/winfillsp.c | 6 +- hw/xwin/wingc.c | 2 +- hw/xwin/winmultiwindowshape.c | 12 +- hw/xwin/winsetsp.c | 4 +- hw/xwin/winshaddd.c | 6 +- hw/xwin/winshadddnl.c | 6 +- hw/xwin/winshadgdi.c | 6 +- hw/xwin/winvideo.c | 2 +- hw/xwin/winwin32rootless.c | 4 +- hw/xwin/winwindow.c | 26 +- hw/xwin/winwindowswm.c | 8 +- include/regionstr.h | 121 +++++---- mi/mi.h | 17 -- mi/mibitblt.c | 32 +-- mi/micopy.c | 26 +- mi/miexpose.c | 110 ++++----- mi/migc.c | 44 ++-- mi/mioverlay.c | 406 +++++++++++++++---------------- mi/mispans.h | 10 - mi/mivaltree.c | 138 +++++------ mi/miwindow.c | 118 ++++----- miext/cw/cw.c | 14 +- miext/damage/damage.c | 124 +++++----- miext/rootless/rootlessCommon.c | 46 ++-- miext/rootless/rootlessScreen.c | 4 +- miext/rootless/rootlessValTree.c | 96 ++++---- miext/rootless/rootlessWindow.c | 66 ++--- miext/shadow/shadow.c | 10 +- miext/shadow/shpacked.c | 4 +- miext/shadow/shplanar.c | 4 +- miext/shadow/shplanar8.c | 4 +- miext/shadow/shrotate.c | 4 +- miext/shadow/shrotpack.h | 4 +- miext/shadow/shrotpackYX.h | 4 +- render/mipict.c | 42 ++-- render/mirect.c | 4 +- render/picture.c | 18 +- xfixes/region.c | 60 ++--- 130 files changed, 1817 insertions(+), 1865 deletions(-) create mode 100755 fix-patch-whitespace create mode 100755 fix-region diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index 14e06e160c..670cf504a5 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -152,7 +152,7 @@ XineramaCloseScreen (int i, ScreenPtr pScreen) pScreen->CreateGC = pScreenPriv->CreateGC; if (pScreen->myNum == 0) - REGION_UNINIT(pScreen, &PanoramiXScreenRegion); + RegionUninit(&PanoramiXScreenRegion); free((pointer) pScreenPriv); @@ -386,7 +386,7 @@ static void XineramaInitData(ScreenPtr pScreen) { int i, w, h; - REGION_NULL(pScreen, &PanoramiXScreenRegion) + RegionNull(&PanoramiXScreenRegion) for (i = 0; i < PanoramiXNumScreens; i++) { BoxRec TheBox; RegionRec ScreenRegion; @@ -398,10 +398,10 @@ static void XineramaInitData(ScreenPtr pScreen) TheBox.y1 = pScreen->y; TheBox.y2 = TheBox.y1 + pScreen->height; - REGION_INIT(pScreen, &ScreenRegion, &TheBox, 1); - REGION_UNION(pScreen, &PanoramiXScreenRegion, &PanoramiXScreenRegion, + RegionInit(&ScreenRegion, &TheBox, 1); + RegionUnion(&PanoramiXScreenRegion, &PanoramiXScreenRegion, &ScreenRegion); - REGION_UNINIT(pScreen, &ScreenRegion); + RegionUninit(&ScreenRegion); } PanoramiXPixWidth = screenInfo.screens[0]->x + screenInfo.screens[0]->width; @@ -421,7 +421,7 @@ static void XineramaInitData(ScreenPtr pScreen) void XineramaReinitData(ScreenPtr pScreen) { - REGION_UNINIT(pScreen, &PanoramiXScreenRegion); + RegionUninit(&PanoramiXScreenRegion); XineramaInitData(pScreen); } @@ -1153,8 +1153,8 @@ XineramaGetImageData( SrcBox.x2 = SrcBox.x1 + width; SrcBox.y2 = SrcBox.y1 + height; - REGION_INIT(pScreen, &SrcRegion, &SrcBox, 1); - REGION_NULL(pScreen, &GrabRegion); + RegionInit(&SrcRegion, &SrcBox, 1); + RegionNull(&GrabRegion); depth = (format == XYPixmap) ? 1 : pDraw->depth; @@ -1169,11 +1169,11 @@ XineramaGetImageData( TheBox.y1 = pScreen->y; TheBox.y2 = TheBox.y1 + pScreen->height; - REGION_INIT(pScreen, &ScreenRegion, &TheBox, 1); - inOut = RECT_IN_REGION(pScreen, &ScreenRegion, &SrcBox); + RegionInit(&ScreenRegion, &TheBox, 1); + inOut = RegionContainsRect(&ScreenRegion, &SrcBox); if(inOut == rgnPART) - REGION_INTERSECT(pScreen, &GrabRegion, &SrcRegion, &ScreenRegion); - REGION_UNINIT(pScreen, &ScreenRegion); + RegionIntersect(&GrabRegion, &SrcRegion, &ScreenRegion); + RegionUninit(&ScreenRegion); if(inOut == rgnIN) { (*pScreen->GetImage)(pDraw, @@ -1184,10 +1184,10 @@ XineramaGetImageData( } else if (inOut == rgnOUT) continue; - nbox = REGION_NUM_RECTS(&GrabRegion); + nbox = RegionNumRects(&GrabRegion); if(nbox) { - pbox = REGION_RECTS(&GrabRegion); + pbox = RegionRects(&GrabRegion); while(nbox--) { w = pbox->x2 - pbox->x1; @@ -1264,8 +1264,8 @@ XineramaGetImageData( pbox++; } - REGION_SUBTRACT(pScreen, &SrcRegion, &SrcRegion, &GrabRegion); - if(!REGION_NOTEMPTY(pScreen, &SrcRegion)) + RegionSubtract(&SrcRegion, &SrcRegion, &GrabRegion); + if(!RegionNotEmpty(&SrcRegion)) break; } @@ -1274,6 +1274,6 @@ XineramaGetImageData( if(ScratchMem) free(ScratchMem); - REGION_UNINIT(pScreen, &SrcRegion); - REGION_UNINIT(pScreen, &GrabRegion); + RegionUninit(&SrcRegion); + RegionUninit(&GrabRegion); } diff --git a/Xext/panoramiXprocs.c b/Xext/panoramiXprocs.c index 5ccbe27c89..457e071a14 100644 --- a/Xext/panoramiXprocs.c +++ b/Xext/panoramiXprocs.c @@ -620,7 +620,7 @@ int PanoramiXTranslateCoords(ClientPtr client) * borderSize */ && (!wBoundingShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, + RegionContainsPoint( wBoundingShape(pWin), x - pWin->drawable.x, y - pWin->drawable.y, &box)) @@ -1087,7 +1087,7 @@ int PanoramiXCopyArea(ClientPtr client) RegionRec totalReg; int rc; - REGION_NULL(unusedScreen, &totalReg); + RegionNull(&totalReg); FOR_NSCREENS_BACKWARD(j) { RegionPtr pRgn; stuff->dstDrawable = dst->info[j].id; @@ -1124,11 +1124,11 @@ int PanoramiXCopyArea(ClientPtr client) stuff->dstX, stuff->dstY); if(pGC->graphicsExposures && pRgn) { if(srcIsRoot) { - REGION_TRANSLATE(unusedScreen, pRgn, + RegionTranslate(pRgn, screenInfo.screens[j]->x, screenInfo.screens[j]->y); } - REGION_APPEND(unusedScreen, &totalReg, pRgn); - REGION_DESTROY(unusedScreen, pRgn); + RegionAppend(&totalReg, pRgn); + RegionDestroy(pRgn); } if(dstShared) @@ -1138,10 +1138,10 @@ int PanoramiXCopyArea(ClientPtr client) if(pGC->graphicsExposures) { ScreenPtr pScreen = pDst->pScreen; Bool overlap; - REGION_VALIDATE(unusedScreen, &totalReg, &overlap); + RegionValidate(&totalReg, &overlap); (*pScreen->SendGraphicsExpose)( client, &totalReg, stuff->dstDrawable, X_CopyArea, 0); - REGION_UNINIT(unusedScreen, &totalReg); + RegionUninit(&totalReg); } } @@ -1193,7 +1193,7 @@ int PanoramiXCopyPlane(ClientPtr client) srcx = stuff->srcX; srcy = stuff->srcY; dstx = stuff->dstX; dsty = stuff->dstY; - REGION_NULL(unusedScreen, &totalReg); + RegionNull(&totalReg); FOR_NSCREENS_BACKWARD(j) { RegionPtr pRgn; stuff->dstDrawable = dst->info[j].id; @@ -1233,8 +1233,8 @@ int PanoramiXCopyPlane(ClientPtr client) stuff->width, stuff->height, stuff->dstX, stuff->dstY, stuff->bitPlane); if(pGC->graphicsExposures && pRgn) { - REGION_APPEND(unusedScreen, &totalReg, pRgn); - REGION_DESTROY(unusedScreen, pRgn); + RegionAppend(&totalReg, pRgn); + RegionDestroy(pRgn); } if(dstShared) @@ -1244,10 +1244,10 @@ int PanoramiXCopyPlane(ClientPtr client) if(pGC->graphicsExposures) { ScreenPtr pScreen = pdstDraw->pScreen; Bool overlap; - REGION_VALIDATE(unusedScreen, &totalReg, &overlap); + RegionValidate(&totalReg, &overlap); (*pScreen->SendGraphicsExpose)( client, &totalReg, stuff->dstDrawable, X_CopyPlane, 0); - REGION_UNINIT(unusedScreen, &totalReg); + RegionUninit(&totalReg); } return Success; diff --git a/Xext/shape.c b/Xext/shape.c index 86b0bc0ec8..fb5b9a76c7 100644 --- a/Xext/shape.c +++ b/Xext/shape.c @@ -153,11 +153,11 @@ RegionOperate ( ScreenPtr pScreen = pWin->drawable.pScreen; if (srcRgn && (xoff || yoff)) - REGION_TRANSLATE(pScreen, srcRgn, xoff, yoff); + RegionTranslate(srcRgn, xoff, yoff); if (!pWin->parent) { if (srcRgn) - REGION_DESTROY(pScreen, srcRgn); + RegionDestroy(srcRgn); return Success; } @@ -168,7 +168,7 @@ RegionOperate ( */ if (srcRgn == NULL) { if (*destRgnp != NULL) { - REGION_DESTROY (pScreen, *destRgnp); + RegionDestroy(*destRgnp); *destRgnp = 0; /* go on to remove shape and generate ShapeNotify */ } @@ -187,17 +187,17 @@ RegionOperate ( else switch (op) { case ShapeSet: if (*destRgnp) - REGION_DESTROY(pScreen, *destRgnp); + RegionDestroy(*destRgnp); *destRgnp = srcRgn; srcRgn = 0; break; case ShapeUnion: if (*destRgnp) - REGION_UNION(pScreen, *destRgnp, *destRgnp, srcRgn); + RegionUnion(*destRgnp, *destRgnp, srcRgn); break; case ShapeIntersect: if (*destRgnp) - REGION_INTERSECT(pScreen, *destRgnp, *destRgnp, srcRgn); + RegionIntersect(*destRgnp, *destRgnp, srcRgn); else { *destRgnp = srcRgn; srcRgn = 0; @@ -206,20 +206,20 @@ RegionOperate ( case ShapeSubtract: if (!*destRgnp) *destRgnp = (*create)(pWin); - REGION_SUBTRACT(pScreen, *destRgnp, *destRgnp, srcRgn); + RegionSubtract(*destRgnp, *destRgnp, srcRgn); break; case ShapeInvert: if (!*destRgnp) - *destRgnp = REGION_CREATE(pScreen, (BoxPtr) 0, 0); + *destRgnp = RegionCreate((BoxPtr) 0, 0); else - REGION_SUBTRACT(pScreen, *destRgnp, srcRgn, *destRgnp); + RegionSubtract(*destRgnp, srcRgn, *destRgnp); break; default: client->errorValue = op; return BadValue; } if (srcRgn) - REGION_DESTROY(pScreen, srcRgn); + RegionDestroy(srcRgn); (*pScreen->SetShape) (pWin, kind); SendShapeNotify (pWin, kind); return Success; @@ -234,7 +234,7 @@ CreateBoundingShape (WindowPtr pWin) extents.y1 = -wBorderWidth (pWin); extents.x2 = pWin->drawable.width + wBorderWidth (pWin); extents.y2 = pWin->drawable.height + wBorderWidth (pWin); - return REGION_CREATE(pWin->drawable.pScreen, &extents, 1); + return RegionCreate(&extents, 1); } RegionPtr @@ -246,7 +246,7 @@ CreateClipShape (WindowPtr pWin) extents.y1 = 0; extents.x2 = pWin->drawable.width; extents.y2 = pWin->drawable.height; - return REGION_CREATE(pWin->drawable.pScreen, &extents, 1); + return RegionCreate(&extents, 1); } static int @@ -323,7 +323,7 @@ ProcShapeRectangles (ClientPtr client) ctype = VerifyRectOrder(nrects, prects, (int)stuff->ordering); if (ctype < 0) return BadMatch; - srcRgn = RECTS_TO_REGION(pScreen, nrects, prects, ctype); + srcRgn = RegionFromRects(nrects, prects, ctype); if (!pWin->optional) MakeWindowOptional (pWin); @@ -419,7 +419,7 @@ ProcShapeMask (ClientPtr client) if (pPixmap->drawable.pScreen != pScreen || pPixmap->drawable.depth != 1) return BadMatch; - srcRgn = BITMAP_TO_REGION(pScreen, pPixmap); + srcRgn = BitmapToRegion(pScreen, pPixmap); if (!srcRgn) return BadAlloc; } @@ -547,8 +547,8 @@ ProcShapeCombine (ClientPtr client) } if (srcRgn) { - tmp = REGION_CREATE(pScreen, (BoxPtr) 0, 0); - REGION_COPY(pScreen, tmp, srcRgn); + tmp = RegionCreate((BoxPtr) 0, 0); + RegionCopy(tmp, srcRgn); srcRgn = tmp; } else srcRgn = (*createSrc) (pSrcWin); @@ -641,7 +641,7 @@ ProcShapeOffset (ClientPtr client) pScreen = pWin->drawable.pScreen; if (srcRgn) { - REGION_TRANSLATE(pScreen, srcRgn, stuff->xOff, stuff->yOff); + RegionTranslate(srcRgn, stuff->xOff, stuff->yOff); (*pScreen->SetShape) (pWin, stuff->destKind); } SendShapeNotify (pWin, (int)stuff->destKind); @@ -697,7 +697,7 @@ ProcShapeQueryExtents (ClientPtr client) rep.clipShaped = (wClipShape(pWin) != 0); if ((region = wBoundingShape(pWin))) { /* this is done in two steps because of a compiler bug on SunOS 4.1.3 */ - pExtents = REGION_EXTENTS(pWin->drawable.pScreen, region); + pExtents = RegionExtents(region); extents = *pExtents; } else { extents.x1 = -wBorderWidth (pWin); @@ -711,7 +711,7 @@ ProcShapeQueryExtents (ClientPtr client) rep.heightBoundingShape = extents.y2 - extents.y1; if ((region = wClipShape(pWin))) { /* this is done in two steps because of a compiler bug on SunOS 4.1.3 */ - pExtents = REGION_EXTENTS(pWin->drawable.pScreen, region); + pExtents = RegionExtents(region); extents = *pExtents; } else { extents.x1 = 0; @@ -899,7 +899,7 @@ SendShapeNotify (WindowPtr pWin, int which) case ShapeBounding: region = wBoundingShape(pWin); if (region) { - extents = *REGION_EXTENTS(pWin->drawable.pScreen, region); + extents = *RegionExtents(region); shaped = xTrue; } else { extents.x1 = -wBorderWidth (pWin); @@ -912,7 +912,7 @@ SendShapeNotify (WindowPtr pWin, int which) case ShapeClip: region = wClipShape(pWin); if (region) { - extents = *REGION_EXTENTS(pWin->drawable.pScreen, region); + extents = *RegionExtents(region); shaped = xTrue; } else { extents.x1 = 0; @@ -925,7 +925,7 @@ SendShapeNotify (WindowPtr pWin, int which) case ShapeInput: region = wInputShape(pWin); if (region) { - extents = *REGION_EXTENTS(pWin->drawable.pScreen, region); + extents = *RegionExtents(region); shaped = xTrue; } else { extents.x1 = -wBorderWidth (pWin); @@ -1050,8 +1050,8 @@ ProcShapeGetRectangles (ClientPtr client) } } else { BoxPtr box; - nrects = REGION_NUM_RECTS(region); - box = REGION_RECTS(region); + nrects = RegionNumRects(region); + box = RegionRects(region); rects = malloc(nrects * sizeof (xRectangle)); if (!rects && nrects) return BadAlloc; diff --git a/Xext/xace.c b/Xext/xace.c index 53f4b4dee0..07e3da5168 100644 --- a/Xext/xace.c +++ b/Xext/xace.c @@ -255,12 +255,12 @@ XaceCensorImage( imageBox.y1 = y; imageBox.x2 = x + w; imageBox.y2 = y + h; - REGION_INIT(pScreen, &imageRegion, &imageBox, 1); - REGION_NULL(pScreen, &censorRegion); + RegionInit(&imageRegion, &imageBox, 1); + RegionNull(&censorRegion); /* censorRegion = imageRegion - visibleRegion */ - REGION_SUBTRACT(pScreen, &censorRegion, &imageRegion, pVisibleRegion); - nRects = REGION_NUM_RECTS(&censorRegion); + RegionSubtract(&censorRegion, &imageRegion, pVisibleRegion); + nRects = RegionNumRects(&censorRegion); if (nRects > 0) { /* we have something to censor */ GCPtr pScratchGC = NULL; @@ -280,7 +280,7 @@ XaceCensorImage( failed = TRUE; goto failSafe; } - for (pBox = REGION_RECTS(&censorRegion), i = 0; + for (pBox = RegionRects(&censorRegion), i = 0; i < nRects; i++, pBox++) { @@ -330,8 +330,8 @@ XaceCensorImage( if (pScratchGC) FreeScratchGC(pScratchGC); if (pPix) FreeScratchPixmapHeader(pPix); } - REGION_UNINIT(pScreen, &imageRegion); - REGION_UNINIT(pScreen, &censorRegion); + RegionUninit(&imageRegion); + RegionUninit(&censorRegion); } /* XaceCensorImage */ /* diff --git a/composite/compalloc.c b/composite/compalloc.c index 7930ebe48d..d8ccc11817 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -134,7 +134,7 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) EnableMapUnmapEvents (pWin); } - REGION_NULL (pScreen, &cw->borderClip); + RegionNull(&cw->borderClip); cw->borderClipX = 0; cw->borderClipY = 0; cw->update = CompositeRedirectAutomatic; @@ -227,7 +227,7 @@ compFreeClientWindow (WindowPtr pWin, XID id) if (cw->damage) DamageDestroy (cw->damage); - REGION_UNINIT (pScreen, &cw->borderClip); + RegionUninit(&cw->borderClip); dixSetPrivate(&pWin->devPrivates, CompWindowPrivateKey, NULL); free(cw); @@ -599,7 +599,7 @@ compFreePixmap (WindowPtr pWin) * case correctly. Unmap adds the window borderClip to the * parent exposed area; regions beyond the parent cause crashes */ - REGION_COPY (pScreen, &pWin->borderClip, &cw->borderClip); + RegionCopy(&pWin->borderClip, &cw->borderClip); pRedirectPixmap = (*pScreen->GetWindowPixmap) (pWin); pParentPixmap = (*pScreen->GetWindowPixmap) (pWin->parent); pWin->redirectDraw = RedirectDrawNone; diff --git a/composite/compext.c b/composite/compext.c index ed437756e0..d37d52a182 100644 --- a/composite/compext.c +++ b/composite/compext.c @@ -218,7 +218,7 @@ ProcCompositeCreateRegionFromBorderClip (ClientPtr client) pRegion = XFixesRegionCopy (pBorderClip); if (!pRegion) return BadAlloc; - REGION_TRANSLATE (pScreen, pRegion, -pWin->drawable.x, -pWin->drawable.y); + RegionTranslate(pRegion, -pWin->drawable.x, -pWin->drawable.y); if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) return BadAlloc; diff --git a/composite/compwindow.c b/composite/compwindow.c index 0f3898cb37..7d877b104a 100644 --- a/composite/compwindow.c +++ b/composite/compwindow.c @@ -98,10 +98,10 @@ compRepaintBorder (ClientPtr pClient, pointer closure) if (rc == Success) { RegionRec exposed; - REGION_NULL(pScreen, &exposed); - REGION_SUBTRACT(pScreen, &exposed, &pWindow->borderClip, &pWindow->winSize); + RegionNull(&exposed); + RegionSubtract(&exposed, &pWindow->borderClip, &pWindow->winSize); miPaintWindow(pWindow, &exposed, PW_BORDER); - REGION_UNINIT(pScreen, &exposed); + RegionUninit(&exposed); } return TRUE; } @@ -283,7 +283,7 @@ compClipNotify (WindowPtr pWin, int dx, int dy) if (cw->borderClipX != pWin->drawable.x || cw->borderClipY != pWin->drawable.y) { - REGION_TRANSLATE (pScreen, &cw->borderClip, + RegionTranslate(&cw->borderClip, pWin->drawable.x - cw->borderClipX, pWin->drawable.y - cw->borderClipY); cw->borderClipX = pWin->drawable.x; @@ -404,14 +404,14 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; - REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); + RegionTranslate(prgnSrc, -dx, -dy); - REGION_NULL (pWin->drawable.pScreen, &rgnDst); + RegionNull(&rgnDst); - REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, + RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); - REGION_TRANSLATE (pWin->drawable.pScreen, &rgnDst, + RegionTranslate(&rgnDst, -pPixmap->screen_x, -pPixmap->screen_y); dx = dx + pPixmap->screen_x - cw->oldx; @@ -419,8 +419,8 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) pGC = GetScratchGC (pPixmap->drawable.depth, pScreen); if (pGC) { - BoxPtr pBox = REGION_RECTS (&rgnDst); - int nBox = REGION_NUM_RECTS (&rgnDst); + BoxPtr pBox = RegionRects (&rgnDst); + int nBox = RegionNumRects (&rgnDst); ValidateGC(&pPixmap->drawable, pGC); while (nBox--) @@ -448,16 +448,16 @@ compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) if (ptOldOrg.x != pWin->drawable.x || ptOldOrg.y != pWin->drawable.y) { if (dx || dy) - REGION_TRANSLATE (pScreen, prgnSrc, dx, dy); + RegionTranslate(prgnSrc, dx, dy); (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc); if (dx || dy) - REGION_TRANSLATE (pScreen, prgnSrc, -dx, -dy); + RegionTranslate(prgnSrc, -dx, -dy); } else { ptOldOrg.x -= dx; ptOldOrg.y -= dy; - REGION_TRANSLATE (prgnSrc, prgnSrc, + RegionTranslate(prgnSrc, pWin->drawable.x - ptOldOrg.x, pWin->drawable.y - ptOldOrg.y); DamageRegionAppend(&pWin->drawable, prgnSrc); @@ -525,26 +525,26 @@ compSetRedirectBorderClip (WindowPtr pWin, RegionPtr pRegion) CompWindowPtr cw = GetCompWindow (pWin); RegionRec damage; - REGION_NULL (pScreen, &damage); + RegionNull(&damage); /* * Align old border clip with new border clip */ - REGION_TRANSLATE (pScreen, &cw->borderClip, + RegionTranslate(&cw->borderClip, pWin->drawable.x - cw->borderClipX, pWin->drawable.y - cw->borderClipY); /* * Compute newly visible portion of window for repaint */ - REGION_SUBTRACT (pScreen, &damage, pRegion, &cw->borderClip); + RegionSubtract(&damage, pRegion, &cw->borderClip); /* * Report that as damaged so it will be redrawn */ DamageRegionAppend(&pWin->drawable, &damage); - REGION_UNINIT (pScreen, &damage); + RegionUninit(&damage); /* * Save the new border clip region */ - REGION_COPY (pScreen, &cw->borderClip, pRegion); + RegionCopy(&cw->borderClip, pRegion); cw->borderClipX = pWin->drawable.x; cw->borderClipY = pWin->drawable.y; } @@ -606,18 +606,18 @@ compWindowUpdateAutomatic (WindowPtr pWin) /* * First move the region from window to screen coordinates */ - REGION_TRANSLATE (pScreen, pRegion, + RegionTranslate(pRegion, pWin->drawable.x, pWin->drawable.y); /* * Clip against the "real" border clip */ - REGION_INTERSECT (pScreen, pRegion, pRegion, &cw->borderClip); + RegionIntersect(pRegion, pRegion, &cw->borderClip); /* * Now translate from screen to dest coordinates */ - REGION_TRANSLATE (pScreen, pRegion, + RegionTranslate(pRegion, -pParent->drawable.x, -pParent->drawable.y); /* diff --git a/damageext/damageext.c b/damageext/damageext.c index e4eda5efc3..7717a40f72 100644 --- a/damageext/damageext.c +++ b/damageext/damageext.c @@ -94,10 +94,10 @@ DamageExtReport (DamagePtr pDamage, RegionPtr pRegion, void *closure) switch (pDamageExt->level) { case DamageReportRawRegion: case DamageReportDeltaRegion: - DamageExtNotify (pDamageExt, REGION_RECTS(pRegion), REGION_NUM_RECTS(pRegion)); + DamageExtNotify (pDamageExt, RegionRects(pRegion), RegionNumRects(pRegion)); break; case DamageReportBoundingBox: - DamageExtNotify (pDamageExt, REGION_EXTENTS(prScreen, pRegion), 1); + DamageExtNotify (pDamageExt, RegionExtents(pRegion), 1); break; case DamageReportNonEmpty: DamageExtNotify (pDamageExt, NullBox, 0); @@ -261,14 +261,14 @@ ProcDamageSubtract (ClientPtr client) if (pRepair) { if (pParts) - REGION_INTERSECT (prScreen, pParts, DamageRegion (pDamage), pRepair); + RegionIntersect(pParts, DamageRegion (pDamage), pRepair); if (DamageSubtract (pDamage, pRepair)) DamageExtReport (pDamage, DamageRegion (pDamage), (void *) pDamageExt); } else { if (pParts) - REGION_COPY (prScreen, pParts, DamageRegion (pDamage)); + RegionCopy(pParts, DamageRegion (pDamage)); DamageEmpty (pDamage); } } @@ -293,9 +293,9 @@ ProcDamageAdd (ClientPtr client) /* The region is relative to the drawable origin, so translate it out to * screen coordinates like damage expects. */ - REGION_TRANSLATE(pScreen, pRegion, pDrawable->x, pDrawable->y); + RegionTranslate(pRegion, pDrawable->x, pDrawable->y); DamageRegionAppend(pDrawable, pRegion); - REGION_TRANSLATE(pScreen, pRegion, -pDrawable->x, -pDrawable->y); + RegionTranslate(pRegion, -pDrawable->x, -pDrawable->y); return Success; } diff --git a/dix/dispatch.c b/dix/dispatch.c index c0efce5bf6..859b93e43d 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -1179,11 +1179,11 @@ ProcTranslateCoords(ClientPtr client) * borderSize */ && (!wBoundingShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, + RegionContainsPoint( &pWin->borderSize, x, y, &box)) && (!wInputShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, + RegionContainsPoint( wInputShape(pWin), x - pWin->drawable.x, y - pWin->drawable.y, &box)) @@ -1661,7 +1661,7 @@ ProcCopyArea(ClientPtr client) (*pDst->pScreen->SendGraphicsExpose) (client, pRgn, stuff->dstDrawable, X_CopyArea, 0); if (pRgn) - REGION_DESTROY(pDst->pScreen, pRgn); + RegionDestroy(pRgn); } return Success; @@ -1711,7 +1711,7 @@ ProcCopyPlane(ClientPtr client) (*pdstDraw->pScreen->SendGraphicsExpose) (client, pRgn, stuff->dstDrawable, X_CopyPlane, 0); if (pRgn) - REGION_DESTROY(pdstDraw->pScreen, pRgn); + RegionDestroy(pRgn); } return Success; } @@ -2151,7 +2151,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, pVisibleRegion = NotClippedByChildren((WindowPtr)pDraw); if (pVisibleRegion) { - REGION_TRANSLATE(pDraw->pScreen, pVisibleRegion, + RegionTranslate(pVisibleRegion, -pDraw->x, -pDraw->y); } } @@ -2240,7 +2240,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, } } if (pVisibleRegion) - REGION_DESTROY(pDraw->pScreen, pVisibleRegion); + RegionDestroy(pVisibleRegion); if (!im_return) free(pBuf); return Success; diff --git a/dix/events.c b/dix/events.c index 502eebd8d7..4c53b55d35 100644 --- a/dix/events.c +++ b/dix/events.c @@ -598,7 +598,7 @@ XineramaConfineCursorToWindow(DeviceIntPtr pDev, i = PanoramiXNumScreens - 1; - REGION_COPY(pSprite->screen, &pSprite->Reg1, + RegionCopy(&pSprite->Reg1, &pSprite->windows[i]->borderSize); off_x = screenInfo.screens[i]->x; off_y = screenInfo.screens[i]->y; @@ -608,18 +608,18 @@ XineramaConfineCursorToWindow(DeviceIntPtr pDev, y = off_y - screenInfo.screens[i]->y; if(x || y) - REGION_TRANSLATE(pSprite->screen, &pSprite->Reg1, x, y); + RegionTranslate(&pSprite->Reg1, x, y); - REGION_UNION(pSprite->screen, &pSprite->Reg1, &pSprite->Reg1, + RegionUnion(&pSprite->Reg1, &pSprite->Reg1, &pSprite->windows[i]->borderSize); off_x = screenInfo.screens[i]->x; off_y = screenInfo.screens[i]->y; } - pSprite->hotLimits = *REGION_EXTENTS(pSprite->screen, &pSprite->Reg1); + pSprite->hotLimits = *RegionExtents(&pSprite->Reg1); - if(REGION_NUM_RECTS(&pSprite->Reg1) > 1) + if(RegionNumRects(&pSprite->Reg1) > 1) pSprite->hotShape = &pSprite->Reg1; else pSprite->hotShape = NullRegion; @@ -671,9 +671,9 @@ ConfineToShape(DeviceIntPtr pDev, RegionPtr shape, int *px, int *py) SpritePtr pSprite; pSprite = pDev->spriteInfo->sprite; - if (POINT_IN_REGION(pSprite->hot.pScreen, shape, x, y, &box)) + if (RegionContainsPoint(shape, x, y, &box)) return; - box = *REGION_EXTENTS(pSprite->hot.pScreen, shape); + box = *RegionExtents(shape); /* this is rather crude */ do { x += incx; @@ -695,7 +695,7 @@ ConfineToShape(DeviceIntPtr pDev, RegionPtr shape, int *px, int *py) else if (y < box.y1) return; /* should never get here! */ } - } while (!POINT_IN_REGION(pSprite->hot.pScreen, shape, x, y, &box)); + } while (!RegionContainsPoint(shape, x, y, &box)); *px = x; *py = y; } @@ -817,7 +817,7 @@ CheckVirtualMotion( i = PanoramiXNumScreens - 1; - REGION_COPY(pSprite->screen, &pSprite->Reg2, + RegionCopy(&pSprite->Reg2, &pSprite->windows[i]->borderSize); off_x = screenInfo.screens[i]->x; off_y = screenInfo.screens[i]->y; @@ -827,9 +827,9 @@ CheckVirtualMotion( y = off_y - screenInfo.screens[i]->y; if(x || y) - REGION_TRANSLATE(pSprite->screen, &pSprite->Reg2, x, y); + RegionTranslate(&pSprite->Reg2, x, y); - REGION_UNION(pSprite->screen, &pSprite->Reg2, &pSprite->Reg2, + RegionUnion(&pSprite->Reg2, &pSprite->Reg2, &pSprite->windows[i]->borderSize); off_x = screenInfo.screens[i]->x; @@ -845,7 +845,7 @@ CheckVirtualMotion( } } - lims = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin->borderSize); + lims = *RegionExtents(&pWin->borderSize); if (pSprite->hot.x < lims.x1) pSprite->hot.x = lims.x1; else if (pSprite->hot.x >= lims.x2) @@ -858,7 +858,7 @@ CheckVirtualMotion( #ifdef PANORAMIX if (!noPanoramiXExtension) { - if (REGION_NUM_RECTS(&pSprite->Reg2) > 1) + if (RegionNumRects(&pSprite->Reg2) > 1) reg = &pSprite->Reg2; } else @@ -903,7 +903,7 @@ ConfineCursorToWindow(DeviceIntPtr pDev, WindowPtr pWin, Bool generateEvents, Bo return; } #endif - pSprite->hotLimits = *REGION_EXTENTS( pScreen, &pWin->borderSize); + pSprite->hotLimits = *RegionExtents(&pWin->borderSize); pSprite->hotShape = wBoundingShape(pWin) ? &pWin->borderSize : NullRegion; CheckPhysLimits(pDev, pSprite->current, generateEvents, @@ -2552,7 +2552,7 @@ PointInBorderSize(WindowPtr pWin, int x, int y) { BoxRec box; - if(POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderSize, x, y, &box)) + if(RegionContainsPoint(&pWin->borderSize, x, y, &box)) return TRUE; #ifdef PANORAMIX @@ -2562,7 +2562,7 @@ PointInBorderSize(WindowPtr pWin, int x, int y) int i; for(i = 1; i < PanoramiXNumScreens; i++) { - if(POINT_IN_REGION(pSprite->screen, + if(RegionContainsPoint( &pSprite->windows[i]->borderSize, x + screenInfo.screens[0]->x - screenInfo.screens[i]->x, y + screenInfo.screens[0]->y - screenInfo.screens[i]->y, @@ -2610,7 +2610,7 @@ XYToWindow(DeviceIntPtr pDev, int x, int y) */ && (!wBoundingShape(pWin) || PointInBorderSize(pWin, x, y)) && (!wInputShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, + RegionContainsPoint( wInputShape(pWin), x - pWin->drawable.x, y - pWin->drawable.y, &box)) @@ -2880,10 +2880,10 @@ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff) pSprite->hotLimits.x2 -= xoff; pSprite->hotLimits.y2 -= yoff; - if (REGION_NOTEMPTY(pSprite->screen, &pSprite->Reg1)) - REGION_TRANSLATE(pSprite->screen, &pSprite->Reg1, xoff, yoff); - if (REGION_NOTEMPTY(pSprite->screen, &pSprite->Reg2)) - REGION_TRANSLATE(pSprite->screen, &pSprite->Reg2, xoff, yoff); + if (RegionNotEmpty(&pSprite->Reg1)) + RegionTranslate(&pSprite->Reg1, xoff, yoff); + if (RegionNotEmpty(&pSprite->Reg2)) + RegionTranslate(&pSprite->Reg2, xoff, yoff); /* FIXME: if we call ConfineCursorToWindow, must we do anything else? */ if ((grab = pDev->deviceGrab.grab) && grab->confineTo) { @@ -3018,8 +3018,8 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin) pSprite->hotShape = NullRegion; pSprite->screen = pScreen; /* gotta UNINIT these someplace */ - REGION_NULL(pScreen, &pSprite->Reg1); - REGION_NULL(pScreen, &pSprite->Reg2); + RegionNull(&pSprite->Reg1); + RegionNull(&pSprite->Reg2); } #endif } @@ -3157,7 +3157,7 @@ XineramaPointInWindowIsVisible( if (!pWin->realized) return FALSE; - if (POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box)) + if (RegionContainsPoint(&pWin->borderClip, x, y, &box)) return TRUE; if(!XineramaSetWindowPntrs(inputInfo.pointer, pWin)) return FALSE; @@ -3171,9 +3171,9 @@ XineramaPointInWindowIsVisible( x = xoff - screenInfo.screens[i]->x; y = yoff - screenInfo.screens[i]->y; - if(POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box) + if(RegionContainsPoint(&pWin->borderClip, x, y, &box) && (!wInputShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, + RegionContainsPoint( wInputShape(pWin), x - pWin->drawable.x, y - pWin->drawable.y, &box))) @@ -3367,7 +3367,7 @@ ProcWarpPointer(ClientPtr client) static Bool BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin) { - if(REGION_NOTEMPTY(pDev->spriteInfo->sprite->hotPhys.pScreen, &pWin->borderSize)) + if(RegionNotEmpty(&pWin->borderSize)) return TRUE; #ifdef PANORAMIX @@ -3375,7 +3375,7 @@ BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin) int i; for(i = 1; i < PanoramiXNumScreens; i++) { - if(REGION_NOTEMPTY(pDev->spriteInfo->sprite->screen, + if(RegionNotEmpty( &pDev->spriteInfo->sprite->windows[i]->borderSize)) return TRUE; } diff --git a/dix/region.c b/dix/region.c index a56160190e..2e8dde557a 100644 --- a/dix/region.c +++ b/dix/region.c @@ -83,8 +83,6 @@ Equipment Corporation. #include #include #include "gc.h" -#include "mi.h" -#include "mispans.h" #include #undef assert @@ -171,7 +169,7 @@ Equipment Corporation. ((r1)->y1 <= (r2)->y1) && \ ((r1)->y2 >= (r2)->y2) ) -#define xallocData(n) malloc(REGION_SZOF(n)) +#define xallocData(n) malloc(RegionSizeof(n)) #define xfreeData(reg) if ((reg)->data && (reg)->data->size) free((reg)->data) #define RECTALLOC_BAIL(pReg,n,bail) \ @@ -197,7 +195,7 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \ { \ if (!RegionRectAlloc(pReg, 1)) \ return FALSE; \ - pNextRect = REGION_TOP(pReg); \ + pNextRect = RegionTop(pReg); \ } \ ADDRECT(pNextRect,nx1,ny1,nx2,ny2); \ pReg->data->numRects++; \ @@ -209,7 +207,7 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \ if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \ { \ RegDataPtr NewData; \ - NewData = (RegDataPtr)realloc((reg)->data, REGION_SZOF(numRects)); \ + NewData = (RegDataPtr)realloc((reg)->data, RegionSizeof(numRects)); \ if (NewData) \ { \ NewData->size = (numRects); \ @@ -265,9 +263,9 @@ RegionPrint(RegionPtr rgn) int i; BoxPtr rects; - num = REGION_NUM_RECTS(rgn); - size = REGION_SIZE(rgn); - rects = REGION_RECTS(rgn); + num = RegionNumRects(rgn); + size = RegionSize(rgn); + rects = RegionRects(rgn); ErrorF("[mi] num: %d size: %d\n", num, size); ErrorF("[mi] extents: %d %d %d %d\n", rgn->extents.x1, rgn->extents.y1, rgn->extents.x2, rgn->extents.y2); @@ -292,7 +290,7 @@ RegionIsValid(RegionPtr reg) if ((reg->extents.x1 > reg->extents.x2) || (reg->extents.y1 > reg->extents.y2)) return FALSE; - numRects = REGION_NUM_RECTS(reg); + numRects = RegionNumRects(reg); if (!numRects) return ((reg->extents.x1 == reg->extents.x2) && (reg->extents.y1 == reg->extents.y2) && @@ -304,7 +302,7 @@ RegionIsValid(RegionPtr reg) BoxPtr pboxP, pboxN; BoxRec box; - pboxP = REGION_RECTS(reg); + pboxP = RegionRects(reg); box = *pboxP; box.y2 = pboxP[numRects-1].y2; pboxN = pboxP + 1; @@ -330,26 +328,6 @@ RegionIsValid(RegionPtr reg) } #endif /* DEBUG */ -/***************************************************************** - * RegionInit(pReg, rect, size) - * Outer region rect is statically allocated. - *****************************************************************/ - -void -RegionInit(RegionPtr pReg, BoxPtr rect, int size) -{ - if (rect) - pixman_region_init_with_extents (pReg, rect); - else - pixman_region_init (pReg); -} - -void -RegionUninit(RegionPtr pReg) -{ - pixman_region_fini (pReg); -} - Bool RegionBreak (RegionPtr pReg) { @@ -371,7 +349,7 @@ RegionRectAlloc(RegionPtr pRgn, int n) if (!pRgn->data) return RegionBreak (pRgn); pRgn->data->numRects = 1; - *REGION_BOXPTR(pRgn) = pRgn->extents; + *RegionBoxptr(pRgn) = pRgn->extents; } else if (!pRgn->data->size) { @@ -389,7 +367,7 @@ RegionRectAlloc(RegionPtr pRgn, int n) n = 250; } n += pRgn->data->numRects; - data = (RegDataPtr)realloc(pRgn->data, REGION_SZOF(n)); + data = (RegDataPtr)realloc(pRgn->data, RegionSizeof(n)); if (!data) return RegionBreak (pRgn); pRgn->data = data; @@ -448,8 +426,8 @@ RegionCoalesce ( * The bands may only be coalesced if the bottom of the previous * matches the top scanline of the current. */ - pPrevBox = REGION_BOX(pReg, prevStart); - pCurBox = REGION_BOX(pReg, curStart); + pPrevBox = RegionBox(pReg, prevStart); + pCurBox = RegionBox(pReg, curStart); if (pPrevBox->y2 != pCurBox->y1) return curStart; /* @@ -528,7 +506,7 @@ RegionAppendNonO ( /* Make sure we have enough space for all rectangles to be added */ RECTALLOC(pReg, newRects); - pNextRect = REGION_TOP(pReg); + pNextRect = RegionTop(pReg); pReg->data->numRects += newRects; do { assert(r->x1 < r->x2); @@ -553,7 +531,7 @@ RegionAppendNonO ( int newRects; \ if ((newRects = rEnd - r)) { \ RECTALLOC(newReg, newRects); \ - memmove((char *)REGION_TOP(newReg),(char *)r, \ + memmove((char *)RegionTop(newReg),(char *)r, \ newRects * sizeof(BoxRec)); \ newReg->data->numRects += newRects; \ } \ @@ -634,7 +612,7 @@ RegionOp( /* * Break any region computed from a broken region */ - if (REGION_NAR (reg1) || REGION_NAR(reg2)) + if (RegionNar (reg1) || RegionNar(reg2)) return RegionBreak (newReg); /* @@ -645,11 +623,11 @@ RegionOp( * another array of rectangles for it to use. */ - r1 = REGION_RECTS(reg1); - newSize = REGION_NUM_RECTS(reg1); + r1 = RegionRects(reg1); + newSize = RegionNumRects(reg1); r1End = r1 + newSize; - numRects = REGION_NUM_RECTS(reg2); - r2 = REGION_RECTS(reg2); + numRects = RegionNumRects(reg2); + r2 = RegionRects(reg2); r2End = r2 + numRects; assert(r1 != r1End); assert(r2 != r2End); @@ -806,7 +784,7 @@ RegionOp( } else if (numRects == 1) { - newReg->extents = *REGION_BOXPTR(newReg); + newReg->extents = *RegionBoxptr(newReg); xfreeData(newReg); newReg->data = NULL; } @@ -847,8 +825,8 @@ RegionSetExtents (RegionPtr pReg) return; } - pBox = REGION_BOXPTR(pReg); - pBoxEnd = REGION_END(pReg); + pBox = RegionBoxptr(pReg); + pBoxEnd = RegionEnd(pReg); /* * Since pBox is the first rectangle in the region, it must have the @@ -953,7 +931,7 @@ RegionUnionO ( assert (y1 < y2); assert(r1 != r1End && r2 != r2End); - pNextRect = REGION_TOP(pReg); + pNextRect = RegionTop(pReg); /* Start off current rectangle */ if (r1->x1 < r2->x1) @@ -1033,7 +1011,7 @@ RegionAppend(RegionPtr dstrgn, RegionPtr rgn) BoxPtr new, old; Bool prepend; - if (REGION_NAR(rgn)) + if (RegionNar(rgn)) return RegionBreak (dstrgn); if (!rgn->data && (dstrgn->data == &RegionEmptyData)) @@ -1043,16 +1021,16 @@ RegionAppend(RegionPtr dstrgn, RegionPtr rgn) return TRUE; } - numRects = REGION_NUM_RECTS(rgn); + numRects = RegionNumRects(rgn); if (!numRects) return TRUE; prepend = FALSE; size = numRects; - dnumRects = REGION_NUM_RECTS(dstrgn); + dnumRects = RegionNumRects(dstrgn); if (!dnumRects && (size < 200)) size = 200; /* XXX pick numbers out of a hat */ RECTALLOC(dstrgn, size); - old = REGION_RECTS(rgn); + old = RegionRects(rgn); if (!dnumRects) dstrgn->extents = rgn->extents; else if (dstrgn->extents.x2 > dstrgn->extents.x1) @@ -1060,7 +1038,7 @@ RegionAppend(RegionPtr dstrgn, RegionPtr rgn) BoxPtr first, last; first = old; - last = REGION_BOXPTR(dstrgn) + (dnumRects - 1); + last = RegionBoxptr(dstrgn) + (dnumRects - 1); if ((first->y1 > last->y2) || ((first->y1 == last->y1) && (first->y2 == last->y2) && (first->x1 > last->x2))) @@ -1073,7 +1051,7 @@ RegionAppend(RegionPtr dstrgn, RegionPtr rgn) } else { - first = REGION_BOXPTR(dstrgn); + first = RegionBoxptr(dstrgn); last = old + (numRects - 1); if ((first->y1 > last->y2) || ((first->y1 == last->y1) && (first->y2 == last->y2) && @@ -1092,16 +1070,16 @@ RegionAppend(RegionPtr dstrgn, RegionPtr rgn) } if (prepend) { - new = REGION_BOX(dstrgn, numRects); + new = RegionBox(dstrgn, numRects); if (dnumRects == 1) - *new = *REGION_BOXPTR(dstrgn); + *new = *RegionBoxptr(dstrgn); else - memmove((char *)new,(char *)REGION_BOXPTR(dstrgn), + memmove((char *)new,(char *)RegionBoxptr(dstrgn), dnumRects * sizeof(BoxRec)); - new = REGION_BOXPTR(dstrgn); + new = RegionBoxptr(dstrgn); } else - new = REGION_BOXPTR(dstrgn) + dnumRects; + new = RegionBoxptr(dstrgn) + dnumRects; if (numRects == 1) *new = *old; else @@ -1242,7 +1220,7 @@ RegionValidate(RegionPtr badreg, Bool *pOverlap) numRects = badreg->data->numRects; if (!numRects) { - if (REGION_NAR(badreg)) + if (RegionNar(badreg)) return FALSE; good(badreg); return TRUE; @@ -1263,7 +1241,7 @@ RegionValidate(RegionPtr badreg, Bool *pOverlap) } /* Step 1: Sort the rects array into ascending (y1, x1) order */ - QuickSortRects(REGION_BOXPTR(badreg), numRects); + QuickSortRects(RegionBoxptr(badreg), numRects); /* Step 2: Scatter the sorted array into the minimum number of regions */ @@ -1277,7 +1255,7 @@ RegionValidate(RegionPtr badreg, Bool *pOverlap) ri[0].prevBand = 0; ri[0].curBand = 0; ri[0].reg = *badreg; - box = REGION_BOXPTR(&ri[0].reg); + box = RegionBoxptr(&ri[0].reg); ri[0].reg.extents = *box; ri[0].reg.data->numRects = 1; @@ -1294,7 +1272,7 @@ RegionValidate(RegionPtr badreg, Bool *pOverlap) for (j = numRI, rit = ri; --j >= 0; rit++) { reg = &rit->reg; - riBox = REGION_END(reg); + riBox = RegionEnd(reg); if (box->y1 == riBox->y1 && box->y2 == riBox->y2) { @@ -1308,7 +1286,7 @@ RegionValidate(RegionPtr badreg, Bool *pOverlap) else { RECTALLOC_BAIL(reg, 1, bail); - *REGION_TOP(reg) = *box; + *RegionTop(reg) = *box; reg->data->numRects++; } goto NextRect; /* So sue me */ @@ -1321,7 +1299,7 @@ RegionValidate(RegionPtr badreg, Bool *pOverlap) Coalesce(reg, rit->prevBand, rit->curBand); rit->curBand = reg->data->numRects; RECTALLOC_BAIL(reg, 1, bail); - *REGION_TOP(reg) = *box; + *RegionTop(reg) = *box; reg->data->numRects++; goto NextRect; } @@ -1355,7 +1333,7 @@ NextRect: ; for (j = numRI, rit = ri; --j >= 0; rit++) { reg = &rit->reg; - riBox = REGION_END(reg); + riBox = RegionEnd(reg); reg->extents.y2 = riBox->y2; if (reg->extents.x2 < riBox->x2) reg->extents.x2 = riBox->x2; Coalesce(reg, rit->prevBand, rit->curBand); @@ -1410,7 +1388,7 @@ RegionFromRects(int nrects, xRectangle *prect, int ctype) int x1, y1, x2, y2; pRgn = RegionCreate(NullBox, 0); - if (REGION_NAR (pRgn)) + if (RegionNar (pRgn)) return pRgn; if (!nrects) return pRgn; @@ -1563,12 +1541,6 @@ RegionTranslate(RegionPtr pReg, int x, int y) pixman_region_translate (pReg, x, y); } -void -RegionReset(RegionPtr pReg, BoxPtr pBox) -{ - pixman_region_reset (pReg, pBox); -} - Bool RegionContainsPoint( RegionPtr pReg, @@ -1580,36 +1552,6 @@ RegionContainsPoint( return pixman_region_contains_point (pReg, x, y, box); } -Bool -RegionNotEmpty(RegionPtr pReg) -{ - return pixman_region_not_empty (pReg); -} - -Bool -RegionBroken(RegionPtr pReg) -{ - good(pReg); - return (REGION_NAR(pReg)); -} - -void -RegionEmpty(RegionPtr pReg) -{ - good(pReg); - xfreeData(pReg); - pReg->extents.x2 = pReg->extents.x1; - pReg->extents.y2 = pReg->extents.y1; - pReg->data = &RegionEmptyData; -} - -BoxPtr -RegionExtents(RegionPtr pReg) -{ - good(pReg); - return(&pReg->extents); -} - #define ExchangeSpans(a, b) \ { \ DDXPointRec tpt; \ @@ -1795,7 +1737,7 @@ RegionClipSpans( if ((! fSorted) && (nspans > 1)) QuickSortSpans(ppt, pwidth, nspans); - pboxBandStart = REGION_BOXPTR(prgnDst); + pboxBandStart = RegionBoxptr(prgnDst); pboxLast = pboxBandStart + numRects; NextBand(); diff --git a/dix/window.c b/dix/window.c index afb10fdbdd..a98437b43a 100644 --- a/dix/window.c +++ b/dix/window.c @@ -416,10 +416,10 @@ CreateRootWindow(ScreenPtr pScreen) box.y1 = 0; box.x2 = pScreen->width; box.y2 = pScreen->height; - REGION_INIT(pScreen, &pWin->clipList, &box, 1); - REGION_INIT(pScreen, &pWin->winSize, &box, 1); - REGION_INIT(pScreen, &pWin->borderSize, &box, 1); - REGION_INIT(pScreen, &pWin->borderClip, &box, 1); + RegionInit(&pWin->clipList, &box, 1); + RegionInit(&pWin->winSize, &box, 1); + RegionInit(&pWin->borderSize, &box, 1); + RegionInit(&pWin->borderClip, &box, 1); pWin->drawable.class = InputOutput; pWin->optional->visual = pScreen->rootVisual; @@ -499,7 +499,7 @@ ClippedRegionFromBox(WindowPtr pWin, RegionPtr Rgn, pScreen = pWin->drawable.pScreen; - box = *(REGION_EXTENTS(pScreen, &pWin->winSize)); + box = *(RegionExtents(&pWin->winSize)); /* we do these calculations to avoid overflows */ if (x > box.x1) box.x1 = x; @@ -515,8 +515,8 @@ ClippedRegionFromBox(WindowPtr pWin, RegionPtr Rgn, box.x2 = box.x1; if (box.y1 > box.y2) box.y2 = box.y1; - REGION_RESET(pScreen, Rgn, &box); - REGION_INTERSECT(pScreen, Rgn, Rgn, &pWin->winSize); + RegionReset(Rgn, &box); + RegionIntersect(Rgn, Rgn, &pWin->winSize); } static RealChildHeadProc realChildHeadProc = NULL; @@ -703,10 +703,10 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w, pWin->drawable.y = pParent->drawable.y + y + (int)bw; /* set up clip list correctly for unobscured WindowPtr */ - REGION_NULL(pScreen, &pWin->clipList); - REGION_NULL(pScreen, &pWin->borderClip); - REGION_NULL(pScreen, &pWin->winSize); - REGION_NULL(pScreen, &pWin->borderSize); + RegionNull(&pWin->clipList); + RegionNull(&pWin->borderClip); + RegionNull(&pWin->winSize); + RegionNull(&pWin->borderSize); pHead = RealChildHead(pParent); if (pHead) @@ -824,16 +824,16 @@ FreeWindowResources(WindowPtr pWin) DeleteWindowFromAnySaveSet(pWin); DeleteWindowFromAnySelections(pWin); DeleteWindowFromAnyEvents(pWin, TRUE); - REGION_UNINIT(pScreen, &pWin->clipList); - REGION_UNINIT(pScreen, &pWin->winSize); - REGION_UNINIT(pScreen, &pWin->borderClip); - REGION_UNINIT(pScreen, &pWin->borderSize); + RegionUninit(&pWin->clipList); + RegionUninit(&pWin->winSize); + RegionUninit(&pWin->borderClip); + RegionUninit(&pWin->borderSize); if (wBoundingShape (pWin)) - REGION_DESTROY(pScreen, wBoundingShape (pWin)); + RegionDestroy(wBoundingShape (pWin)); if (wClipShape (pWin)) - REGION_DESTROY(pScreen, wClipShape (pWin)); + RegionDestroy(wClipShape (pWin)); if (wInputShape (pWin)) - REGION_DESTROY(pScreen, wInputShape (pWin)); + RegionDestroy(wInputShape (pWin)); if (pWin->borderIsPixel == FALSE) (*pScreen->DestroyPixmap)(pWin->border.pixmap); if (pWin->backgroundState == BackgroundPixmap) @@ -1431,10 +1431,10 @@ PatchUp: { RegionRec exposed; - REGION_NULL(pScreen, &exposed); - REGION_SUBTRACT(pScreen, &exposed, &pWin->borderClip, &pWin->winSize); + RegionNull(&exposed); + RegionSubtract(&exposed, &pWin->borderClip, &pWin->winSize); miPaintWindow(pWin, &exposed, PW_BORDER); - REGION_UNINIT(pScreen, &exposed); + RegionUninit(&exposed); } return error; } @@ -1581,7 +1581,7 @@ SetWinSize (WindowPtr pWin) box.y1 = pWin->drawable.y; box.x2 = pWin->drawable.x + pWin->drawable.width; box.y2 = pWin->drawable.y + pWin->drawable.height; - REGION_RESET (pScreen, &pWin->winSize, &box); + RegionReset(&pWin->winSize, &box); } else #endif @@ -1593,15 +1593,15 @@ SetWinSize (WindowPtr pWin) ScreenPtr pScreen; pScreen = pWin->drawable.pScreen; - REGION_TRANSLATE(pScreen, &pWin->winSize, - pWin->drawable.x, + RegionTranslate(&pWin->winSize, - pWin->drawable.x, - pWin->drawable.y); if (wBoundingShape (pWin)) - REGION_INTERSECT(pScreen, &pWin->winSize, &pWin->winSize, + RegionIntersect(&pWin->winSize, &pWin->winSize, wBoundingShape (pWin)); if (wClipShape (pWin)) - REGION_INTERSECT(pScreen, &pWin->winSize, &pWin->winSize, + RegionIntersect(&pWin->winSize, &pWin->winSize, wClipShape (pWin)); - REGION_TRANSLATE(pScreen, &pWin->winSize, pWin->drawable.x, + RegionTranslate(&pWin->winSize, pWin->drawable.x, pWin->drawable.y); } } @@ -1626,7 +1626,7 @@ SetBorderSize (WindowPtr pWin) box.y1 = pWin->drawable.y - bw; box.x2 = pWin->drawable.x + pWin->drawable.width + bw; box.y2 = pWin->drawable.y + pWin->drawable.height + bw; - REGION_RESET (pScreen, &pWin->borderSize, &box); + RegionReset(&pWin->borderSize, &box); } else #endif @@ -1638,17 +1638,17 @@ SetBorderSize (WindowPtr pWin) ScreenPtr pScreen; pScreen = pWin->drawable.pScreen; - REGION_TRANSLATE(pScreen, &pWin->borderSize, - pWin->drawable.x, + RegionTranslate(&pWin->borderSize, - pWin->drawable.x, - pWin->drawable.y); - REGION_INTERSECT(pScreen, &pWin->borderSize, &pWin->borderSize, + RegionIntersect(&pWin->borderSize, &pWin->borderSize, wBoundingShape (pWin)); - REGION_TRANSLATE(pScreen, &pWin->borderSize, pWin->drawable.x, + RegionTranslate(&pWin->borderSize, pWin->drawable.x, pWin->drawable.y); - REGION_UNION(pScreen, &pWin->borderSize, &pWin->borderSize, + RegionUnion(&pWin->borderSize, &pWin->borderSize, &pWin->winSize); } } else { - REGION_COPY(pWin->drawable.pScreen, &pWin->borderSize, + RegionCopy(&pWin->borderSize, &pWin->winSize); } } @@ -1848,12 +1848,12 @@ MakeBoundingRegion ( ScreenPtr pScreen; pScreen = pWin->drawable.pScreen; - pRgn = REGION_CREATE(pScreen, pBox, 1); + pRgn = RegionCreate(pBox, 1); if (wBoundingShape (pWin)) { - REGION_TRANSLATE(pScreen, pRgn, -pWin->origin.x, + RegionTranslate(pRgn, -pWin->origin.x, -pWin->origin.y); - REGION_INTERSECT(pScreen, pRgn, pRgn, wBoundingShape (pWin)); - REGION_TRANSLATE(pScreen, pRgn, pWin->origin.x, + RegionIntersect(pRgn, pRgn, wBoundingShape (pWin)); + RegionTranslate(pRgn, pWin->origin.x, pWin->origin.y); } return pRgn; @@ -1875,10 +1875,10 @@ ShapeOverlap ( pScreen = pWin->drawable.pScreen; pWinRgn = MakeBoundingRegion (pWin, pWinBox); pSibRgn = MakeBoundingRegion (pSib, pSibBox); - REGION_INTERSECT(pScreen, pWinRgn, pWinRgn, pSibRgn); - ret = REGION_NOTEMPTY(pScreen, pWinRgn); - REGION_DESTROY(pScreen, pWinRgn); - REGION_DESTROY(pScreen, pSibRgn); + RegionIntersect(pWinRgn, pWinRgn, pSibRgn); + ret = RegionNotEmpty(pWinRgn); + RegionDestroy(pWinRgn); + RegionDestroy(pSibRgn); return ret; } @@ -2004,7 +2004,7 @@ WhereDoIGoInTheStack( else if (pSib) { if ((IsSiblingAboveMe(pWin, pSib) == Above) && - (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT)) + (RegionContainsRect(&pSib->borderSize, &box) != rgnOUT)) return(pFirst); else return(pWin->nextSib); @@ -2019,7 +2019,7 @@ WhereDoIGoInTheStack( else if (pSib) { if ((IsSiblingAboveMe(pWin, pSib) == Below) && - (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT)) + (RegionContainsRect(&pSib->borderSize, &box) != rgnOUT)) return NullWindow; else return(pWin->nextSib); @@ -2033,7 +2033,7 @@ WhereDoIGoInTheStack( return(pWin->nextSib); else if (pSib) { - if (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT) + if (RegionContainsRect(&pSib->borderSize, &box) != rgnOUT) { if (IsSiblingAboveMe(pWin, pSib) == Above) return(pFirst); @@ -2681,10 +2681,10 @@ MapWindow(WindowPtr pWin, ClientPtr client) (*pScreen->ClipNotify) (pWin, 0, 0); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree)(NullWindow, pWin, VTMap); - REGION_NULL(pScreen, &temp); - REGION_COPY(pScreen, &temp, &pWin->clipList); + RegionNull(&temp); + RegionCopy(&temp, &pWin->clipList); (*pScreen->WindowExposures) (pWin, &temp, NullRegion); - REGION_UNINIT(pScreen, &temp); + RegionUninit(&temp); } return(Success); @@ -3017,10 +3017,10 @@ PointInWindowIsVisible(WindowPtr pWin, int x, int y) if (!pWin->realized) return (FALSE); - if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderClip, + if (RegionContainsPoint(&pWin->borderClip, x, y, &box) && (!wInputShape(pWin) || - POINT_IN_REGION(pWin->drawable.pScreen, + RegionContainsPoint( wInputShape(pWin), x - pWin->drawable.x, y - pWin->drawable.y, &box))) @@ -3036,12 +3036,12 @@ NotClippedByChildren(WindowPtr pWin) RegionPtr pReg; pScreen = pWin->drawable.pScreen; - pReg = REGION_CREATE(pScreen, NullBox, 1); + pReg = RegionCreate(NullBox, 1); if (pWin->parent || screenIsSaved != SCREEN_SAVER_ON || !HasSaverWindow (pWin->drawable.pScreen)) { - REGION_INTERSECT(pScreen, pReg, &pWin->borderClip, &pWin->winSize); + RegionIntersect(pReg, &pWin->borderClip, &pWin->winSize); } return(pReg); } diff --git a/doc/xml/Xserver-spec.xml b/doc/xml/Xserver-spec.xml index 1bea20fd4d..88885aec34 100644 --- a/doc/xml/Xserver-spec.xml +++ b/doc/xml/Xserver-spec.xml @@ -2101,7 +2101,7 @@ Making direct calls is faster on many architectures. BoxPtr rect; int size; - macro: RegionPtr REGION_CREATE(pScreen, rect, size) + macro: RegionPtr RegionCreate(rect, size) RegionCreate creates a region that describes ONE rectangle. The @@ -2122,7 +2122,7 @@ applicable. BoxPtr rect; int size; - macro: REGION_INIT(pScreen, pRegion, rect, size) + macro: RegionInit(pRegion, rect, size) Given an existing raw region structure (such as an local variable), this @@ -2136,7 +2136,7 @@ allocation overhead for the region structure itself. Bool pScreen->RegionCopy(dstrgn, srcrgn) RegionPtr dstrgn, srcrgn; - macro: Bool REGION_COPY(pScreen, dstrgn, srcrgn) + macro: Bool RegionCopy(dstrgn, srcrgn) RegionCopy copies the description of one region, srcrgn, to another @@ -2148,7 +2148,7 @@ dstrgn; returning TRUE if the copy succeeded, and FALSE otherwise. void pScreen->RegionDestroy( pRegion) RegionPtr pRegion; - macro: REGION_DESTROY(pScreen, pRegion) + macro: RegionDestroy(pRegion) RegionDestroy destroys a region and frees all allocated memory. @@ -2158,7 +2158,7 @@ RegionDestroy destroys a region and frees all allocated memory. void pScreen->RegionUninit (pRegion) RegionPtr pRegion; - macro: REGION_UNINIT(pScreen, pRegion) + macro: RegionUninit(pRegion) Frees everything except the region structure itself, useful when the @@ -2171,23 +2171,23 @@ it has been RegionInit'ed again. Bool pScreen->Intersect(newReg, reg1, reg2) RegionPtr newReg, reg1, reg2; - macro: Bool REGION_INTERSECT(pScreen, newReg, reg1, reg2) + macro: Bool RegionIntersect(newReg, reg1, reg2) Bool pScreen->Union(newReg, reg1, reg2) RegionPtr newReg, reg1, reg2; - macro: Bool REGION_UNION(pScreen, newReg, reg1, reg2) + macro: Bool RegionUnion(newReg, reg1, reg2) Bool pScreen->Subtract(newReg, regMinuend, regSubtrahend) RegionPtr newReg, regMinuend, regSubtrahend; - macro: Bool REGION_UNION(pScreen, newReg, regMinuend, regSubtrahend) + macro: Bool RegionUnion(newReg, regMinuend, regSubtrahend) Bool pScreen->Inverse(newReg, pReg, pBox) RegionPtr newReg, pReg; BoxPtr pBox; - macro: Bool REGION_INVERSE(pScreen, newReg, pReg, pBox) + macro: Bool RegionInverse(newReg, pReg, pBox) The above four calls all do basic logical operations on regions. They @@ -2213,7 +2213,7 @@ Each routine must return the value TRUE for success. RegionPtr pRegion; BoxPtr pBox; - macro: REGION_RESET(pScreen, pRegion, pBox) + macro: RegionReset(pRegion, pBox) RegionReset sets the region to describe @@ -2225,7 +2225,7 @@ one rectangle and reallocates it to a size of one rectangle, if applicable. TranslateRegion simply moves a region +x in the x direction and +y in the y @@ -2237,7 +2237,7 @@ direction. RegionPtr pRegion; BoxPtr pBox; - macro: int RECT_IN_REGION(pScreen, pRegion, pBox) + macro: int RegionContainsRect(pRegion, pBox) RectIn returns one of the defined constants rgnIN, rgnOUT, or rgnPART, @@ -2252,7 +2252,7 @@ These constants are defined in Xserver/include/region.h. int x, y; BoxPtr pBox; - macro: Bool POINT_IN_REGION(pScreen, pRegion, x, y, pBox) + macro: Bool RegionContainsPoint(pRegion, x, y, pBox) PointInRegion returns true if the point x, y is in the region. In @@ -2275,7 +2275,7 @@ returned box. Bool pScreen->RegionNotEmpty(pRegion) RegionPtr pRegion; - macro: Bool REGION_NOTEMPTY(pScreen, pRegion) + macro: Bool RegionNotEmpty(pRegion) RegionNotEmpty is a boolean function that returns @@ -2286,7 +2286,7 @@ true or false depending upon whether the region encloses any pixels. void pScreen->RegionEmpty(pRegion) RegionPtr pRegion; - macro: REGION_EMPTY(pScreen, pRegion) + macro: RegionEmpty(pRegion) RegionEmpty sets the region to be empty. @@ -2296,7 +2296,7 @@ RegionEmpty sets the region to be empty. BoxPtr pScreen->RegionExtents(pRegion) RegionPtr pRegion; - macro: REGION_EXTENTS(pScreen, pRegion) + macro: RegionExtents(pRegion) RegionExtents returns a rectangle that is the smallest @@ -2310,13 +2310,13 @@ in your region struct. RegionPtr pDstRgn; RegionPtr pRegion; - macro: Bool REGION_APPEND(pScreen, pDstRgn, pRegion) + macro: Bool RegionAppend(pDstRgn, pRegion) Bool pScreen->RegionValidate (pRegion, pOverlap) RegionPtr pRegion; Bool *pOverlap; - macro: Bool REGION_VALIDATE(pScreen, pRegion, pOverlap) + macro: Bool RegionValidate(pRegion, pOverlap) These functions provide an optimization for clip list generation and @@ -2332,7 +2332,7 @@ regions overlap; FALSE otherwise. RegionPtr pScreen->BitmapToRegion (pPixmap) PixmapPtr pPixmap; - macro: RegionPtr BITMAP_TO_REGION(pScreen, pPixmap) + macro: RegionPtr BitmapToRegion(pScreen, pPixmap) Given a depth-1 pixmap, this routine must create a valid region which @@ -2346,7 +2346,7 @@ areas filled with 0's. This routine returns NULL if out of memory. xRectangle *pRects; int ordering; - macro: RegionPtr RECTS_TO_REGION(pScreen, nrects, pRects, ordering) + macro: RegionPtr RegionFromRects(nrects, pRects, ordering) Given a client-supplied list of rectangles, produces a region which includes diff --git a/exa/exa.c b/exa/exa.c index 46a850f8fc..4e1ffd699b 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -161,10 +161,10 @@ exaPixmapDirty (PixmapPtr pPix, int x1, int y1, int x2, int y2) if (box.x1 >= box.x2 || box.y1 >= box.y2) return; - REGION_INIT(pScreen, ®ion, &box, 1); + RegionInit(®ion, &box, 1); DamageRegionAppend(&pPix->drawable, ®ion); DamageRegionProcessPending(&pPix->drawable); - REGION_UNINIT(pScreen, ®ion); + RegionUninit(®ion); } static int @@ -658,7 +658,7 @@ exaBitmapToRegion(PixmapPtr pPix) exaPrepareAccess(&pPix->drawable, EXA_PREPARE_SRC); swap(pExaScr, pScreen, BitmapToRegion); - ret = pScreen->BitmapToRegion(pPix); + ret = (*pScreen->BitmapToRegion)(pPix); swap(pExaScr, pScreen, BitmapToRegion); exaFinishAccess(&pPix->drawable, EXA_PREPARE_SRC); diff --git a/exa/exa_accel.c b/exa/exa_accel.c index cf48ecd0dd..6c677c7a1c 100644 --- a/exa/exa_accel.c +++ b/exa/exa_accel.c @@ -81,7 +81,7 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, return; } - pextent = REGION_EXTENTS(pGC->pScreen, pClip); + pextent = RegionExtents(pClip); extentX1 = pextent->x1; extentY1 = pextent->y1; extentX2 = pextent->x2; @@ -106,7 +106,7 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, if (fullX1 >= fullX2) continue; - nbox = REGION_NUM_RECTS (pClip); + nbox = RegionNumRects (pClip); if (nbox == 1) { (*pExaScr->info->Solid) (pPixmap, @@ -115,7 +115,7 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n, } else { - pbox = REGION_RECTS(pClip); + pbox = RegionRects(pClip); while(nbox--) { if (pbox->y1 <= fullY1 && fullY1 < pbox->y2) @@ -192,8 +192,8 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y, y += pDrawable->y; pClip = fbGetCompositeClip(pGC); - for (nbox = REGION_NUM_RECTS(pClip), - pbox = REGION_RECTS(pClip); + for (nbox = RegionNumRects(pClip), + pbox = RegionRects(pClip); nbox--; pbox++) { @@ -416,15 +416,15 @@ exaHWCopyNtoN (DrawablePtr pSrcDrawable, else ordering = CT_UNSORTED; - srcregion = RECTS_TO_REGION(pScreen, nbox, rects, ordering); + srcregion = RegionFromRects(nbox, rects, ordering); free(rects); if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask, pGC->fillStyle, pGC->alu, pGC->clientClipType)) { - dstregion = REGION_CREATE(pScreen, NullBox, 0); - REGION_COPY(pScreen, dstregion, srcregion); - REGION_TRANSLATE(pScreen, dstregion, dst_off_x - dx - src_off_x, + dstregion = RegionCreate(NullBox, 0); + RegionCopy(dstregion, srcregion); + RegionTranslate(dstregion, dst_off_x - dx - src_off_x, dst_off_y - dy - src_off_y); } } @@ -551,12 +551,12 @@ fallback: out: if (dstregion) { - REGION_UNINIT(pScreen, dstregion); - REGION_DESTROY(pScreen, dstregion); + RegionUninit(dstregion); + RegionDestroy(dstregion); } if (srcregion) { - REGION_UNINIT(pScreen, srcregion); - REGION_DESTROY(pScreen, srcregion); + RegionUninit(srcregion); + RegionDestroy(srcregion); } return ret; @@ -788,13 +788,13 @@ exaPolyFillRect(DrawablePtr pDrawable, int xoff, yoff; int xorg, yorg; int n; - RegionPtr pReg = RECTS_TO_REGION(pScreen, nrect, prect, CT_UNSORTED); + RegionPtr pReg = RegionFromRects(nrect, prect, CT_UNSORTED); /* Compute intersection of rects and clip region */ - REGION_TRANSLATE(pScreen, pReg, pDrawable->x, pDrawable->y); - REGION_INTERSECT(pScreen, pReg, pClip, pReg); + RegionTranslate(pReg, pDrawable->x, pDrawable->y); + RegionIntersect(pReg, pClip, pReg); - if (!REGION_NUM_RECTS(pReg)) { + if (!RegionNumRects(pReg)) { goto out; } @@ -856,7 +856,7 @@ fallback: xorg = pDrawable->x; yorg = pDrawable->y; - pextent = REGION_EXTENTS(pGC->pScreen, pClip); + pextent = RegionExtents(pClip); extentX1 = pextent->x1; extentY1 = pextent->y1; extentX2 = pextent->x2; @@ -883,7 +883,7 @@ fallback: if ((fullX1 >= fullX2) || (fullY1 >= fullY2)) continue; - n = REGION_NUM_RECTS (pClip); + n = RegionNumRects (pClip); if (n == 1) { (*pExaScr->info->Solid) (pPixmap, @@ -892,7 +892,7 @@ fallback: } else { - pbox = REGION_RECTS(pClip); + pbox = RegionRects(pClip); /* * clip the rectangle to each box in the clip region * this is logically equivalent to calling Intersect(), @@ -927,8 +927,8 @@ fallback: exaMarkSync(pDrawable->pScreen); out: - REGION_UNINIT(pScreen, pReg); - REGION_DESTROY(pScreen, pReg); + RegionUninit(pReg); + RegionDestroy(pReg); } const GCOps exaOps = { @@ -964,14 +964,14 @@ exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; - REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); + RegionTranslate(prgnSrc, -dx, -dy); - REGION_INIT (pWin->drawable.pScreen, &rgnDst, NullBox, 0); + RegionInit(&rgnDst, NullBox, 0); - REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc); + RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); #ifdef COMPOSITE if (pPixmap->screen_x || pPixmap->screen_y) - REGION_TRANSLATE (pWin->drawable.pScreen, &rgnDst, + RegionTranslate(&rgnDst, -pPixmap->screen_x, -pPixmap->screen_y); #endif @@ -987,11 +987,11 @@ exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) pExaScr->fallback_flags &= ~EXA_ACCEL_COPYWINDOW; fallback: - REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); + RegionUninit(&rgnDst); if (pExaScr->fallback_flags & EXA_FALLBACK_COPYWINDOW) { pExaScr->fallback_flags &= ~EXA_FALLBACK_COPYWINDOW; - REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, dx, dy); + RegionTranslate(prgnSrc, dx, dy); ExaCheckCopyWindow(pWin, ptOldOrg, prgnSrc); } } @@ -1007,7 +1007,7 @@ exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel, Bool ret = FALSE; exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff); - REGION_TRANSLATE(pScreen, pRegion, xoff, yoff); + RegionTranslate(pRegion, xoff, yoff); if (pExaScr->fallback_counter || pExaPixmap->accel_blocked) goto out; @@ -1030,8 +1030,8 @@ exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel, int nbox; BoxPtr pBox; - nbox = REGION_NUM_RECTS (pRegion); - pBox = REGION_RECTS (pRegion); + nbox = RegionNumRects (pRegion); + pBox = RegionRects (pRegion); while (nbox--) { @@ -1060,18 +1060,18 @@ exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel, *(CARD8*)pExaPixmap->sys_ptr = pixel; } - REGION_UNION(pScreen, &pExaPixmap->validSys, &pExaPixmap->validSys, + RegionUnion(&pExaPixmap->validSys, &pExaPixmap->validSys, pRegion); - REGION_UNION(pScreen, &pExaPixmap->validFB, &pExaPixmap->validFB, + RegionUnion(&pExaPixmap->validFB, &pExaPixmap->validFB, pRegion); - REGION_SUBTRACT(pScreen, pending_damage, pending_damage, pRegion); + RegionSubtract(pending_damage, pending_damage, pRegion); } ret = TRUE; } out: - REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); + RegionTranslate(pRegion, -xoff, -yoff); return ret; } @@ -1090,8 +1090,8 @@ exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, ExaPixmapPrivPtr pTileExaPixmap = ExaGetPixmapPriv(pTile); int xoff, yoff; int tileWidth, tileHeight; - int nbox = REGION_NUM_RECTS (pRegion); - BoxPtr pBox = REGION_RECTS (pRegion); + int nbox = RegionNumRects (pRegion); + BoxPtr pBox = RegionRects (pRegion); Bool ret = FALSE; int i; @@ -1137,7 +1137,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, if ((*pExaScr->info->PrepareCopy) (pTile, pPixmap, 1, 1, alu, planemask)) { if (xoff || yoff) - REGION_TRANSLATE(pScreen, pRegion, xoff, yoff); + RegionTranslate(pRegion, xoff, yoff); for (i = 0; i < nbox; i++) { @@ -1245,7 +1245,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile, exaMarkSync(pDrawable->pScreen); if (xoff || yoff) - REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff); + RegionTranslate(pRegion, -xoff, -yoff); } return ret; diff --git a/exa/exa_classic.c b/exa/exa_classic.c index e1ead6c0d3..0b0ca4eb84 100644 --- a/exa/exa_classic.c +++ b/exa/exa_classic.c @@ -131,8 +131,8 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth, box.y1 = 0; box.x2 = w; box.y2 = h; - REGION_INIT(pScreen, &pExaPixmap->validSys, &box, 0); - REGION_INIT(pScreen, &pExaPixmap->validFB, &box, 0); + RegionInit(&pExaPixmap->validSys, &box, 0); + RegionInit(&pExaPixmap->validFB, &box, 0); exaSetAccelBlock(pExaScr, pExaPixmap, w, h, bpp); @@ -237,8 +237,8 @@ exaDestroyPixmap_classic (PixmapPtr pPixmap) pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr; pPixmap->devKind = pExaPixmap->sys_pitch; } - REGION_UNINIT(pPixmap->drawable.pScreen, &pExaPixmap->validSys); - REGION_UNINIT(pPixmap->drawable.pScreen, &pExaPixmap->validFB); + RegionUninit(&pExaPixmap->validSys); + RegionUninit(&pExaPixmap->validFB); } swap(pExaScr, pScreen, DestroyPixmap); diff --git a/exa/exa_migration_classic.c b/exa/exa_migration_classic.c index 871679ffc6..6c49fb798c 100644 --- a/exa/exa_migration_classic.c +++ b/exa/exa_migration_classic.c @@ -78,8 +78,8 @@ exaPixmapIsDirty (PixmapPtr pPix) if (!pExaPixmap->pDamage) return FALSE; - return REGION_NOTEMPTY (pScreen, DamageRegion(pExaPixmap->pDamage)) || - !REGION_EQUAL(pScreen, &pExaPixmap->validSys, &pExaPixmap->validFB); + return RegionNotEmpty(DamageRegion(pExaPixmap->pDamage)) || + !RegionEqual(&pExaPixmap->validSys, &pExaPixmap->validFB); } /** @@ -123,22 +123,22 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc, /* Damaged bits are valid in current copy but invalid in other one */ if (pExaPixmap->use_gpu_copy) { - REGION_UNION(pScreen, &pExaPixmap->validFB, &pExaPixmap->validFB, + RegionUnion(&pExaPixmap->validFB, &pExaPixmap->validFB, damage); - REGION_SUBTRACT(pScreen, &pExaPixmap->validSys, &pExaPixmap->validSys, + RegionSubtract(&pExaPixmap->validSys, &pExaPixmap->validSys, damage); } else { - REGION_UNION(pScreen, &pExaPixmap->validSys, &pExaPixmap->validSys, + RegionUnion(&pExaPixmap->validSys, &pExaPixmap->validSys, damage); - REGION_SUBTRACT(pScreen, &pExaPixmap->validFB, &pExaPixmap->validFB, + RegionSubtract(&pExaPixmap->validFB, &pExaPixmap->validFB, damage); } - REGION_EMPTY(pScreen, damage); + RegionEmpty(damage); /* Copy bits valid in source but not in destination */ - REGION_NULL(pScreen, &CopyReg); - REGION_SUBTRACT(pScreen, &CopyReg, pValidSrc, pValidDst); + RegionNull(&CopyReg); + RegionSubtract(&CopyReg, pValidSrc, pValidDst); if (migrate->as_dst) { ExaScreenPriv (pPixmap->drawable.pScreen); @@ -153,7 +153,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc, RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage); #if DEBUG_MIGRATE - if (REGION_NIL(pending_damage)) { + if (RegionNil(pending_damage)) { static Bool firsttime = TRUE; if (firsttime) { @@ -167,23 +167,23 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc, * rects by filling it up to the extents of the union of the * destination valid region and the pending damage region. */ - if (REGION_NUM_RECTS(pValidDst) > 10) { + if (RegionNumRects(pValidDst) > 10) { BoxRec box; BoxPtr pValidExt, pDamageExt; RegionRec closure; - pValidExt = REGION_EXTENTS(pScreen, pValidDst); - pDamageExt = REGION_EXTENTS(pScreen, pending_damage); + pValidExt = RegionExtents(pValidDst); + pDamageExt = RegionExtents(pending_damage); box.x1 = min(pValidExt->x1, pDamageExt->x1); box.y1 = min(pValidExt->y1, pDamageExt->y1); box.x2 = max(pValidExt->x2, pDamageExt->x2); box.y2 = max(pValidExt->y2, pDamageExt->y2); - REGION_INIT(pScreen, &closure, &box, 0); - REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, &closure); + RegionInit(&closure, &box, 0); + RegionIntersect(&CopyReg, &CopyReg, &closure); } else - REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, pending_damage); + RegionIntersect(&CopyReg, &CopyReg, pending_damage); } /* The caller may provide a region to be subtracted from the calculated @@ -191,17 +191,17 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc, * contribute to the result of the operation. */ if (migrate->pReg) - REGION_SUBTRACT(pScreen, &CopyReg, &CopyReg, migrate->pReg); + RegionSubtract(&CopyReg, &CopyReg, migrate->pReg); } else { /* The caller may restrict the region to be migrated for source pixmaps * to what's relevant for the operation. */ if (migrate->pReg) - REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, migrate->pReg); + RegionIntersect(&CopyReg, &CopyReg, migrate->pReg); } - pBox = REGION_RECTS(&CopyReg); - nbox = REGION_NUM_RECTS(&CopyReg); + pBox = RegionRects(&CopyReg); + nbox = RegionNumRects(&CopyReg); save_use_gpu_copy = pExaPixmap->use_gpu_copy; save_pitch = pPixmap->devKind; @@ -252,13 +252,13 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc, * removing parts of it which are also in the destination valid region. * Removing anything beyond that would lead to data loss. */ - if (REGION_NUM_RECTS(pValidSrc) > 20) - REGION_SUBTRACT(pScreen, pValidSrc, pValidSrc, pValidDst); + if (RegionNumRects(pValidSrc) > 20) + RegionSubtract(pValidSrc, pValidSrc, pValidDst); /* The copied bits are now valid in destination */ - REGION_UNION(pScreen, pValidDst, pValidDst, &CopyReg); + RegionUnion(pValidDst, pValidDst, &CopyReg); - REGION_UNINIT(pScreen, &CopyReg); + RegionUninit(&CopyReg); if (access_prepared) exaFinishAccess(&pPixmap->drawable, fallback_index); @@ -440,7 +440,7 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area) /* Mark all FB bits as invalid, so all valid system bits get copied to FB * next time */ - REGION_EMPTY(pPixmap->drawable.pScreen, &pExaPixmap->validFB); + RegionEmpty(&pExaPixmap->validFB); } /** @@ -531,15 +531,15 @@ exaAssertNotDirty (PixmapPtr pPixmap) if (exaPixmapIsPinned(pPixmap) || pExaPixmap->area == NULL) return ret; - REGION_NULL(pScreen, &ValidReg); - REGION_INTERSECT(pScreen, &ValidReg, &pExaPixmap->validFB, + RegionNull(&ValidReg); + RegionIntersect(&ValidReg, &pExaPixmap->validFB, &pExaPixmap->validSys); - nbox = REGION_NUM_RECTS(&ValidReg); + nbox = RegionNumRects(&ValidReg); if (!nbox) goto out; - pBox = REGION_RECTS(&ValidReg); + pBox = RegionRects(&ValidReg); dst_pitch = pExaPixmap->sys_pitch; src_pitch = pExaPixmap->fb_pitch; @@ -586,7 +586,7 @@ skip: pPixmap->devKind = save_pitch; out: - REGION_UNINIT(pScreen, &ValidReg); + RegionUninit(&ValidReg); return ret; } diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c index 49e04f22ac..89cb137e42 100644 --- a/exa/exa_mixed.c +++ b/exa/exa_mixed.c @@ -180,7 +180,7 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth, exaSetAccelBlock(pExaScr, pExaPixmap, width, height, bitsPerPixel); - REGION_EMPTY(pScreen, &pExaPixmap->validFB); + RegionEmpty(&pExaPixmap->validFB); } /* Need to re-create system copy if there's also a GPU copy */ @@ -192,7 +192,7 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth, DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage); DamageDestroy(pExaPixmap->pDamage); pExaPixmap->pDamage = NULL; - REGION_EMPTY(pScreen, &pExaPixmap->validSys); + RegionEmpty(&pExaPixmap->validSys); if (pExaScr->deferred_mixed_pixmap == pPixmap) pExaScr->deferred_mixed_pixmap = NULL; diff --git a/exa/exa_render.c b/exa/exa_render.c index b7f383f384..6f2af8a8f5 100644 --- a/exa/exa_render.c +++ b/exa/exa_render.c @@ -292,7 +292,7 @@ exaTryDriverSolidFill(PicturePtr pSrc, exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y); - REGION_TRANSLATE(pScreen, ®ion, dst_off_x, dst_off_y); + RegionTranslate(®ion, dst_off_x, dst_off_y); if (pSrc->pDrawable) { pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable); @@ -305,7 +305,7 @@ exaTryDriverSolidFill(PicturePtr pSrc, !exaGetPixelFromRGBA(&pixel, red, green, blue, alpha, pDst->pFormat)) { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); + RegionUninit(®ion); return -1; } @@ -320,18 +320,18 @@ exaTryDriverSolidFill(PicturePtr pSrc, } if (!exaPixmapHasGpuCopy(pDstPix)) { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); + RegionUninit(®ion); return 0; } if (!(*pExaScr->info->PrepareSolid) (pDstPix, GXcopy, 0xffffffff, pixel)) { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); + RegionUninit(®ion); return -1; } - nbox = REGION_NUM_RECTS(®ion); - pbox = REGION_RECTS(®ion); + nbox = RegionNumRects(®ion); + pbox = RegionRects(®ion); while (nbox--) { @@ -342,7 +342,7 @@ exaTryDriverSolidFill(PicturePtr pSrc, (*pExaScr->info->DoneSolid) (pDstPix); exaMarkSync(pDst->pDrawable->pScreen); - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); + RegionUninit(®ion); return 1; } @@ -469,10 +469,10 @@ exaTryDriverCompositeRects(CARD8 op, rects->width, rects->height)) goto next_rect; - REGION_TRANSLATE(pScreen, ®ion, dst_off_x, dst_off_y); + RegionTranslate(®ion, dst_off_x, dst_off_y); - nbox = REGION_NUM_RECTS(®ion); - pbox = REGION_RECTS(®ion); + nbox = RegionNumRects(®ion); + pbox = RegionRects(®ion); xMask = xMask + mask_off_x - xDst - dst_off_x; yMask = yMask + mask_off_y - yDst - dst_off_y; @@ -494,7 +494,7 @@ exaTryDriverCompositeRects(CARD8 op, } next_rect: - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); + RegionUninit(®ion); rects++; } @@ -575,11 +575,11 @@ exaCompositeRects(CARD8 op, * (see use of DamagePendingRegion in exaCopyDirty) */ - REGION_INIT(pScreen, ®ion, &box, 1); + RegionInit(®ion, &box, 1); DamageRegionAppend(pDst->pDrawable, ®ion); - REGION_UNINIT(pScreen, ®ion); + RegionUninit(®ion); } /************************************************************/ @@ -703,7 +703,7 @@ exaTryDriverComposite(CARD8 op, exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y); - REGION_TRANSLATE(pScreen, ®ion, dst_off_x, dst_off_y); + RegionTranslate(®ion, dst_off_x, dst_off_y); if (pExaScr->do_migration) { ExaMigrationRec pixmaps[3]; @@ -737,7 +737,7 @@ exaTryDriverComposite(CARD8 op, if (pSrcPix) { pSrcPix = exaGetOffscreenPixmap (pSrc->pDrawable, &src_off_x, &src_off_y); if (!pSrcPix) { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); + RegionUninit(®ion); return 0; } } @@ -746,25 +746,25 @@ exaTryDriverComposite(CARD8 op, pMaskPix = exaGetOffscreenPixmap (pMask->pDrawable, &mask_off_x, &mask_off_y); if (!pMaskPix) { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); + RegionUninit(®ion); return 0; } } if (!exaPixmapHasGpuCopy(pDstPix)) { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); + RegionUninit(®ion); return 0; } if (!(*pExaScr->info->PrepareComposite) (op, pSrc, pMask, pDst, pSrcPix, pMaskPix, pDstPix)) { - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); + RegionUninit(®ion); return -1; } - nbox = REGION_NUM_RECTS(®ion); - pbox = REGION_RECTS(®ion); + nbox = RegionNumRects(®ion); + pbox = RegionRects(®ion); xMask = xMask + mask_off_x - xDst - dst_off_x; yMask = yMask + mask_off_y - yDst - dst_off_y; @@ -788,7 +788,7 @@ exaTryDriverComposite(CARD8 op, (*pExaScr->info->DoneComposite) (pDstPix); exaMarkSync(pDst->pDrawable->pScreen); - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); + RegionUninit(®ion); return 1; } @@ -953,9 +953,9 @@ exaComposite(CARD8 op, goto done; ret = exaHWCopyNtoN(pSrc->pDrawable, pDst->pDrawable, NULL, - REGION_RECTS(®ion), REGION_NUM_RECTS(®ion), + RegionRects(®ion), RegionNumRects(®ion), xSrc - xDst, ySrc - yDst, FALSE, FALSE); - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); + RegionUninit(®ion); /* Reset values to their original values. */ xDst -= pDst->pDrawable->x; @@ -1005,7 +1005,7 @@ exaComposite(CARD8 op, (PixmapPtr)pSrc->pDrawable, &patOrg, FB_ALLONES, GXcopy, CT_NONE); - REGION_UNINIT(pDst->pDrawable->pScreen, ®ion); + RegionUninit(®ion); if (ret) goto done; diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c index 402d76db97..a078cc1140 100644 --- a/exa/exa_unaccel.c +++ b/exa/exa_unaccel.c @@ -131,10 +131,10 @@ ExaCheckCopyNtoN (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, PixmapPtr pPixmap = exaGetDrawablePixmap(pSrc); exaGetDrawableDeltas(pSrc, pPixmap, &xoff, &yoff); - REGION_INIT(pScreen, ®, pbox, nbox); - REGION_TRANSLATE(pScreen, ®, xoff + dx, yoff + dy); + RegionInit(®, pbox, nbox); + RegionTranslate(®, xoff + dx, yoff + dy); pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_SRC, ®); - REGION_UNINIT(pScreen, ®); + RegionUninit(®); } else exaPrepareAccess (pSrc, EXA_PREPARE_SRC); @@ -144,10 +144,10 @@ ExaCheckCopyNtoN (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, PixmapPtr pPixmap = exaGetDrawablePixmap(pDst); exaGetDrawableDeltas(pSrc, pPixmap, &xoff, &yoff); - REGION_INIT(pScreen, ®, pbox, nbox); - REGION_TRANSLATE(pScreen, ®, xoff, yoff); + RegionInit(®, pbox, nbox); + RegionTranslate(®, xoff, yoff); pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_DEST, ®); - REGION_UNINIT(pScreen, ®); + RegionUninit(®); } else exaPrepareAccess (pDst, EXA_PREPARE_DEST); @@ -188,9 +188,9 @@ ExaFallbackPrepareReg(DrawablePtr pDrawable, box.x2 = box.x1 + width; box.y2 = box.y1 + height; - REGION_INIT(pScreen, ®, &box, 1); + RegionInit(®, &box, 1); pExaScr->prepare_access_reg(pPixmap, index, ®); - REGION_UNINIT(pScreen, ®); + RegionUninit(®); } else exaPrepareAccess(pDrawable, index); } @@ -382,9 +382,9 @@ ExaCheckCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) int xoff, yoff; exaGetDrawableDeltas(&pWin->drawable, pPixmap, &xoff, &yoff); - REGION_TRANSLATE(pScreen, prgnSrc, xoff, yoff); + RegionTranslate(prgnSrc, xoff, yoff); pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_SRC, prgnSrc); - REGION_TRANSLATE(pScreen, prgnSrc, -xoff, -yoff); + RegionTranslate(prgnSrc, -xoff, -yoff); } else exaPrepareAccess(pDrawable, EXA_PREPARE_SRC); @@ -458,9 +458,9 @@ ExaSrcValidate(DrawablePtr pDrawable, dst = (pExaScr->srcPix == pPix) ? &pExaScr->srcReg : &pExaScr->maskReg; - REGION_INIT(pScreen, ®, &box, 1); - REGION_UNION(pScreen, dst, dst, ®); - REGION_UNINIT(pScreen, ®); + RegionInit(®, &box, 1); + RegionUnion(dst, dst, ®); + RegionUninit(®); if (pExaScr->SavedSourceValidate) { swap(pExaScr, pScreen, SourceValidate); @@ -495,30 +495,30 @@ ExaPrepareCompositeReg(ScreenPtr pScreen, Bool ret; - REGION_NULL(pScreen, ®ion); + RegionNull(®ion); if (pSrc->pDrawable) { pSrcPix = exaGetDrawablePixmap(pSrc->pDrawable); - REGION_NULL(pScreen, &pExaScr->srcReg); + RegionNull(&pExaScr->srcReg); srcReg = &pExaScr->srcReg; pExaScr->srcPix = pSrcPix; if (pSrc != pDst) - REGION_TRANSLATE(pScreen, pSrc->pCompositeClip, + RegionTranslate(pSrc->pCompositeClip, -pSrc->pDrawable->x, -pSrc->pDrawable->y); } if (pMask && pMask->pDrawable) { pMaskPix = exaGetDrawablePixmap(pMask->pDrawable); - REGION_NULL(pScreen, &pExaScr->maskReg); + RegionNull(&pExaScr->maskReg); maskReg = &pExaScr->maskReg; if (pMask != pDst && pMask != pSrc) - REGION_TRANSLATE(pScreen, pMask->pCompositeClip, + RegionTranslate(pMask->pCompositeClip, -pMask->pDrawable->x, -pMask->pDrawable->y); } - REGION_TRANSLATE(pScreen, pDst->pCompositeClip, + RegionTranslate(pDst->pCompositeClip, -pDst->pDrawable->x, -pDst->pDrawable->y); @@ -531,23 +531,23 @@ ExaPrepareCompositeReg(ScreenPtr pScreen, width, height); swap(pExaScr, pScreen, SourceValidate); - REGION_TRANSLATE(pScreen, pDst->pCompositeClip, + RegionTranslate(pDst->pCompositeClip, pDst->pDrawable->x, pDst->pDrawable->y); if (pSrc->pDrawable && pSrc != pDst) - REGION_TRANSLATE(pScreen, pSrc->pCompositeClip, + RegionTranslate(pSrc->pCompositeClip, pSrc->pDrawable->x, pSrc->pDrawable->y); if (pMask && pMask->pDrawable && pMask != pDst && pMask != pSrc) - REGION_TRANSLATE(pScreen, pMask->pCompositeClip, + RegionTranslate(pMask->pCompositeClip, pMask->pDrawable->x, pMask->pDrawable->y); if (!ret) { if (srcReg) - REGION_UNINIT(pScreen, srcReg); + RegionUninit(srcReg); if (maskReg) - REGION_UNINIT(pScreen, maskReg); + RegionUninit(maskReg); return FALSE; } @@ -577,9 +577,9 @@ ExaPrepareCompositeReg(ScreenPtr pScreen, maskReg); if (srcReg) - REGION_UNINIT(pScreen, srcReg); + RegionUninit(srcReg); if (maskReg) - REGION_UNINIT(pScreen, maskReg); + RegionUninit(maskReg); pDstPix = exaGetDrawablePixmap(pDst->pDrawable); if (!exaOpReadsDestination(op)) { @@ -587,7 +587,7 @@ ExaPrepareCompositeReg(ScreenPtr pScreen, int yoff; exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &xoff, &yoff); - REGION_TRANSLATE(pScreen, ®ion, pDst->pDrawable->x + xoff, + RegionTranslate(®ion, pDst->pDrawable->x + xoff, pDst->pDrawable->y + yoff); dstReg = ®ion; } @@ -598,7 +598,7 @@ ExaPrepareCompositeReg(ScreenPtr pScreen, dstReg); pExaScr->prepare_access_reg(pDstPix, EXA_PREPARE_DEST, dstReg); - REGION_UNINIT(pScreen, ®ion); + RegionUninit(®ion); return TRUE; } diff --git a/fb/fb.h b/fb/fb.h index e2222a5c76..7ab4adf697 100644 --- a/fb/fb.h +++ b/fb/fb.h @@ -739,7 +739,7 @@ typedef struct { */ #define fbWindowEnabled(pWin) \ - REGION_NOTEMPTY((pWin)->drawable.pScreen, \ + RegionNotEmpty(\ &(pWin)->drawable.pScreen->root->borderClip) #define fbDrawableEnabled(pDrawable) \ diff --git a/fb/fb24_32.c b/fb/fb24_32.c index 1ebd598a86..2e600edc0d 100644 --- a/fb/fb24_32.c +++ b/fb/fb24_32.c @@ -335,8 +335,8 @@ fb24_32SetSpans (DrawablePtr pDrawable, { d = dst + (ppt->y + dstYoff) * dstStride; s = (CARD8 *) src; - n = REGION_NUM_RECTS(pClip); - pbox = REGION_RECTS (pClip); + n = RegionNumRects(pClip); + pbox = RegionRects (pClip); while (n--) { if (pbox->y1 > ppt->y) @@ -399,8 +399,8 @@ fb24_32PutZImage (DrawablePtr pDrawable, dstStride *= sizeof(FbBits); dst = (CARD8 *) dstBits; - for (nbox = REGION_NUM_RECTS (pClip), - pbox = REGION_RECTS(pClip); + for (nbox = RegionNumRects (pClip), + pbox = RegionRects(pClip); nbox--; pbox++) { diff --git a/fb/fbarc.c b/fb/fbarc.c index 3a8a2c56a8..33e44b0c6b 100644 --- a/fb/fbarc.c +++ b/fb/fbarc.c @@ -102,7 +102,7 @@ fbPolyArc (DrawablePtr pDrawable, y2 = box.y1 + (int)parcs->height + 1; box.y2 = y2; if ( (x2 <= SHRT_MAX) && (y2 <= SHRT_MAX) && - (RECT_IN_REGION(pDrawable->pScreen, cclip, &box) == rgnIN) ) { + (RegionContainsRect(cclip, &box) == rgnIN) ) { #ifdef FB_ACCESS_WRAPPER if (!wrapped) { fbPrepareAccess (pDrawable); diff --git a/fb/fbbits.h b/fb/fbbits.h index 44991f1068..8bf1a0290d 100644 --- a/fb/fbbits.h +++ b/fb/fbbits.h @@ -670,7 +670,7 @@ POLYLINE (DrawablePtr pDrawable, int xoff = pDrawable->x; int yoff = pDrawable->y; unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); - BoxPtr pBox = REGION_EXTENTS (pDrawable->pScreen, fbGetCompositeClip (pGC)); + BoxPtr pBox = RegionExtents(fbGetCompositeClip (pGC)); FbBits *dst; int dstStride; @@ -807,7 +807,7 @@ POLYSEGMENT (DrawablePtr pDrawable, int xoff = pDrawable->x; int yoff = pDrawable->y; unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); - BoxPtr pBox = REGION_EXTENTS (pDrawable->pScreen, fbGetCompositeClip (pGC)); + BoxPtr pBox = RegionExtents(fbGetCompositeClip (pGC)); FbBits *dst; int dstStride; diff --git a/fb/fbfill.c b/fb/fbfill.c index 831b1ce76d..801a0d0a95 100644 --- a/fb/fbfill.c +++ b/fb/fbfill.c @@ -185,7 +185,7 @@ fbSolidBoxClipped (DrawablePtr pDrawable, fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); - for (nbox = REGION_NUM_RECTS(pClip), pbox = REGION_RECTS(pClip); + for (nbox = RegionNumRects(pClip), pbox = RegionRects(pClip); nbox--; pbox++) { diff --git a/fb/fbfillrect.c b/fb/fbfillrect.c index 4e4edb3fd5..7fc03f9a5f 100644 --- a/fb/fbfillrect.c +++ b/fb/fbfillrect.c @@ -44,7 +44,7 @@ fbPolyFillRect(DrawablePtr pDrawable, xorg = pDrawable->x; yorg = pDrawable->y; - pextent = REGION_EXTENTS(pGC->pScreen, pClip); + pextent = RegionExtents(pClip); extentX1 = pextent->x1; extentY1 = pextent->y1; extentX2 = pextent->x2; @@ -71,7 +71,7 @@ fbPolyFillRect(DrawablePtr pDrawable, if ((fullX1 >= fullX2) || (fullY1 >= fullY2)) continue; - n = REGION_NUM_RECTS (pClip); + n = RegionNumRects (pClip); if (n == 1) { fbFill (pDrawable, @@ -80,7 +80,7 @@ fbPolyFillRect(DrawablePtr pDrawable, } else { - pbox = REGION_RECTS(pClip); + pbox = RegionRects(pClip); /* * clip the rectangle to each box in the clip region * this is logically equivalent to calling Intersect() diff --git a/fb/fbfillsp.c b/fb/fbfillsp.c index 5d21472135..194bfc88b5 100644 --- a/fb/fbfillsp.c +++ b/fb/fbfillsp.c @@ -41,7 +41,7 @@ fbFillSpans (DrawablePtr pDrawable, int fullX1, fullX2, fullY1; int partX1, partX2; - pextent = REGION_EXTENTS(pGC->pScreen, pClip); + pextent = RegionExtents(pClip); extentX1 = pextent->x1; extentY1 = pextent->y1; extentX2 = pextent->x2; @@ -66,7 +66,7 @@ fbFillSpans (DrawablePtr pDrawable, if (fullX1 >= fullX2) continue; - nbox = REGION_NUM_RECTS (pClip); + nbox = RegionNumRects (pClip); if (nbox == 1) { fbFill (pDrawable, @@ -75,7 +75,7 @@ fbFillSpans (DrawablePtr pDrawable, } else { - pbox = REGION_RECTS(pClip); + pbox = RegionRects(pClip); while(nbox--) { if (pbox->y1 <= fullY1 && fullY1 < pbox->y2) diff --git a/fb/fbgc.c b/fb/fbgc.c index fda391b14b..e3e923675b 100644 --- a/fb/fbgc.c +++ b/fb/fbgc.c @@ -213,7 +213,7 @@ fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) ) { miComputeCompositeClip (pGC, pDrawable); - pPriv->oneRect = REGION_NUM_RECTS(fbGetCompositeClip(pGC)) == 1; + pPriv->oneRect = RegionNumRects(fbGetCompositeClip(pGC)) == 1; } #ifdef FB_24_32BIT diff --git a/fb/fbglyph.c b/fb/fbglyph.c index 2c19b742fa..44fe80fc96 100644 --- a/fb/fbglyph.c +++ b/fb/fbglyph.c @@ -39,7 +39,7 @@ fbGlyphIn (RegionPtr pRegion, int height) { BoxRec box; - BoxPtr pExtents = REGION_EXTENTS (dummyScreen, pRegion); + BoxPtr pExtents = RegionExtents(pRegion); /* * Check extents by hand to avoid 16 bit overflows @@ -56,7 +56,7 @@ fbGlyphIn (RegionPtr pRegion, box.x2 = x + width; box.y1 = y; box.y2 = y + height; - return RECT_IN_REGION (dummyScreen, pRegion, &box) == rgnIN; + return RegionContainsRect(pRegion, &box) == rgnIN; } #ifdef FB_24BIT diff --git a/fb/fbimage.c b/fb/fbimage.c index 2b9ac27c08..da1e8bcc4b 100644 --- a/fb/fbimage.c +++ b/fb/fbimage.c @@ -134,8 +134,8 @@ fbPutZImage (DrawablePtr pDrawable, fbGetStipDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff); - for (nbox = REGION_NUM_RECTS (pClip), - pbox = REGION_RECTS(pClip); + for (nbox = RegionNumRects (pClip), + pbox = RegionRects(pClip); nbox--; pbox++) { @@ -224,8 +224,8 @@ fbPutXYImage (DrawablePtr pDrawable, } } - for (nbox = REGION_NUM_RECTS (pClip), - pbox = REGION_RECTS(pClip); + for (nbox = RegionNumRects (pClip), + pbox = RegionRects(pClip); nbox--; pbox++) { diff --git a/fb/fbline.c b/fb/fbline.c index 2cee123ae0..fa80573e2d 100644 --- a/fb/fbline.c +++ b/fb/fbline.c @@ -117,7 +117,7 @@ fbPolyLine (DrawablePtr pDrawable, #ifndef FBNOPIXADDR if (pGC->fillStyle == FillSolid && pGC->lineStyle == LineSolid && - REGION_NUM_RECTS (fbGetCompositeClip(pGC)) == 1) + RegionNumRects (fbGetCompositeClip(pGC)) == 1) { switch (pDrawable->bitsPerPixel) { case 8: line = fbPolyline8; break; @@ -154,7 +154,7 @@ fbPolySegment (DrawablePtr pDrawable, #ifndef FBNOPIXADDR if (pGC->fillStyle == FillSolid && pGC->lineStyle == LineSolid && - REGION_NUM_RECTS (fbGetCompositeClip(pGC)) == 1) + RegionNumRects (fbGetCompositeClip(pGC)) == 1) { switch (pDrawable->bitsPerPixel) { case 8: seg = fbPolySegment8; break; diff --git a/fb/fboverlay.c b/fb/fboverlay.c index 3eb1b032d5..392e27f394 100644 --- a/fb/fboverlay.c +++ b/fb/fboverlay.c @@ -75,7 +75,7 @@ fbOverlayCreateWindow(WindowPtr pWin) */ if (!pWin->parent) { - REGION_EMPTY (pWin->drawable.pScreen, + RegionEmpty( &pScrPriv->layer[i].u.run.region); } return TRUE; @@ -93,7 +93,7 @@ fbOverlayCloseScreen (int iScreen, ScreenPtr pScreen) for (i = 0; i < pScrPriv->nlayers; i++) { (*pScreen->DestroyPixmap)(pScrPriv->layer[i].u.run.pixmap); - REGION_UNINIT (pScreen, &pScrPriv->layer[i].u.run.region); + RegionUninit(&pScrPriv->layer[i].u.run.region); } return TRUE; } @@ -147,7 +147,7 @@ fbOverlayCreateScreenResources(ScreenPtr pScreen) pbits)) return FALSE; pScrPriv->layer[i].u.run.pixmap = pPixmap; - REGION_INIT(pScreen, &pScrPriv->layer[i].u.run.region, &box, 0); + RegionInit(&pScrPriv->layer[i].u.run.region, &box, 0); } pScreen->devPrivate = pScrPriv->layer[0].u.run.pixmap; return TRUE; @@ -175,24 +175,24 @@ fbOverlayUpdateLayerRegion (ScreenPtr pScreen, int i; RegionRec rgnNew; - if (!prgn || !REGION_NOTEMPTY(pScreen, prgn)) + if (!prgn || !RegionNotEmpty(prgn)) return; for (i = 0; i < pScrPriv->nlayers; i++) { if (i == layer) { /* add new piece to this fb */ - REGION_UNION (pScreen, + RegionUnion( &pScrPriv->layer[i].u.run.region, &pScrPriv->layer[i].u.run.region, prgn); } - else if (REGION_NOTEMPTY (pScreen, + else if (RegionNotEmpty( &pScrPriv->layer[i].u.run.region)) { /* paint new piece with chroma key */ - REGION_NULL (pScreen, &rgnNew); - REGION_INTERSECT (pScreen, + RegionNull(&rgnNew); + RegionIntersect( &rgnNew, prgn, &pScrPriv->layer[i].u.run.region); @@ -200,9 +200,9 @@ fbOverlayUpdateLayerRegion (ScreenPtr pScreen, &rgnNew, pScrPriv->layer[i].key, i); - REGION_UNINIT(pScreen, &rgnNew); + RegionUninit(&rgnNew); /* remove piece from other fbs */ - REGION_SUBTRACT (pScreen, + RegionSubtract( &pScrPriv->layer[i].u.run.region, &pScrPriv->layer[i].u.run.region, prgn); @@ -232,21 +232,21 @@ fbOverlayCopyWindow(WindowPtr pWin, /* * Clip to existing bits */ - REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy); - REGION_NULL (pScreen, &rgnDst); - REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc); - REGION_TRANSLATE(pScreen, &rgnDst, dx, dy); + RegionTranslate(prgnSrc, -dx, -dy); + RegionNull(&rgnDst); + RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); + RegionTranslate(&rgnDst, dx, dy); /* * Compute the portion of each fb affected by this copy */ for (i = 0; i < pScrPriv->nlayers; i++) { - REGION_NULL (pScreen, &layerRgn[i]); - REGION_INTERSECT(pScreen, &layerRgn[i], &rgnDst, + RegionNull(&layerRgn[i]); + RegionIntersect(&layerRgn[i], &rgnDst, &pScrPriv->layer[i].u.run.region); - if (REGION_NOTEMPTY (pScreen, &layerRgn[i])) + if (RegionNotEmpty(&layerRgn[i])) { - REGION_TRANSLATE(pScreen, &layerRgn[i], -dx, -dy); + RegionTranslate(&layerRgn[i], -dx, -dy); pPixmap = pScrPriv->layer[i].u.run.pixmap; miCopyRegion (&pPixmap->drawable, &pPixmap->drawable, 0, @@ -259,12 +259,12 @@ fbOverlayCopyWindow(WindowPtr pWin, */ for (i = 0; i < pScrPriv->nlayers; i++) { - if (REGION_NOTEMPTY (pScreen, &layerRgn[i])) + if (RegionNotEmpty(&layerRgn[i])) fbOverlayUpdateLayerRegion (pScreen, i, &layerRgn[i]); - REGION_UNINIT(pScreen, &layerRgn[i]); + RegionUninit(&layerRgn[i]); } - REGION_UNINIT(pScreen, &rgnDst); + RegionUninit(&rgnDst); } void diff --git a/fb/fbpict.c b/fb/fbpict.c index 896d33ebbd..26cdc0d846 100644 --- a/fb/fbpict.c +++ b/fb/fbpict.c @@ -77,8 +77,8 @@ fbWalkCompositeRegion (CARD8 op, xMask, yMask, xDst, yDst, width, height)) return; - n = REGION_NUM_RECTS (®ion); - pbox = REGION_RECTS (®ion); + n = RegionNumRects (®ion); + pbox = RegionRects (®ion); while (n--) { h = pbox->y2 - pbox->y1; @@ -138,7 +138,7 @@ fbWalkCompositeRegion (CARD8 op, } pbox++; } - REGION_UNINIT (pDst->pDrawable->pScreen, ®ion); + RegionUninit(®ion); } void diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c index cbaab33651..625ce715ba 100644 --- a/fb/fbpixmap.c +++ b/fb/fbpixmap.c @@ -116,7 +116,7 @@ if (((rx1) < (rx2)) && ((ry1) < (ry2)) && \ if ((reg)->data->numRects == (reg)->data->size) \ { \ RegionRectAlloc(reg, 1); \ - fr = REGION_BOXPTR(reg); \ + fr = RegionBoxptr(reg); \ r = fr + (reg)->data->numRects; \ } \ r->x1 = (rx1); \ @@ -153,10 +153,10 @@ fbPixmapToRegion(PixmapPtr pPix) FbBits *pwLine; int nWidth; - pReg = REGION_CREATE(pPix->drawable.pScreen, NULL, 1); + pReg = RegionCreate(NULL, 1); if(!pReg) return NullRegion; - FirstRect = REGION_BOXPTR(pReg); + FirstRect = RegionBoxptr(pReg); rects = FirstRect; fbPrepareAccess(&pPix->drawable); @@ -304,8 +304,8 @@ fbPixmapToRegion(PixmapPtr pPix) pReg->extents.x1 = pReg->extents.x2 = 0; else { - pReg->extents.y1 = REGION_BOXPTR(pReg)->y1; - pReg->extents.y2 = REGION_END(pReg)->y2; + pReg->extents.y1 = RegionBoxptr(pReg)->y1; + pReg->extents.y2 = RegionEnd(pReg)->y2; if (pReg->data->numRects == 1) { free(pReg->data); diff --git a/fb/fbpoint.c b/fb/fbpoint.c index c0ea8ba5b2..f260a69ca1 100644 --- a/fb/fbpoint.c +++ b/fb/fbpoint.c @@ -154,7 +154,7 @@ fbPolyPoint (DrawablePtr pDrawable, case 32: dots = fbDots32; break; } #endif - for (nBox = REGION_NUM_RECTS (pClip), pBox = REGION_RECTS (pClip); + for (nBox = RegionNumRects (pClip), pBox = RegionRects (pClip); nBox--; pBox++) (*dots) (dst, dstStride, dstBpp, pBox, pptInit, nptInit, pDrawable->x, pDrawable->y, dstXoff, dstYoff, and, xor); diff --git a/fb/fbpush.c b/fb/fbpush.c index 891572f0d3..9d827181d4 100644 --- a/fb/fbpush.c +++ b/fb/fbpush.c @@ -190,8 +190,8 @@ fbPushImage (DrawablePtr pDrawable, BoxPtr pbox; int x1, y1, x2, y2; - for (nbox = REGION_NUM_RECTS (pClip), - pbox = REGION_RECTS(pClip); + for (nbox = RegionNumRects (pClip), + pbox = RegionRects(pClip); nbox--; pbox++) { diff --git a/fb/fbseg.c b/fb/fbseg.c index 999be1cda5..7cc38a20cc 100644 --- a/fb/fbseg.c +++ b/fb/fbseg.c @@ -624,8 +624,8 @@ fbSegment (DrawablePtr pDrawable, unsigned int oc1; /* outcode of point 1 */ unsigned int oc2; /* outcode of point 2 */ - nBox = REGION_NUM_RECTS (pClip); - pBox = REGION_RECTS (pClip); + nBox = RegionNumRects (pClip); + pBox = RegionRects (pClip); bres = fbSelectBres (pDrawable, pGC); diff --git a/fb/fbsetsp.c b/fb/fbsetsp.c index 227ba4c622..61dc4dc30d 100644 --- a/fb/fbsetsp.c +++ b/fb/fbsetsp.c @@ -60,8 +60,8 @@ fbSetSpans (DrawablePtr pDrawable, xoff = (int) (((long) src) & (FB_MASK >> 3)); s = (FbBits *) (src - xoff); xoff <<= 3; - n = REGION_NUM_RECTS(pClip); - pbox = REGION_RECTS (pClip); + n = RegionNumRects(pClip); + pbox = RegionRects (pClip); while (n--) { if (pbox->y1 > ppt->y) diff --git a/fb/fbwindow.c b/fb/fbwindow.c index 46c0334488..bb0384d91f 100644 --- a/fb/fbwindow.c +++ b/fb/fbwindow.c @@ -128,15 +128,15 @@ fbCopyWindow(WindowPtr pWin, dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; - REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); + RegionTranslate(prgnSrc, -dx, -dy); - REGION_NULL (pWin->drawable.pScreen, &rgnDst); + RegionNull(&rgnDst); - REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc); + RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); #ifdef COMPOSITE if (pPixmap->screen_x || pPixmap->screen_y) - REGION_TRANSLATE (pWin->drawable.pScreen, &rgnDst, + RegionTranslate(&rgnDst, -pPixmap->screen_x, -pPixmap->screen_y); #endif @@ -144,7 +144,7 @@ fbCopyWindow(WindowPtr pWin, 0, &rgnDst, dx, dy, fbCopyWindowProc, 0, 0); - REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); + RegionUninit(&rgnDst); fbValidateDrawable (&pWin->drawable); } @@ -211,8 +211,8 @@ fbFillRegionSolid (DrawablePtr pDrawable, FbStride dstStride; int dstBpp; int dstXoff, dstYoff; - int n = REGION_NUM_RECTS(pRegion); - BoxPtr pbox = REGION_RECTS(pRegion); + int n = RegionNumRects(pRegion); + BoxPtr pbox = RegionRects(pRegion); #ifndef FB_ACCESS_WRAPPER int try_mmx = 0; diff --git a/fix-patch-whitespace b/fix-patch-whitespace new file mode 100755 index 0000000000..2d06d8ea81 --- /dev/null +++ b/fix-patch-whitespace @@ -0,0 +1,4 @@ +#!/bin/sh +git diff --check | +sed -n 's!^\([^:]*\):\([^:]*\):.*!sed -i "\2 s/[ \t]*$//; \2 s/ *\t/\t/g" \1!p' | +sh diff --git a/fix-region b/fix-region new file mode 100755 index 0000000000..ef8eb42187 --- /dev/null +++ b/fix-region @@ -0,0 +1,38 @@ +#!/bin/sh +sed -i \ + -e 's/REGION_NIL\b/RegionNil/g' \ + -e 's/REGION_NAR\b/RegionNar/g' \ + -e 's/REGION_NUM_RECTS\b/RegionNumRects/g' \ + -e 's/REGION_SIZE\b/RegionSize/g' \ + -e 's/REGION_RECTS\b/RegionRects/g' \ + -e 's/REGION_BOXPTR\b/RegionBoxptr/g' \ + -e 's/REGION_BOX\b/RegionBox/g' \ + -e 's/REGION_TOP\b/RegionTop/g' \ + -e 's/REGION_END\b/RegionEnd/g' \ + -e 's/REGION_SZOF\b/RegionSizeof/g' \ + -e 's/REGION_CREATE *([^,]*, */RegionCreate(/g' \ + -e 's/REGION_COPY *([^,]*, */RegionCopy(/g' \ + -e 's/REGION_DESTROY *([^,]*, */RegionDestroy(/g' \ + -e 's/REGION_INTERSECT *([^,]*, */RegionIntersect(/g' \ + -e 's/REGION_UNION *([^,]*, */RegionUnion(/g' \ + -e 's/REGION_SUBTRACT *([^,]*, */RegionSubtract(/g' \ + -e 's/REGION_INVERSE *([^,]*, */RegionInverse(/g' \ + -e 's/REGION_TRANSLATE *([^,]*, */RegionTranslate(/g' \ + -e 's/RECT_IN_REGION *([^,]*, */RegionContainsRect(/g' \ + -e 's/POINT_IN_REGION *([^,]*, */RegionContainsPoint(/g' \ + -e 's/REGION_EQUAL *([^,]*, */RegionEqual(/g' \ + -e 's/REGION_APPEND *([^,]*, */RegionAppend(/g' \ + -e 's/REGION_VALIDATE *([^,]*, */RegionValidate(/g' \ + -e 's/BITMAP_TO_REGION\b/BitmapToRegion/g' \ + -e 's/RECTS_TO_REGION *([^,]*, */RegionFromRects(/g' \ + -e 's/REGION_BREAK *([^,]*, */RegionBreak(/g' \ + -e 's/REGION_INIT *([^,]*, */RegionInit(/g' \ + -e 's/REGION_UNINIT *([^,]*, */RegionUninit(/g' \ + -e 's/REGION_RESET *([^,]*, */RegionReset(/g' \ + -e 's/REGION_NOTEMPTY *([^,]*, */RegionNotEmpty(/g' \ + -e 's/REGION_BROKEN *([^,]*, */RegionBroken(/g' \ + -e 's/REGION_EMPTY *([^,]*, */RegionEmpty(/g' \ + -e 's/REGION_EXTENTS *([^,]*, */RegionExtents(/g' \ + -e 's/REGION_NULL *([^,]*, */RegionNull(/g' \ + -e 's/REGION_NULL$/RegionNull/g' \ + "$@" diff --git a/glx/glxdri.c b/glx/glxdri.c index 131efcf39a..32b35db4c3 100644 --- a/glx/glxdri.c +++ b/glx/glxdri.c @@ -468,7 +468,7 @@ nooverride: pRegion = NULL; } else { pRegion = DamageRegion(driDraw->pDamage); - if (REGION_NIL(pRegion)) + if (RegionNil(pRegion)) return Success; } @@ -531,8 +531,8 @@ nooverride: int i, numRects; BoxPtr p; - numRects = REGION_NUM_RECTS (pRegion); - p = REGION_RECTS (pRegion); + numRects = RegionNumRects (pRegion); + p = RegionRects (pRegion); CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, 0) ); CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, 0) ); @@ -832,12 +832,12 @@ static void __glXReportDamage(__DRIdrawable *driDraw, __glXenterServer(GL_FALSE); - REGION_INIT(pDraw->pScreen, ®ion, (BoxPtr) rects, num_rects); - REGION_TRANSLATE(pScreen, ®ion, pDraw->x, pDraw->y); + RegionInit(®ion, (BoxPtr) rects, num_rects); + RegionTranslate(®ion, pDraw->x, pDraw->y); DamageRegionAppend(pDraw, ®ion); /* This is wrong, this needs a seperate function. */ DamageRegionProcessPending(pDraw); - REGION_UNINIT(pDraw->pScreen, ®ion); + RegionUninit(®ion); __glXleaveServer(GL_FALSE); } diff --git a/glx/glxdri2.c b/glx/glxdri2.c index b971102d8b..177c73ca25 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -122,7 +122,7 @@ __glXDRIdrawableCopySubBuffer(__GLXdrawable *drawable, box.y1 = private->height - y - h; box.x2 = x + w; box.y2 = private->height - y; - REGION_INIT(drawable->pDraw->pScreen, ®ion, &box, 0); + RegionInit(®ion, &box, 0); DRI2CopyRegion(drawable->pDraw, ®ion, DRI2BufferFrontLeft, DRI2BufferBackLeft); @@ -139,7 +139,7 @@ __glXDRIdrawableWaitX(__GLXdrawable *drawable) box.y1 = 0; box.x2 = private->width; box.y2 = private->height; - REGION_INIT(drawable->pDraw->pScreen, ®ion, &box, 0); + RegionInit(®ion, &box, 0); DRI2CopyRegion(drawable->pDraw, ®ion, DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); @@ -156,7 +156,7 @@ __glXDRIdrawableWaitGL(__GLXdrawable *drawable) box.y1 = 0; box.x2 = private->width; box.y2 = private->height; - REGION_INIT(drawable->pDraw->pScreen, ®ion, &box, 0); + RegionInit(®ion, &box, 0); DRI2CopyRegion(drawable->pDraw, ®ion, DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft); diff --git a/hw/dmx/dmxextension.c b/hw/dmx/dmxextension.c index 5945a5eda4..009283505f 100644 --- a/hw/dmx/dmxextension.c +++ b/hw/dmx/dmxextension.c @@ -350,7 +350,7 @@ void dmxUpdateScreenResources(ScreenPtr pScreen, int x, int y, int w, int h) * clipList to be broken since it will be recalculated in * ValidateTree() */ - REGION_BREAK(pScreen, &pRoot->clipList); + RegionBreak(&pRoot->clipList); } else { /* Otherwise, we just set it directly since there are no * windows visible on this screen @@ -994,7 +994,7 @@ static void dmxForceExposures(int idx) * clipList to be broken since it will be recalculated in * ValidateTree() */ - REGION_BREAK(pScreen, &pRoot->clipList); + RegionBreak(&pRoot->clipList); pScreen->ValidateTree(pRoot, NULL, VTBroken); pScreen->HandleExposures(pRoot); if (pScreen->PostValidateTree) diff --git a/hw/dmx/dmxgc.c b/hw/dmx/dmxgc.c index a761ea89a6..3e75de75e9 100644 --- a/hw/dmx/dmxgc.c +++ b/hw/dmx/dmxgc.c @@ -363,9 +363,9 @@ void dmxChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) case CT_REGION: if (dmxScreen->beDisplay) { - nRects = REGION_NUM_RECTS((RegionPtr)pGC->clientClip); + nRects = RegionNumRects((RegionPtr)pGC->clientClip); pRects = malloc(nRects * sizeof(*pRects)); - pBox = REGION_RECTS((RegionPtr)pGC->clientClip); + pBox = RegionRects((RegionPtr)pGC->clientClip); for (i = 0; i < nRects; i++) { pRects[i].x = pBox[i].x1; diff --git a/hw/dmx/dmxgcops.c b/hw/dmx/dmxgcops.c index 267a306dbc..589c6377b3 100644 --- a/hw/dmx/dmxgcops.c +++ b/hw/dmx/dmxgcops.c @@ -127,16 +127,16 @@ void dmxPutImage(DrawablePtr pDrawable, GCPtr pGC, box.y1 = y; box.x2 = x + w; box.y2 = y + h; - pSubImages = REGION_CREATE(pGC->pScreen, &box, 1); + pSubImages = RegionCreate(&box, 1); - pClip = REGION_CREATE(pGC->pScreen, NullBox, 1); - REGION_COPY(pGC->pScreen, pClip, pGC->pCompositeClip); - REGION_TRANSLATE(pGC->pScreen, pClip, + pClip = RegionCreate(NullBox, 1); + RegionCopy(pClip, pGC->pCompositeClip); + RegionTranslate(pClip, -pDrawable->x, -pDrawable->y); - REGION_INTERSECT(pGC->pScreen, pSubImages, pSubImages, pClip); + RegionIntersect(pSubImages, pSubImages, pClip); - nBox = REGION_NUM_RECTS(pSubImages); - pBox = REGION_RECTS(pSubImages); + nBox = RegionNumRects(pSubImages); + pBox = RegionRects(pSubImages); while (nBox--) { XPutImage(dmxScreen->beDisplay, draw, pGCPriv->gc, img, @@ -148,8 +148,8 @@ void dmxPutImage(DrawablePtr pDrawable, GCPtr pGC, pBox->y2 - pBox->y1); pBox++; } - REGION_DESTROY(pGC->pScreen, pClip); - REGION_DESTROY(pGC->pScreen, pSubImages); + RegionDestroy(pClip); + RegionDestroy(pSubImages); } else { XPutImage(dmxScreen->beDisplay, draw, pGCPriv->gc, img, 0, 0, x, y, w, h); diff --git a/hw/dmx/dmxpict.c b/hw/dmx/dmxpict.c index 0544c88bae..1642145005 100644 --- a/hw/dmx/dmxpict.c +++ b/hw/dmx/dmxpict.c @@ -871,8 +871,8 @@ int dmxChangePictureClip(PicturePtr pPicture, int clipType, pPictPriv->pict, 0, 0, None); } else if (pPicture->clientClip) { RegionPtr pClip = pPicture->clientClip; - BoxPtr pBox = REGION_RECTS(pClip); - int nBox = REGION_NUM_RECTS(pClip); + BoxPtr pBox = RegionRects(pClip); + int nBox = RegionNumRects(pClip); XRectangle *pRects; XRectangle *pRect; int nRects; diff --git a/hw/dmx/dmxpixmap.c b/hw/dmx/dmxpixmap.c index c8b064b78e..a64cbd0a46 100644 --- a/hw/dmx/dmxpixmap.c +++ b/hw/dmx/dmxpixmap.c @@ -201,7 +201,7 @@ RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap) Bool overlap; if (!dmxScreen->beDisplay) { - pReg = REGION_CREATE(pScreen, NullBox, 1); + pReg = RegionCreate(NullBox, 1); return pReg; } @@ -209,8 +209,8 @@ RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap) pPixmap->drawable.width, pPixmap->drawable.height, 1, XYPixmap); - pReg = REGION_CREATE(pScreen, NullBox, 1); - pTmpReg = REGION_CREATE(pScreen, NullBox, 1); + pReg = RegionCreate(NullBox, 1); + pTmpReg = RegionCreate(NullBox, 1); if(!pReg || !pTmpReg) { XDestroyImage(ximage); return NullRegion; @@ -229,8 +229,8 @@ RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap) } else if (currentPixel == 0L) { /* right edge */ Box.x2 = x; - REGION_RESET(pScreen, pTmpReg, &Box); - REGION_APPEND(pScreen, pReg, pTmpReg); + RegionReset(pTmpReg, &Box); + RegionAppend(pReg, pTmpReg); } previousPixel = currentPixel; } @@ -238,15 +238,15 @@ RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap) if (previousPixel != 0L) { /* right edge because of the end of pixmap */ Box.x2 = pPixmap->drawable.width; - REGION_RESET(pScreen, pTmpReg, &Box); - REGION_APPEND(pScreen, pReg, pTmpReg); + RegionReset(pTmpReg, &Box); + RegionAppend(pReg, pTmpReg); } } - REGION_DESTROY(pScreen, pTmpReg); + RegionDestroy(pTmpReg); XDestroyImage(ximage); - REGION_VALIDATE(pScreen, pReg, &overlap); + RegionValidate(pReg, &overlap); dmxSync(dmxScreen, FALSE); return(pReg); diff --git a/hw/dmx/dmxshadow.c b/hw/dmx/dmxshadow.c index 461fd085bc..a62eb5c520 100644 --- a/hw/dmx/dmxshadow.c +++ b/hw/dmx/dmxshadow.c @@ -47,8 +47,8 @@ void dmxShadowUpdateProc(ScreenPtr pScreen, shadowBufPtr pBuf) { RegionPtr damage = &pBuf->damage; - int nbox = REGION_NUM_RECTS(damage); - BoxPtr pbox = REGION_RECTS(damage); + int nbox = RegionNumRects(damage); + BoxPtr pbox = RegionRects(damage); DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; if (!dmxScreen->beDisplay) diff --git a/hw/dmx/dmxwindow.c b/hw/dmx/dmxwindow.c index 5b0baff3a2..28212a3305 100644 --- a/hw/dmx/dmxwindow.c +++ b/hw/dmx/dmxwindow.c @@ -940,8 +940,8 @@ static void dmxDoSetShape(WindowPtr pWindow) /* First, set the bounding shape */ if (wBoundingShape(pWindow)) { - pBox = REGION_RECTS(wBoundingShape(pWindow)); - nRect = nBox = REGION_NUM_RECTS(wBoundingShape(pWindow)); + pBox = RegionRects(wBoundingShape(pWindow)); + nRect = nBox = RegionNumRects(wBoundingShape(pWindow)); pRectFirst = pRect = malloc(nRect * sizeof(*pRect)); while (nBox--) { pRect->x = pBox->x1; @@ -963,8 +963,8 @@ static void dmxDoSetShape(WindowPtr pWindow) /* Next, set the clip shape */ if (wClipShape(pWindow)) { - pBox = REGION_RECTS(wClipShape(pWindow)); - nRect = nBox = REGION_NUM_RECTS(wClipShape(pWindow)); + pBox = RegionRects(wClipShape(pWindow)); + nRect = nBox = RegionNumRects(wClipShape(pWindow)); pRectFirst = pRect = malloc(nRect * sizeof(*pRect)); while (nBox--) { pRect->x = pBox->x1; diff --git a/hw/dmx/input/dmxconsole.c b/hw/dmx/input/dmxconsole.c index 297166eddc..80df0649e3 100644 --- a/hw/dmx/input/dmxconsole.c +++ b/hw/dmx/input/dmxconsole.c @@ -226,7 +226,7 @@ static void dmxConsoleDrawWindows(pointer private) pChild->drawable.height, pChild->visibility, pChild->overrideRedirect, - REGION_NUM_RECTS(&pChild->clipList)); + RegionNumRects(&pChild->clipList)); #endif rect.x = scalex(priv, pChild->drawable.x + pScreen->x); rect.y = scaley(priv, pChild->drawable.y + pScreen->y); diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index b968516055..e0cb95672d 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -343,13 +343,13 @@ ephyrInternalDamageRedisplay (ScreenPtr pScreen) pRegion = DamageRegion (scrpriv->pDamage); - if (REGION_NOTEMPTY (pScreen, pRegion)) + if (RegionNotEmpty(pRegion)) { int nbox; BoxPtr pbox; - nbox = REGION_NUM_RECTS (pRegion); - pbox = REGION_RECTS (pRegion); + nbox = RegionNumRects (pRegion); + pbox = RegionRects (pRegion); while (nbox--) { @@ -897,10 +897,10 @@ ephyrExposePairedWindow (int a_remote) return; } screen = pair->local->drawable.pScreen; - REGION_NULL (screen, ®); - REGION_COPY (screen, ®, &pair->local->clipList); + RegionNull(®); + RegionCopy(®, &pair->local->clipList); screen->WindowExposures (pair->local, ®, NullRegion); - REGION_UNINIT (screen, ®); + RegionUninit(®); } #endif /* XF86DRI */ diff --git a/hw/kdrive/ephyr/ephyrdriext.c b/hw/kdrive/ephyr/ephyrdriext.c index 55cc0f128a..23c20321f9 100644 --- a/hw/kdrive/ephyr/ephyrdriext.c +++ b/hw/kdrive/ephyr/ephyrdriext.c @@ -418,11 +418,11 @@ ephyrDRIClipNotify (WindowPtr a_win, EPHYR_LOG_ERROR ("failed to get window pair\n") ; goto out ; } - rects = calloc(REGION_NUM_RECTS (&a_win->clipList), + rects = calloc(RegionNumRects (&a_win->clipList), sizeof (EphyrRect)) ; - for (i=0; i < REGION_NUM_RECTS (&a_win->clipList); i++) { + for (i=0; i < RegionNumRects (&a_win->clipList); i++) { memmove (&rects[i], - ®ION_RECTS (&a_win->clipList)[i], + &RegionRects (&a_win->clipList)[i], sizeof (EphyrRect)) ; rects[i].x1 -= a_win->drawable.x; rects[i].x2 -= a_win->drawable.x; @@ -436,7 +436,7 @@ ephyrDRIClipNotify (WindowPtr a_win, is_ok = hostx_set_window_bounding_rectangles (pair->remote, rects, - REGION_NUM_RECTS (&a_win->clipList)) ; + RegionNumRects (&a_win->clipList)) ; is_ok = TRUE ; out: @@ -1168,12 +1168,12 @@ ProcXF86DRIGetDrawableInfo (register ClientPtr client) return BadMatch ; } EPHYR_LOG ("clip list of xephyr gl drawable:\n") ; - for (i=0; i < REGION_NUM_RECTS (&window->clipList); i++) { + for (i=0; i < RegionNumRects (&window->clipList); i++) { EPHYR_LOG ("x1:%d, y1:%d, x2:%d, y2:%d\n", - REGION_RECTS (&window->clipList)[i].x1, - REGION_RECTS (&window->clipList)[i].y1, - REGION_RECTS (&window->clipList)[i].x2, - REGION_RECTS (&window->clipList)[i].y2) ; + RegionRects (&window->clipList)[i].x1, + RegionRects (&window->clipList)[i].y1, + RegionRects (&window->clipList)[i].x2, + RegionRects (&window->clipList)[i].y2) ; } if (!ephyrDRIGetDrawableInfo (stuff->screen, diff --git a/hw/kdrive/ephyr/ephyrvideo.c b/hw/kdrive/ephyr/ephyrvideo.c index 65127ceb9e..69a89ae61c 100644 --- a/hw/kdrive/ephyr/ephyrvideo.c +++ b/hw/kdrive/ephyr/ephyrvideo.c @@ -946,8 +946,8 @@ ephyrPutImage (KdScreenInfo *a_info, a_drw_x, a_drw_y, a_drw_w, a_drw_h, a_src_x, a_src_y, a_src_w, a_src_h, a_width, a_height, a_buf, - (EphyrHostBox*)REGION_RECTS (a_clipping_region), - REGION_NUM_RECTS (a_clipping_region))) { + (EphyrHostBox*)RegionRects (a_clipping_region), + RegionNumRects (a_clipping_region))) { EPHYR_LOG_ERROR ("EphyrHostXVPutImage() failed\n") ; goto out ; } @@ -1025,8 +1025,8 @@ ephyrReputImage (KdScreenInfo *a_info, port_priv->src_w, port_priv->src_h, port_priv->image_width, port_priv->image_height, port_priv->image_buf, - (EphyrHostBox*)REGION_RECTS (a_clipping_region), - REGION_NUM_RECTS (a_clipping_region))) { + (EphyrHostBox*)RegionRects (a_clipping_region), + RegionNumRects (a_clipping_region))) { EPHYR_LOG_ERROR ("ephyrHostXVPutImage() failed\n") ; goto out ; } @@ -1064,7 +1064,7 @@ ephyrPutVideo (KdScreenInfo *a_info, dst_box.y2 = a_drw_y + a_drw_h; if (!DoSimpleClip (&dst_box, - REGION_EXTENTS (pScreen->pScreen, a_clipping_region), + RegionExtents(a_clipping_region), &clipped_area)) { EPHYR_LOG_ERROR ("failed to simple clip\n") ; goto out ; @@ -1115,7 +1115,7 @@ ephyrGetVideo (KdScreenInfo *a_info, dst_box.y2 = a_drw_y + a_drw_h; if (!DoSimpleClip (&dst_box, - REGION_EXTENTS (pScreen->pScreen, a_clipping_region), + RegionExtents(a_clipping_region), &clipped_area)) { EPHYR_LOG_ERROR ("failed to simple clip\n") ; goto out ; @@ -1166,7 +1166,7 @@ ephyrPutStill (KdScreenInfo *a_info, dst_box.y2 = a_drw_y + a_drw_h; if (!DoSimpleClip (&dst_box, - REGION_EXTENTS (pScreen->pScreen, a_clipping_region), + RegionExtents(a_clipping_region), &clipped_area)) { EPHYR_LOG_ERROR ("failed to simple clip\n") ; goto out ; @@ -1217,7 +1217,7 @@ ephyrGetStill (KdScreenInfo *a_info, dst_box.y2 = a_drw_y + a_drw_h; if (!DoSimpleClip (&dst_box, - REGION_EXTENTS (pScreen->pScreen, a_clipping_region), + RegionExtents(a_clipping_region), &clipped_area)) { EPHYR_LOG_ERROR ("failed to simple clip\n") ; goto out ; diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c index 7993f9bd16..27596e4676 100644 --- a/hw/kdrive/src/kdrive.c +++ b/hw/kdrive/src/kdrive.c @@ -121,8 +121,8 @@ KdSetRootClip (ScreenPtr pScreen, BOOL enable) { RegionPtr borderVisible; - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - REGION_SUBTRACT(pScreen, borderVisible, + borderVisible = RegionCreate(NullBox, 1); + RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); pWin->valdata->before.borderVisible = borderVisible; } @@ -138,15 +138,15 @@ KdSetRootClip (ScreenPtr pScreen, BOOL enable) box.y2 = pScreen->height; pWin->drawable.width = pScreen->width; pWin->drawable.height = pScreen->height; - REGION_INIT (pScreen, &pWin->winSize, &box, 1); - REGION_INIT (pScreen, &pWin->borderSize, &box, 1); - REGION_RESET(pScreen, &pWin->borderClip, &box); - REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); + RegionInit(&pWin->winSize, &box, 1); + RegionInit(&pWin->borderSize, &box, 1); + RegionReset(&pWin->borderClip, &box); + RegionBreak(&pWin->clipList); } else { - REGION_EMPTY(pScreen, &pWin->borderClip); - REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); + RegionEmpty(&pWin->borderClip); + RegionBreak(&pWin->clipList); } ResizeChildrenWinSize (pWin, 0, 0, 0, 0); @@ -836,8 +836,8 @@ KdCreateWindow (WindowPtr pWin) if (!pScreenPriv->enabled) { - REGION_EMPTY (pWin->drawable.pScreen, &pWin->borderClip); - REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); + RegionEmpty(&pWin->borderClip); + RegionBreak(&pWin->clipList); } } #endif diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c index c81d7daaa4..99ab2d824b 100644 --- a/hw/kdrive/src/kxv.c +++ b/hw/kdrive/src/kxv.c @@ -268,9 +268,9 @@ KdXVFreeAdaptor(XvAdaptorPtr pAdaptor) pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr; if(pPriv) { if(pPriv->clientClip) - REGION_DESTROY(pAdaptor->pScreen, pPriv->clientClip); + RegionDestroy(pPriv->clientClip); if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) - REGION_DESTROY(pAdaptor->pScreen, pPriv->pCompositeClip); + RegionDestroy(pPriv->pCompositeClip); free(pPriv); } } @@ -607,18 +607,18 @@ KdXVUpdateCompositeClip(XvPortRecPrivatePtr portPriv) return; } - pCompositeClip = REGION_CREATE(pWin->pScreen, NullBox, 1); - REGION_COPY(pWin->pScreen, pCompositeClip, portPriv->clientClip); - REGION_TRANSLATE(pWin->pScreen, pCompositeClip, + pCompositeClip = RegionCreate(NullBox, 1); + RegionCopy(pCompositeClip, portPriv->clientClip); + RegionTranslate(pCompositeClip, portPriv->pDraw->x + portPriv->clipOrg.x, portPriv->pDraw->y + portPriv->clipOrg.y); - REGION_INTERSECT(pWin->pScreen, pCompositeClip, pregWin, pCompositeClip); + RegionIntersect(pCompositeClip, pregWin, pCompositeClip); portPriv->pCompositeClip = pCompositeClip; portPriv->FreeCompositeClip = TRUE; if(freeCompClip) { - REGION_DESTROY(pWin->pScreen, pregWin); + RegionDestroy(pregWin); } } @@ -633,17 +633,17 @@ KdXVCopyClip( /* copy the new clip if it exists */ if((pGC->clientClipType == CT_REGION) && pGC->clientClip) { if(!portPriv->clientClip) - portPriv->clientClip = REGION_CREATE(pGC->pScreen, NullBox, 1); + portPriv->clientClip = RegionCreate(NullBox, 1); /* Note: this is in window coordinates */ - REGION_COPY(pGC->pScreen, portPriv->clientClip, pGC->clientClip); + RegionCopy(portPriv->clientClip, pGC->clientClip); } else if(portPriv->clientClip) { /* free the old clientClip */ - REGION_DESTROY(pGC->pScreen, portPriv->clientClip); + RegionDestroy(portPriv->clientClip); portPriv->clientClip = NULL; } /* get rid of the old clip list */ if(portPriv->pCompositeClip && portPriv->FreeCompositeClip) { - REGION_DESTROY(pWin->pScreen, portPriv->pCompositeClip); + RegionDestroy(portPriv->pCompositeClip); } portPriv->clipOrg = pGC->clipOrg; @@ -670,18 +670,18 @@ KdXVRegetVideo(XvPortRecPrivatePtr portPriv) WinBox.y2 = WinBox.y1 + portPriv->drw_h; /* clip to the window composite clip */ - REGION_INIT(portPriv->pDraw->pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(portPriv->pDraw->pScreen, &ClipRegion, NullBox, 1); - REGION_INTERSECT(portPriv->pDraw->pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip); + RegionInit(&WinRegion, &WinBox, 1); + RegionInit(&ClipRegion, NullBox, 1); + RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip); /* that's all if it's totally obscured */ - if(!REGION_NOTEMPTY(portPriv->pDraw->pScreen, &ClipRegion)) { + if(!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto CLIP_VIDEO_BAILOUT; } if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - REGION_SUBTRACT(portPriv->pDraw->pScreen, &ClipRegion, &WinRegion, &ClipRegion); + RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); } ret = (*portPriv->AdaptorRec->GetVideo)(portPriv->screen, portPriv->pDraw, @@ -706,8 +706,8 @@ CLIP_VIDEO_BAILOUT: if(!portPriv->FreeCompositeClip) portPriv->pCompositeClip = NULL; - REGION_UNINIT(portPriv->pDraw->pScreen, &WinRegion); - REGION_UNINIT(portPriv->pDraw->pScreen, &ClipRegion); + RegionUninit(&WinRegion); + RegionUninit(&ClipRegion); return ret; } @@ -734,9 +734,9 @@ KdXVReputVideo(XvPortRecPrivatePtr portPriv) WinBox.y2 = WinBox.y1 + portPriv->drw_h; /* clip to the window composite clip */ - REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(pScreen, &ClipRegion, NullBox, 1); - REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip); + RegionInit(&WinRegion, &WinBox, 1); + RegionInit(&ClipRegion, NullBox, 1); + RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip); /* clip and translate to the viewport */ if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { @@ -748,21 +748,21 @@ KdXVReputVideo(XvPortRecPrivatePtr portPriv) VPBox.x2 = screen->width; VPBox.y2 = screen->height; - REGION_INIT(pScreen, &VPReg, &VPBox, 1); - REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg); - REGION_UNINIT(pScreen, &VPReg); + RegionInit(&VPReg, &VPBox, 1); + RegionIntersect(&ClipRegion, &ClipRegion, &VPReg); + RegionUninit(&VPReg); } /* that's all if it's totally obscured */ - if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) { + if(!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto CLIP_VIDEO_BAILOUT; } /* bailout if we have to clip but the hardware doesn't support it */ if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = REGION_RECTS(&ClipRegion); - if( (REGION_NUM_RECTS(&ClipRegion) != 1) || + BoxPtr clipBox = RegionRects(&ClipRegion); + if( (RegionNumRects(&ClipRegion) != 1) || (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { @@ -772,7 +772,7 @@ KdXVReputVideo(XvPortRecPrivatePtr portPriv) } if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion); + RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); } ret = (*portPriv->AdaptorRec->PutVideo)(portPriv->screen, portPriv->pDraw, @@ -796,8 +796,8 @@ CLIP_VIDEO_BAILOUT: if(!portPriv->FreeCompositeClip) portPriv->pCompositeClip = NULL; - REGION_UNINIT(pScreen, &WinRegion); - REGION_UNINIT(pScreen, &ClipRegion); + RegionUninit(&WinRegion); + RegionUninit(&ClipRegion); return ret; } @@ -823,9 +823,9 @@ KdXVReputImage(XvPortRecPrivatePtr portPriv) WinBox.y2 = WinBox.y1 + portPriv->drw_h; /* clip to the window composite clip */ - REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(pScreen, &ClipRegion, NullBox, 1); - REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip); + RegionInit(&WinRegion, &WinBox, 1); + RegionInit(&ClipRegion, NullBox, 1); + RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip); /* clip and translate to the viewport */ if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { @@ -837,21 +837,21 @@ KdXVReputImage(XvPortRecPrivatePtr portPriv) VPBox.x2 = screen->width; VPBox.y2 = screen->height; - REGION_INIT(pScreen, &VPReg, &VPBox, 1); - REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg); - REGION_UNINIT(pScreen, &VPReg); + RegionInit(&VPReg, &VPBox, 1); + RegionIntersect(&ClipRegion, &ClipRegion, &VPReg); + RegionUninit(&VPReg); } /* that's all if it's totally obscured */ - if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) { + if(!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto CLIP_VIDEO_BAILOUT; } /* bailout if we have to clip but the hardware doesn't support it */ if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = REGION_RECTS(&ClipRegion); - if( (REGION_NUM_RECTS(&ClipRegion) != 1) || + BoxPtr clipBox = RegionRects(&ClipRegion); + if( (RegionNumRects(&ClipRegion) != 1) || (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { @@ -861,7 +861,7 @@ KdXVReputImage(XvPortRecPrivatePtr portPriv) } if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion); + RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); } ret = (*portPriv->AdaptorRec->ReputImage)(portPriv->screen, portPriv->pDraw, @@ -882,8 +882,8 @@ CLIP_VIDEO_BAILOUT: if(!portPriv->FreeCompositeClip) portPriv->pCompositeClip = NULL; - REGION_UNINIT(pScreen, &WinRegion); - REGION_UNINIT(pScreen, &ClipRegion); + RegionUninit(&WinRegion); + RegionUninit(&ClipRegion); return ret; } @@ -1021,7 +1021,7 @@ KdXVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) XvPortRecPrivatePtr pPriv; Bool AreasExposed; - AreasExposed = (WinPriv && reg1 && REGION_NOTEMPTY(pScreen, reg1)); + AreasExposed = (WinPriv && reg1 && RegionNotEmpty(reg1)); pScreen->WindowExposures = ScreenPriv->WindowExposures; (*pScreen->WindowExposures)(pWin, reg1, reg2); @@ -1089,7 +1089,7 @@ KdXVClipNotify(WindowPtr pWin, int dx, int dy) pPriv = WinPriv->PortRec; if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) - REGION_DESTROY(pScreen, pPriv->pCompositeClip); + RegionDestroy(pPriv->pCompositeClip); pPriv->pCompositeClip = NULL; @@ -1220,7 +1220,7 @@ KdXVDisable(ScreenPtr pScreen) pPriv->isOn = XV_OFF; if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) - REGION_DESTROY(pScreen, pPriv->pCompositeClip); + RegionDestroy(pPriv->pCompositeClip); pPriv->pCompositeClip = NULL; @@ -1330,9 +1330,9 @@ KdXVPutStill( WinBox.x2 = WinBox.x1 + drw_w; WinBox.y2 = WinBox.y1 + drw_h; - REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(pScreen, &ClipRegion, NullBox, 1); - REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip); + RegionInit(&WinRegion, &WinBox, 1); + RegionInit(&ClipRegion, NullBox, 1); + RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip); if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { RegionRec VPReg; @@ -1343,23 +1343,23 @@ KdXVPutStill( VPBox.x2 = screen->width; VPBox.y2 = screen->height; - REGION_INIT(pScreen, &VPReg, &VPBox, 1); - REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg); - REGION_UNINIT(pScreen, &VPReg); + RegionInit(&VPReg, &VPBox, 1); + RegionIntersect(&ClipRegion, &ClipRegion, &VPReg); + RegionUninit(&VPReg); } if(portPriv->pDraw) { KdXVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv); } - if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) { + if(!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto PUT_STILL_BAILOUT; } if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = REGION_RECTS(&ClipRegion); - if( (REGION_NUM_RECTS(&ClipRegion) != 1) || + BoxPtr clipBox = RegionRects(&ClipRegion); + if( (RegionNumRects(&ClipRegion) != 1) || (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { @@ -1369,7 +1369,7 @@ KdXVPutStill( } if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion); + RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); } ret = (*portPriv->AdaptorRec->PutStill)(portPriv->screen, pDraw, @@ -1398,8 +1398,8 @@ PUT_STILL_BAILOUT: portPriv->isOn = XV_PENDING; } - REGION_UNINIT(pScreen, &WinRegion); - REGION_UNINIT(pScreen, &ClipRegion); + RegionUninit(&WinRegion); + RegionUninit(&ClipRegion); return ret; } @@ -1483,21 +1483,21 @@ KdXVGetStill( WinBox.x2 = WinBox.x1 + drw_w; WinBox.y2 = WinBox.y1 + drw_h; - REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(pScreen, &ClipRegion, NullBox, 1); - REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip); + RegionInit(&WinRegion, &WinBox, 1); + RegionInit(&ClipRegion, NullBox, 1); + RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip); if(portPriv->pDraw) { KdXVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv); } - if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) { + if(!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto GET_STILL_BAILOUT; } if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion); + RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); } ret = (*portPriv->AdaptorRec->GetStill)(portPriv->screen, pDraw, @@ -1513,8 +1513,8 @@ GET_STILL_BAILOUT: portPriv->isOn = XV_PENDING; } - REGION_UNINIT(pScreen, &WinRegion); - REGION_UNINIT(pScreen, &ClipRegion); + RegionUninit(&WinRegion); + RegionUninit(&ClipRegion); return ret; } @@ -1630,9 +1630,9 @@ KdXVPutImage( WinBox.x2 = WinBox.x1 + drw_w; WinBox.y2 = WinBox.y1 + drw_h; - REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_INIT(pScreen, &ClipRegion, NullBox, 1); - REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip); + RegionInit(&WinRegion, &WinBox, 1); + RegionInit(&ClipRegion, NullBox, 1); + RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip); if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { RegionRec VPReg; @@ -1643,23 +1643,23 @@ KdXVPutImage( VPBox.x2 = pScreen->width; VPBox.y2 = pScreen->height; - REGION_INIT(pScreen, &VPReg, &VPBox, 1); - REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg); - REGION_UNINIT(pScreen, &VPReg); + RegionInit(&VPReg, &VPBox, 1); + RegionIntersect(&ClipRegion, &ClipRegion, &VPReg); + RegionUninit(&VPReg); } if(portPriv->pDraw) { KdXVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv); } - if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) { + if(!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto PUT_IMAGE_BAILOUT; } if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = REGION_RECTS(&ClipRegion); - if( (REGION_NUM_RECTS(&ClipRegion) != 1) || + BoxPtr clipBox = RegionRects(&ClipRegion); + if( (RegionNumRects(&ClipRegion) != 1) || (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { @@ -1669,7 +1669,7 @@ KdXVPutImage( } if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion); + RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); } ret = (*portPriv->AdaptorRec->PutImage)(portPriv->screen, pDraw, @@ -1698,8 +1698,8 @@ PUT_IMAGE_BAILOUT: portPriv->isOn = XV_PENDING; } - REGION_UNINIT(pScreen, &WinRegion); - REGION_UNINIT(pScreen, &ClipRegion); + RegionUninit(&WinRegion); + RegionUninit(&ClipRegion); return ret; } @@ -1869,8 +1869,8 @@ KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg) GCPtr pGC; ChangeGCVal val[2]; xRectangle *rects, *r; - BoxPtr pBox = REGION_RECTS (pRgn); - int nBox = REGION_NUM_RECTS (pRgn); + BoxPtr pBox = RegionRects (pRgn); + int nBox = RegionNumRects (pRgn); rects = malloc(nBox * sizeof (xRectangle)); if (!rects) @@ -1897,7 +1897,7 @@ KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg) ValidateGC (pDraw, pGC); (*pGC->ops->PolyFillRect) (pDraw, pGC, - REGION_NUM_RECTS (pRgn), rects); + RegionNumRects (pRgn), rects); FreeScratchGC (pGC); bail1: diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index 1aad2d1005..7867a428bb 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -1085,8 +1085,8 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable) { RegionPtr borderVisible; - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - REGION_SUBTRACT(pScreen, borderVisible, + borderVisible = RegionCreate(NullBox, 1); + RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); pWin->valdata->before.borderVisible = borderVisible; } @@ -1105,18 +1105,18 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable) box.y1 = 0; box.x2 = pScreen->width; box.y2 = pScreen->height; - REGION_INIT (pScreen, &pWin->winSize, &box, 1); - REGION_INIT (pScreen, &pWin->borderSize, &box, 1); + RegionInit(&pWin->winSize, &box, 1); + RegionInit(&pWin->borderSize, &box, 1); if (WasViewable) - REGION_RESET(pScreen, &pWin->borderClip, &box); + RegionReset(&pWin->borderClip, &box); pWin->drawable.width = pScreen->width; pWin->drawable.height = pScreen->height; - REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); + RegionBreak(&pWin->clipList); } else { - REGION_EMPTY(pScreen, &pWin->borderClip); - REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); + RegionEmpty(&pWin->borderClip); + RegionBreak(&pWin->clipList); } ResizeChildrenWinSize (pWin, 0, 0, 0, 0); diff --git a/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c index a142abebcf..d883ab36a6 100644 --- a/hw/xfree86/common/xf86fbman.c +++ b/hw/xfree86/common/xf86fbman.c @@ -363,8 +363,8 @@ AllocateArea( if(granularity <= 1) granularity = 0; - boxp = REGION_RECTS(offman->FreeBoxes); - num = REGION_NUM_RECTS(offman->FreeBoxes); + boxp = RegionRects(offman->FreeBoxes); + num = RegionNumRects(offman->FreeBoxes); /* look through the free boxes */ for(i = 0; i < num; i++, boxp++) { @@ -407,9 +407,9 @@ AllocateArea( /* bye, bye */ (*link->area.RemoveAreaCallback)(&link->area); - REGION_INIT(pScreen, &NewReg, &(link->area.box), 1); - REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &NewReg); - REGION_UNINIT(pScreen, &NewReg); + RegionInit(&NewReg, &(link->area.box), 1); + RegionUnion(offman->FreeBoxes, offman->FreeBoxes, &NewReg); + RegionUninit(&NewReg); area = &(link->area); break; @@ -427,9 +427,9 @@ AllocateArea( area->RemoveAreaCallback = removeCB; area->devPrivate.ptr = privData; - REGION_INIT(pScreen, &NewReg, &(area->box), 1); - REGION_SUBTRACT(pScreen, offman->FreeBoxes, offman->FreeBoxes, &NewReg); - REGION_UNINIT(pScreen, &NewReg); + RegionInit(&NewReg, &(area->box), 1); + RegionSubtract(offman->FreeBoxes, offman->FreeBoxes, &NewReg); + RegionUninit(&NewReg); } return area; @@ -477,9 +477,9 @@ localFreeOffscreenArea(FBAreaPtr area) } /* put the area back into the pool */ - REGION_INIT(pScreen, &FreedRegion, &(pLink->area.box), 1); - REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &FreedRegion); - REGION_UNINIT(pScreen, &FreedRegion); + RegionInit(&FreedRegion, &(pLink->area.box), 1); + RegionUnion(offman->FreeBoxes, offman->FreeBoxes, &FreedRegion); + RegionUninit(&FreedRegion); if(pLinkPrev) pLinkPrev->next = pLink->next; @@ -536,12 +536,12 @@ localResizeOffscreenArea( (resize->box.x2 == OrigArea.x2)) return TRUE; - REGION_INIT(pScreen, &FreedReg, &OrigArea, 1); - REGION_INIT(pScreen, &NewReg, &(resize->box), 1); - REGION_SUBTRACT(pScreen, &FreedReg, &FreedReg, &NewReg); - REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &FreedReg); - REGION_UNINIT(pScreen, &FreedReg); - REGION_UNINIT(pScreen, &NewReg); + RegionInit(&FreedReg, &OrigArea, 1); + RegionInit(&NewReg, &(resize->box), 1); + RegionSubtract(&FreedReg, &FreedReg, &NewReg); + RegionUnion(offman->FreeBoxes, offman->FreeBoxes, &FreedReg); + RegionUninit(&FreedReg); + RegionUninit(&NewReg); SendCallFreeBoxCallbacks(offman); @@ -551,8 +551,8 @@ localResizeOffscreenArea( /* otherwise we remove the old region */ - REGION_INIT(pScreen, &FreedReg, &OrigArea, 1); - REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &FreedReg); + RegionInit(&FreedReg, &OrigArea, 1); + RegionUnion(offman->FreeBoxes, offman->FreeBoxes, &FreedReg); /* remove the old link */ if(pLinkPrev) @@ -589,8 +589,8 @@ localResizeOffscreenArea( offman->NumUsedAreas--; } else { /* reinstate the old region */ - REGION_SUBTRACT(pScreen, offman->FreeBoxes, offman->FreeBoxes, &FreedReg); - REGION_UNINIT(pScreen, &FreedReg); + RegionSubtract(offman->FreeBoxes, offman->FreeBoxes, &FreedReg); + RegionUninit(&FreedReg); pLink->next = offman->UsedAreas; offman->UsedAreas = pLink; @@ -598,7 +598,7 @@ localResizeOffscreenArea( } - REGION_UNINIT(pScreen, &FreedReg); + RegionUninit(&FreedReg); SendCallFreeBoxCallbacks(offman); @@ -636,47 +636,47 @@ localQueryLargestOffscreenArea( if(offman->NumUsedAreas) { FBLinkPtr pLink; RegionRec tmpRegion; - newRegion = REGION_CREATE(pScreen, NULL, 1); - REGION_COPY(pScreen, newRegion, offman->InitialBoxes); + newRegion = RegionCreate(NULL, 1); + RegionCopy(newRegion, offman->InitialBoxes); pLink = offman->UsedAreas; while(pLink) { if(!pLink->area.RemoveAreaCallback) { - REGION_INIT(pScreen, &tmpRegion, &(pLink->area.box), 1); - REGION_SUBTRACT(pScreen, newRegion, newRegion, &tmpRegion); - REGION_UNINIT(pScreen, &tmpRegion); + RegionInit(&tmpRegion, &(pLink->area.box), 1); + RegionSubtract(newRegion, newRegion, &tmpRegion); + RegionUninit(&tmpRegion); } pLink = pLink->next; } - nbox = REGION_NUM_RECTS(newRegion); - pbox = REGION_RECTS(newRegion); + nbox = RegionNumRects(newRegion); + pbox = RegionRects(newRegion); break; } case 1: if(offman->NumUsedAreas) { FBLinkPtr pLink; RegionRec tmpRegion; - newRegion = REGION_CREATE(pScreen, NULL, 1); - REGION_COPY(pScreen, newRegion, offman->FreeBoxes); + newRegion = RegionCreate(NULL, 1); + RegionCopy(newRegion, offman->FreeBoxes); pLink = offman->UsedAreas; while(pLink) { if(pLink->area.RemoveAreaCallback) { - REGION_INIT(pScreen, &tmpRegion, &(pLink->area.box), 1); - REGION_APPEND(pScreen, newRegion, &tmpRegion); - REGION_UNINIT(pScreen, &tmpRegion); + RegionInit(&tmpRegion, &(pLink->area.box), 1); + RegionAppend(newRegion, &tmpRegion); + RegionUninit(&tmpRegion); } pLink = pLink->next; } - nbox = REGION_NUM_RECTS(newRegion); - pbox = REGION_RECTS(newRegion); + nbox = RegionNumRects(newRegion); + pbox = RegionRects(newRegion); break; } default: - nbox = REGION_NUM_RECTS(offman->FreeBoxes); - pbox = REGION_RECTS(offman->FreeBoxes); + nbox = RegionNumRects(offman->FreeBoxes); + pbox = RegionRects(offman->FreeBoxes); break; } @@ -719,7 +719,7 @@ localQueryLargestOffscreenArea( } if(newRegion) - REGION_DESTROY(pScreen, newRegion); + RegionDestroy(newRegion); return TRUE; } @@ -741,9 +741,9 @@ localPurgeUnlockedOffscreenAreas(ScreenPtr pScreen) if(pLink->area.RemoveAreaCallback) { (*pLink->area.RemoveAreaCallback)(&pLink->area); - REGION_INIT(pScreen, &FreedRegion, &(pLink->area.box), 1); - REGION_APPEND(pScreen, offman->FreeBoxes, &FreedRegion); - REGION_UNINIT(pScreen, &FreedRegion); + RegionInit(&FreedRegion, &(pLink->area.box), 1); + RegionAppend(offman->FreeBoxes, &FreedRegion); + RegionUninit(&FreedRegion); if(pPrev) pPrev->next = pLink->next; @@ -761,7 +761,7 @@ localPurgeUnlockedOffscreenAreas(ScreenPtr pScreen) } if(anyUsed) { - REGION_VALIDATE(pScreen, offman->FreeBoxes, &anyUsed); + RegionValidate(offman->FreeBoxes, &anyUsed); SendCallFreeBoxCallbacks(offman); } @@ -924,7 +924,7 @@ localAllocateOffscreenLinear( return NULL; /* No linear available, so try and pinch some from the XY areas */ - extents = REGION_EXTENTS(pScreen, offman->InitialBoxes); + extents = RegionExtents(offman->InitialBoxes); pitch = extents->x2 - extents->x1; if (gran > 1) { @@ -1055,7 +1055,7 @@ localResizeOffscreenLinear(FBLinearPtr resize, int length) BoxPtr extents; int pitch, w, h; - extents = REGION_EXTENTS(pScreen, offman->InitialBoxes); + extents = RegionExtents(offman->InitialBoxes); pitch = extents->x2 - extents->x1; if(length < pitch) { /* special case */ @@ -1121,7 +1121,7 @@ localQueryLargestOffscreenLinear( offman = (FBManagerPtr)dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); - extents = REGION_EXTENTS(pScreen, offman->InitialBoxes); + extents = RegionExtents(offman->InitialBoxes); if((extents->x2 - extents->x1) == w) *size = w * h; return TRUE; @@ -1171,8 +1171,8 @@ xf86FBCloseScreen (int i, ScreenPtr pScreen) free(tmp2); } - REGION_DESTROY(pScreen, offman->InitialBoxes); - REGION_DESTROY(pScreen, offman->FreeBoxes); + RegionDestroy(offman->InitialBoxes); + RegionDestroy(offman->FreeBoxes); free(offman->FreeBoxesUpdateCallback); free(offman->devPrivates); @@ -1206,15 +1206,15 @@ xf86InitFBManager( if (FullBox->y2 < FullBox->y1) return FALSE; if (FullBox->x2 < FullBox->x1) return FALSE; - REGION_INIT(pScreen, &ScreenRegion, &ScreenBox, 1); - REGION_INIT(pScreen, &FullRegion, FullBox, 1); + RegionInit(&ScreenRegion, &ScreenBox, 1); + RegionInit(&FullRegion, FullBox, 1); - REGION_SUBTRACT(pScreen, &FullRegion, &FullRegion, &ScreenRegion); + RegionSubtract(&FullRegion, &FullRegion, &ScreenRegion); ret = xf86InitFBManagerRegion(pScreen, &FullRegion); - REGION_UNINIT(pScreen, &ScreenRegion); - REGION_UNINIT(pScreen, &FullRegion); + RegionUninit(&ScreenRegion); + RegionUninit(&FullRegion); return ret; } @@ -1249,17 +1249,17 @@ xf86InitFBManagerArea( } /* Factor out virtual resolution */ - pRegion = RECTS_TO_REGION(pScreen, nRect, Rect, 0); + pRegion = RegionFromRects(nRect, Rect, 0); if (pRegion) { - if (!REGION_NAR(pRegion)) { + if (!RegionNar(pRegion)) { Rect[2].x = Rect[2].y = 0; Rect[2].width = pScrn->virtualX; Rect[2].height = pScrn->virtualY; - pScreenRegion = RECTS_TO_REGION(pScreen, 1, &Rect[2], 0); + pScreenRegion = RegionFromRects(1, &Rect[2], 0); if (pScreenRegion) { - if (!REGION_NAR(pScreenRegion)) { - REGION_SUBTRACT(pScreen, pRegion, pRegion, pScreenRegion); + if (!RegionNar(pScreenRegion)) { + RegionSubtract(pRegion, pRegion, pScreenRegion); ret = xf86InitFBManagerRegion(pScreen, pRegion); @@ -1301,11 +1301,11 @@ xf86InitFBManagerArea( } } - REGION_DESTROY(pScreen, pScreenRegion); + RegionDestroy(pScreenRegion); } } - REGION_DESTROY(pScreen, pRegion); + RegionDestroy(pRegion); } return ret; @@ -1318,7 +1318,7 @@ xf86InitFBManagerRegion( ){ FBManagerPtr offman; - if(REGION_NIL(FullRegion)) + if(RegionNil(FullRegion)) return FALSE; if(!xf86RegisterOffscreenManager(pScreen, &xf86FBManFuncs)) @@ -1332,11 +1332,11 @@ xf86InitFBManagerRegion( offman->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = xf86FBCloseScreen; - offman->InitialBoxes = REGION_CREATE(pScreen, NULL, 1); - offman->FreeBoxes = REGION_CREATE(pScreen, NULL, 1); + offman->InitialBoxes = RegionCreate(NULL, 1); + offman->FreeBoxes = RegionCreate(NULL, 1); - REGION_COPY(pScreen, offman->InitialBoxes, FullRegion); - REGION_COPY(pScreen, offman->FreeBoxes, FullRegion); + RegionCopy(offman->InitialBoxes, FullRegion); + RegionCopy(offman->FreeBoxes, FullRegion); offman->pScreen = pScreen; offman->UsedAreas = NULL; @@ -1415,7 +1415,7 @@ xf86AllocateLinearOffscreenArea ( offman = (FBManagerPtr)dixLookupPrivate(&pScreen->devPrivates, xf86FBScreenKey); - extents = REGION_EXTENTS(pScreen, offman->InitialBoxes); + extents = RegionExtents(offman->InitialBoxes); w = extents->x2 - extents->x1; if (gran > 1) { diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index efed677afe..36e325f6a5 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -322,9 +322,9 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor) pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr; if(pPriv) { if(pPriv->clientClip) - REGION_DESTROY(pAdaptor->pScreen, pPriv->clientClip); + RegionDestroy(pPriv->clientClip); if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) - REGION_DESTROY(pAdaptor->pScreen, pPriv->pCompositeClip); + RegionDestroy(pPriv->pCompositeClip); free(pPriv); } } @@ -658,18 +658,18 @@ xf86XVUpdateCompositeClip(XvPortRecPrivatePtr portPriv) return; } - pCompositeClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, pCompositeClip, portPriv->clientClip); - REGION_TRANSLATE(pScreen, pCompositeClip, + pCompositeClip = RegionCreate(NullBox, 1); + RegionCopy(pCompositeClip, portPriv->clientClip); + RegionTranslate(pCompositeClip, portPriv->pDraw->x + portPriv->clipOrg.x, portPriv->pDraw->y + portPriv->clipOrg.y); - REGION_INTERSECT(pScreen, pCompositeClip, pregWin, pCompositeClip); + RegionIntersect(pCompositeClip, pregWin, pCompositeClip); portPriv->pCompositeClip = pCompositeClip; portPriv->FreeCompositeClip = TRUE; if(freeCompClip) { - REGION_DESTROY(pScreen, pregWin); + RegionDestroy(pregWin); } } @@ -684,17 +684,17 @@ xf86XVCopyClip( /* copy the new clip if it exists */ if((pGC->clientClipType == CT_REGION) && pGC->clientClip) { if(!portPriv->clientClip) - portPriv->clientClip = REGION_CREATE(pScreen, NullBox, 1); + portPriv->clientClip = RegionCreate(NullBox, 1); /* Note: this is in window coordinates */ - REGION_COPY(pScreen, portPriv->clientClip, pGC->clientClip); + RegionCopy(portPriv->clientClip, pGC->clientClip); } else if(portPriv->clientClip) { /* free the old clientClip */ - REGION_DESTROY(pScreen, portPriv->clientClip); + RegionDestroy(portPriv->clientClip); portPriv->clientClip = NULL; } /* get rid of the old clip list */ if(portPriv->pCompositeClip && portPriv->FreeCompositeClip) { - REGION_DESTROY(pScreen, portPriv->pCompositeClip); + RegionDestroy(portPriv->pCompositeClip); } portPriv->clipOrg = pGC->clipOrg; @@ -723,18 +723,18 @@ xf86XVRegetVideo(XvPortRecPrivatePtr portPriv) WinBox.y2 = WinBox.y1 + portPriv->drw_h; /* clip to the window composite clip */ - REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_NULL(pScreen, &ClipRegion); - REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip); + RegionInit(&WinRegion, &WinBox, 1); + RegionNull(&ClipRegion); + RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip); /* that's all if it's totally obscured */ - if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) { + if(!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto CLIP_VIDEO_BAILOUT; } if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion); + RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); } ret = (*portPriv->AdaptorRec->GetVideo)(portPriv->pScrn, @@ -760,8 +760,8 @@ CLIP_VIDEO_BAILOUT: if(!portPriv->FreeCompositeClip) portPriv->pCompositeClip = NULL; - REGION_UNINIT(pScreen, &WinRegion); - REGION_UNINIT(pScreen, &ClipRegion); + RegionUninit(&WinRegion); + RegionUninit(&ClipRegion); return ret; } @@ -788,9 +788,9 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv) WinBox.y2 = WinBox.y1 + portPriv->drw_h; /* clip to the window composite clip */ - REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_NULL(pScreen, &ClipRegion); - REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip); + RegionInit(&WinRegion, &WinBox, 1); + RegionNull(&ClipRegion); + RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip); /* clip and translate to the viewport */ if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { @@ -802,21 +802,21 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv) VPBox.x2 = portPriv->pScrn->frameX1 + 1; VPBox.y2 = portPriv->pScrn->frameY1 + 1; - REGION_INIT(pScreen, &VPReg, &VPBox, 1); - REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg); - REGION_UNINIT(pScreen, &VPReg); + RegionInit(&VPReg, &VPBox, 1); + RegionIntersect(&ClipRegion, &ClipRegion, &VPReg); + RegionUninit(&VPReg); } /* that's all if it's totally obscured */ - if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) { + if(!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto CLIP_VIDEO_BAILOUT; } /* bailout if we have to clip but the hardware doesn't support it */ if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = REGION_RECTS(&ClipRegion); - if( (REGION_NUM_RECTS(&ClipRegion) != 1) || + BoxPtr clipBox = RegionRects(&ClipRegion); + if( (RegionNumRects(&ClipRegion) != 1) || (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { @@ -826,7 +826,7 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv) } if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion); + RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); } ret = (*portPriv->AdaptorRec->PutVideo)(portPriv->pScrn, @@ -851,8 +851,8 @@ CLIP_VIDEO_BAILOUT: if(!portPriv->FreeCompositeClip) portPriv->pCompositeClip = NULL; - REGION_UNINIT(pScreen, &WinRegion); - REGION_UNINIT(pScreen, &ClipRegion); + RegionUninit(&WinRegion); + RegionUninit(&ClipRegion); return ret; } @@ -878,9 +878,9 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv) WinBox.y2 = WinBox.y1 + portPriv->drw_h; /* clip to the window composite clip */ - REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_NULL(pScreen, &ClipRegion); - REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip); + RegionInit(&WinRegion, &WinBox, 1); + RegionNull(&ClipRegion); + RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip); /* clip and translate to the viewport */ if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { @@ -892,21 +892,21 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv) VPBox.x2 = portPriv->pScrn->frameX1 + 1; VPBox.y2 = portPriv->pScrn->frameY1 + 1; - REGION_INIT(pScreen, &VPReg, &VPBox, 1); - REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg); - REGION_UNINIT(pScreen, &VPReg); + RegionInit(&VPReg, &VPBox, 1); + RegionIntersect(&ClipRegion, &ClipRegion, &VPReg); + RegionUninit(&VPReg); } /* that's all if it's totally obscured */ - if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) { + if(!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto CLIP_VIDEO_BAILOUT; } /* bailout if we have to clip but the hardware doesn't support it */ if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = REGION_RECTS(&ClipRegion); - if( (REGION_NUM_RECTS(&ClipRegion) != 1) || + BoxPtr clipBox = RegionRects(&ClipRegion); + if( (RegionNumRects(&ClipRegion) != 1) || (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { @@ -916,7 +916,7 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv) } if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion); + RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); } ret = (*portPriv->AdaptorRec->ReputImage)(portPriv->pScrn, @@ -938,8 +938,8 @@ CLIP_VIDEO_BAILOUT: if(!portPriv->FreeCompositeClip) portPriv->pCompositeClip = NULL; - REGION_UNINIT(pScreen, &WinRegion); - REGION_UNINIT(pScreen, &ClipRegion); + RegionUninit(&WinRegion); + RegionUninit(&ClipRegion); return ret; } @@ -1060,7 +1060,7 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2) XvPortRecPrivatePtr pPriv; Bool AreasExposed; - AreasExposed = (WinPriv && reg1 && REGION_NOTEMPTY(pScreen, reg1)); + AreasExposed = (WinPriv && reg1 && RegionNotEmpty(reg1)); pScreen->WindowExposures = ScreenPriv->WindowExposures; (*pScreen->WindowExposures)(pWin, reg1, reg2); @@ -1131,7 +1131,7 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy) if(!pPriv) goto next; if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) - REGION_DESTROY(pScreen, pPriv->pCompositeClip); + RegionDestroy(pPriv->pCompositeClip); pPriv->pCompositeClip = NULL; @@ -1268,7 +1268,7 @@ xf86XVLeaveVT(int index, int flags) pPriv->isOn = XV_OFF; if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) - REGION_DESTROY(pScreen, pPriv->pCompositeClip); + RegionDestroy(pPriv->pCompositeClip); pPriv->pCompositeClip = NULL; @@ -1309,7 +1309,7 @@ xf86XVAdjustFrame(int index, int x, int y, int flags) if(!pPriv->type && (pPriv->isOn != XV_OFF)) { /* overlaid still/image */ if(pPriv->pCompositeClip && pPriv->FreeCompositeClip) - REGION_DESTROY(pScreen, pPriv->pCompositeClip); + RegionDestroy(pPriv->pCompositeClip); pPriv->pCompositeClip = NULL; @@ -1432,9 +1432,9 @@ xf86XVPutStill( WinBox.x2 = WinBox.x1 + drw_w; WinBox.y2 = WinBox.y1 + drw_h; - REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_NULL(pScreen, &ClipRegion); - REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip); + RegionInit(&WinRegion, &WinBox, 1); + RegionNull(&ClipRegion); + RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip); if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { RegionRec VPReg; @@ -1445,23 +1445,23 @@ xf86XVPutStill( VPBox.x2 = portPriv->pScrn->frameX1 + 1; VPBox.y2 = portPriv->pScrn->frameY1 + 1; - REGION_INIT(pScreen, &VPReg, &VPBox, 1); - REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg); - REGION_UNINIT(pScreen, &VPReg); + RegionInit(&VPReg, &VPBox, 1); + RegionIntersect(&ClipRegion, &ClipRegion, &VPReg); + RegionUninit(&VPReg); } if(portPriv->pDraw) { xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv); } - if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) { + if(!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto PUT_STILL_BAILOUT; } if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = REGION_RECTS(&ClipRegion); - if( (REGION_NUM_RECTS(&ClipRegion) != 1) || + BoxPtr clipBox = RegionRects(&ClipRegion); + if( (RegionNumRects(&ClipRegion) != 1) || (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { @@ -1471,7 +1471,7 @@ xf86XVPutStill( } if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion); + RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); } ret = (*portPriv->AdaptorRec->PutStill)(portPriv->pScrn, @@ -1500,8 +1500,8 @@ PUT_STILL_BAILOUT: portPriv->isOn = XV_PENDING; } - REGION_UNINIT(pScreen, &WinRegion); - REGION_UNINIT(pScreen, &ClipRegion); + RegionUninit(&WinRegion); + RegionUninit(&ClipRegion); return ret; } @@ -1584,21 +1584,21 @@ xf86XVGetStill( WinBox.x2 = WinBox.x1 + drw_w; WinBox.y2 = WinBox.y1 + drw_h; - REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_NULL(pScreen, &ClipRegion); - REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip); + RegionInit(&WinRegion, &WinBox, 1); + RegionNull(&ClipRegion); + RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip); if(portPriv->pDraw) { xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv); } - if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) { + if(!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto GET_STILL_BAILOUT; } if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion); + RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); } ret = (*portPriv->AdaptorRec->GetStill)(portPriv->pScrn, @@ -1615,8 +1615,8 @@ GET_STILL_BAILOUT: portPriv->isOn = XV_PENDING; } - REGION_UNINIT(pScreen, &WinRegion); - REGION_UNINIT(pScreen, &ClipRegion); + RegionUninit(&WinRegion); + RegionUninit(&ClipRegion); return ret; } @@ -1732,9 +1732,9 @@ xf86XVPutImage( WinBox.x2 = WinBox.x1 + drw_w; WinBox.y2 = WinBox.y1 + drw_h; - REGION_INIT(pScreen, &WinRegion, &WinBox, 1); - REGION_NULL(pScreen, &ClipRegion); - REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip); + RegionInit(&WinRegion, &WinBox, 1); + RegionNull(&ClipRegion); + RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip); if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) { RegionRec VPReg; @@ -1745,9 +1745,9 @@ xf86XVPutImage( VPBox.x2 = portPriv->pScrn->frameX1 + 1; VPBox.y2 = portPriv->pScrn->frameY1 + 1; - REGION_INIT(pScreen, &VPReg, &VPBox, 1); - REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg); - REGION_UNINIT(pScreen, &VPReg); + RegionInit(&VPReg, &VPBox, 1); + RegionIntersect(&ClipRegion, &ClipRegion, &VPReg); + RegionUninit(&VPReg); } /* If we are changing windows, unregister our port in the old window */ @@ -1758,14 +1758,14 @@ xf86XVPutImage( ret = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv); if(ret != Success) goto PUT_IMAGE_BAILOUT; - if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) { + if(!RegionNotEmpty(&ClipRegion)) { clippedAway = TRUE; goto PUT_IMAGE_BAILOUT; } if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) { - BoxPtr clipBox = REGION_RECTS(&ClipRegion); - if( (REGION_NUM_RECTS(&ClipRegion) != 1) || + BoxPtr clipBox = RegionRects(&ClipRegion); + if( (RegionNumRects(&ClipRegion) != 1) || (clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) || (clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2)) { @@ -1775,7 +1775,7 @@ xf86XVPutImage( } if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) { - REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion); + RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion); } ret = (*portPriv->AdaptorRec->PutImage)(portPriv->pScrn, @@ -1803,8 +1803,8 @@ PUT_IMAGE_BAILOUT: portPriv->isOn = XV_PENDING; } - REGION_UNINIT(pScreen, &WinRegion); - REGION_UNINIT(pScreen, &ClipRegion); + RegionUninit(&WinRegion); + RegionUninit(&ClipRegion); return ret; } @@ -1834,8 +1834,8 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes) WindowPtr pWin = (WindowPtr)pDraw; XF86XVWindowPtr pPriv = GET_XF86XV_WINDOW(pWin); GCPtr pGC = NULL; - BoxPtr pbox = REGION_RECTS(clipboxes); - int i, nbox = REGION_NUM_RECTS(clipboxes); + BoxPtr pbox = RegionRects(clipboxes); + int i, nbox = RegionNumRects(clipboxes); xRectangle *rects; if(!xf86Screens[pScreen->myNum]->vtSema) return; @@ -1860,7 +1860,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes) ValidateGC(pDraw, pGC); } - REGION_TRANSLATE(pDraw->pScreen, clipboxes, -pDraw->x, -pDraw->y); + RegionTranslate(clipboxes, -pDraw->x, -pDraw->y); rects = malloc(nbox * sizeof(xRectangle)); @@ -1883,8 +1883,8 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes) { DrawablePtr root = &pScreen->root->drawable; ChangeGCVal pval[2]; - BoxPtr pbox = REGION_RECTS(clipboxes); - int i, nbox = REGION_NUM_RECTS(clipboxes); + BoxPtr pbox = RegionRects(clipboxes); + int i, nbox = RegionNumRects(clipboxes); xRectangle *rects; GCPtr gc; @@ -1936,7 +1936,7 @@ xf86XVClipVideoHelper( ){ double xsw, xdw, ysw, ydw; INT32 delta; - BoxPtr extents = REGION_EXTENTS(DummyScreen, reg); + BoxPtr extents = RegionExtents(reg); int diff; xsw = (*xb - *xa) << 16; @@ -1998,9 +1998,9 @@ xf86XVClipVideoHelper( (dst->y1 > extents->y1) || (dst->y2 < extents->y2)) { RegionRec clipReg; - REGION_INIT(DummyScreen, &clipReg, dst, 1); - REGION_INTERSECT(DummyScreen, reg, reg, &clipReg); - REGION_UNINIT(DummyScreen, &clipReg); + RegionInit(&clipReg, dst, 1); + RegionIntersect(reg, reg, &clipReg); + RegionUninit(&clipReg); } return TRUE; } diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index f7cea5edef..63c77ded6f 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -1157,7 +1157,7 @@ DRIDCNTreeTraversal(WindowPtr pWin, pointer data) ScreenPtr pScreen = pWin->drawable.pScreen; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - if (REGION_NUM_RECTS(&pWin->clipList) > 0) { + if (RegionNumRects(&pWin->clipList) > 0) { WindowPtr *pDRIWindows = (WindowPtr*)data; int i = 0; @@ -1269,7 +1269,7 @@ DRICreateDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable, pDRIDrawablePriv->pScreen = pScreen; pDRIDrawablePriv->refCount = 1; pDRIDrawablePriv->drawableIndex = -1; - pDRIDrawablePriv->nrects = REGION_NUM_RECTS(&pWin->clipList); + pDRIDrawablePriv->nrects = RegionNumRects(&pWin->clipList); /* save private off of preallocated index */ dixSetPrivate(&pWin->devPrivates, DRIWindowPrivKey, @@ -1288,8 +1288,8 @@ DRICreateDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable, drmUpdateDrawableInfo(pDRIPriv->drmFD, pDRIDrawablePriv->hwDrawable, DRM_DRAWABLE_CLIPRECTS, - REGION_NUM_RECTS(&pWin->clipList), - REGION_RECTS(&pWin->clipList)); + RegionNumRects(&pWin->clipList), + RegionRects(&pWin->clipList)); *hHWDrawable = pDRIDrawablePriv->hwDrawable; } } @@ -1502,8 +1502,8 @@ DRIGetDrawableInfo(ScreenPtr pScreen, #endif *W = (int)(pWin->drawable.width); *H = (int)(pWin->drawable.height); - *numClipRects = REGION_NUM_RECTS(&pWin->clipList); - *pClipRects = (drm_clip_rect_t *)REGION_RECTS(&pWin->clipList); + *numClipRects = RegionNumRects(&pWin->clipList); + *pClipRects = (drm_clip_rect_t *)RegionRects(&pWin->clipList); if (!*numClipRects && pDRIPriv->fullscreen) { /* use fake full-screen clip rect */ @@ -1883,10 +1883,10 @@ DRITreeTraversal(WindowPtr pWin, pointer data) ScreenPtr pScreen = pWin->drawable.pScreen; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - if(REGION_NUM_RECTS(&(pWin->clipList)) > 0) { + if(RegionNumRects(&(pWin->clipList)) > 0) { RegionPtr reg = (RegionPtr)data; - REGION_UNION(pScreen, reg, reg, &(pWin->clipList)); + RegionUnion(reg, reg, &(pWin->clipList)); pDRIPriv->nrWalked++; } @@ -1932,21 +1932,21 @@ DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) if(pDRIPriv->nrWindowsVisible > 0) { RegionRec reg; - REGION_NULL(pScreen, ®); + RegionNull(®); pDRIPriv->nrWalked = 0; TraverseTree(pWin, DRITreeTraversal, (pointer)(®)); - if(REGION_NOTEMPTY(pScreen, ®)) { - REGION_TRANSLATE(pScreen, ®, ptOldOrg.x - pWin->drawable.x, + if(RegionNotEmpty(®)) { + RegionTranslate(®, ptOldOrg.x - pWin->drawable.x, ptOldOrg.y - pWin->drawable.y); - REGION_INTERSECT(pScreen, ®, ®, prgnSrc); + RegionIntersect(®, ®, prgnSrc); /* The MoveBuffers interface is not ideal */ (*pDRIPriv->pDriverInfo->MoveBuffers)(pWin, ptOldOrg, ®, pDRIPriv->pDriverInfo->ddxDrawableTableEntry); } - REGION_UNINIT(pScreen, ®); + RegionUninit(®); } /* call lower wrapped functions */ @@ -2122,7 +2122,7 @@ DRIClipNotify(WindowPtr pWin, int dx, int dy) if(!pDRIPriv) return; if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) { - int nrects = REGION_NUM_RECTS(&pWin->clipList); + int nrects = RegionNumRects(&pWin->clipList); if(!pDRIPriv->windowsTouched) { DRILockTree(pScreen); @@ -2143,7 +2143,7 @@ DRIClipNotify(WindowPtr pWin, int dx, int dy) drmUpdateDrawableInfo(pDRIPriv->drmFD, pDRIDrawablePriv->hwDrawable, DRM_DRAWABLE_CLIPRECTS, - nrects, REGION_RECTS(&pWin->clipList)); + nrects, RegionRects(&pWin->clipList)); } /* call lower wrapped functions */ @@ -2368,9 +2368,9 @@ DRIMoveBuffersHelper( BoxRec tmpBox; int y, nbox; - extents = REGION_EXTENTS(pScreen, reg); - nbox = REGION_NUM_RECTS(reg); - pbox = REGION_RECTS(reg); + extents = RegionExtents(reg); + nbox = RegionNumRects(reg); + pbox = RegionRects(reg); if((dy > 0) && (dy < (extents->y2 - extents->y1))) { *ydir = -1; diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c index 45a8271a0b..3c8d3a82d6 100644 --- a/hw/xfree86/dri2/dri2.c +++ b/hw/xfree86/dri2/dri2.c @@ -461,7 +461,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, box.y1 = 0; box.x2 = pPriv->width; box.y2 = pPriv->height; - REGION_INIT(pDraw->pScreen, ®ion, &box, 0); + RegionInit(®ion, &box, 0); DRI2CopyRegion(pDraw, ®ion, DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); @@ -614,7 +614,7 @@ DRI2CanFlip(DrawablePtr pDraw) pWinPixmap = pScreen->GetWindowPixmap(pWin); if (pRootPixmap != pWinPixmap) return FALSE; - if (!REGION_EQUAL(pScreen, &pWin->clipList, &pRoot->winSize)) + if (!RegionEqual(&pWin->clipList, &pRoot->winSize)) return FALSE; return TRUE; @@ -710,7 +710,7 @@ DRI2SwapComplete(ClientPtr client, DrawablePtr pDraw, int frame, box.y1 = 0; box.x2 = pDraw->width; box.y2 = pDraw->height; - REGION_INIT(pScreen, ®ion, &box, 0); + RegionInit(®ion, &box, 0); DRI2CopyRegion(pDraw, ®ion, DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft); @@ -782,7 +782,7 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, box.y1 = 0; box.x2 = pDraw->width; box.y2 = pDraw->height; - REGION_INIT(pScreen, ®ion, &box, 0); + RegionInit(®ion, &box, 0); pPriv->swapsPending++; diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 065ba480c6..60003d5025 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -3155,9 +3155,9 @@ xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn, &crtc_box); if (crtc) { - REGION_INIT (pScreen, &crtc_region_local, &crtc_box, 1); + RegionInit(&crtc_region_local, &crtc_box, 1); crtc_region = &crtc_region_local; - REGION_INTERSECT (pScreen, crtc_region, crtc_region, reg); + RegionIntersect(crtc_region, crtc_region, reg); } *crtc_ret = crtc; } @@ -3166,7 +3166,7 @@ xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn, crtc_region, width, height); if (crtc_region != reg) - REGION_UNINIT (pScreen, &crtc_region_local); + RegionUninit(&crtc_region_local); return ret; } diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index e3683a8ed8..4cc99ad214 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -81,8 +81,8 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region) PictFormatPtr format = compWindowFormat (screen->root); int error; PicturePtr src, dst; - int n = REGION_NUM_RECTS(region); - BoxPtr b = REGION_RECTS(region); + int n = RegionNumRects(region); + BoxPtr b = RegionRects(region); XID include_inferiors = IncludeInferiors; src = CreatePicture (None, @@ -167,10 +167,10 @@ xf86CrtcDamageShadow (xf86CrtcPtr crtc) if (damage_box.y1 < 0) damage_box.y1 = 0; if (damage_box.x2 > pScreen->width) damage_box.x2 = pScreen->width; if (damage_box.y2 > pScreen->height) damage_box.y2 = pScreen->height; - REGION_INIT (pScreen, &damage_region, &damage_box, 1); + RegionInit(&damage_region, &damage_box, 1); DamageRegionAppend (&(*pScreen->GetScreenPixmap)(pScreen)->drawable, &damage_region); - REGION_UNINIT (pScreen, &damage_region); + RegionUninit(&damage_region); crtc->shadowClear = TRUE; } @@ -217,7 +217,7 @@ xf86RotateRedisplay(ScreenPtr pScreen) return FALSE; xf86RotatePrepare (pScreen); region = DamageRegion(damage); - if (REGION_NOTEMPTY(pScreen, region)) + if (RegionNotEmpty(region)) { int c; SourceValidateProcPtr SourceValidate; @@ -240,14 +240,14 @@ xf86RotateRedisplay(ScreenPtr pScreen) RegionRec crtc_damage; /* compute portion of damage that overlaps crtc */ - REGION_INIT(pScreen, &crtc_damage, &crtc->bounds, 1); - REGION_INTERSECT (pScreen, &crtc_damage, &crtc_damage, region); + RegionInit(&crtc_damage, &crtc->bounds, 1); + RegionIntersect(&crtc_damage, &crtc_damage, region); /* update damaged region */ - if (REGION_NOTEMPTY(pScreen, &crtc_damage)) + if (RegionNotEmpty(&crtc_damage)) xf86RotateCrtcRedisplay (crtc, &crtc_damage); - REGION_UNINIT (pScreen, &crtc_damage); + RegionUninit(&crtc_damage); } } pScreen->SourceValidate = SourceValidate; diff --git a/hw/xfree86/shadowfb/shadow.c b/hw/xfree86/shadowfb/shadow.c index fd5f26c0e0..a0e4b9e363 100644 --- a/hw/xfree86/shadowfb/shadow.c +++ b/hw/xfree86/shadowfb/shadow.c @@ -272,18 +272,18 @@ ShadowCopyWindow( RegionRec rgnDst; if (pPriv->vtSema) { - REGION_NULL(pWin->drawable.pScreen, &rgnDst); - REGION_COPY(pWin->drawable.pScreen, &rgnDst, prgn); + RegionNull(&rgnDst); + RegionCopy(&rgnDst, prgn); - REGION_TRANSLATE(pWin->drawable.pScreen, &rgnDst, + RegionTranslate(&rgnDst, pWin->drawable.x - ptOldOrg.x, pWin->drawable.y - ptOldOrg.y); - REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, &rgnDst); - if ((num = REGION_NUM_RECTS(&rgnDst))) { + RegionIntersect(&rgnDst, &pWin->borderClip, &rgnDst); + if ((num = RegionNumRects(&rgnDst))) { if(pPriv->preRefresh) - (*pPriv->preRefresh)(pPriv->pScrn, num, REGION_RECTS(&rgnDst)); + (*pPriv->preRefresh)(pPriv->pScrn, num, RegionRects(&rgnDst)); } else { - REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); + RegionUninit(&rgnDst); } } @@ -293,8 +293,8 @@ ShadowCopyWindow( if (num) { if (pPriv->postRefresh) - (*pPriv->postRefresh)(pPriv->pScrn, num, REGION_RECTS(&rgnDst)); - REGION_UNINIT(pWin->drawable.pScreen, &rgnDst); + (*pPriv->postRefresh)(pPriv->pScrn, num, RegionRects(&rgnDst)); + RegionUninit(&rgnDst); } } @@ -1353,37 +1353,37 @@ ShadowFontToBox(BoxPtr BB, DrawablePtr pDrawable, GCPtr pGC, int x, int y, } right += pFont->info.maxbounds.rightSideBearing; BB->x1 = - max(pDrawable->x + x - left, (REGION_EXTENTS(pGC->pScreen, + max(pDrawable->x + x - left, (RegionExtents( &((WindowPtr) pDrawable)->winSize))->x1); BB->y1 = max(pDrawable->y + y - ascent, - (REGION_EXTENTS(pGC->pScreen, + (RegionExtents( &((WindowPtr) pDrawable)->winSize))->y1); BB->x2 = min(pDrawable->x + x + right, - (REGION_EXTENTS(pGC->pScreen, + (RegionExtents( &((WindowPtr) pDrawable)->winSize))->x2); BB->y2 = min(pDrawable->y + y + descent, - (REGION_EXTENTS(pGC->pScreen, + (RegionExtents( &((WindowPtr) pDrawable)->winSize))->y2); } else { ShadowTextExtent(pFont, count, chars, wide ? (FONTLASTROW(pFont) == 0) ? Linear16Bit : TwoD16Bit : Linear8Bit, BB); BB->x1 = - max(pDrawable->x + x + BB->x1, (REGION_EXTENTS(pGC->pScreen, + max(pDrawable->x + x + BB->x1, (RegionExtents( &((WindowPtr) pDrawable)->winSize))->x1); BB->y1 = max(pDrawable->y + y + BB->y1, - (REGION_EXTENTS(pGC->pScreen, + (RegionExtents( &((WindowPtr) pDrawable)->winSize))->y1); BB->x2 = min(pDrawable->x + x + BB->x2, - (REGION_EXTENTS(pGC->pScreen, + (RegionExtents( &((WindowPtr) pDrawable)->winSize))->x2); BB->y2 = min(pDrawable->y + y + BB->y2, - (REGION_EXTENTS(pGC->pScreen, + (RegionExtents( &((WindowPtr) pDrawable)->winSize))->y2); } } diff --git a/hw/xfree86/xaa/xaaBitBlt.c b/hw/xfree86/xaa/xaaBitBlt.c index 75033bcca9..5148ed4a2d 100644 --- a/hw/xfree86/xaa/xaaBitBlt.c +++ b/hw/xfree86/xaa/xaaBitBlt.c @@ -118,8 +118,8 @@ XAABitBlt( fastExpose = 0; } } else { - REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1); - REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip); + RegionInit(&rgnDst, &fastBox, 1); + RegionIntersect(&rgnDst, &rgnDst, prgnSrcClip); } dstx += pDstDrawable->x; @@ -128,9 +128,9 @@ XAABitBlt( if (pDstDrawable->type == DRAWABLE_WINDOW) { if (!((WindowPtr)pDstDrawable)->realized) { if (!fastClip) - REGION_UNINIT(pGC->pScreen, &rgnDst); + RegionUninit(&rgnDst); if (freeSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); + RegionDestroy(prgnSrcClip); return NULL; } } @@ -153,8 +153,8 @@ XAABitBlt( blown region and call intersect */ cclip = pGC->pCompositeClip; - if (REGION_NUM_RECTS(cclip) == 1) { - BoxPtr pBox = REGION_RECTS(cclip); + if (RegionNumRects(cclip) == 1) { + BoxPtr pBox = RegionRects(cclip); if (fastBox.x1 < pBox->x1) fastBox.x1 = pBox->x1; if (fastBox.x2 > pBox->x2) fastBox.x2 = pBox->x2; @@ -163,37 +163,37 @@ XAABitBlt( /* Check to see if the region is empty */ if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) { - REGION_NULL(pGC->pScreen, &rgnDst); + RegionNull(&rgnDst); } else { - REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1); + RegionInit(&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); + RegionInit(&rgnDst, &fastBox,1); } } else { - REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy); + RegionTranslate(&rgnDst, -dx, -dy); } if (!fastClip) { - REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, + RegionIntersect(&rgnDst, &rgnDst, pGC->pCompositeClip); } /* Do bit blitting */ - numRects = REGION_NUM_RECTS(&rgnDst); + numRects = RegionNumRects(&rgnDst); if (numRects && width && height) { if(!(pptSrc = (DDXPointPtr)malloc(numRects * sizeof(DDXPointRec)))) { - REGION_UNINIT(pGC->pScreen, &rgnDst); + RegionUninit(&rgnDst); if (freeSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); + RegionDestroy(prgnSrcClip); return NULL; } - pbox = REGION_RECTS(&rgnDst); + pbox = RegionRects(&rgnDst); ppt = pptSrc; for (i = numRects; --i >= 0; pbox++, ppt++) { ppt->x = pbox->x1 + dx; @@ -214,8 +214,8 @@ XAABitBlt( (int)origSource.height, origDest.x, origDest.y, bitPlane); } - REGION_UNINIT(pGC->pScreen, &rgnDst); + RegionUninit(&rgnDst); if (freeSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); + RegionDestroy(prgnSrcClip); return prgnExposed; } diff --git a/hw/xfree86/xaa/xaaCpyArea.c b/hw/xfree86/xaa/xaaCpyArea.c index 1a03bfdb25..443a0e15e0 100644 --- a/hw/xfree86/xaa/xaaCpyArea.c +++ b/hw/xfree86/xaa/xaaCpyArea.c @@ -95,8 +95,8 @@ XAADoBitBlt( ((pSrc->type == DRAWABLE_WINDOW) && (pDst->type == DRAWABLE_WINDOW))); - pbox = REGION_RECTS(prgnDst); - nbox = REGION_NUM_RECTS(prgnDst); + pbox = RegionRects(prgnDst); + nbox = RegionNumRects(prgnDst); pboxNew1 = NULL; pptNew1 = NULL; @@ -204,8 +204,8 @@ XAADoImageWrite( int srcwidth; unsigned char* psrcBase; /* start of image */ unsigned char* srcPntr; /* index into the image */ - BoxPtr pbox = REGION_RECTS(prgnDst); - int nbox = REGION_NUM_RECTS(prgnDst); + BoxPtr pbox = RegionRects(prgnDst); + int nbox = RegionNumRects(prgnDst); XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); int Bpp = pSrc->bitsPerPixel >> 3; @@ -233,8 +233,8 @@ XAADoImageRead( int dstwidth; unsigned char* pdstBase; /* start of image */ unsigned char* dstPntr; /* index into the image */ - BoxPtr pbox = REGION_RECTS(prgnDst); - int nbox = REGION_NUM_RECTS(prgnDst); + BoxPtr pbox = RegionRects(prgnDst); + int nbox = RegionNumRects(prgnDst); XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); int Bpp = pSrc->bitsPerPixel >> 3; /* wouldn't get here unless both src and dst have same bpp */ diff --git a/hw/xfree86/xaa/xaaCpyPlane.c b/hw/xfree86/xaa/xaaCpyPlane.c index e3010eafb7..6d2b3a008f 100644 --- a/hw/xfree86/xaa/xaaCpyPlane.c +++ b/hw/xfree86/xaa/xaaCpyPlane.c @@ -76,8 +76,8 @@ XAACopyPlane1toNColorExpand( DDXPointPtr pptSrc ) { XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - BoxPtr pbox = REGION_RECTS(rgnDst); - int numrects = REGION_NUM_RECTS(rgnDst); + BoxPtr pbox = RegionRects(rgnDst); + int numrects = RegionNumRects(rgnDst); unsigned char *src = ((PixmapPtr)pSrc)->devPrivate.ptr; int srcwidth = ((PixmapPtr)pSrc)->devKind; @@ -101,8 +101,8 @@ XAACopyPlaneNtoNColorExpand( DDXPointPtr pptSrc ){ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - BoxPtr pbox = REGION_RECTS(rgnDst); - int numrects = REGION_NUM_RECTS(rgnDst); + BoxPtr pbox = RegionRects(rgnDst); + int numrects = RegionNumRects(rgnDst); unsigned char *src = ((PixmapPtr)pSrc)->devPrivate.ptr; unsigned char *data, *srcPtr, *dataPtr; int srcwidth = ((PixmapPtr)pSrc)->devKind; @@ -168,14 +168,14 @@ XAAPushPixelsSolidColorExpansion( int xOrg, int yOrg ) { XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - int MaxBoxes = REGION_NUM_RECTS(pGC->pCompositeClip); + int MaxBoxes = RegionNumRects(pGC->pCompositeClip); BoxPtr pbox, pClipBoxes; int nboxes, srcx, srcy; xRectangle TheRect; unsigned char *src = pBitMap->devPrivate.ptr; int srcwidth = pBitMap->devKind; - if(!REGION_NUM_RECTS(pGC->pCompositeClip)) + if(!RegionNumRects(pGC->pCompositeClip)) return; TheRect.x = xOrg; diff --git a/hw/xfree86/xaa/xaaCpyWin.c b/hw/xfree86/xaa/xaaCpyWin.c index d58db8ea1b..c3c2690b2e 100644 --- a/hw/xfree86/xaa/xaaCpyWin.c +++ b/hw/xfree86/xaa/xaaCpyWin.c @@ -49,18 +49,18 @@ XAACopyWindow( pwinRoot = pScreen->root; - REGION_NULL(pScreen, &rgnDst); + RegionNull(&rgnDst); dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; - REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy); - REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc); + RegionTranslate(prgnSrc, -dx, -dy); + RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); - pbox = REGION_RECTS(&rgnDst); - nbox = REGION_NUM_RECTS(&rgnDst); + pbox = RegionRects(&rgnDst); + nbox = RegionNumRects(&rgnDst); if(!nbox || !(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) { - REGION_UNINIT(pScreen, &rgnDst); + RegionUninit(&rgnDst); return; } ppt = pptSrc; @@ -78,5 +78,5 @@ XAACopyWindow( &(infoRec->ScratchGC), &rgnDst, pptSrc); free(pptSrc); - REGION_UNINIT(pScreen, &rgnDst); + RegionUninit(&rgnDst); } diff --git a/hw/xfree86/xaa/xaaDashLine.c b/hw/xfree86/xaa/xaaDashLine.c index 63233e05df..e84708449e 100644 --- a/hw/xfree86/xaa/xaaDashLine.c +++ b/hw/xfree86/xaa/xaaDashLine.c @@ -37,8 +37,8 @@ XAAPolyLinesDashed( XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&pGC->devPrivates, XAAGetGCKey()); - BoxPtr pboxInit = REGION_RECTS(pGC->pCompositeClip); - int nboxInit = REGION_NUM_RECTS(pGC->pCompositeClip); + BoxPtr pboxInit = RegionRects(pGC->pCompositeClip); + int nboxInit = RegionNumRects(pGC->pCompositeClip); unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); int xorg = pDrawable->x; int yorg = pDrawable->y; diff --git a/hw/xfree86/xaa/xaaFillArc.c b/hw/xfree86/xaa/xaaFillArc.c index d83922ce03..47d804108b 100644 --- a/hw/xfree86/xaa/xaaFillArc.c +++ b/hw/xfree86/xaa/xaaFillArc.c @@ -171,7 +171,7 @@ XAAPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs) cclip = pGC->pCompositeClip; - if(!REGION_NUM_RECTS(cclip)) + if(!RegionNumRects(cclip)) return; for (arc = parcs, i = narcs; --i >= 0; arc++) @@ -198,7 +198,7 @@ XAAPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs) y2 = box.y1 + (int)arc->height + 1; box.y2 = y2; if ( (x2 <= SHRT_MAX) && (y2 <= SHRT_MAX) && - (RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN) ) + (RegionContainsRect(cclip, &box) == rgnIN) ) { if ((arc->angle2 >= FULLCIRCLE) || (arc->angle2 <= -FULLCIRCLE)) diff --git a/hw/xfree86/xaa/xaaFillPoly.c b/hw/xfree86/xaa/xaaFillPoly.c index 6f11e35ffd..289a3cab1f 100644 --- a/hw/xfree86/xaa/xaaFillPoly.c +++ b/hw/xfree86/xaa/xaaFillPoly.c @@ -213,7 +213,7 @@ XAAFillPolygonSolid( int c, y, maxy, h, yoffset; DDXPointPtr topPoint; - if(!REGION_NUM_RECTS(pGC->pCompositeClip)) + if(!RegionNumRects(pGC->pCompositeClip)) return; if (mode == CoordModePrevious) { @@ -226,7 +226,7 @@ XAAFillPolygonSolid( mode = CoordModeOrigin; } - if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1) { + if (RegionNumRects(pGC->pCompositeClip) != 1) { miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn); return; } @@ -676,7 +676,7 @@ XAAFillPolygonStippled( RectFuncPtr RectFunc = NULL; TrapFuncPtr TrapFunc = NULL; - if(!REGION_NUM_RECTS(pGC->pCompositeClip)) + if(!RegionNumRects(pGC->pCompositeClip)) return; if (mode == CoordModePrevious) { @@ -689,7 +689,7 @@ XAAFillPolygonStippled( mode = CoordModeOrigin; } - if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1) { + if (RegionNumRects(pGC->pCompositeClip) != 1) { miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn); return; } @@ -836,7 +836,7 @@ XAAFillPolygonTiled( RectFuncPtr RectFunc = NULL; TrapFuncPtr TrapFunc = NULL; - if(!REGION_NUM_RECTS(pGC->pCompositeClip)) + if(!RegionNumRects(pGC->pCompositeClip)) return; if (mode == CoordModePrevious) { @@ -849,7 +849,7 @@ XAAFillPolygonTiled( mode = CoordModeOrigin; } - if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1) { + if (RegionNumRects(pGC->pCompositeClip) != 1) { miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn); return; } diff --git a/hw/xfree86/xaa/xaaFillRect.c b/hw/xfree86/xaa/xaaFillRect.c index 0b83ef3eed..dde31c1f35 100644 --- a/hw/xfree86/xaa/xaaFillRect.c +++ b/hw/xfree86/xaa/xaaFillRect.c @@ -40,7 +40,7 @@ XAAPolyFillRect( if((nrectFill <= 0) || !pGC->planemask) return; - if(!REGION_NUM_RECTS(pGC->pCompositeClip)) + if(!RegionNumRects(pGC->pCompositeClip)) return; switch(pGC->fillStyle) { @@ -944,8 +944,8 @@ XAAClipAndRenderRects( pboxClippedBase = (BoxPtr)infoRec->PreAllocMem; pboxClipped = pboxClippedBase; - if (REGION_NUM_RECTS(pGC->pCompositeClip) == 1) { - pextent = REGION_RECTS(pGC->pCompositeClip); + if (RegionNumRects(pGC->pCompositeClip) == 1) { + pextent = RegionRects(pGC->pCompositeClip); while (nrectFill--) { pboxClipped->x1 = max(pextent->x1, prect->x); pboxClipped->y1 = max(pextent->y1, prect->y); @@ -967,7 +967,7 @@ XAAClipAndRenderRects( } } } else { - pextent = REGION_EXTENTS(pGC->pScreen, pGC->pCompositeClip); + pextent = RegionExtents(pGC->pCompositeClip); while (nrectFill--) { int n; BoxRec box, *pbox; @@ -986,8 +986,8 @@ XAAClipAndRenderRects( if ((box.x1 >= box.x2) || (box.y1 >= box.y2)) continue; - n = REGION_NUM_RECTS (pGC->pCompositeClip); - pbox = REGION_RECTS(pGC->pCompositeClip); + n = RegionNumRects (pGC->pCompositeClip); + pbox = RegionRects(pGC->pCompositeClip); /* clip the rectangle to each box in the clip region this is logically equivalent to calling Intersect() @@ -1030,8 +1030,8 @@ XAAGetRectClipBoxes( xRectangle *prect = prectInit; RegionPtr prgnClip = pGC->pCompositeClip; - if (REGION_NUM_RECTS(prgnClip) == 1) { - pextent = REGION_RECTS(prgnClip); + if (RegionNumRects(prgnClip) == 1) { + pextent = RegionRects(prgnClip); while (nrectFill--) { pboxClipped->x1 = max(pextent->x1, prect->x); pboxClipped->y1 = max(pextent->y1, prect->y); @@ -1049,7 +1049,7 @@ XAAGetRectClipBoxes( } } } else { - pextent = REGION_EXTENTS(pGC->pScreen, prgnClip); + pextent = RegionExtents(prgnClip); while (nrectFill--) { int n; BoxRec box, *pbox; @@ -1068,8 +1068,8 @@ XAAGetRectClipBoxes( if ((box.x1 >= box.x2) || (box.y1 >= box.y2)) continue; - n = REGION_NUM_RECTS (prgnClip); - pbox = REGION_RECTS(prgnClip); + n = RegionNumRects (prgnClip); + pbox = RegionRects(prgnClip); /* clip the rectangle to each box in the clip region this is logically equivalent to calling Intersect() diff --git a/hw/xfree86/xaa/xaaImage.c b/hw/xfree86/xaa/xaaImage.c index 30caa2a9a8..e88f45c551 100644 --- a/hw/xfree86/xaa/xaaImage.c +++ b/hw/xfree86/xaa/xaaImage.c @@ -406,7 +406,7 @@ XAAPutImage( Bool depthBug = FALSE; if(!w || !h) return; - if(!REGION_NUM_RECTS(pGC->pCompositeClip)) + if(!RegionNumRects(pGC->pCompositeClip)) return; depthBug = XAA_DEPTH_BUG(pGC); @@ -431,7 +431,7 @@ XAAPutImage( !(infoRec->WriteBitmapFlags & NO_PLANEMASK) && !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY))){ - int MaxBoxes = REGION_NUM_RECTS(pGC->pCompositeClip); + int MaxBoxes = RegionNumRects(pGC->pCompositeClip); BoxPtr pbox, pClipBoxes; int nboxes, srcx, srcy, srcwidth; xRectangle TheRect; diff --git a/hw/xfree86/xaa/xaaLine.c b/hw/xfree86/xaa/xaaLine.c index 7469de179d..d6c06eba86 100644 --- a/hw/xfree86/xaa/xaaLine.c +++ b/hw/xfree86/xaa/xaaLine.c @@ -35,8 +35,8 @@ XAAPolyLines( #endif ){ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - BoxPtr pboxInit = REGION_RECTS(pGC->pCompositeClip); - int nboxInit = REGION_NUM_RECTS(pGC->pCompositeClip); + BoxPtr pboxInit = RegionRects(pGC->pCompositeClip); + int nboxInit = RegionNumRects(pGC->pCompositeClip); unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); int xorg = pDrawable->x; int yorg = pDrawable->y; diff --git a/hw/xfree86/xaa/xaaNonTEText.c b/hw/xfree86/xaa/xaaNonTEText.c index 072fe19250..a7fcf7ab99 100644 --- a/hw/xfree86/xaa/xaaNonTEText.c +++ b/hw/xfree86/xaa/xaaNonTEText.c @@ -128,7 +128,7 @@ XAAImageText8NonTEColorExpansion( XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); unsigned long n; - if(!REGION_NUM_RECTS(pGC->pCompositeClip)) + if(!RegionNumRects(pGC->pCompositeClip)) return; (*pGC->font->get_glyphs)(pGC->font, (unsigned long)count, @@ -153,7 +153,7 @@ XAAImageText16NonTEColorExpansion( XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); unsigned long n; - if(!REGION_NUM_RECTS(pGC->pCompositeClip)) + if(!RegionNumRects(pGC->pCompositeClip)) return; (*pGC->font->get_glyphs)( @@ -188,7 +188,7 @@ XAAImageGlyphBltNonTEColorExpansion( ){ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - if(!REGION_NUM_RECTS(pGC->pCompositeClip)) + if(!RegionNumRects(pGC->pCompositeClip)) return; ImageGlyphBltNonTEColorExpansion( @@ -208,7 +208,7 @@ XAAPolyGlyphBltNonTEColorExpansion( ){ XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - if(!REGION_NUM_RECTS(pGC->pCompositeClip)) + if(!RegionNumRects(pGC->pCompositeClip)) return; PolyGlyphBltNonTEColorExpansion( @@ -368,8 +368,8 @@ ImageGlyphBltNonTEColorExpansion( int skippix, skipglyph, width, n, i; int Left, Right, Top, Bottom; int LeftEdge, RightEdge, ytop, ybot; - int nbox = REGION_NUM_RECTS(cclip); - BoxPtr pbox = REGION_RECTS(cclip); + int nbox = RegionNumRects(cclip); + BoxPtr pbox = RegionRects(cclip); Bool AlreadySetup = FALSE; width = CollectCharacterInfo(infoRec->GlyphInfo, nglyph, ppci, font); @@ -405,8 +405,8 @@ ImageGlyphBltNonTEColorExpansion( nbox--; pbox++; } - nbox = REGION_NUM_RECTS(cclip); - pbox = REGION_RECTS(cclip); + nbox = RegionNumRects(cclip); + pbox = RegionRects(cclip); if(infoRec->WriteBitmap && (nglyph > 1) && ((FONTMAXBOUNDS(font, rightSideBearing) - @@ -477,8 +477,8 @@ PolyGlyphBltNonTEColorExpansion( int skippix, skipglyph, width, n, i; int Left, Right, Top, Bottom; int LeftEdge, RightEdge; - int nbox = REGION_NUM_RECTS(cclip); - BoxPtr pbox = REGION_RECTS(cclip); + int nbox = RegionNumRects(cclip); + BoxPtr pbox = RegionRects(cclip); width = CollectCharacterInfo(infoRec->GlyphInfo, nglyph, ppci, font); diff --git a/hw/xfree86/xaa/xaaOverlay.c b/hw/xfree86/xaa/xaaOverlay.c index 14de9bd346..4b52bf6fdc 100644 --- a/hw/xfree86/xaa/xaaOverlay.c +++ b/hw/xfree86/xaa/xaaOverlay.c @@ -59,18 +59,18 @@ XAACopyWindow8_32( if(doUnderlay) freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip); - REGION_NULL(pScreen, &rgnDst); + RegionNull(&rgnDst); dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; - REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy); - REGION_INTERSECT(pScreen, &rgnDst, borderClip, prgnSrc); + RegionTranslate(prgnSrc, -dx, -dy); + RegionIntersect(&rgnDst, borderClip, prgnSrc); - pbox = REGION_RECTS(&rgnDst); - nbox = REGION_NUM_RECTS(&rgnDst); + pbox = RegionRects(&rgnDst); + nbox = RegionNumRects(&rgnDst); if(!nbox || !(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) { - REGION_UNINIT(pScreen, &rgnDst); + RegionUninit(&rgnDst); return; } ppt = pptSrc; @@ -88,9 +88,9 @@ XAACopyWindow8_32( &(infoRec->ScratchGC), &rgnDst, pptSrc); free(pptSrc); - REGION_UNINIT(pScreen, &rgnDst); + RegionUninit(&rgnDst); if(freeReg) - REGION_DESTROY(pScreen, borderClip); + RegionDestroy(borderClip); } static void diff --git a/hw/xfree86/xaa/xaaOverlayDF.c b/hw/xfree86/xaa/xaaOverlayDF.c index b186cb5cdb..61adec62b2 100644 --- a/hw/xfree86/xaa/xaaOverlayDF.c +++ b/hw/xfree86/xaa/xaaOverlayDF.c @@ -341,18 +341,18 @@ XAAOverCopyWindow( infoRec->ScratchGC.alu = GXcopy; infoRec->ScratchGC.planemask = ~0; - REGION_NULL(pScreen, &rgnDst); + RegionNull(&rgnDst); dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; - REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy); - REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc); + RegionTranslate(prgnSrc, -dx, -dy); + RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); - nbox = REGION_NUM_RECTS(&rgnDst); + nbox = RegionNumRects(&rgnDst); if(nbox && (pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) { - pbox = REGION_RECTS(&rgnDst); + pbox = RegionRects(&rgnDst); for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) { ppt->x = pbox->x1 + dx; ppt->y = pbox->y1 + dy; @@ -371,18 +371,18 @@ XAAOverCopyWindow( free(pptSrc); } - REGION_UNINIT(pScreen, &rgnDst); + RegionUninit(&rgnDst); if(pWin->drawable.depth == 8) { - REGION_NULL(pScreen, &rgnDst); + RegionNull(&rgnDst); miSegregateChildren(pWin, &rgnDst, pScrn->depth); - if(REGION_NOTEMPTY(pScreen, &rgnDst)) { - REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrc); - nbox = REGION_NUM_RECTS(&rgnDst); + if(RegionNotEmpty(&rgnDst)) { + RegionIntersect(&rgnDst, &rgnDst, prgnSrc); + nbox = RegionNumRects(&rgnDst); if(nbox && (pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))){ - pbox = REGION_RECTS(&rgnDst); + pbox = RegionRects(&rgnDst); for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) { ppt->x = pbox->x1 + dx; ppt->y = pbox->y1 + dy; @@ -394,7 +394,7 @@ XAAOverCopyWindow( free(pptSrc); } } - REGION_UNINIT(pScreen, &rgnDst); + RegionUninit(&rgnDst); } } @@ -409,13 +409,13 @@ XAAOverWindowExposures( XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); if((pWin->drawable.bitsPerPixel != 8) && infoRec->pScrn->vtSema) { - if(REGION_NUM_RECTS(pReg) && infoRec->FillSolidRects) { + if(RegionNumRects(pReg) && infoRec->FillSolidRects) { XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen); SWITCH_DEPTH(8); (*infoRec->FillSolidRects)(infoRec->pScrn, infoRec->pScrn->colorKey, GXcopy, ~0, - REGION_NUM_RECTS(pReg), REGION_RECTS(pReg)); + RegionNumRects(pReg), RegionRects(pReg)); miWindowExposures(pWin, pReg, pOtherReg); return; } else if(infoRec->NeedToSync) { diff --git a/hw/xfree86/xaa/xaaPCache.c b/hw/xfree86/xaa/xaaPCache.c index 598a1bec8e..f7f6a29bb0 100644 --- a/hw/xfree86/xaa/xaaPCache.c +++ b/hw/xfree86/xaa/xaaPCache.c @@ -639,8 +639,8 @@ XAAInitPixmapCache( ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; XAAInfoRecPtr infoRec = (XAAInfoRecPtr)data; XAAPixmapCachePrivatePtr pCachePriv; - BoxPtr pBox = REGION_RECTS(areas); - int nBox = REGION_NUM_RECTS(areas); + BoxPtr pBox = RegionRects(areas); + int nBox = RegionNumRects(areas); int Num512, Num256, Num128, NumPartial, NumColor, NumMono; int Target512, Target256; CacheLinkPtr List512, List256, List128, ListPartial, ListColor, ListMono; diff --git a/hw/xfree86/xaa/xaaPict.c b/hw/xfree86/xaa/xaaPict.c index 38ef21e850..aaafacba51 100644 --- a/hw/xfree86/xaa/xaaPict.c +++ b/hw/xfree86/xaa/xaaPict.c @@ -215,7 +215,7 @@ XAADoComposite ( BoxPtr pbox; int nbox, w, h; - if(!REGION_NUM_RECTS(pDst->pCompositeClip)) + if(!RegionNumRects(pDst->pCompositeClip)) return TRUE; if(!infoRec->pScrn->vtSema || !DRAWABLE_IS_ON_CARD(pDst->pDrawable)) @@ -273,8 +273,8 @@ XAADoComposite ( width, height)) return TRUE; - nbox = REGION_NUM_RECTS(®ion); - pbox = REGION_RECTS(®ion); + nbox = RegionNumRects(®ion); + pbox = RegionRects(®ion); if(!nbox) return TRUE; @@ -298,7 +298,7 @@ XAADoComposite ( } /* WriteBitmap sets the Sync flag */ - REGION_UNINIT(pScreen, ®ion); + RegionUninit(®ion); return TRUE; } @@ -340,11 +340,11 @@ XAADoComposite ( width, height)) return TRUE; - nbox = REGION_NUM_RECTS(®ion); - pbox = REGION_RECTS(®ion); + nbox = RegionNumRects(®ion); + pbox = RegionRects(®ion); if(!nbox) { - REGION_UNINIT(pScreen, ®ion); + RegionUninit(®ion); return TRUE; } @@ -355,7 +355,7 @@ XAADoComposite ( ((PixmapPtr)(pMask->pDrawable))->devKind, w, h, flags)) { - REGION_UNINIT(pScreen, ®ion); + RegionUninit(®ion); return FALSE; } @@ -371,7 +371,7 @@ XAADoComposite ( } SET_SYNC_FLAG(infoRec); - REGION_UNINIT(pScreen, ®ion); + RegionUninit(®ion); return TRUE; } } else { @@ -409,11 +409,11 @@ XAADoComposite ( width, height)) return TRUE; - nbox = REGION_NUM_RECTS(®ion); - pbox = REGION_RECTS(®ion); + nbox = RegionNumRects(®ion); + pbox = RegionRects(®ion); if(!nbox) { - REGION_UNINIT(pScreen, ®ion); + RegionUninit(®ion); return TRUE; } @@ -423,7 +423,7 @@ XAADoComposite ( ((PixmapPtr)(pSrc->pDrawable))->devKind, w, h, flags)) { - REGION_UNINIT(pScreen, ®ion); + RegionUninit(®ion); return FALSE; } @@ -440,7 +440,7 @@ XAADoComposite ( } SET_SYNC_FLAG(infoRec); - REGION_UNINIT(pScreen, ®ion); + RegionUninit(®ion); return TRUE; } @@ -476,16 +476,16 @@ XAACompositeSrcCopy (PicturePtr pSrc, width, height)) return; - nbox = REGION_NUM_RECTS(®ion); - pbox = REGION_RECTS(®ion); + nbox = RegionNumRects(®ion); + pbox = RegionRects(®ion); if(!nbox) { - REGION_UNINIT(pScreen, ®ion); + RegionUninit(®ion); return; } pptSrc = malloc(sizeof(DDXPointRec) * nbox); if (!pptSrc) { - REGION_UNINIT(pScreen, ®ion); + RegionUninit(®ion); return; } xoff = xSrc - xDst; @@ -502,7 +502,7 @@ XAACompositeSrcCopy (PicturePtr pSrc, pptSrc); free(pptSrc); - REGION_UNINIT(pScreen, ®ion); + RegionUninit(®ion); return; } @@ -588,7 +588,7 @@ XAADoGlyphs (CARD8 op, ScreenPtr pScreen = pDst->pDrawable->pScreen; XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - if(!REGION_NUM_RECTS(pDst->pCompositeClip)) + if(!RegionNumRects(pDst->pCompositeClip)) return TRUE; if(!infoRec->pScrn->vtSema || diff --git a/hw/xfree86/xaa/xaaRect.c b/hw/xfree86/xaa/xaaRect.c index 0a7e174b7f..4a3912946e 100644 --- a/hw/xfree86/xaa/xaaRect.c +++ b/hw/xfree86/xaa/xaaRect.c @@ -46,8 +46,8 @@ XAAPolyRectangleThinSolid( int clipYMax; /* lower right corner of clip rect */ int width, height; /* width and height of rect */ - nClipRects = REGION_NUM_RECTS(pGC->pCompositeClip); - pClipRects = REGION_RECTS(pGC->pCompositeClip); + nClipRects = RegionNumRects(pGC->pCompositeClip); + pClipRects = RegionRects(pGC->pCompositeClip); if(!nClipRects) return; diff --git a/hw/xfree86/xaa/xaaSpans.c b/hw/xfree86/xaa/xaaSpans.c index 46d6d07405..a742cba1bb 100644 --- a/hw/xfree86/xaa/xaaSpans.c +++ b/hw/xfree86/xaa/xaaSpans.c @@ -49,7 +49,7 @@ XAAFillSpans( if((nInit <= 0) || !pGC->planemask) return; - if(!REGION_NUM_RECTS(pGC->pCompositeClip)) + if(!RegionNumRects(pGC->pCompositeClip)) return; switch(pGC->fillStyle) { @@ -117,7 +117,7 @@ XAAFillSpans( } - if((nInit < 10) || (REGION_NUM_RECTS(pGC->pCompositeClip) != 1)) + if((nInit < 10) || (RegionNumRects(pGC->pCompositeClip) != 1)) fastClip = FALSE; if(fastClip) { @@ -797,10 +797,10 @@ XAAClipAndRenderSpans( pptNew = pptBase; pwidthNew = pwidthBase; - numRects = REGION_NUM_RECTS(pGC->pCompositeClip); + numRects = RegionNumRects(pGC->pCompositeClip); if(numRects == 1) { - BoxPtr pextent = REGION_RECTS(pGC->pCompositeClip); + BoxPtr pextent = RegionRects(pGC->pCompositeClip); while(nspans--) { if ((pextent->y1 <= ppt->y) && (ppt->y < pextent->y2)) { @@ -830,7 +830,7 @@ XAAClipAndRenderSpans( while(nspans--) { nbox = numRects; - pbox = REGION_RECTS(pGC->pCompositeClip); + pbox = RegionRects(pGC->pCompositeClip); /* find the first band */ while(nbox && (pbox->y2 <= ppt->y)) { diff --git a/hw/xfree86/xaa/xaaTEText.c b/hw/xfree86/xaa/xaaTEText.c index b182283108..729e8a8cbc 100644 --- a/hw/xfree86/xaa/xaaTEText.c +++ b/hw/xfree86/xaa/xaaTEText.c @@ -110,7 +110,7 @@ XAAImageText8TEColorExpansion( XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); unsigned long n; - if(!REGION_NUM_RECTS(pGC->pCompositeClip)) + if(!RegionNumRects(pGC->pCompositeClip)) return; (*pGC->font->get_glyphs)(pGC->font, (unsigned long)count, @@ -134,7 +134,7 @@ XAAImageText16TEColorExpansion( XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); unsigned long n; - if(!REGION_NUM_RECTS(pGC->pCompositeClip)) + if(!RegionNumRects(pGC->pCompositeClip)) return; (*pGC->font->get_glyphs)( @@ -169,7 +169,7 @@ XAAImageGlyphBltTEColorExpansion( { XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - if(!REGION_NUM_RECTS(pGC->pCompositeClip)) + if(!RegionNumRects(pGC->pCompositeClip)) return; XAAGlyphBltTEColorExpansion( @@ -189,7 +189,7 @@ XAAPolyGlyphBltTEColorExpansion( { XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - if(!REGION_NUM_RECTS(pGC->pCompositeClip)) + if(!RegionNumRects(pGC->pCompositeClip)) return; XAAGlyphBltTEColorExpansion( @@ -229,8 +229,8 @@ XAAGlyphBltTEColorExpansion( int skippix, skipglyphs; int Left, Right, Top, Bottom; int LeftEdge, RightEdge, ytop, ybot; - int nbox = REGION_NUM_RECTS(cclip); - BoxPtr pbox = REGION_RECTS(cclip); + int nbox = RegionNumRects(cclip); + BoxPtr pbox = RegionRects(cclip); unsigned int **glyphs = NULL; int glyphWidth = FONTMAXBOUNDS(font, characterWidth); diff --git a/hw/xfree86/xaa/xaaWideLine.c b/hw/xfree86/xaa/xaaWideLine.c index a684d66762..79a6159cda 100644 --- a/hw/xfree86/xaa/xaaWideLine.c +++ b/hw/xfree86/xaa/xaaWideLine.c @@ -804,10 +804,10 @@ XAAPolylinesWideSolid ( int yorg = pDrawable->y; Bool hardClip = FALSE; - if(!REGION_NUM_RECTS(pGC->pCompositeClip)) + if(!RegionNumRects(pGC->pCompositeClip)) return; - if(REGION_NUM_RECTS(pGC->pCompositeClip) != 1) { + if(RegionNumRects(pGC->pCompositeClip) != 1) { miWideLine(pDrawable, pGC, mode, npt, pPts); return; } diff --git a/hw/xfree86/xaa/xaawrap.h b/hw/xfree86/xaa/xaawrap.h index 86ba003d6b..3f3c261712 100644 --- a/hw/xfree86/xaa/xaawrap.h +++ b/hw/xfree86/xaa/xaawrap.h @@ -32,7 +32,7 @@ #define XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC)\ XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&(pGC)->devPrivates, XAAGetGCKey()); \ GCFuncs *oldFuncs = pGC->funcs;\ - if(!REGION_NUM_RECTS(pGC->pCompositeClip)) return; \ + if(!RegionNumRects(pGC->pCompositeClip)) return; \ pGC->funcs = pGCPriv->wrapFuncs;\ pGC->ops = pGCPriv->wrapOps diff --git a/hw/xnest/Events.c b/hw/xnest/Events.c index 277718ba36..194ec630ab 100644 --- a/hw/xnest/Events.c +++ b/hw/xnest/Events.c @@ -93,7 +93,7 @@ xnestCollectExposures(void) Box.x2 = Box.x1 + X.xexpose.width; Box.y2 = Box.y1 + X.xexpose.height; - REGION_INIT(pWin->drawable.pScreen, &Rgn, &Box, 1); + RegionInit(&Rgn, &Box, 1); miSendExposures(pWin, &Rgn, Box.x2, Box.y2); } diff --git a/hw/xnest/GC.c b/hw/xnest/GC.c index 4082bfc579..2cd555c58a 100644 --- a/hw/xnest/GC.c +++ b/hw/xnest/GC.c @@ -210,10 +210,10 @@ xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects) break; case CT_REGION: - nRects = REGION_NUM_RECTS((RegionPtr)pValue); + nRects = RegionNumRects((RegionPtr)pValue); size = nRects * sizeof(*pRects); pRects = (XRectangle *) malloc(size); - pBox = REGION_RECTS((RegionPtr)pValue); + pBox = RegionRects((RegionPtr)pValue); for (i = nRects; i-- > 0; ) { pRects[i].x = pBox[i].x1; pRects[i].y = pBox[i].y1; @@ -277,7 +277,7 @@ xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects) * other parts of server can only deal with CT_NONE, * CT_PIXMAP and CT_REGION client clips. */ - pGC->clientClip = (pointer) RECTS_TO_REGION(pGC->pScreen, nRects, + pGC->clientClip = (pointer) RegionFromRects(nRects, (xRectangle *)pValue, type); free(pValue); pValue = pGC->clientClip; @@ -313,7 +313,7 @@ xnestDestroyClipHelper(GCPtr pGC) break; case CT_REGION: - REGION_DESTROY(pGC->pScreen, pGC->clientClip); + RegionDestroy(pGC->clientClip); break; } } @@ -331,8 +331,8 @@ xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc) break; case CT_REGION: - pRgn = REGION_CREATE(pGCDst->pScreen, NULL, 1); - REGION_COPY(pGCDst->pScreen, pRgn, pGCSrc->clientClip); + pRgn = RegionCreate(NULL, 1); + RegionCopy(pRgn, pGCSrc->clientClip); xnestChangeClip(pGCDst, CT_REGION, pRgn, 0); break; } diff --git a/hw/xnest/GCOps.c b/hw/xnest/GCOps.c index ad9668ec1b..6b76fc28b4 100644 --- a/hw/xnest/GCOps.c +++ b/hw/xnest/GCOps.c @@ -131,8 +131,8 @@ xnestBitBlitHelper(GCPtr pGC) BoxRec Box; Bool pending, overlap; - pReg = REGION_CREATE(pGC->pScreen, NULL, 1); - pTmpReg = REGION_CREATE(pGC->pScreen, NULL, 1); + pReg = RegionCreate(NULL, 1); + pTmpReg = RegionCreate(NULL, 1); if(!pReg || !pTmpReg) return NullRegion; pending = True; @@ -149,15 +149,15 @@ xnestBitBlitHelper(GCPtr pGC) Box.y1 = event.xgraphicsexpose.y; Box.x2 = event.xgraphicsexpose.x + event.xgraphicsexpose.width; Box.y2 = event.xgraphicsexpose.y + event.xgraphicsexpose.height; - REGION_RESET(pGC->pScreen, pTmpReg, &Box); - REGION_APPEND(pGC->pScreen, pReg, pTmpReg); + RegionReset(pTmpReg, &Box); + RegionAppend(pReg, pTmpReg); pending = event.xgraphicsexpose.count; break; } } - REGION_DESTROY(pGC->pScreen, pTmpReg); - REGION_VALIDATE(pGC->pScreen, pReg, &overlap); + RegionDestroy(pTmpReg); + RegionValidate(pReg, &overlap); return(pReg); } } diff --git a/hw/xnest/Pixmap.c b/hw/xnest/Pixmap.c index 583f877f3a..bf0648088b 100644 --- a/hw/xnest/Pixmap.c +++ b/hw/xnest/Pixmap.c @@ -97,8 +97,8 @@ xnestPixmapToRegion(PixmapPtr pPixmap) pPixmap->drawable.width, pPixmap->drawable.height, 1, XYPixmap); - pReg = REGION_CREATE(pPixmap->drawable.pScreen, NULL, 1); - pTmpReg = REGION_CREATE(pPixmap->drawable.pScreen, NULL, 1); + pReg = RegionCreate(NULL, 1); + pTmpReg = RegionCreate(NULL, 1); if(!pReg || !pTmpReg) { XDestroyImage(ximage); return NullRegion; @@ -118,8 +118,8 @@ xnestPixmapToRegion(PixmapPtr pPixmap) else if (currentPixel == 0L) { /* right edge */ Box.x2 = x; - REGION_RESET(pPixmap->drawable.pScreen, pTmpReg, &Box); - REGION_APPEND(pPixmap->drawable.pScreen, pReg, pTmpReg); + RegionReset(pTmpReg, &Box); + RegionAppend(pReg, pTmpReg); } previousPixel = currentPixel; } @@ -127,15 +127,15 @@ xnestPixmapToRegion(PixmapPtr pPixmap) if (previousPixel != 0L) { /* right edge because of the end of pixmap */ Box.x2 = pPixmap->drawable.width; - REGION_RESET(pPixmap->drawable.pScreen, pTmpReg, &Box); - REGION_APPEND(pPixmap->drawable.pScreen, pReg, pTmpReg); + RegionReset(pTmpReg, &Box); + RegionAppend(pReg, pTmpReg); } } - REGION_DESTROY(pPixmap->drawable.pScreen, pTmpReg); + RegionDestroy(pTmpReg); XDestroyImage(ximage); - REGION_VALIDATE(pPixmap->drawable.pScreen, pReg, &overlap); + RegionValidate(pReg, &overlap); return(pReg); } diff --git a/hw/xnest/Window.c b/hw/xnest/Window.c index 11d53694e9..fab2f39810 100644 --- a/hw/xnest/Window.c +++ b/hw/xnest/Window.c @@ -135,9 +135,9 @@ xnestCreateWindow(WindowPtr pWin) if (pWin->nextSib) xnestWindowPriv(pWin->nextSib)->sibling_above = xnestWindow(pWin); xnestWindowPriv(pWin)->bounding_shape = - REGION_CREATE(pWin->drawable.pScreen, NULL, 1); + RegionCreate(NULL, 1); xnestWindowPriv(pWin)->clip_shape = - REGION_CREATE(pWin->drawable.pScreen, NULL, 1); + RegionCreate(NULL, 1); if (!pWin->parent) /* only the root window will have the right colormap */ xnestSetInstalledColormapWindows(pWin->drawable.pScreen); @@ -151,9 +151,9 @@ xnestDestroyWindow(WindowPtr pWin) if (pWin->nextSib) xnestWindowPriv(pWin->nextSib)->sibling_above = xnestWindowPriv(pWin)->sibling_above; - REGION_DESTROY(pWin->drawable.pScreen, + RegionDestroy( xnestWindowPriv(pWin)->bounding_shape); - REGION_DESTROY(pWin->drawable.pScreen, + RegionDestroy( xnestWindowPriv(pWin)->clip_shape); XDestroyWindow(xnestDisplay, xnestWindow(pWin)); xnestWindowPriv(pWin)->window = None; @@ -415,7 +415,7 @@ xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_exposed) event.xexpose.type = ProcessedExpose; - if (RECT_IN_REGION(pWin->drawable.pScreen, pRgn, &Box) != rgnIN) + if (RegionContainsRect(pRgn, &Box) != rgnIN) XPutBackEvent(xnestDisplay, &event); } @@ -439,11 +439,11 @@ xnestRegionEqual(RegionPtr pReg1, RegionPtr pReg2) if (pReg1 == NullRegion || pReg2 == NullRegion) return False; - pBox1 = REGION_RECTS(pReg1); - n1 = REGION_NUM_RECTS(pReg1); + pBox1 = RegionRects(pReg1); + n1 = RegionNumRects(pReg1); - pBox2 = REGION_RECTS(pReg2); - n2 = REGION_NUM_RECTS(pReg2); + pBox2 = RegionRects(pReg2); + n2 = RegionNumRects(pReg2); if (n1 != n2) return False; @@ -466,13 +466,13 @@ xnestShapeWindow(WindowPtr pWin) wBoundingShape(pWin))) { if (wBoundingShape(pWin)) { - REGION_COPY(pWin->drawable.pScreen, + RegionCopy( xnestWindowPriv(pWin)->bounding_shape, wBoundingShape(pWin)); reg = XCreateRegion(); - pBox = REGION_RECTS(xnestWindowPriv(pWin)->bounding_shape); + pBox = RegionRects(xnestWindowPriv(pWin)->bounding_shape); for (i = 0; - i < REGION_NUM_RECTS(xnestWindowPriv(pWin)->bounding_shape); + i < RegionNumRects(xnestWindowPriv(pWin)->bounding_shape); i++) { rect.x = pBox[i].x1; rect.y = pBox[i].y1; @@ -485,7 +485,7 @@ xnestShapeWindow(WindowPtr pWin) XDestroyRegion(reg); } else { - REGION_EMPTY(pWin->drawable.pScreen, + RegionEmpty( xnestWindowPriv(pWin)->bounding_shape); XShapeCombineMask(xnestDisplay, xnestWindow(pWin), @@ -497,13 +497,13 @@ xnestShapeWindow(WindowPtr pWin) wClipShape(pWin))) { if (wClipShape(pWin)) { - REGION_COPY(pWin->drawable.pScreen, + RegionCopy( xnestWindowPriv(pWin)->clip_shape, wClipShape(pWin)); reg = XCreateRegion(); - pBox = REGION_RECTS(xnestWindowPriv(pWin)->clip_shape); + pBox = RegionRects(xnestWindowPriv(pWin)->clip_shape); for (i = 0; - i < REGION_NUM_RECTS(xnestWindowPriv(pWin)->clip_shape); + i < RegionNumRects(xnestWindowPriv(pWin)->clip_shape); i++) { rect.x = pBox[i].x1; rect.y = pBox[i].y1; @@ -516,7 +516,7 @@ xnestShapeWindow(WindowPtr pWin) XDestroyRegion(reg); } else { - REGION_EMPTY(pWin->drawable.pScreen, + RegionEmpty( xnestWindowPriv(pWin)->clip_shape); XShapeCombineMask(xnestDisplay, xnestWindow(pWin), diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index 7453eccdfb..1d99d36bfd 100644 --- a/hw/xquartz/darwin.c +++ b/hw/xquartz/darwin.c @@ -817,8 +817,8 @@ xf86SetRootClip (ScreenPtr pScreen, int enable) { RegionPtr borderVisible; - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - REGION_SUBTRACT(pScreen, borderVisible, + borderVisible = RegionCreate(NullBox, 1); + RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); pWin->valdata->before.borderVisible = borderVisible; } @@ -837,13 +837,13 @@ xf86SetRootClip (ScreenPtr pScreen, int enable) box.y1 = 0; box.x2 = pScreen->width; box.y2 = pScreen->height; - REGION_RESET(pScreen, &pWin->borderClip, &box); - REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); + RegionReset(&pWin->borderClip, &box); + RegionBreak(&pWin->clipList); } else { - REGION_EMPTY(pScreen, &pWin->borderClip); - REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList); + RegionEmpty(&pWin->borderClip); + RegionBreak(&pWin->clipList); } ResizeChildrenWinSize (pWin, 0, 0, 0, 0); @@ -852,8 +852,8 @@ xf86SetRootClip (ScreenPtr pScreen, int enable) { if (pWin->backStorage) { - pOldClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, pOldClip, &pWin->clipList); + pOldClip = RegionCreate(NullBox, 1); + RegionCopy(pOldClip, &pWin->clipList); } if (pWin->firstChild) @@ -882,7 +882,7 @@ xf86SetRootClip (ScreenPtr pScreen, int enable) (pWin, 0, 0, pOldClip, pWin->drawable.x, pWin->drawable.y); if (WasViewable) - REGION_DESTROY(pScreen, pOldClip); + RegionDestroy(pOldClip); if (bsExposed) { RegionPtr valExposed = NullRegion; @@ -891,8 +891,8 @@ xf86SetRootClip (ScreenPtr pScreen, int enable) valExposed = &pWin->valdata->after.exposed; (*pScreen->WindowExposures) (pWin, valExposed, bsExposed); if (valExposed) - REGION_EMPTY(pScreen, valExposed); - REGION_DESTROY(pScreen, bsExposed); + RegionEmpty(valExposed); + RegionDestroy(bsExposed); } } if (WasViewable) diff --git a/hw/xquartz/xpr/dri.c b/hw/xquartz/xpr/dri.c index 3b14581d09..d9b2e03386 100644 --- a/hw/xquartz/xpr/dri.c +++ b/hw/xquartz/xpr/dri.c @@ -347,8 +347,8 @@ DRIUpdateSurface(DRIDrawablePrivPtr pDRIDrawablePriv, DrawablePtr pDraw) wc.height = pWin->drawable.height + 2 * pWin->borderWidth; wc.bit_gravity = XP_GRAVITY_NONE; - wc.shape_nrects = REGION_NUM_RECTS(&pWin->clipList); - wc.shape_rects = REGION_RECTS(&pWin->clipList); + wc.shape_nrects = RegionNumRects(&pWin->clipList); + wc.shape_rects = RegionRects(&pWin->clipList); wc.shape_tx = - (pTopWin->drawable.x - pTopWin->borderWidth); wc.shape_ty = - (pTopWin->drawable.y - pTopWin->borderWidth); diff --git a/hw/xquartz/xpr/xprFrame.c b/hw/xquartz/xpr/xprFrame.c index 6dc2c87fa1..9f5d8a6379 100644 --- a/hw/xquartz/xpr/xprFrame.c +++ b/hw/xquartz/xpr/xprFrame.c @@ -163,8 +163,8 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, if (pShape != NULL) { - wc.shape_nrects = REGION_NUM_RECTS(pShape); - wc.shape_rects = REGION_RECTS(pShape); + wc.shape_nrects = RegionNumRects(pShape); + wc.shape_rects = RegionRects(pShape); wc.shape_tx = wc.shape_ty = 0; mask |= XP_SHAPE; } @@ -306,8 +306,8 @@ xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape) if (pShape != NULL) { - wc.shape_nrects = REGION_NUM_RECTS(pShape); - wc.shape_rects = REGION_RECTS(pShape); + wc.shape_nrects = RegionNumRects(pShape); + wc.shape_rects = RegionRects(pShape); } else { diff --git a/hw/xwin/winfillsp.c b/hw/xwin/winfillsp.c index 702f34f966..1e8e3e6f1d 100644 --- a/hw/xwin/winfillsp.c +++ b/hw/xwin/winfillsp.c @@ -80,8 +80,8 @@ winFillSpansNativeGDI (DrawablePtr pDrawable, int fullX1, fullX2, fullY1; HRGN hrgn = NULL, combined = NULL; - nbox = REGION_NUM_RECTS (pClip); - pbox = REGION_RECTS (pClip); + nbox = RegionNumRects (pClip); + pbox = RegionRects (pClip); if (!nbox) return; @@ -97,7 +97,7 @@ winFillSpansNativeGDI (DrawablePtr pDrawable, pbox++; } - pextent = REGION_EXTENTS (pGC->pScreen, pClip); + pextent = RegionExtents(pClip); extentX1 = pextent->x1; extentY1 = pextent->y1; extentX2 = pextent->x2; diff --git a/hw/xwin/wingc.c b/hw/xwin/wingc.c index 1f37752639..196b5b5ddb 100644 --- a/hw/xwin/wingc.c +++ b/hw/xwin/wingc.c @@ -210,7 +210,7 @@ winDestroyGCNativeGDI (GCPtr pGC) winScreenPriv(pGC->pScreen); if (pGC->freeCompClip) - REGION_DESTROY (pGC->pScreen, pGC->pCompositeClip); + RegionDestroy(pGC->pCompositeClip); /* Free the memory DC */ if (pGCPriv->hdcMem != NULL) diff --git a/hw/xwin/winmultiwindowshape.c b/hw/xwin/winmultiwindowshape.c index 597eab62c9..9b4910b9c9 100644 --- a/hw/xwin/winmultiwindowshape.c +++ b/hw/xwin/winmultiwindowshape.c @@ -117,15 +117,15 @@ winReshapeMultiWindow (WindowPtr pWin) if (!wBoundingShape (pWin)) return; - REGION_NULL(pWin->drawable.pScreen, &rrNewShape); - REGION_COPY(pWin->drawable.pScreen, &rrNewShape, wBoundingShape(pWin)); - REGION_TRANSLATE(pWin->drawable.pScreen, + RegionNull(&rrNewShape); + RegionCopy(&rrNewShape, wBoundingShape(pWin)); + RegionTranslate( &rrNewShape, pWin->borderWidth, pWin->borderWidth); - nRects = REGION_NUM_RECTS(&rrNewShape); - pShape = REGION_RECTS(&rrNewShape); + nRects = RegionNumRects(&rrNewShape); + pShape = RegionRects(&rrNewShape); /* Don't do anything if there are no rectangles in the region */ if (nRects > 0) @@ -205,7 +205,7 @@ winReshapeMultiWindow (WindowPtr pWin) pWinPriv->hRgn = hRgn; } - REGION_UNINIT(pWin->drawable.pScreen, &rrNewShape); + RegionUninit(&rrNewShape); return; } diff --git a/hw/xwin/winsetsp.c b/hw/xwin/winsetsp.c index f894d6cdae..d1bf90b57d 100644 --- a/hw/xwin/winsetsp.c +++ b/hw/xwin/winsetsp.c @@ -54,8 +54,8 @@ winSetSpansNativeGDI (DrawablePtr pDrawable, int nbox; BoxPtr pbox; - nbox = REGION_NUM_RECTS (pGC->pCompositeClip); - pbox = REGION_RECTS (pGC->pCompositeClip); + nbox = RegionNumRects (pGC->pCompositeClip); + pbox = RegionRects (pGC->pCompositeClip); if (!nbox) return; diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c index 85dc10f53b..8dd1084e69 100644 --- a/hw/xwin/winshaddd.c +++ b/hw/xwin/winshaddd.c @@ -525,8 +525,8 @@ winShadowUpdateDD (ScreenPtr pScreen, HRESULT ddrval = DD_OK; RECT rcDest, rcSrc; POINT ptOrigin; - DWORD dwBox = REGION_NUM_RECTS (damage); - BoxPtr pBox = REGION_RECTS (damage); + DWORD dwBox = RegionNumRects (damage); + BoxPtr pBox = RegionRects (damage); HRGN hrgnTemp = NULL, hrgnCombined = NULL; /* @@ -588,7 +588,7 @@ winShadowUpdateDD (ScreenPtr pScreen, } else { - BoxPtr pBoxExtents = REGION_EXTENTS (pScreen, damage); + BoxPtr pBoxExtents = RegionExtents(damage); /* Compute a GDI region from the damaged region */ hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2); diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c index e78fbd9e6a..5ca3e4f624 100644 --- a/hw/xwin/winshadddnl.c +++ b/hw/xwin/winshadddnl.c @@ -601,8 +601,8 @@ winShadowUpdateDDNL (ScreenPtr pScreen, HRESULT ddrval = DD_OK; RECT rcDest, rcSrc; POINT ptOrigin; - DWORD dwBox = REGION_NUM_RECTS (damage); - BoxPtr pBox = REGION_RECTS (damage); + DWORD dwBox = RegionNumRects (damage); + BoxPtr pBox = RegionRects (damage); HRGN hrgnTemp = NULL, hrgnCombined = NULL; /* @@ -677,7 +677,7 @@ winShadowUpdateDDNL (ScreenPtr pScreen, } else { - BoxPtr pBoxExtents = REGION_EXTENTS (pScreen, damage); + BoxPtr pBoxExtents = RegionExtents(damage); /* Compute a GDI region from the damaged region */ hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2); diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c index d38e4f76be..96d149c2b1 100644 --- a/hw/xwin/winshadgdi.c +++ b/hw/xwin/winshadgdi.c @@ -499,8 +499,8 @@ winShadowUpdateGDI (ScreenPtr pScreen, winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; RegionPtr damage = shadowDamage(pBuf); - DWORD dwBox = REGION_NUM_RECTS (damage); - BoxPtr pBox = REGION_RECTS (damage); + DWORD dwBox = RegionNumRects (damage); + BoxPtr pBox = RegionRects (damage); int x, y, w, h; HRGN hrgnTemp = NULL, hrgnCombined = NULL; #ifdef XWIN_UPDATESTATS @@ -508,7 +508,7 @@ winShadowUpdateGDI (ScreenPtr pScreen, static DWORD s_dwTotalUpdates = 0; static DWORD s_dwTotalBoxes = 0; #endif - BoxPtr pBoxExtents = REGION_EXTENTS (pScreen, damage); + BoxPtr pBoxExtents = RegionExtents(damage); /* * Return immediately if the app is not active diff --git a/hw/xwin/winvideo.c b/hw/xwin/winvideo.c index 4cdb3c4855..0438e5f549 100755 --- a/hw/xwin/winvideo.c +++ b/hw/xwin/winvideo.c @@ -185,7 +185,7 @@ winSetupImageVideo (ScreenPtr pScreen) #if 0 /* gotta uninit this someplace */ - REGION_NULL(pScreen, &pPriv->clip); + RegionNull(&pPriv->clip); #endif #if 0 diff --git a/hw/xwin/winwin32rootless.c b/hw/xwin/winwin32rootless.c index c225a44959..9749861fd9 100755 --- a/hw/xwin/winwin32rootless.c +++ b/hw/xwin/winwin32rootless.c @@ -150,8 +150,8 @@ winMWExtWMCreateRgnFromRegion (RegionPtr pShape) if (pShape == NULL) return NULL; - nRects = REGION_NUM_RECTS(pShape); - pRects = REGION_RECTS(pShape); + nRects = RegionNumRects(pShape); + pRects = RegionRects(pShape); hRgn = CreateRectRgn (0, 0, 0, 0); if (hRgn == NULL) diff --git a/hw/xwin/winwindow.c b/hw/xwin/winwindow.c index 9348d5c1c7..bc0614dc11 100644 --- a/hw/xwin/winwindow.c +++ b/hw/xwin/winwindow.c @@ -147,22 +147,22 @@ winCopyWindowNativeGDI (WindowPtr pWin, pwinRoot = pWin->drawable.pScreen->root; /* Create a region for the destination */ - prgnDst = REGION_CREATE(pWin->drawable.pScreen, NULL, 1); + prgnDst = RegionCreate(NULL, 1); /* Calculate the shift from the source to the destination */ dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; /* Translate the region from the destination to the source? */ - REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); - REGION_INTERSECT(pWin->drawable.pScreen, prgnDst, &pWin->borderClip, + RegionTranslate(prgnSrc, -dx, -dy); + RegionIntersect(prgnDst, &pWin->borderClip, prgnSrc); /* Get a pointer to the first box in the region to be copied */ - pBox = REGION_RECTS(prgnDst); + pBox = RegionRects(prgnDst); /* Get the number of boxes in the region */ - nbox = REGION_NUM_RECTS(prgnDst); + nbox = RegionNumRects(prgnDst); /* Allocate source points for each box */ if(!(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) @@ -179,7 +179,7 @@ winCopyWindowNativeGDI (WindowPtr pWin, } /* Setup loop pointers again */ - pBoxDst = REGION_RECTS(prgnDst); + pBoxDst = RegionRects(prgnDst); ppt = pptSrc; #if 0 @@ -205,7 +205,7 @@ winCopyWindowNativeGDI (WindowPtr pWin, /* Cleanup the regions, etc. */ free(pptSrc); - REGION_DESTROY(pWin->drawable.pScreen, prgnDst); + RegionDestroy(prgnDst); } @@ -593,13 +593,13 @@ winReshapeRootless (WindowPtr pWin) if (!wBoundingShape (pWin)) return; - REGION_NULL(pScreen, &rrNewShape); - REGION_COPY(pScreen, &rrNewShape, wBoundingShape(pWin)); - REGION_TRANSLATE(pScreen, &rrNewShape, pWin->borderWidth, + RegionNull(&rrNewShape); + RegionCopy(&rrNewShape, wBoundingShape(pWin)); + RegionTranslate(&rrNewShape, pWin->borderWidth, pWin->borderWidth); - nRects = REGION_NUM_RECTS(&rrNewShape); - pShape = REGION_RECTS(&rrNewShape); + nRects = RegionNumRects(&rrNewShape); + pShape = RegionRects(&rrNewShape); if (nRects > 0) { @@ -631,7 +631,7 @@ winReshapeRootless (WindowPtr pWin) pWinPriv->hRgn = hRgn; } - REGION_UNINIT(pScreen, &rrNewShape); + RegionUninit(&rrNewShape); return; } diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c index 99329c383f..5935ac4536 100755 --- a/hw/xwin/winwindowswm.c +++ b/hw/xwin/winwindowswm.c @@ -495,11 +495,11 @@ ProcWindowsWMFrameDraw (register ClientPtr client) /* wBoundingShape is relative to *inner* origin of window. Translate by borderWidth to get the outside-relative position. */ - REGION_NULL(pScreen, &newShape); - REGION_COPY(pScreen, &newShape, wBoundingShape(pWin)); - REGION_TRANSLATE(pScreen, &newShape, pWin->borderWidth, pWin->borderWidth); + RegionNull(&newShape); + RegionCopy(&newShape, wBoundingShape(pWin)); + RegionTranslate(&newShape, pWin->borderWidth, pWin->borderWidth); winMWExtWMReshapeFrame (pRLWinPriv, &newShape); - REGION_UNINIT(pScreen, &newShape); + RegionUninit(&newShape); } #if CYGMULTIWINDOW_DEBUG ErrorF ("ProcWindowsWMFrameDraw - done\n"); diff --git a/include/regionstr.h b/include/regionstr.h index 89cf0249a3..c6dd16231e 100644 --- a/include/regionstr.h +++ b/include/regionstr.h @@ -70,68 +70,68 @@ extern _X_EXPORT BoxRec RegionEmptyBox; extern _X_EXPORT RegDataRec RegionEmptyData; extern _X_EXPORT RegDataRec RegionBrokenData; -#define REGION_NIL(reg) ((reg)->data && !(reg)->data->numRects) +#define RegionNil(reg) ((reg)->data && !(reg)->data->numRects) /* not a region */ -#define REGION_NAR(reg) ((reg)->data == &RegionBrokenData) -#define REGION_NUM_RECTS(reg) ((reg)->data ? (reg)->data->numRects : 1) -#define REGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0) -#define REGION_RECTS(reg) ((reg)->data ? (BoxPtr)((reg)->data + 1) \ +#define RegionNar(reg) ((reg)->data == &RegionBrokenData) +#define RegionNumRects(reg) ((reg)->data ? (reg)->data->numRects : 1) +#define RegionSize(reg) ((reg)->data ? (reg)->data->size : 0) +#define RegionRects(reg) ((reg)->data ? (BoxPtr)((reg)->data + 1) \ : &(reg)->extents) -#define REGION_BOXPTR(reg) ((BoxPtr)((reg)->data + 1)) -#define REGION_BOX(reg,i) (®ION_BOXPTR(reg)[i]) -#define REGION_TOP(reg) REGION_BOX(reg, (reg)->data->numRects) -#define REGION_END(reg) REGION_BOX(reg, (reg)->data->numRects - 1) -#define REGION_SZOF(n) (sizeof(RegDataRec) + ((n) * sizeof(BoxRec))) +#define RegionBoxptr(reg) ((BoxPtr)((reg)->data + 1)) +#define RegionBox(reg,i) (&RegionBoxptr(reg)[i]) +#define RegionTop(reg) RegionBox(reg, (reg)->data->numRects) +#define RegionEnd(reg) RegionBox(reg, (reg)->data->numRects - 1) +#define RegionSizeof(n) (sizeof(RegDataRec) + ((n) * sizeof(BoxRec))) -#define REGION_CREATE(_pScreen, _rect, _size) \ +#define RegionCreate(_rect, _size) \ RegionCreate(_rect, _size) -#define REGION_COPY(_pScreen, dst, src) \ +#define RegionCopy(dst, src) \ RegionCopy(dst, src) -#define REGION_DESTROY(_pScreen, _pReg) \ +#define RegionDestroy(_pReg) \ RegionDestroy(_pReg) -#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \ +#define RegionIntersect(newReg, reg1, reg2) \ RegionIntersect(newReg, reg1, reg2) -#define REGION_UNION(_pScreen, newReg, reg1, reg2) \ +#define RegionUnion(newReg, reg1, reg2) \ RegionUnion(newReg, reg1, reg2) -#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \ +#define RegionSubtract(newReg, reg1, reg2) \ RegionSubtract(newReg, reg1, reg2) -#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \ +#define RegionInverse(newReg, reg1, invRect) \ RegionInverse(newReg, reg1, invRect) -#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \ +#define RegionTranslate(_pReg, _x, _y) \ RegionTranslate(_pReg, _x, _y) -#define RECT_IN_REGION(_pScreen, _pReg, prect) \ +#define RegionContainsRect(_pReg, prect) \ RegionContainsRect(_pReg, prect) -#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \ +#define RegionContainsPoint(_pReg, _x, _y, prect) \ RegionContainsPoint(_pReg, _x, _y, prect) -#define REGION_APPEND(_pScreen, dstrgn, rgn) \ +#define RegionAppend(dstrgn, rgn) \ RegionAppend(dstrgn, rgn) -#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \ +#define RegionValidate(badreg, pOverlap) \ RegionValidate(badreg, pOverlap) -#define BITMAP_TO_REGION(_pScreen, pPix) \ +#define BitmapToRegion(_pScreen, pPix) \ (*(_pScreen)->BitmapToRegion)(pPix) /* no mi version?! */ -#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \ +#define RegionFromRects(nrects, prect, ctype) \ RegionFromRects(nrects, prect, ctype) -#define REGION_EQUAL(_pScreen, _pReg1, _pReg2) \ +#define RegionEqual(_pReg1, _pReg2) \ RegionEqual(_pReg1, _pReg2) -#define REGION_BREAK(_pScreen, _pReg) \ +#define RegionBreak(_pReg) \ RegionBreak(_pReg) -#define REGION_INIT(_pScreen, _pReg, _rect, _size) \ +#define RegionInit(_pReg, _rect, _size) \ { \ if ((_rect) != NULL) \ { \ @@ -142,7 +142,7 @@ extern _X_EXPORT RegDataRec RegionBrokenData; { \ (_pReg)->extents = RegionEmptyBox; \ if (((_size) > 1) && ((_pReg)->data = \ - (RegDataPtr)malloc(REGION_SZOF(_size)))) \ + (RegDataPtr)malloc(RegionSizeof(_size)))) \ { \ (_pReg)->data->size = (_size); \ (_pReg)->data->numRects = 0; \ @@ -153,7 +153,7 @@ extern _X_EXPORT RegDataRec RegionBrokenData; } -#define REGION_UNINIT(_pScreen, _pReg) \ +#define RegionUninit(_pReg) \ { \ if ((_pReg)->data && (_pReg)->data->size) { \ free((_pReg)->data); \ @@ -161,41 +161,36 @@ extern _X_EXPORT RegDataRec RegionBrokenData; } \ } -#define REGION_RESET(_pScreen, _pReg, _pBox) \ +#define RegionReset(_pReg, _pBox) \ { \ (_pReg)->extents = *(_pBox); \ - REGION_UNINIT(_pScreen, _pReg); \ + RegionUninit(_pReg); \ (_pReg)->data = (RegDataPtr)NULL; \ } -#define REGION_NOTEMPTY(_pScreen, _pReg) \ - !REGION_NIL(_pReg) +#define RegionNotEmpty(_pReg) \ + !RegionNil(_pReg) -#define REGION_BROKEN(_pScreen, _pReg) \ - REGION_NAR(_pReg) +#define RegionBroken(_pReg) \ + RegionNar(_pReg) -#define REGION_EMPTY(_pScreen, _pReg) \ +#define RegionEmpty(_pReg) \ { \ - REGION_UNINIT(_pScreen, _pReg); \ + RegionUninit(_pReg); \ (_pReg)->extents.x2 = (_pReg)->extents.x1; \ (_pReg)->extents.y2 = (_pReg)->extents.y1; \ (_pReg)->data = &RegionEmptyData; \ } -#define REGION_EXTENTS(_pScreen, _pReg) \ +#define RegionExtents(_pReg) \ (&(_pReg)->extents) -#define REGION_NULL(_pScreen, _pReg) \ +#define RegionNull(_pReg) \ { \ (_pReg)->extents = RegionEmptyBox; \ (_pReg)->data = &RegionEmptyData; \ } -#ifndef REGION_NULL -#define REGION_NULL(_pScreen, _pReg) \ - REGION_INIT(_pScreen, _pReg, NullBox, 1) -#endif - /* moved from mi.h */ extern _X_EXPORT void InitRegions (void); @@ -204,17 +199,9 @@ extern _X_EXPORT RegionPtr RegionCreate( BoxPtr /*rect*/, int /*size*/); -extern _X_EXPORT void RegionInit( - RegionPtr /*pReg*/, - BoxPtr /*rect*/, - int /*size*/); - extern _X_EXPORT void RegionDestroy( RegionPtr /*pReg*/); -extern _X_EXPORT void RegionUninit( - RegionPtr /*pReg*/); - extern _X_EXPORT Bool RegionCopy( RegionPtr /*dst*/, RegionPtr /*src*/); @@ -261,10 +248,6 @@ extern _X_EXPORT void RegionTranslate( int /*x*/, int /*y*/); -extern _X_EXPORT void RegionReset( - RegionPtr /*pReg*/, - BoxPtr /*pBox*/); - extern _X_EXPORT Bool RegionBreak( RegionPtr /*pReg*/); @@ -278,16 +261,28 @@ extern _X_EXPORT Bool RegionEqual( RegionPtr /*pReg1*/, RegionPtr /*pReg2*/); -extern _X_EXPORT Bool RegionNotEmpty( - RegionPtr /*pReg*/); +extern _X_EXPORT Bool RegionRectAlloc( + RegionPtr /*pRgn*/, + int /*n*/ +); -extern _X_EXPORT void RegionEmpty( - RegionPtr /*pReg*/); - -extern _X_EXPORT BoxPtr RegionExtents( - RegionPtr /*pReg*/); +#ifdef DEBUG +extern _X_EXPORT Bool RegionIsValid( + RegionPtr /*prgn*/ +); +#endif extern _X_EXPORT void RegionPrint( RegionPtr /*pReg*/); +extern _X_EXPORT int RegionClipSpans( + RegionPtr /*prgnDst*/, + DDXPointPtr /*ppt*/, + int * /*pwidth*/, + int /*nspans*/, + DDXPointPtr /*pptNew*/, + int * /*pwidthNew*/, + int /*fSorted*/ +); + #endif /* REGIONSTRUCT_H */ diff --git a/mi/mi.h b/mi/mi.h index 9f67d2e9a1..fa32b6b622 100644 --- a/mi/mi.h +++ b/mi/mi.h @@ -418,23 +418,6 @@ extern _X_EXPORT void miPushPixels( int /*yOrg*/ ); -/* miregion.c */ - -/* see also region.h */ - -extern _X_EXPORT Bool RegionRectAlloc( - RegionPtr /*pRgn*/, - int /*n*/ -); - -#ifdef DEBUG -extern _X_EXPORT Bool RegionIsValid( - RegionPtr /*prgn*/ -); -#endif - -extern _X_EXPORT Bool RegionBroken(RegionPtr pReg); - /* miscrinit.c */ extern _X_EXPORT Bool miModifyPixmapHeader( diff --git a/mi/mibitblt.c b/mi/mibitblt.c index 9c6e03d533..8448483475 100644 --- a/mi/mibitblt.c +++ b/mi/mibitblt.c @@ -116,7 +116,7 @@ miCopyArea(DrawablePtr pSrcDrawable, box.x2 = pSrcDrawable->x + (int) pSrcDrawable->width; box.y2 = pSrcDrawable->y + (int) pSrcDrawable->height; - prgnSrcClip = REGION_CREATE(pGC->pScreen, &box, 1); + prgnSrcClip = RegionCreate(&box, 1); realSrcClip = 1; } else @@ -145,8 +145,8 @@ miCopyArea(DrawablePtr pSrcDrawable, pptFirst = ppt = malloc(heightSrc * sizeof(DDXPointRec)); pwidthFirst = pwidth = malloc(heightSrc * sizeof(unsigned int)); - numRects = REGION_NUM_RECTS(prgnSrcClip); - boxes = REGION_RECTS(prgnSrcClip); + numRects = RegionNumRects(prgnSrcClip); + boxes = RegionRects(prgnSrcClip); ordering = malloc(numRects * sizeof(unsigned int)); if(!pptFirst || !pwidthFirst || !ordering) { @@ -259,7 +259,7 @@ miCopyArea(DrawablePtr pSrcDrawable, prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn, widthSrc, heightSrc, xOut, yOut, (unsigned long)0); if(realSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); + RegionDestroy(prgnSrcClip); free(ordering); free(pwidthFirst); @@ -443,9 +443,9 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc, to destroy what it's sent. note that this means we don't have to free prgnSrcClip ourselves. */ - prgnSrcClip = REGION_CREATE(pGCT->pScreen, NULL, 0); - REGION_COPY(pGCT->pScreen, prgnSrcClip, prgnSrc); - REGION_TRANSLATE(pGCT->pScreen, prgnSrcClip, srcx, 0); + prgnSrcClip = RegionCreate(NULL, 0); + RegionCopy(prgnSrcClip, prgnSrc); + RegionTranslate(prgnSrcClip, srcx, 0); (*pGCT->funcs->ChangeClip)(pGCT, CT_REGION, prgnSrcClip, 0); ValidateGC((DrawablePtr)pPixmap, pGCT); @@ -578,7 +578,7 @@ miCopyPlane( DrawablePtr pSrcDrawable, box.x2 = box.x1; if (box.y1 > box.y2) box.y2 = box.y1; - prgnSrc = REGION_CREATE(pGC->pScreen, &box, 1); + prgnSrc = RegionCreate(&box, 1); if (pSrcDrawable->type != DRAWABLE_PIXMAP) { /* clip to visible drawable */ @@ -586,15 +586,15 @@ miCopyPlane( DrawablePtr pSrcDrawable, if (pGC->subWindowMode == IncludeInferiors) { RegionPtr clipList = NotClippedByChildren ((WindowPtr) pSrcDrawable); - REGION_INTERSECT(pGC->pScreen, prgnSrc, prgnSrc, clipList); - REGION_DESTROY(pGC->pScreen, clipList); + RegionIntersect(prgnSrc, prgnSrc, clipList); + RegionDestroy(clipList); } else - REGION_INTERSECT(pGC->pScreen, prgnSrc, prgnSrc, + RegionIntersect(prgnSrc, prgnSrc, &((WindowPtr)pSrcDrawable)->clipList); } - box = *REGION_EXTENTS(pGC->pScreen, prgnSrc); - REGION_TRANSLATE(pGC->pScreen, prgnSrc, -box.x1, -box.y1); + box = *RegionExtents(prgnSrc); + RegionTranslate(prgnSrc, -box.x1, -box.y1); if ((box.x2 > box.x1) && (box.y2 > box.y1)) { @@ -618,7 +618,7 @@ miCopyPlane( DrawablePtr pSrcDrawable, } prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, bitPlane); - REGION_DESTROY(pGC->pScreen, prgnSrc); + RegionDestroy(prgnSrc); return prgnExposed; } @@ -761,11 +761,11 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth, box.y1 = 0; box.x2 = w; box.y2 = h; - prgnSrc = REGION_CREATE(pGC->pScreen, &box, 1); + prgnSrc = RegionCreate(&box, 1); miOpqStipDrawable(pDraw, pGC, prgnSrc, (MiBits *) pImage, leftPad, w, h, x, y); - REGION_DESTROY(pGC->pScreen, prgnSrc); + RegionDestroy(prgnSrc); break; case XYPixmap: diff --git a/mi/micopy.c b/mi/micopy.c index 6df9d88d9f..157e324309 100644 --- a/mi/micopy.c +++ b/mi/micopy.c @@ -49,8 +49,8 @@ miCopyRegion (DrawablePtr pSrcDrawable, int nbox; BoxPtr pboxNew1, pboxNew2, pboxBase, pboxNext, pboxTmp; - pbox = REGION_RECTS(pDstRegion); - nbox = REGION_NUM_RECTS(pDstRegion); + pbox = RegionRects(pDstRegion); + nbox = RegionNumRects(pDstRegion); /* XXX we have to err on the side of safety when both are windows, * because we don't know if IncludeInferiors is being used. @@ -209,7 +209,7 @@ miDoCopy (DrawablePtr pSrcDrawable, * VT is inactive, make sure the region isn't empty */ if (!((WindowPtr) pSrcDrawable)->parent && - REGION_NOTEMPTY (pSrcDrawable->pScreen, + RegionNotEmpty( &((WindowPtr) pSrcDrawable)->borderClip)) { /* @@ -291,9 +291,9 @@ miDoCopy (DrawablePtr pSrcDrawable, blown region and call intersect */ cclip = miGetCompositeClip(pGC); - if (REGION_NUM_RECTS(cclip) == 1) + if (RegionNumRects(cclip) == 1) { - BoxPtr pBox = REGION_RECTS(cclip); + BoxPtr pBox = RegionRects(cclip); if (box_x1 < pBox->x1) box_x1 = pBox->x1; if (box_x2 > pBox->x2) box_x2 = pBox->x2; @@ -306,7 +306,7 @@ miDoCopy (DrawablePtr pSrcDrawable, /* Check to see if the region is empty */ if (box_x1 >= box_x2 || box_y1 >= box_y2) { - REGION_NULL(pGC->pScreen, &rgnDst); + RegionNull(&rgnDst); } else { @@ -315,25 +315,25 @@ miDoCopy (DrawablePtr pSrcDrawable, box.y1 = box_y1; box.x2 = box_x2; box.y2 = box_y2; - REGION_INIT(pGC->pScreen, &rgnDst, &box, 1); + RegionInit(&rgnDst, &box, 1); } /* Clip against complex source if needed */ if (!fastSrc) { - REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip); - REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy); + RegionIntersect(&rgnDst, &rgnDst, prgnSrcClip); + RegionTranslate(&rgnDst, -dx, -dy); } /* Clip against complex dest if needed */ if (!fastDst) { - REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, + RegionIntersect(&rgnDst, &rgnDst, miGetCompositeClip(pGC)); } /* Do bit blitting */ - numRects = REGION_NUM_RECTS(&rgnDst); + numRects = RegionNumRects(&rgnDst); if (numRects && widthSrc && heightSrc) miCopyRegion (pSrcDrawable, pDstDrawable, pGC, &rgnDst, dx, dy, copyProc, bitPlane, closure); @@ -347,8 +347,8 @@ miDoCopy (DrawablePtr pSrcDrawable, xOut - pDstDrawable->x, yOut - pDstDrawable->y, (unsigned long) bitPlane); - REGION_UNINIT(pGC->pScreen, &rgnDst); + RegionUninit(&rgnDst); if (freeSrcClip) - REGION_DESTROY(pGC->pScreen, prgnSrcClip); + RegionDestroy(prgnSrcClip); return prgnExposed; } diff --git a/mi/miexpose.c b/mi/miexpose.c index 088149be7d..2fd070d9e3 100644 --- a/mi/miexpose.c +++ b/mi/miexpose.c @@ -175,21 +175,21 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, if (pGC->subWindowMode == IncludeInferiors) { prgnSrcClip = NotClippedByChildren (pSrcWin); - if ((RECT_IN_REGION(pscr, prgnSrcClip, &TsrcBox)) == rgnIN) + if ((RegionContainsRect(prgnSrcClip, &TsrcBox)) == rgnIN) { - REGION_DESTROY(pscr, prgnSrcClip); + RegionDestroy(prgnSrcClip); return NULL; } } else { - if ((RECT_IN_REGION(pscr, &pSrcWin->clipList, &TsrcBox)) == rgnIN) + if ((RegionContainsRect(&pSrcWin->clipList, &TsrcBox)) == rgnIN) return NULL; prgnSrcClip = &rgnSrcRec; - REGION_NULL(pscr, prgnSrcClip); - REGION_COPY(pscr, prgnSrcClip, &pSrcWin->clipList); + RegionNull(prgnSrcClip); + RegionCopy(prgnSrcClip, &pSrcWin->clipList); } - REGION_TRANSLATE(pscr, prgnSrcClip, + RegionTranslate(prgnSrcClip, -pSrcDrawable->x, -pSrcDrawable->y); } else @@ -206,7 +206,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, box.x2 = pSrcDrawable->width; box.y2 = pSrcDrawable->height; prgnSrcClip = &rgnSrcRec; - REGION_INIT(pscr, prgnSrcClip, &box, 1); + RegionInit(prgnSrcClip, &box, 1); pSrcWin = NULL; } @@ -223,11 +223,11 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, else { prgnDstClip = &rgnDstRec; - REGION_NULL(pscr, prgnDstClip); - REGION_COPY(pscr, prgnDstClip, + RegionNull(prgnDstClip); + RegionCopy(prgnDstClip, &((WindowPtr)pDstDrawable)->clipList); } - REGION_TRANSLATE(pscr, prgnDstClip, + RegionTranslate(prgnDstClip, -pDstDrawable->x, -pDstDrawable->y); } else @@ -239,24 +239,24 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, box.x2 = pDstDrawable->width; box.y2 = pDstDrawable->height; prgnDstClip = &rgnDstRec; - REGION_INIT(pscr, prgnDstClip, &box, 1); + RegionInit(prgnDstClip, &box, 1); } /* drawable-relative source region */ - REGION_INIT(pscr, &rgnExposed, &srcBox, 1); + RegionInit(&rgnExposed, &srcBox, 1); /* now get the hidden parts of the source box*/ - REGION_SUBTRACT(pscr, &rgnExposed, &rgnExposed, prgnSrcClip); + RegionSubtract(&rgnExposed, &rgnExposed, prgnSrcClip); /* move them over the destination */ - REGION_TRANSLATE(pscr, &rgnExposed, dstx-srcx, dsty-srcy); + RegionTranslate(&rgnExposed, dstx-srcx, dsty-srcy); /* intersect with visible areas of dest */ - REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, prgnDstClip); + RegionIntersect(&rgnExposed, &rgnExposed, prgnDstClip); /* intersect with client clip region. */ if (pGC->clientClipType == CT_REGION) - REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, pGC->clientClip); + RegionIntersect(&rgnExposed, &rgnExposed, pGC->clientClip); /* * If we have LOTS of rectangles, we decide to take the extents @@ -266,7 +266,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, * for windows. */ extents = pGC->graphicsExposures && - (REGION_NUM_RECTS(&rgnExposed) > RECTLIMIT) && + (RegionNumRects(&rgnExposed) > RECTLIMIT) && (pDstDrawable->type != DRAWABLE_PIXMAP); if (pSrcWin) { @@ -278,13 +278,13 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, * exposed region will undo all our work! */ if (extents && pSrcWin && region && - (RECT_IN_REGION(pscr, region, &srcBox) != rgnIN)) + (RegionContainsRect(region, &srcBox) != rgnIN)) extents = FALSE; } if (extents) { - expBox = *REGION_EXTENTS(pscr, &rgnExposed); - REGION_RESET(pscr, &rgnExposed, &expBox); + expBox = *RegionExtents(&rgnExposed); + RegionReset(&rgnExposed, &expBox); } if ((pDstDrawable->type != DRAWABLE_PIXMAP) && (((WindowPtr)pDstDrawable)->backgroundState != None)) @@ -292,52 +292,52 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, WindowPtr pWin = (WindowPtr)pDstDrawable; /* make the exposed area screen-relative */ - REGION_TRANSLATE(pscr, &rgnExposed, + RegionTranslate(&rgnExposed, pDstDrawable->x, pDstDrawable->y); if (extents) { /* miPaintWindow doesn't clip, so we have to */ - REGION_INTERSECT(pscr, &rgnExposed, &rgnExposed, &pWin->clipList); + RegionIntersect(&rgnExposed, &rgnExposed, &pWin->clipList); } miPaintWindow((WindowPtr)pDstDrawable, &rgnExposed, PW_BACKGROUND); if (extents) { - REGION_RESET(pscr, &rgnExposed, &expBox); + RegionReset(&rgnExposed, &expBox); } else - REGION_TRANSLATE(pscr, &rgnExposed, + RegionTranslate(&rgnExposed, -pDstDrawable->x, -pDstDrawable->y); } if (prgnDstClip == &rgnDstRec) { - REGION_UNINIT(pscr, prgnDstClip); + RegionUninit(prgnDstClip); } else if (prgnDstClip != prgnSrcClip) { - REGION_DESTROY(pscr, prgnDstClip); + RegionDestroy(prgnDstClip); } if (prgnSrcClip == &rgnSrcRec) { - REGION_UNINIT(pscr, prgnSrcClip); + RegionUninit(prgnSrcClip); } else { - REGION_DESTROY(pscr, prgnSrcClip); + RegionDestroy(prgnSrcClip); } if (pGC->graphicsExposures) { /* don't look */ - RegionPtr exposed = REGION_CREATE(pscr, NullBox, 0); + RegionPtr exposed = RegionCreate(NullBox, 0); *exposed = rgnExposed; return exposed; } else { - REGION_UNINIT(pscr, &rgnExposed); + RegionUninit(&rgnExposed); return NULL; } } @@ -348,7 +348,7 @@ void miSendGraphicsExpose (ClientPtr client, RegionPtr pRgn, XID drawable, int major, int minor) { - if (pRgn && !REGION_NIL(pRgn)) + if (pRgn && !RegionNil(pRgn)) { xEvent *pEvent; xEvent *pe; @@ -356,8 +356,8 @@ miSendGraphicsExpose (ClientPtr client, RegionPtr pRgn, XID drawable, int i; int numRects; - numRects = REGION_NUM_RECTS(pRgn); - pBox = REGION_RECTS(pRgn); + numRects = RegionNumRects(pRgn); + pBox = RegionRects(pRgn); if(!(pEvent = malloc(numRects * sizeof(xEvent)))) return; pe = pEvent; @@ -401,8 +401,8 @@ miSendExposures( WindowPtr pWin, RegionPtr pRgn, int dx, int dy) xEvent *pEvent, *pe; int i; - pBox = REGION_RECTS(pRgn); - numRects = REGION_NUM_RECTS(pRgn); + pBox = RegionRects(pRgn); + numRects = RegionNumRects(pRgn); if(!(pEvent = calloc(1, numRects * sizeof(xEvent)))) return; @@ -457,8 +457,8 @@ void miWindowExposures( WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed) { RegionPtr exposures = prgn; - if ((prgn && !REGION_NIL(prgn)) || - (exposures && !REGION_NIL(exposures)) || other_exposed) + if ((prgn && !RegionNil(prgn)) || + (exposures && !RegionNil(exposures)) || other_exposed) { RegionRec expRec; int clientInterested; @@ -471,15 +471,15 @@ miWindowExposures( WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed) { if (exposures) { - REGION_UNION(pWin->drawable.pScreen, other_exposed, + RegionUnion(other_exposed, exposures, other_exposed); if (exposures != prgn) - REGION_DESTROY(pWin->drawable.pScreen, exposures); + RegionDestroy(exposures); } exposures = other_exposed; } - if (clientInterested && exposures && (REGION_NUM_RECTS(exposures) > RECTLIMIT)) + if (clientInterested && exposures && (RegionNumRects(exposures) > RECTLIMIT)) { /* * If we have LOTS of rectangles, we decide to take the extents @@ -489,34 +489,34 @@ miWindowExposures( WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed) */ BoxRec box; - box = *REGION_EXTENTS( pWin->drawable.pScreen, exposures); + box = *RegionExtents(exposures); if (exposures == prgn) { exposures = &expRec; - REGION_INIT( pWin->drawable.pScreen, exposures, &box, 1); - REGION_RESET( pWin->drawable.pScreen, prgn, &box); + RegionInit(exposures, &box, 1); + RegionReset(prgn, &box); } else { - REGION_RESET( pWin->drawable.pScreen, exposures, &box); - REGION_UNION( pWin->drawable.pScreen, prgn, prgn, exposures); + RegionReset(exposures, &box); + RegionUnion(prgn, prgn, exposures); } /* miPaintWindow doesn't clip, so we have to */ - REGION_INTERSECT( pWin->drawable.pScreen, prgn, prgn, &pWin->clipList); + RegionIntersect(prgn, prgn, &pWin->clipList); } - if (prgn && !REGION_NIL(prgn)) + if (prgn && !RegionNil(prgn)) miPaintWindow(pWin, prgn, PW_BACKGROUND); - if (clientInterested && exposures && !REGION_NIL(exposures)) + if (clientInterested && exposures && !RegionNil(exposures)) miSendExposures(pWin, exposures, pWin->drawable.x, pWin->drawable.y); if (exposures == &expRec) { - REGION_UNINIT( pWin->drawable.pScreen, exposures); + RegionUninit(exposures); } else if (exposures && exposures != prgn && exposures != other_exposed) - REGION_DESTROY( pWin->drawable.pScreen, exposures); + RegionDestroy(exposures); if (prgn) - REGION_EMPTY( pWin->drawable.pScreen, prgn); + RegionEmpty(prgn); } else if (exposures && exposures != prgn) - REGION_DESTROY( pWin->drawable.pScreen, exposures); + RegionDestroy(exposures); } #ifdef ROOTLESS @@ -647,7 +647,7 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) gcmask |= GCFillStyle | GCTile | GCTileStipXOrigin | GCTileStipYOrigin; } - prect = malloc(REGION_NUM_RECTS(prgn) * sizeof(xRectangle)); + prect = malloc(RegionNumRects(prgn) * sizeof(xRectangle)); if (!prect) return; @@ -661,8 +661,8 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what) ChangeGC (NullClient, pGC, gcmask, gcval); ValidateGC (drawable, pGC); - numRects = REGION_NUM_RECTS(prgn); - pbox = REGION_RECTS(prgn); + numRects = RegionNumRects(prgn); + pbox = RegionRects(prgn); for (i= numRects; --i >= 0; pbox++, prect++) { prect->x = pbox->x1 - draw_x_off; diff --git a/mi/migc.c b/mi/migc.c index 7b2b1c3504..778c4b4639 100644 --- a/mi/migc.c +++ b/mi/migc.c @@ -50,7 +50,7 @@ miDestroyGC(GCPtr pGC) if (pGC->pRotatedPixmap) (*pGC->pScreen->DestroyPixmap) (pGC->pRotatedPixmap); if (pGC->freeCompClip) - REGION_DESTROY(pGC->pScreen, pGC->pCompositeClip); + RegionDestroy(pGC->pCompositeClip); } void @@ -68,7 +68,7 @@ miDestroyClip(GCPtr pGC) * we know we'll never have a list of rectangles, since ChangeClip * immediately turns them into a region */ - REGION_DESTROY(pGC->pScreen, pGC->clientClip); + RegionDestroy(pGC->clientClip); } pGC->clientClip = NULL; pGC->clientClipType = CT_NONE; @@ -81,7 +81,7 @@ miChangeClip( GCPtr pGC, int type, pointer pvalue, int nrects) if (type == CT_PIXMAP) { /* convert the pixmap to a region */ - pGC->clientClip = (pointer) BITMAP_TO_REGION(pGC->pScreen, + pGC->clientClip = (pointer) BitmapToRegion(pGC->pScreen, (PixmapPtr) pvalue); (*pGC->pScreen->DestroyPixmap) (pvalue); } @@ -92,7 +92,7 @@ miChangeClip( GCPtr pGC, int type, pointer pvalue, int nrects) } else if (type != CT_NONE) { - pGC->clientClip = (pointer) RECTS_TO_REGION(pGC->pScreen, nrects, + pGC->clientClip = (pointer) RegionFromRects(nrects, (xRectangle *) pvalue, type); free(pvalue); @@ -116,8 +116,8 @@ miCopyClip(GCPtr pgcDst, GCPtr pgcSrc) pgcSrc->clientClip, 0); break; case CT_REGION: - prgnNew = REGION_CREATE(pgcSrc->pScreen, NULL, 1); - REGION_COPY(pgcDst->pScreen, prgnNew, + prgnNew = RegionCreate(NULL, 1); + RegionCopy(prgnNew, (RegionPtr) (pgcSrc->clientClip)); (*pgcDst->funcs->ChangeClip) (pgcDst, CT_REGION, (pointer) prgnNew, 0); break; @@ -167,7 +167,7 @@ miComputeCompositeClip( GCPtr pGC, DrawablePtr pDrawable) if (pGC->clientClipType == CT_NONE) { if (freeCompClip) - REGION_DESTROY(pScreen, pGC->pCompositeClip); + RegionDestroy(pGC->pCompositeClip); pGC->pCompositeClip = pregWin; pGC->freeCompClip = freeTmpClip; } @@ -182,30 +182,30 @@ miComputeCompositeClip( GCPtr pGC, DrawablePtr pDrawable) * clip. if neither is real, create a new region. */ - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, pDrawable->x + pGC->clipOrg.x, pDrawable->y + pGC->clipOrg.y); if (freeCompClip) { - REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, + RegionIntersect(pGC->pCompositeClip, pregWin, pGC->clientClip); if (freeTmpClip) - REGION_DESTROY(pScreen, pregWin); + RegionDestroy(pregWin); } else if (freeTmpClip) { - REGION_INTERSECT(pScreen, pregWin, pregWin, pGC->clientClip); + RegionIntersect(pregWin, pregWin, pGC->clientClip); pGC->pCompositeClip = pregWin; } else { - pGC->pCompositeClip = REGION_CREATE(pScreen, NullBox, 0); - REGION_INTERSECT(pScreen, pGC->pCompositeClip, + pGC->pCompositeClip = RegionCreate(NullBox, 0); + RegionIntersect(pGC->pCompositeClip, pregWin, pGC->clientClip); } pGC->freeCompClip = TRUE; - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, -(pDrawable->x + pGC->clipOrg.x), -(pDrawable->y + pGC->clipOrg.y)); } @@ -223,31 +223,31 @@ miComputeCompositeClip( GCPtr pGC, DrawablePtr pDrawable) if (pGC->freeCompClip) { - REGION_RESET(pScreen, pGC->pCompositeClip, &pixbounds); + RegionReset(pGC->pCompositeClip, &pixbounds); } else { pGC->freeCompClip = TRUE; - pGC->pCompositeClip = REGION_CREATE(pScreen, &pixbounds, 1); + pGC->pCompositeClip = RegionCreate(&pixbounds, 1); } if (pGC->clientClipType == CT_REGION) { if(pDrawable->x || pDrawable->y) { - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, pDrawable->x + pGC->clipOrg.x, pDrawable->y + pGC->clipOrg.y); - REGION_INTERSECT(pScreen, pGC->pCompositeClip, + RegionIntersect(pGC->pCompositeClip, pGC->pCompositeClip, pGC->clientClip); - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, -(pDrawable->x + pGC->clipOrg.x), -(pDrawable->y + pGC->clipOrg.y)); } else { - REGION_TRANSLATE(pScreen, pGC->pCompositeClip, + RegionTranslate(pGC->pCompositeClip, -pGC->clipOrg.x, -pGC->clipOrg.y); - REGION_INTERSECT(pScreen, pGC->pCompositeClip, + RegionIntersect(pGC->pCompositeClip, pGC->pCompositeClip, pGC->clientClip); - REGION_TRANSLATE(pScreen, pGC->pCompositeClip, + RegionTranslate(pGC->pCompositeClip, pGC->clipOrg.x, pGC->clipOrg.y); } } diff --git a/mi/mioverlay.c b/mi/mioverlay.c index da3ff4ae75..d8eb64278f 100644 --- a/mi/mioverlay.c +++ b/mi/mioverlay.c @@ -201,8 +201,8 @@ miOverlayCreateWindow(WindowPtr pWin) pTree->visibility = VisibilityNotViewable; pWinPriv->tree = pTree; if(pWin->parent) { - REGION_NULL(pScreen, &(pTree->borderClip)); - REGION_NULL(pScreen, &(pTree->clipList)); + RegionNull(&(pTree->borderClip)); + RegionNull(&(pTree->clipList)); RebuildTree(pWin); } else { BoxRec fullBox; @@ -210,8 +210,8 @@ miOverlayCreateWindow(WindowPtr pWin) fullBox.y1 = 0; fullBox.x2 = pScreen->width; fullBox.y2 = pScreen->height; - REGION_INIT(pScreen, &(pTree->borderClip), &fullBox, 1); - REGION_INIT(pScreen, &(pTree->clipList), &fullBox, 1); + RegionInit(&(pTree->borderClip), &fullBox, 1); + RegionInit(&(pTree->clipList), &fullBox, 1); } } else free(pTree); } @@ -239,8 +239,8 @@ miOverlayDestroyWindow(WindowPtr pWin) else if(pTree->parent) pTree->parent->lastChild = pTree->prevSib; - REGION_UNINIT(pScreen, &(pTree->borderClip)); - REGION_UNINIT(pScreen, &(pTree->clipList)); + RegionUninit(&(pTree->borderClip)); + RegionUninit(&(pTree->clipList)); free(pTree); } @@ -338,7 +338,7 @@ miOverlayMarkOverlappedWindows( doUnderlay = (IN_UNDERLAY(pWin) || HasUnderlayChildren(pWin)); - box = REGION_EXTENTS(pScreen, &pWin->borderSize); + box = RegionExtents(&pWin->borderSize); if((pChild = pFirst)) { pLast = pChild->parent->lastChild; @@ -349,13 +349,13 @@ miOverlayMarkOverlappedWindows( pTree = MIOVERLAY_GET_WINDOW_TREE(pChild); if(pChild->viewable) { - if (REGION_BROKEN (pScreen, &pChild->winSize)) + if (RegionBroken(&pChild->winSize)) SetWinSize (pChild); - if (REGION_BROKEN (pScreen, &pChild->borderSize)) + if (RegionBroken(&pChild->borderSize)) SetBorderSize (pChild); if (markAll || - RECT_IN_REGION(pScreen, &pChild->borderSize, box)) + RegionContainsRect(&pChild->borderSize, box)) { MARK_OVERLAY(pChild); overMarked = TRUE; @@ -410,12 +410,12 @@ miOverlayMarkOverlappedWindows( while(1) { if(tChild->pWin->viewable) { - if (REGION_BROKEN (pScreen, &tChild->pWin->winSize)) + if (RegionBroken(&tChild->pWin->winSize)) SetWinSize (tChild->pWin); - if (REGION_BROKEN (pScreen, &tChild->pWin->borderSize)) + if (RegionBroken(&tChild->pWin->borderSize)) SetBorderSize (tChild->pWin); - if(RECT_IN_REGION(pScreen, &(tChild->pWin->borderSize), box)) + if(RegionContainsRect(&(tChild->pWin->borderSize), box)) { MARK_UNDERLAY(tChild->pWin); underMarked = TRUE; @@ -473,7 +473,7 @@ miOverlayComputeClips( borderSize.y2 = dy; oldVis = tParent->visibility; - switch (RECT_IN_REGION( pScreen, universe, &borderSize)) { + switch (RegionContainsRect(universe, &borderSize)) { case rgnIN: newVis = VisibilityUnobscured; break; @@ -521,8 +521,8 @@ miOverlayComputeClips( while (1) { if (tChild->pWin->viewable) { if (tChild->visibility != VisibilityFullyObscured) { - REGION_TRANSLATE( pScreen, &tChild->borderClip, dx, dy); - REGION_TRANSLATE( pScreen, &tChild->clipList, dx, dy); + RegionTranslate(&tChild->borderClip, dx, dy); + RegionTranslate(&tChild->clipList, dx, dy); tChild->pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; @@ -530,14 +530,14 @@ miOverlayComputeClips( (* pScreen->ClipNotify) (tChild->pWin, dx, dy); } if (tChild->valdata) { - REGION_NULL(pScreen, &tChild->valdata->borderExposed); + RegionNull(&tChild->valdata->borderExposed); if (HasParentRelativeBorder(tChild->pWin)){ - REGION_SUBTRACT(pScreen, + RegionSubtract( &tChild->valdata->borderExposed, &tChild->borderClip, &tChild->pWin->winSize); } - REGION_NULL(pScreen, &tChild->valdata->exposed); + RegionNull(&tChild->valdata->exposed); } if (tChild->firstChild) { tChild = tChild->firstChild; @@ -555,50 +555,50 @@ miOverlayComputeClips( /* fall through */ default: if (dx || dy) { - REGION_TRANSLATE( pScreen, &tParent->borderClip, dx, dy); - REGION_TRANSLATE( pScreen, &tParent->clipList, dx, dy); + RegionTranslate(&tParent->borderClip, dx, dy); + RegionTranslate(&tParent->clipList, dx, dy); } break; case VTBroken: - REGION_EMPTY (pScreen, &tParent->borderClip); - REGION_EMPTY (pScreen, &tParent->clipList); + RegionEmpty(&tParent->borderClip); + RegionEmpty(&tParent->clipList); break; } borderVisible = tParent->valdata->borderVisible; - REGION_NULL(pScreen, &tParent->valdata->borderExposed); - REGION_NULL(pScreen, &tParent->valdata->exposed); + RegionNull(&tParent->valdata->borderExposed); + RegionNull(&tParent->valdata->exposed); if (HasBorder (pParent)) { if (borderVisible) { - REGION_SUBTRACT( pScreen, exposed, universe, borderVisible); - REGION_DESTROY( pScreen, borderVisible); + RegionSubtract(exposed, universe, borderVisible); + RegionDestroy(borderVisible); } else - REGION_SUBTRACT( pScreen, exposed, universe, &tParent->borderClip); + RegionSubtract(exposed, universe, &tParent->borderClip); if (HasParentRelativeBorder(pParent) && (dx || dy)) - REGION_SUBTRACT( pScreen, &tParent->valdata->borderExposed, + RegionSubtract(&tParent->valdata->borderExposed, universe, &pParent->winSize); else - REGION_SUBTRACT( pScreen, &tParent->valdata->borderExposed, + RegionSubtract(&tParent->valdata->borderExposed, exposed, &pParent->winSize); - REGION_COPY( pScreen, &tParent->borderClip, universe); - REGION_INTERSECT( pScreen, universe, universe, &pParent->winSize); + RegionCopy(&tParent->borderClip, universe); + RegionIntersect(universe, universe, &pParent->winSize); } else - REGION_COPY( pScreen, &tParent->borderClip, universe); + RegionCopy(&tParent->borderClip, universe); if ((tChild = tParent->firstChild) && pParent->mapped) { - REGION_NULL(pScreen, &childUniverse); - REGION_NULL(pScreen, &childUnion); + RegionNull(&childUniverse); + RegionNull(&childUnion); for (; tChild; tChild = tChild->nextSib) { if (tChild->pWin->viewable) - REGION_APPEND( pScreen, &childUnion, &tChild->pWin->borderSize); + RegionAppend(&childUnion, &tChild->pWin->borderSize); } - REGION_VALIDATE( pScreen, &childUnion, &overlap); + RegionValidate(&childUnion, &overlap); for (tChild = tParent->firstChild; tChild; @@ -606,31 +606,31 @@ miOverlayComputeClips( { if (tChild->pWin->viewable) { if (tChild->valdata) { - REGION_INTERSECT( pScreen, &childUniverse, universe, + RegionIntersect(&childUniverse, universe, &tChild->pWin->borderSize); miOverlayComputeClips (tChild->pWin, &childUniverse, kind, exposed); } if (overlap) - REGION_SUBTRACT( pScreen, universe, universe, + RegionSubtract(universe, universe, &tChild->pWin->borderSize); } } if (!overlap) - REGION_SUBTRACT( pScreen, universe, universe, &childUnion); - REGION_UNINIT( pScreen, &childUnion); - REGION_UNINIT( pScreen, &childUniverse); + RegionSubtract(universe, universe, &childUnion); + RegionUninit(&childUnion); + RegionUninit(&childUniverse); } if (oldVis == VisibilityFullyObscured || oldVis == VisibilityNotViewable) { - REGION_COPY( pScreen, &tParent->valdata->exposed, universe); + RegionCopy(&tParent->valdata->exposed, universe); } else if (newVis != VisibilityFullyObscured && newVis != VisibilityNotViewable) { - REGION_SUBTRACT( pScreen, &tParent->valdata->exposed, + RegionSubtract(&tParent->valdata->exposed, universe, &tParent->clipList); } @@ -708,14 +708,14 @@ miOverlayMarkUnrealizedWindow( if ((pChild != pWin) || fromConfigure) { miOverlayTreePtr pTree; - REGION_EMPTY(pChild->drawable.pScreen, &pChild->clipList); + RegionEmpty(&pChild->clipList); if (pChild->drawable.pScreen->ClipNotify) (* pChild->drawable.pScreen->ClipNotify)(pChild, 0, 0); - REGION_EMPTY(pChild->drawable.pScreen, &pChild->borderClip); + RegionEmpty(&pChild->borderClip); if((pTree = MIOVERLAY_GET_WINDOW_TREE(pChild))) { if(pTree->valdata != (miOverlayValDataPtr)UnmapValData) { - REGION_EMPTY(pChild->drawable.pScreen, &pTree->clipList); - REGION_EMPTY(pChild->drawable.pScreen, &pTree->borderClip); + RegionEmpty(&pTree->clipList); + RegionEmpty(&pTree->borderClip); } } } @@ -740,9 +740,9 @@ miOverlayValidateTree( if (!pChild) pChild = pParent->firstChild; - REGION_NULL(pScreen, &totalClip); - REGION_NULL(pScreen, &childClip); - REGION_NULL(pScreen, &exposed); + RegionNull(&totalClip); + RegionNull(&childClip); + RegionNull(&exposed); newParent = pParent; @@ -756,52 +756,52 @@ miOverlayValidateTree( else tChild = tParent->firstChild; - if (REGION_BROKEN (pScreen, &tParent->clipList) && - !REGION_BROKEN (pScreen, &tParent->borderClip)) + if (RegionBroken(&tParent->clipList) && + !RegionBroken(&tParent->borderClip)) { kind = VTBroken; - REGION_COPY (pScreen, &totalClip, &tParent->borderClip); - REGION_INTERSECT (pScreen, &totalClip, &totalClip, + RegionCopy(&totalClip, &tParent->borderClip); + RegionIntersect(&totalClip, &totalClip, &tParent->pWin->winSize); for (tWin = tParent->firstChild; tWin != tChild; tWin = tWin->nextSib) { if (tWin->pWin->viewable) - REGION_SUBTRACT (pScreen, &totalClip, &totalClip, + RegionSubtract(&totalClip, &totalClip, &tWin->pWin->borderSize); } - REGION_EMPTY (pScreen, &tParent->clipList); + RegionEmpty(&tParent->clipList); } else { for(tWin = tChild; tWin; tWin = tWin->nextSib) { if(tWin->valdata) - REGION_APPEND(pScreen, &totalClip, &tWin->borderClip); + RegionAppend(&totalClip, &tWin->borderClip); } - REGION_VALIDATE(pScreen, &totalClip, &overlap); + RegionValidate(&totalClip, &overlap); } if(kind != VTStack) - REGION_UNION(pScreen, &totalClip, &totalClip, &tParent->clipList); + RegionUnion(&totalClip, &totalClip, &tParent->clipList); for(tWin = tChild; tWin; tWin = tWin->nextSib) { if(tWin->valdata) { if(tWin->pWin->viewable) { - REGION_INTERSECT(pScreen, &childClip, &totalClip, + RegionIntersect(&childClip, &totalClip, &tWin->pWin->borderSize); miOverlayComputeClips(tWin->pWin, &childClip, kind, &exposed); - REGION_SUBTRACT(pScreen, &totalClip, &totalClip, + RegionSubtract(&totalClip, &totalClip, &tWin->pWin->borderSize); } else { /* Means we are unmapping */ - REGION_EMPTY(pScreen, &tWin->clipList); - REGION_EMPTY( pScreen, &tWin->borderClip); + RegionEmpty(&tWin->clipList); + RegionEmpty(&tWin->borderClip); tWin->valdata = NULL; } } } - REGION_UNINIT(pScreen, &childClip); + RegionUninit(&childClip); if(!((*pPriv->InOverlay)(newParent))) { - REGION_NULL(pScreen, &tParent->valdata->exposed); - REGION_NULL(pScreen, &tParent->valdata->borderExposed); + RegionNull(&tParent->valdata->exposed); + RegionNull(&tParent->valdata->borderExposed); } switch (kind) { @@ -809,18 +809,18 @@ miOverlayValidateTree( break; default: if(!((*pPriv->InOverlay)(newParent))) - REGION_SUBTRACT(pScreen, &tParent->valdata->exposed, &totalClip, + RegionSubtract(&tParent->valdata->exposed, &totalClip, &tParent->clipList); /* fall through */ case VTMap: - REGION_COPY( pScreen, &tParent->clipList, &totalClip); + RegionCopy(&tParent->clipList, &totalClip); if(!((*pPriv->InOverlay)(newParent))) newParent->drawable.serialNumber = NEXT_SERIAL_NUMBER; break; } - REGION_UNINIT( pScreen, &totalClip); - REGION_UNINIT( pScreen, &exposed); + RegionUninit(&totalClip); + RegionUninit(&exposed); SKIP_UNDERLAY: @@ -853,14 +853,14 @@ miOverlayHandleExposures(WindowPtr pWin) while (1) { if((mival = pTree->valdata)) { if(!((*pPriv->InOverlay)(pTree->pWin))) { - if (REGION_NOTEMPTY(pScreen, &mival->borderExposed)) { + if (RegionNotEmpty(&mival->borderExposed)) { miPaintWindow(pTree->pWin, &mival->borderExposed, PW_BORDER); } - REGION_UNINIT(pScreen, &mival->borderExposed); + RegionUninit(&mival->borderExposed); (*WindowExposures)(pTree->pWin,&mival->exposed,NullRegion); - REGION_UNINIT(pScreen, &mival->exposed); + RegionUninit(&mival->exposed); } free(mival); pTree->valdata = NULL; @@ -882,24 +882,24 @@ miOverlayHandleExposures(WindowPtr pWin) while (1) { if ( (val = pChild->valdata) ) { if(!((*pPriv->InOverlay)(pChild))) { - REGION_UNION(pScreen, &val->after.exposed, &val->after.exposed, + RegionUnion(&val->after.exposed, &val->after.exposed, &val->after.borderExposed); - if (REGION_NOTEMPTY(pScreen, &val->after.exposed)) { + if (RegionNotEmpty(&val->after.exposed)) { (*(MIOVERLAY_GET_SCREEN_PRIVATE(pScreen)->MakeTransparent))( pScreen, - REGION_NUM_RECTS(&val->after.exposed), - REGION_RECTS(&val->after.exposed)); + RegionNumRects(&val->after.exposed), + RegionRects(&val->after.exposed)); } } else { - if (REGION_NOTEMPTY(pScreen, &val->after.borderExposed)) { + if (RegionNotEmpty(&val->after.borderExposed)) { miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER); } (*WindowExposures)(pChild, &val->after.exposed, NullRegion); } - REGION_UNINIT(pScreen, &val->after.borderExposed); - REGION_UNINIT(pScreen, &val->after.exposed); + RegionUninit(&val->after.borderExposed); + RegionUninit(&val->after.exposed); free(val); pChild->valdata = NULL; if (pChild->firstChild) @@ -940,13 +940,13 @@ miOverlayMoveWindow( oldpt.x = pWin->drawable.x; oldpt.y = pWin->drawable.y; if (WasViewable) { - REGION_NULL(pScreen, &overReg); - REGION_NULL(pScreen, &underReg); + RegionNull(&overReg); + RegionNull(&underReg); if(pTree) { - REGION_COPY(pScreen, &overReg, &pWin->borderClip); - REGION_COPY(pScreen, &underReg, &pTree->borderClip); + RegionCopy(&overReg, &pWin->borderClip); + RegionCopy(&underReg, &pTree->borderClip); } else { - REGION_COPY(pScreen, &overReg, &pWin->borderClip); + RegionCopy(&overReg, &pWin->borderClip); CollectUnderlayChildrenRegions(pWin, &underReg); } (*pScreen->MarkOverlappedWindows)(pWin, pWin, NULL); @@ -971,16 +971,16 @@ miOverlayMoveWindow( (*pScreen->ValidateTree)(pWin->parent, NullWindow, kind); - if(REGION_NOTEMPTY(pScreen, &underReg)) { + if(RegionNotEmpty(&underReg)) { pPriv->copyUnderlay = TRUE; (* pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, &underReg); } - REGION_UNINIT(pScreen, &underReg); - if(REGION_NOTEMPTY(pScreen, &overReg)) { + RegionUninit(&underReg); + if(RegionNotEmpty(&overReg)) { pPriv->copyUnderlay = FALSE; (* pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, &overReg); } - REGION_UNINIT(pScreen, &overReg); + RegionUninit(&overReg); (*pScreen->HandleExposures)(pWin->parent); if (pScreen->PostValidateTree) @@ -1003,8 +1003,8 @@ miOverlayWindowExposures( RegionPtr exposures = prgn; ScreenPtr pScreen = pWin->drawable.pScreen; - if ((prgn && !REGION_NIL(prgn)) || - (exposures && !REGION_NIL(exposures)) || other_exposed) + if ((prgn && !RegionNil(prgn)) || + (exposures && !RegionNil(exposures)) || other_exposed) { RegionRec expRec; int clientInterested; @@ -1013,51 +1013,51 @@ miOverlayWindowExposures( ExposureMask; if (other_exposed) { if (exposures) { - REGION_UNION(pScreen, other_exposed, exposures, other_exposed); + RegionUnion(other_exposed, exposures, other_exposed); if (exposures != prgn) - REGION_DESTROY(pScreen, exposures); + RegionDestroy(exposures); } exposures = other_exposed; } if (clientInterested && exposures && - (REGION_NUM_RECTS(exposures) > RECTLIMIT)) + (RegionNumRects(exposures) > RECTLIMIT)) { miOverlayScreenPtr pPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); BoxRec box; - box = *REGION_EXTENTS(pScreen, exposures); + box = *RegionExtents(exposures); if (exposures == prgn) { exposures = &expRec; - REGION_INIT(pScreen, exposures, &box, 1); - REGION_RESET(pScreen, prgn, &box); + RegionInit(exposures, &box, 1); + RegionReset(prgn, &box); } else { - REGION_RESET(pScreen, exposures, &box); - REGION_UNION(pScreen, prgn, prgn, exposures); + RegionReset(exposures, &box); + RegionUnion(prgn, prgn, exposures); } /* This is the only reason why we are replacing mi's version of this file */ if(!((*pPriv->InOverlay)(pWin))) { miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); - REGION_INTERSECT(pScreen, prgn, prgn, &pTree->clipList); + RegionIntersect(prgn, prgn, &pTree->clipList); } else - REGION_INTERSECT(pScreen, prgn, prgn, &pWin->clipList); + RegionIntersect(prgn, prgn, &pWin->clipList); } - if (prgn && !REGION_NIL(prgn)) + if (prgn && !RegionNil(prgn)) miPaintWindow(pWin, prgn, PW_BACKGROUND); - if (clientInterested && exposures && !REGION_NIL(exposures)) + if (clientInterested && exposures && !RegionNil(exposures)) miSendExposures(pWin, exposures, pWin->drawable.x, pWin->drawable.y); if (exposures == &expRec) { - REGION_UNINIT(pScreen, exposures); + RegionUninit(exposures); } else if (exposures && exposures != prgn && exposures != other_exposed) - REGION_DESTROY(pScreen, exposures); + RegionDestroy(exposures); if (prgn) - REGION_EMPTY(pScreen, prgn); + RegionEmpty(prgn); } else if (exposures && exposures != prgn) - REGION_DESTROY(pScreen, exposures); + RegionDestroy(exposures); } @@ -1082,23 +1082,23 @@ miOverlayRecomputeExposures ( /* * compute exposed regions of this window */ - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, + RegionSubtract(&pWin->valdata->after.exposed, &pWin->clipList, pValid->over); /* * compute exposed regions of the border */ - REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed, + RegionSubtract(&pWin->valdata->after.borderExposed, &pWin->borderClip, &pWin->winSize); - REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed, + RegionSubtract(&pWin->valdata->after.borderExposed, &pWin->valdata->after.borderExposed, pValid->over); } if(pTree && pTree->valdata) { - REGION_SUBTRACT(pScreen, &pTree->valdata->exposed, + RegionSubtract(&pTree->valdata->exposed, &pTree->clipList, pValid->under); - REGION_SUBTRACT(pScreen, &pTree->valdata->borderExposed, + RegionSubtract(&pTree->valdata->borderExposed, &pTree->borderClip, &pWin->winSize); - REGION_SUBTRACT(pScreen, &pTree->valdata->borderExposed, + RegionSubtract(&pTree->valdata->borderExposed, &pTree->valdata->borderExposed, pValid->under); } else if (!pWin->valdata) return WT_NOMATCH; @@ -1154,11 +1154,11 @@ miOverlayResizeWindow( /* * save the visible region of the window */ - oldRegion = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldRegion, &pWin->winSize); + oldRegion = RegionCreate(NullBox, 1); + RegionCopy(oldRegion, &pWin->winSize); if(doUnderlay) { - oldRegion2 = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldRegion2, &pWin->winSize); + oldRegion2 = RegionCreate(NullBox, 1); + RegionCopy(oldRegion2, &pWin->winSize); } /* @@ -1170,16 +1170,16 @@ miOverlayResizeWindow( g = pChild->winGravity; if (g != UnmapGravity) { if (!gravitate[g]) - gravitate[g] = REGION_CREATE(pScreen, NullBox, 1); - REGION_UNION(pScreen, gravitate[g], + gravitate[g] = RegionCreate(NullBox, 1); + RegionUnion(gravitate[g], gravitate[g], &pChild->borderClip); if(doUnderlay) { if (!gravitate2[g]) - gravitate2[g] = REGION_CREATE(pScreen, NullBox, 0); + gravitate2[g] = RegionCreate(NullBox, 0); if((tChild = MIOVERLAY_GET_WINDOW_TREE(pChild))) { - REGION_UNION(pScreen, gravitate2[g], + RegionUnion(gravitate2[g], gravitate2[g], &tChild->borderClip); } else CollectUnderlayChildrenRegions(pChild, gravitate2[g]); @@ -1193,11 +1193,11 @@ miOverlayResizeWindow( oldWinClip = oldWinClip2 = NULL; if (pWin->bitGravity != ForgetGravity) { - oldWinClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldWinClip, &pWin->clipList); + oldWinClip = RegionCreate(NullBox, 1); + RegionCopy(oldWinClip, &pWin->clipList); if(pTree) { - oldWinClip2 = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldWinClip2, &pTree->clipList); + oldWinClip2 = RegionCreate(NullBox, 1); + RegionCopy(oldWinClip2, &pTree->clipList); } } /* @@ -1213,26 +1213,26 @@ miOverlayResizeWindow( if ((pWin->drawable.height != h || pWin->drawable.width != w) && HasBorder (pWin)) { - borderVisible = REGION_CREATE(pScreen, NullBox, 1); + borderVisible = RegionCreate(NullBox, 1); if(pTree) - borderVisible2 = REGION_CREATE(pScreen, NullBox, 1); + borderVisible2 = RegionCreate(NullBox, 1); /* for tiled borders, we punt and draw the whole thing */ if (pWin->borderIsPixel || !moved) { if (shrunk || moved) - REGION_SUBTRACT(pScreen, borderVisible, + RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); else - REGION_COPY(pScreen, borderVisible, + RegionCopy(borderVisible, &pWin->borderClip); if(pTree) { if (shrunk || moved) - REGION_SUBTRACT(pScreen, borderVisible, + RegionSubtract(borderVisible, &pTree->borderClip, &pWin->winSize); else - REGION_COPY(pScreen, borderVisible, + RegionCopy(borderVisible, &pTree->borderClip); } } @@ -1259,7 +1259,7 @@ miOverlayResizeWindow( pFirstChange = MoveWindowInStack(pWin, pSib); if (WasViewable) { - pRegion = REGION_CREATE(pScreen, NullBox, 1); + pRegion = RegionCreate(NullBox, 1); (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange, NULL); @@ -1274,9 +1274,9 @@ miOverlayResizeWindow( * the entire window is trashed unless bitGravity * recovers portions of it */ - REGION_COPY(pScreen, &pWin->valdata->after.exposed, &pWin->clipList); + RegionCopy(&pWin->valdata->after.exposed, &pWin->clipList); if(pTree) - REGION_COPY(pScreen, &pTree->valdata->exposed, &pTree->clipList); + RegionCopy(&pTree->valdata->exposed, &pTree->clipList); } GravityTranslate (x, y, oldx, oldy, dw, dh, pWin->bitGravity, &nx, &ny); @@ -1304,20 +1304,20 @@ miOverlayResizeWindow( dx = (oldx - nx) - offx; dy = (oldy - ny) - offy; if (dx || dy) { - REGION_TRANSLATE(pScreen, &pWin->winSize, dx, dy); + RegionTranslate(&pWin->winSize, dx, dy); offx += dx; offy += dy; } if(gravitate[g]) - REGION_INTERSECT(pScreen, gravitate[g], gravitate[g], + RegionIntersect(gravitate[g], gravitate[g], &pWin->winSize); if(gravitate2[g]) - REGION_INTERSECT(pScreen, gravitate2[g], gravitate2[g], + RegionIntersect(gravitate2[g], gravitate2[g], &pWin->winSize); } /* get winSize back where it belongs */ if (offx || offy) - REGION_TRANSLATE(pScreen, &pWin->winSize, -offx, -offy); + RegionTranslate(&pWin->winSize, -offx, -offy); } /* * add screen bits to the appropriate bucket @@ -1325,22 +1325,22 @@ miOverlayResizeWindow( if (oldWinClip2) { - REGION_COPY(pScreen, pRegion, oldWinClip2); - REGION_TRANSLATE(pScreen, pRegion, nx - oldx, ny - oldy); - REGION_INTERSECT(pScreen, oldWinClip2, pRegion, &pTree->clipList); + RegionCopy(pRegion, oldWinClip2); + RegionTranslate(pRegion, nx - oldx, ny - oldy); + RegionIntersect(oldWinClip2, pRegion, &pTree->clipList); for (g = pWin->bitGravity + 1; g <= StaticGravity; g++) { if (gravitate2[g]) - REGION_SUBTRACT(pScreen, oldWinClip2, oldWinClip2, + RegionSubtract(oldWinClip2, oldWinClip2, gravitate2[g]); } - REGION_TRANSLATE(pScreen, oldWinClip2, oldx - nx, oldy - ny); + RegionTranslate(oldWinClip2, oldx - nx, oldy - ny); g = pWin->bitGravity; if (!gravitate2[g]) gravitate2[g] = oldWinClip2; else { - REGION_UNION(pScreen,gravitate2[g],gravitate2[g],oldWinClip2); - REGION_DESTROY(pScreen, oldWinClip2); + RegionUnion(gravitate2[g],gravitate2[g],oldWinClip2); + RegionDestroy(oldWinClip2); } } @@ -1349,9 +1349,9 @@ miOverlayResizeWindow( /* * clip to new clipList */ - REGION_COPY(pScreen, pRegion, oldWinClip); - REGION_TRANSLATE(pScreen, pRegion, nx - oldx, ny - oldy); - REGION_INTERSECT(pScreen, oldWinClip, pRegion, &pWin->clipList); + RegionCopy(pRegion, oldWinClip); + RegionTranslate(pRegion, nx - oldx, ny - oldy); + RegionIntersect(oldWinClip, pRegion, &pWin->clipList); /* * don't step on any gravity bits which will be copied after this * region. Note -- this assumes that the regions will be copied @@ -1359,16 +1359,16 @@ miOverlayResizeWindow( */ for (g = pWin->bitGravity + 1; g <= StaticGravity; g++) { if (gravitate[g]) - REGION_SUBTRACT(pScreen, oldWinClip, oldWinClip, + RegionSubtract(oldWinClip, oldWinClip, gravitate[g]); } - REGION_TRANSLATE(pScreen, oldWinClip, oldx - nx, oldy - ny); + RegionTranslate(oldWinClip, oldx - nx, oldy - ny); g = pWin->bitGravity; if (!gravitate[g]) gravitate[g] = oldWinClip; else { - REGION_UNION(pScreen, gravitate[g], gravitate[g], oldWinClip); - REGION_DESTROY(pScreen, oldWinClip); + RegionUnion(gravitate[g], gravitate[g], oldWinClip); + RegionDestroy(oldWinClip); } } @@ -1392,23 +1392,23 @@ miOverlayResizeWindow( /* only copy the remaining useful bits */ if(gravitate[g]) - REGION_INTERSECT(pScreen, gravitate[g], + RegionIntersect(gravitate[g], gravitate[g], oldRegion); if(gravitate2[g]) - REGION_INTERSECT(pScreen, gravitate2[g], + RegionIntersect(gravitate2[g], gravitate2[g], oldRegion2); /* clip to not overwrite already copied areas */ if (destClip && gravitate[g]) { - REGION_TRANSLATE(pScreen, destClip, oldpt.x - x, oldpt.y - y); - REGION_SUBTRACT(pScreen, gravitate[g], gravitate[g], destClip); - REGION_TRANSLATE(pScreen, destClip, x - oldpt.x, y - oldpt.y); + RegionTranslate(destClip, oldpt.x - x, oldpt.y - y); + RegionSubtract(gravitate[g], gravitate[g], destClip); + RegionTranslate(destClip, x - oldpt.x, y - oldpt.y); } if (destClip2 && gravitate2[g]) { - REGION_TRANSLATE(pScreen, destClip2, oldpt.x - x, oldpt.y - y); - REGION_SUBTRACT(pScreen,gravitate2[g],gravitate2[g],destClip2); - REGION_TRANSLATE(pScreen, destClip2, x - oldpt.x, y - oldpt.y); + RegionTranslate(destClip2, oldpt.x - x, oldpt.y - y); + RegionSubtract(gravitate2[g],gravitate2[g],destClip2); + RegionTranslate(destClip2, x - oldpt.x, y - oldpt.y); } /* and move those bits */ @@ -1429,9 +1429,9 @@ miOverlayResizeWindow( /* remove any overwritten bits from the remaining useful bits */ if(gravitate[g]) - REGION_SUBTRACT(pScreen, oldRegion, oldRegion, gravitate[g]); + RegionSubtract(oldRegion, oldRegion, gravitate[g]); if(gravitate2[g]) - REGION_SUBTRACT(pScreen, oldRegion2, oldRegion2, gravitate2[g]); + RegionSubtract(oldRegion2, oldRegion2, gravitate2[g]); /* * recompute exposed regions of child windows @@ -1456,38 +1456,38 @@ miOverlayResizeWindow( if (g == pWin->bitGravity) { if(gravitate[g]) - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, + RegionSubtract(&pWin->valdata->after.exposed, &pWin->valdata->after.exposed, gravitate[g]); if(gravitate2[g] && pTree) - REGION_SUBTRACT(pScreen, &pTree->valdata->exposed, + RegionSubtract(&pTree->valdata->exposed, &pTree->valdata->exposed, gravitate2[g]); } if(gravitate[g]) { if (!destClip) destClip = gravitate[g]; else { - REGION_UNION(pScreen, destClip, destClip, gravitate[g]); - REGION_DESTROY(pScreen, gravitate[g]); + RegionUnion(destClip, destClip, gravitate[g]); + RegionDestroy(gravitate[g]); } } if(gravitate2[g]) { if (!destClip2) destClip2 = gravitate2[g]; else { - REGION_UNION(pScreen, destClip2, destClip2, gravitate2[g]); - REGION_DESTROY(pScreen, gravitate2[g]); + RegionUnion(destClip2, destClip2, gravitate2[g]); + RegionDestroy(gravitate2[g]); } } } - REGION_DESTROY(pScreen, pRegion); - REGION_DESTROY(pScreen, oldRegion); + RegionDestroy(pRegion); + RegionDestroy(oldRegion); if(doUnderlay) - REGION_DESTROY(pScreen, oldRegion2); + RegionDestroy(oldRegion2); if (destClip) - REGION_DESTROY(pScreen, destClip); + RegionDestroy(destClip); if (destClip2) - REGION_DESTROY(pScreen, destClip2); + RegionDestroy(destClip2); (*pScreen->HandleExposures)(pWin->parent); if (pScreen->PostValidateTree) (*pScreen->PostValidateTree)(pWin->parent, pFirstChange, VTOther); @@ -1510,8 +1510,8 @@ miOverlaySetShape(WindowPtr pWin, int kind) if (HasBorder (pWin)) { RegionPtr borderVisible; - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - REGION_SUBTRACT(pScreen, borderVisible, + borderVisible = RegionCreate(NullBox, 1); + RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); pWin->valdata->before.borderVisible = borderVisible; pWin->valdata->before.resized = TRUE; @@ -1519,8 +1519,8 @@ miOverlaySetShape(WindowPtr pWin, int kind) miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); RegionPtr borderVisible2; - borderVisible2 = REGION_CREATE(pScreen, NULL, 1); - REGION_SUBTRACT(pScreen, borderVisible2, + borderVisible2 = RegionCreate(NULL, 1); + RegionSubtract(borderVisible2, &pTree->borderClip, &pWin->winSize); pTree->valdata->borderVisible = borderVisible2; } @@ -1579,16 +1579,16 @@ miOverlayChangeBorderWidth( if (HadBorder) { RegionPtr borderVisible; - borderVisible = REGION_CREATE(pScreen, NULL, 1); - REGION_SUBTRACT(pScreen, borderVisible, + borderVisible = RegionCreate(NULL, 1); + RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); pWin->valdata->before.borderVisible = borderVisible; if(IN_UNDERLAY(pWin)) { miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin); RegionPtr borderVisible2; - borderVisible2 = REGION_CREATE(pScreen, NULL, 1); - REGION_SUBTRACT(pScreen, borderVisible2, + borderVisible2 = RegionCreate(NULL, 1); + RegionSubtract(borderVisible2, &pTree->borderClip, &pWin->winSize); pTree->valdata->borderVisible = borderVisible2; } @@ -1623,11 +1623,11 @@ miOverlaySetRootClip(ScreenPtr pScreen, Bool enable) box.x2 = pScreen->width; box.y2 = pScreen->height; - REGION_RESET(pScreen, &pTree->borderClip, &box); + RegionReset(&pTree->borderClip, &box); } else - REGION_EMPTY(pScreen, &pTree->borderClip); + RegionEmpty(&pTree->borderClip); - REGION_BREAK(pScreen, &pTree->clipList); + RegionBreak(&pTree->clipList); } static void @@ -1662,7 +1662,7 @@ miOverlayClearToBackground( clipList = ((*pScreenPriv->InOverlay)(pWin)) ? &pWin->clipList : &pTree->clipList; - extents = REGION_EXTENTS(pScreen, clipList); + extents = RegionExtents(clipList); if (x1 < extents->x1) x1 = extents->x1; if (x2 > extents->x2) x2 = extents->x2; @@ -1675,16 +1675,16 @@ miOverlayClearToBackground( box.x1 = x1; box.x2 = x2; box.y1 = y1; box.y2 = y2; - REGION_INIT(pScreen, ®, &box, 1); + RegionInit(®, &box, 1); - REGION_INTERSECT(pScreen, ®, ®, clipList); + RegionIntersect(®, ®, clipList); if (generateExposures) (*pScreen->WindowExposures)(pWin, ®, pBSReg); else if (pWin->backgroundState != None) miPaintWindow(pWin, ®, PW_BACKGROUND); - REGION_UNINIT(pScreen, ®); + RegionUninit(®); if (pBSReg) - REGION_DESTROY(pScreen, pBSReg); + RegionDestroy(pBSReg); } @@ -1738,12 +1738,12 @@ miOverlayComputeCompositeClip(GCPtr pGC, WindowPtr pWin) } if (pGC->subWindowMode == IncludeInferiors) { - pregWin = REGION_CREATE(pScreen, NullBox, 1); + pregWin = RegionCreate(NullBox, 1); freeTmpClip = TRUE; if (pWin->parent || (screenIsSaved != SCREEN_SAVER_ON) || !HasSaverWindow (pScreen)) { - REGION_INTERSECT(pScreen,pregWin,&pTree->borderClip,&pWin->winSize); + RegionIntersect(pregWin,&pTree->borderClip,&pWin->winSize); } } else { pregWin = &pTree->clipList; @@ -1752,29 +1752,29 @@ miOverlayComputeCompositeClip(GCPtr pGC, WindowPtr pWin) freeCompClip = pGC->freeCompClip; if (pGC->clientClipType == CT_NONE) { if (freeCompClip) - REGION_DESTROY(pScreen, pGC->pCompositeClip); + RegionDestroy(pGC->pCompositeClip); pGC->pCompositeClip = pregWin; pGC->freeCompClip = freeTmpClip; } else { - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, pWin->drawable.x + pGC->clipOrg.x, pWin->drawable.y + pGC->clipOrg.y); if (freeCompClip) { - REGION_INTERSECT(pGC->pScreen, pGC->pCompositeClip, + RegionIntersect(pGC->pCompositeClip, pregWin, pGC->clientClip); if (freeTmpClip) - REGION_DESTROY(pScreen, pregWin); + RegionDestroy(pregWin); } else if (freeTmpClip) { - REGION_INTERSECT(pScreen, pregWin, pregWin, pGC->clientClip); + RegionIntersect(pregWin, pregWin, pGC->clientClip); pGC->pCompositeClip = pregWin; } else { - pGC->pCompositeClip = REGION_CREATE(pScreen, NullBox, 0); - REGION_INTERSECT(pScreen, pGC->pCompositeClip, + pGC->pCompositeClip = RegionCreate(NullBox, 0); + RegionIntersect(pGC->pCompositeClip, pregWin, pGC->clientClip); } pGC->freeCompClip = TRUE; - REGION_TRANSLATE(pScreen, pGC->clientClip, + RegionTranslate(pGC->clientClip, -(pWin->drawable.x + pGC->clipOrg.x), -(pWin->drawable.y + pGC->clipOrg.y)); } @@ -1792,7 +1792,7 @@ miOverlayCollectUnderlayRegions( return FALSE; } - *region = REGION_CREATE(pWin->drawable.pScreen, NullBox, 0); + *region = RegionCreate(NullBox, 0); CollectUnderlayChildrenRegions(pWin, *region); @@ -1913,7 +1913,7 @@ CollectUnderlayChildrenRegions(WindowPtr pWin, RegionPtr pReg) while(1) { if((pTree = MIOVERLAY_GET_WINDOW_TREE(pChild))) { - REGION_APPEND(pScreen, pReg, &pTree->borderClip); + RegionAppend(pReg, &pTree->borderClip); hasUnderlay = TRUE; } else if(pChild->firstChild) { @@ -1931,7 +1931,7 @@ CollectUnderlayChildrenRegions(WindowPtr pWin, RegionPtr pReg) if(hasUnderlay) { Bool overlap; - REGION_VALIDATE(pScreen, pReg, &overlap); + RegionValidate(pReg, &overlap); } return hasUnderlay; diff --git a/mi/mispans.h b/mi/mispans.h index ef090bb514..c3a3e67ae5 100644 --- a/mi/mispans.h +++ b/mi/mispans.h @@ -85,16 +85,6 @@ extern _X_EXPORT void miFreeSpanGroup( SpanGroup * /*spanGroup*/ ); -extern _X_EXPORT int RegionClipSpans( - RegionPtr /*prgnDst*/, - DDXPointPtr /*ppt*/, - int * /*pwidth*/, - int /*nspans*/, - DDXPointPtr /*pptNew*/, - int * /*pwidthNew*/, - int /*fSorted*/ -); - /* Rops which must use span groups */ #define miSpansCarefulRop(rop) (((rop) & 0xc) == 0x8 || ((rop) & 0x3) == 0x2) #define miSpansEasyRop(rop) (!miSpansCarefulRop(rop)) diff --git a/mi/mivaltree.c b/mi/mivaltree.c index cfcdab7569..dc88c4d77c 100644 --- a/mi/mivaltree.c +++ b/mi/mivaltree.c @@ -116,8 +116,8 @@ miShapedWindowIn (ScreenPtr pScreen, RegionPtr universe, RegionPtr bounding, Bool someIn, someOut; int t, x1, y1, x2, y2; - nbox = REGION_NUM_RECTS (bounding); - boundBox = REGION_RECTS (bounding); + nbox = RegionNumRects (bounding); + boundBox = RegionRects (bounding); someIn = someOut = FALSE; x1 = rect->x1; y1 = rect->y1; @@ -141,7 +141,7 @@ miShapedWindowIn (ScreenPtr pScreen, RegionPtr universe, RegionPtr bounding, box.x2 = box.x1; if (box.y1 > box.y2) box.y2 = box.y1; - switch (RECT_IN_REGION(pScreen, universe, &box)) + switch (RegionContainsRect(universe, &box)) { case rgnIN: if (someOut) @@ -252,15 +252,15 @@ miComputeClips ( if (miSetRedirectBorderClipProc) { if (TreatAsTransparent (pParent)) - REGION_EMPTY (pScreen, universe); + RegionEmpty(universe); (*miSetRedirectBorderClipProc) (pParent, universe); } - REGION_COPY(pScreen, universe, &pParent->borderSize); + RegionCopy(universe, &pParent->borderSize); } #endif oldVis = pParent->visibility; - switch (RECT_IN_REGION( pScreen, universe, &borderSize)) + switch (RegionContainsRect(universe, &borderSize)) { case rgnIN: newVis = VisibilityUnobscured; @@ -320,9 +320,9 @@ miComputeClips ( { if (pChild->visibility != VisibilityFullyObscured) { - REGION_TRANSLATE( pScreen, &pChild->borderClip, + RegionTranslate(&pChild->borderClip, dx, dy); - REGION_TRANSLATE( pScreen, &pChild->clipList, + RegionTranslate(&pChild->clipList, dx, dy); pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER; if (pScreen->ClipNotify) @@ -331,16 +331,16 @@ miComputeClips ( } if (pChild->valdata) { - REGION_NULL(pScreen, + RegionNull( &pChild->valdata->after.borderExposed); if (HasParentRelativeBorder(pChild)) { - REGION_SUBTRACT(pScreen, + RegionSubtract( &pChild->valdata->after.borderExposed, &pChild->borderClip, &pChild->winSize); } - REGION_NULL(pScreen, &pChild->valdata->after.exposed); + RegionNull(&pChild->valdata->after.exposed); } if (pChild->firstChild) { @@ -369,20 +369,20 @@ miComputeClips ( * We translate the old clipList because that will be exposed or copied * if gravity is right. */ - REGION_TRANSLATE( pScreen, &pParent->borderClip, dx, dy); - REGION_TRANSLATE( pScreen, &pParent->clipList, dx, dy); + RegionTranslate(&pParent->borderClip, dx, dy); + RegionTranslate(&pParent->clipList, dx, dy); } break; case VTBroken: - REGION_EMPTY (pScreen, &pParent->borderClip); - REGION_EMPTY (pScreen, &pParent->clipList); + RegionEmpty(&pParent->borderClip); + RegionEmpty(&pParent->clipList); break; } borderVisible = pParent->valdata->before.borderVisible; resized = pParent->valdata->before.resized; - REGION_NULL(pScreen, &pParent->valdata->after.borderExposed); - REGION_NULL(pScreen, &pParent->valdata->after.exposed); + RegionNull(&pParent->valdata->after.borderExposed); + RegionNull(&pParent->valdata->after.exposed); /* * Since the borderClip must not be clipped by the children, we do @@ -402,22 +402,22 @@ miComputeClips ( * of the border will be saved by DIX in borderVisible -- * use that region and destroy it */ - REGION_SUBTRACT( pScreen, exposed, universe, borderVisible); - REGION_DESTROY( pScreen, borderVisible); + RegionSubtract(exposed, universe, borderVisible); + RegionDestroy(borderVisible); } else { - REGION_SUBTRACT( pScreen, exposed, universe, &pParent->borderClip); + RegionSubtract(exposed, universe, &pParent->borderClip); } if (HasParentRelativeBorder(pParent) && (dx || dy)) - REGION_SUBTRACT( pScreen, &pParent->valdata->after.borderExposed, + RegionSubtract(&pParent->valdata->after.borderExposed, universe, &pParent->winSize); else - REGION_SUBTRACT( pScreen, &pParent->valdata->after.borderExposed, + RegionSubtract(&pParent->valdata->after.borderExposed, exposed, &pParent->winSize); - REGION_COPY( pScreen, &pParent->borderClip, universe); + RegionCopy(&pParent->borderClip, universe); /* * To get the right clipList for the parent, and to make doubly sure @@ -425,15 +425,15 @@ miComputeClips ( * border from the universe before proceeding. */ - REGION_INTERSECT( pScreen, universe, universe, &pParent->winSize); + RegionIntersect(universe, universe, &pParent->winSize); } else - REGION_COPY( pScreen, &pParent->borderClip, universe); + RegionCopy(&pParent->borderClip, universe); if ((pChild = pParent->firstChild) && pParent->mapped) { - REGION_NULL(pScreen, &childUniverse); - REGION_NULL(pScreen, &childUnion); + RegionNull(&childUniverse); + RegionNull(&childUnion); if ((pChild->drawable.y < pParent->lastChild->drawable.y) || ((pChild->drawable.y == pParent->lastChild->drawable.y) && (pChild->drawable.x < pParent->lastChild->drawable.x))) @@ -441,7 +441,7 @@ miComputeClips ( for (; pChild; pChild = pChild->nextSib) { if (pChild->viewable && !TreatAsTransparent(pChild)) - REGION_APPEND( pScreen, &childUnion, &pChild->borderSize); + RegionAppend(&childUnion, &pChild->borderSize); } } else @@ -449,10 +449,10 @@ miComputeClips ( for (pChild = pParent->lastChild; pChild; pChild = pChild->prevSib) { if (pChild->viewable && !TreatAsTransparent(pChild)) - REGION_APPEND( pScreen, &childUnion, &pChild->borderSize); + RegionAppend(&childUnion, &pChild->borderSize); } } - REGION_VALIDATE( pScreen, &childUnion, &overlap); + RegionValidate(&childUnion, &overlap); for (pChild = pParent->firstChild; pChild; @@ -469,7 +469,7 @@ miComputeClips ( * Figure out the new universe from the child's * perspective and recurse. */ - REGION_INTERSECT( pScreen, &childUniverse, + RegionIntersect(&childUniverse, universe, &pChild->borderSize); miComputeClips (pChild, pScreen, &childUniverse, kind, @@ -481,14 +481,14 @@ miComputeClips ( * other sibling. */ if (overlap && !TreatAsTransparent (pChild)) - REGION_SUBTRACT( pScreen, universe, universe, + RegionSubtract(universe, universe, &pChild->borderSize); } } if (!overlap) - REGION_SUBTRACT( pScreen, universe, universe, &childUnion); - REGION_UNINIT( pScreen, &childUnion); - REGION_UNINIT( pScreen, &childUniverse); + RegionSubtract(universe, universe, &childUnion); + RegionUninit(&childUnion); + RegionUninit(&childUniverse); } /* if any children */ /* @@ -501,12 +501,12 @@ miComputeClips ( if (oldVis == VisibilityFullyObscured || oldVis == VisibilityNotViewable) { - REGION_COPY( pScreen, &pParent->valdata->after.exposed, universe); + RegionCopy(&pParent->valdata->after.exposed, universe); } else if (newVis != VisibilityFullyObscured && newVis != VisibilityNotViewable) { - REGION_SUBTRACT( pScreen, &pParent->valdata->after.exposed, + RegionSubtract(&pParent->valdata->after.exposed, universe, &pParent->clipList); } @@ -520,7 +520,7 @@ miComputeClips ( } #ifdef NOTDEF - REGION_COPY( pScreen, &pParent->clipList, universe); + RegionCopy(&pParent->clipList, universe); #endif pParent->drawable.serialNumber = NEXT_SERIAL_NUMBER; @@ -616,8 +616,8 @@ miValidateTree ( if (pChild == NullWindow) pChild = pParent->firstChild; - REGION_NULL(pScreen, &childClip); - REGION_NULL(pScreen, &exposed); + RegionNull(&childClip); + RegionNull(&exposed); /* * compute the area of the parent window occupied @@ -625,10 +625,10 @@ miValidateTree ( * is the area which can be divied up among the marked * children in their new configuration. */ - REGION_NULL(pScreen, &totalClip); + RegionNull(&totalClip); viewvals = 0; - if (REGION_BROKEN (pScreen, &pParent->clipList) && - !REGION_BROKEN (pScreen, &pParent->borderClip)) + if (RegionBroken(&pParent->clipList) && + !RegionBroken(&pParent->borderClip)) { kind = VTBroken; /* @@ -636,19 +636,19 @@ miValidateTree ( * assume everything is busted. */ forward = TRUE; - REGION_COPY (pScreen, &totalClip, &pParent->borderClip); - REGION_INTERSECT (pScreen, &totalClip, &totalClip, &pParent->winSize); + RegionCopy(&totalClip, &pParent->borderClip); + RegionIntersect(&totalClip, &totalClip, &pParent->winSize); for (pWin = pParent->firstChild; pWin != pChild; pWin = pWin->nextSib) { if (pWin->viewable && !TreatAsTransparent (pWin)) - REGION_SUBTRACT (pScreen, &totalClip, &totalClip, &pWin->borderSize); + RegionSubtract(&totalClip, &totalClip, &pWin->borderSize); } for (pWin = pChild; pWin; pWin = pWin->nextSib) if (pWin->valdata && pWin->viewable) viewvals++; - REGION_EMPTY (pScreen, &pParent->clipList); + RegionEmpty(&pParent->clipList); } else { @@ -666,7 +666,7 @@ miValidateTree ( if (pWin->redirectDraw != RedirectDrawNone && miGetRedirectBorderClipProc) pBorderClip = (*miGetRedirectBorderClipProc)(pWin); #endif - REGION_APPEND( pScreen, &totalClip, pBorderClip ); + RegionAppend(&totalClip, pBorderClip ); if (pWin->viewable) viewvals++; } @@ -685,7 +685,7 @@ miValidateTree ( if (pWin->redirectDraw != RedirectDrawNone && miGetRedirectBorderClipProc) pBorderClip = (*miGetRedirectBorderClipProc)(pWin); #endif - REGION_APPEND( pScreen, &totalClip, pBorderClip ); + RegionAppend(&totalClip, pBorderClip ); if (pWin->viewable) viewvals++; } @@ -694,7 +694,7 @@ miValidateTree ( pWin = pWin->prevSib; } } - REGION_VALIDATE( pScreen, &totalClip, &overlap); + RegionValidate(&totalClip, &overlap); } /* @@ -707,7 +707,7 @@ miValidateTree ( overlap = TRUE; if (kind != VTStack) { - REGION_UNION( pScreen, &totalClip, &totalClip, &pParent->clipList); + RegionUnion(&totalClip, &totalClip, &pParent->clipList); if (viewvals > 1) { /* @@ -717,12 +717,12 @@ miValidateTree ( * lower than the cost of multiple Subtracts in the * loop below. */ - REGION_NULL(pScreen, &childUnion); + RegionNull(&childUnion); if (forward) { for (pWin = pChild; pWin; pWin = pWin->nextSib) if (pWin->valdata && pWin->viewable && !TreatAsTransparent (pWin)) - REGION_APPEND( pScreen, &childUnion, + RegionAppend(&childUnion, &pWin->borderSize); } else @@ -731,16 +731,16 @@ miValidateTree ( while (1) { if (pWin->valdata && pWin->viewable && !TreatAsTransparent (pWin)) - REGION_APPEND( pScreen, &childUnion, + RegionAppend(&childUnion, &pWin->borderSize); if (pWin == pChild) break; pWin = pWin->prevSib; } } - REGION_VALIDATE(pScreen, &childUnion, &overlap); + RegionValidate(&childUnion, &overlap); if (overlap) - REGION_UNINIT(pScreen, &childUnion); + RegionUninit(&childUnion); } } @@ -750,13 +750,13 @@ miValidateTree ( { if (pWin->viewable) { if (pWin->valdata) { - REGION_INTERSECT( pScreen, &childClip, + RegionIntersect(&childClip, &totalClip, &pWin->borderSize); miComputeClips (pWin, pScreen, &childClip, kind, &exposed); if (overlap && !TreatAsTransparent (pWin)) { - REGION_SUBTRACT( pScreen, &totalClip, + RegionSubtract(&totalClip, &totalClip, &pWin->borderSize); } @@ -765,24 +765,24 @@ miValidateTree ( } } else { if (pWin->valdata) { - REGION_EMPTY( pScreen, &pWin->clipList); + RegionEmpty(&pWin->clipList); if (pScreen->ClipNotify) (* pScreen->ClipNotify) (pWin, 0, 0); - REGION_EMPTY( pScreen, &pWin->borderClip); + RegionEmpty(&pWin->borderClip); pWin->valdata = NULL; } } } - REGION_UNINIT( pScreen, &childClip); + RegionUninit(&childClip); if (!overlap) { - REGION_SUBTRACT(pScreen, &totalClip, &totalClip, &childUnion); - REGION_UNINIT(pScreen, &childUnion); + RegionSubtract(&totalClip, &totalClip, &childUnion); + RegionUninit(&childUnion); } - REGION_NULL(pScreen, &pParent->valdata->after.exposed); - REGION_NULL(pScreen, &pParent->valdata->after.borderExposed); + RegionNull(&pParent->valdata->after.exposed); + RegionNull(&pParent->valdata->after.borderExposed); /* * each case below is responsible for updating the @@ -798,17 +798,17 @@ miValidateTree ( * exposures and obscures as per miComputeClips and reset the parent's * clipList. */ - REGION_SUBTRACT( pScreen, &pParent->valdata->after.exposed, + RegionSubtract(&pParent->valdata->after.exposed, &totalClip, &pParent->clipList); /* fall through */ case VTMap: - REGION_COPY( pScreen, &pParent->clipList, &totalClip); + RegionCopy(&pParent->clipList, &totalClip); pParent->drawable.serialNumber = NEXT_SERIAL_NUMBER; break; } - REGION_UNINIT( pScreen, &totalClip); - REGION_UNINIT( pScreen, &exposed); + RegionUninit(&totalClip); + RegionUninit(&exposed); if (pScreen->ClipNotify) (*pScreen->ClipNotify) (pParent, 0, 0); return (1); diff --git a/mi/miwindow.c b/mi/miwindow.c index ce35974291..02b407486b 100644 --- a/mi/miwindow.c +++ b/mi/miwindow.c @@ -112,16 +112,16 @@ miClearToBackground(WindowPtr pWin, box.y2 = y2; pScreen = pWin->drawable.pScreen; - REGION_INIT(pScreen, ®, &box, 1); + RegionInit(®, &box, 1); - REGION_INTERSECT(pScreen, ®, ®, &pWin->clipList); + RegionIntersect(®, ®, &pWin->clipList); if (generateExposures) (*pScreen->WindowExposures)(pWin, ®, pBSReg); else if (pWin->backgroundState != None) miPaintWindow(pWin, ®, PW_BACKGROUND); - REGION_UNINIT(pScreen, ®); + RegionUninit(®); if (pBSReg) - REGION_DESTROY(pScreen, pBSReg); + RegionDestroy(pBSReg); } void @@ -164,9 +164,9 @@ miMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst, WindowPtr *ppLayerWin) { if (pChild->viewable) { - if (REGION_BROKEN (pScreen, &pChild->winSize)) + if (RegionBroken(&pChild->winSize)) SetWinSize (pChild); - if (REGION_BROKEN (pScreen, &pChild->borderSize)) + if (RegionBroken(&pChild->borderSize)) SetBorderSize (pChild); (* MarkWindow)(pChild); if (pChild->firstChild) @@ -186,17 +186,17 @@ miMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst, WindowPtr *ppLayerWin) } if ( (pChild = pFirst) ) { - box = REGION_EXTENTS(pChild->drawable.pScreen, &pWin->borderSize); + box = RegionExtents(&pWin->borderSize); pLast = pChild->parent->lastChild; while (1) { if (pChild->viewable) { - if (REGION_BROKEN (pScreen, &pChild->winSize)) + if (RegionBroken(&pChild->winSize)) SetWinSize (pChild); - if (REGION_BROKEN (pScreen, &pChild->borderSize)) + if (RegionBroken(&pChild->borderSize)) SetBorderSize (pChild); - if (RECT_IN_REGION(pScreen, &pChild->borderSize, box)) + if (RegionContainsRect(&pChild->borderSize, box)) { (* MarkWindow)(pChild); anyMarked = TRUE; @@ -241,11 +241,11 @@ miHandleValidateExposures(WindowPtr pWin) { if ( (val = pChild->valdata) ) { - if (REGION_NOTEMPTY(pScreen, &val->after.borderExposed)) + if (RegionNotEmpty(&val->after.borderExposed)) miPaintWindow(pChild, &val->after.borderExposed, PW_BORDER); - REGION_UNINIT(pScreen, &val->after.borderExposed); + RegionUninit(&val->after.borderExposed); (*WindowExposures)(pChild, &val->after.exposed, NullRegion); - REGION_UNINIT(pScreen, &val->after.exposed); + RegionUninit(&val->after.exposed); free(val); pChild->valdata = NULL; if (pChild->firstChild) @@ -285,8 +285,8 @@ miMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pNextSib, VTKind kind) oldpt.y = pWin->drawable.y; if (WasViewable) { - oldRegion = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldRegion, &pWin->borderClip); + oldRegion = RegionCreate(NullBox, 1); + RegionCopy(oldRegion, &pWin->borderClip); anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, &pLayerWin); } pWin->origin.x = x + (int)bw; @@ -317,7 +317,7 @@ miMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pNextSib, VTKind kind) { (*pScreen->ValidateTree)(pLayerWin->parent, NullWindow, kind); (* pWin->drawable.pScreen->CopyWindow)(pWin, oldpt, oldRegion); - REGION_DESTROY(pScreen, oldRegion); + RegionDestroy(oldRegion); /* XXX need to retile border if ParentRelative origin */ (*pScreen->HandleExposures)(pLayerWin->parent); } @@ -357,14 +357,14 @@ miRecomputeExposures ( /* * compute exposed regions of this window */ - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, + RegionSubtract(&pWin->valdata->after.exposed, &pWin->clipList, pValid); /* * compute exposed regions of the border */ - REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed, + RegionSubtract(&pWin->valdata->after.borderExposed, &pWin->borderClip, &pWin->winSize); - REGION_SUBTRACT(pScreen, &pWin->valdata->after.borderExposed, + RegionSubtract(&pWin->valdata->after.borderExposed, &pWin->valdata->after.borderExposed, pValid); return WT_WALKCHILDREN; } @@ -416,8 +416,8 @@ miSlideAndSizeWindow(WindowPtr pWin, /* * save the visible region of the window */ - oldRegion = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldRegion, &pWin->winSize); + oldRegion = RegionCreate(NullBox, 1); + RegionCopy(oldRegion, &pWin->winSize); /* * categorize child windows into regions to be moved @@ -430,8 +430,8 @@ miSlideAndSizeWindow(WindowPtr pWin, if (g != UnmapGravity) { if (!gravitate[g]) - gravitate[g] = REGION_CREATE(pScreen, NullBox, 1); - REGION_UNION(pScreen, gravitate[g], + gravitate[g] = RegionCreate(NullBox, 1); + RegionUnion(gravitate[g], gravitate[g], &pChild->borderClip); } else @@ -446,8 +446,8 @@ miSlideAndSizeWindow(WindowPtr pWin, oldWinClip = NULL; if (pWin->bitGravity != ForgetGravity) { - oldWinClip = REGION_CREATE(pScreen, NullBox, 1); - REGION_COPY(pScreen, oldWinClip, &pWin->clipList); + oldWinClip = RegionCreate(NullBox, 1); + RegionCopy(oldWinClip, &pWin->clipList); } /* * if the window is changing size, borderExposed @@ -462,16 +462,16 @@ miSlideAndSizeWindow(WindowPtr pWin, if ((pWin->drawable.height != h || pWin->drawable.width != w) && HasBorder (pWin)) { - borderVisible = REGION_CREATE(pScreen, NullBox, 1); + borderVisible = RegionCreate(NullBox, 1); /* for tiled borders, we punt and draw the whole thing */ if (pWin->borderIsPixel || !moved) { if (shrunk || moved) - REGION_SUBTRACT(pScreen, borderVisible, + RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); else - REGION_COPY(pScreen, borderVisible, + RegionCopy(borderVisible, &pWin->borderClip); } } @@ -498,7 +498,7 @@ miSlideAndSizeWindow(WindowPtr pWin, if (WasViewable) { - pRegion = REGION_CREATE(pScreen, NullBox, 1); + pRegion = RegionCreate(NullBox, 1); if (pLayerWin == pWin) anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange, @@ -520,7 +520,7 @@ miSlideAndSizeWindow(WindowPtr pWin, * the entire window is trashed unless bitGravity * recovers portions of it */ - REGION_COPY(pScreen, &pWin->valdata->after.exposed, &pWin->clipList); + RegionCopy(&pWin->valdata->after.exposed, &pWin->clipList); } GravityTranslate (x, y, oldx, oldy, dw, dh, pWin->bitGravity, &nx, &ny); @@ -549,16 +549,16 @@ miSlideAndSizeWindow(WindowPtr pWin, dy = (oldy - ny) - offy; if (dx || dy) { - REGION_TRANSLATE(pScreen, &pWin->winSize, dx, dy); + RegionTranslate(&pWin->winSize, dx, dy); offx += dx; offy += dy; } - REGION_INTERSECT(pScreen, gravitate[g], gravitate[g], + RegionIntersect(gravitate[g], gravitate[g], &pWin->winSize); } /* get winSize back where it belongs */ if (offx || offy) - REGION_TRANSLATE(pScreen, &pWin->winSize, -offx, -offy); + RegionTranslate(&pWin->winSize, -offx, -offy); } /* * add screen bits to the appropriate bucket @@ -569,9 +569,9 @@ miSlideAndSizeWindow(WindowPtr pWin, /* * clip to new clipList */ - REGION_COPY(pScreen, pRegion, oldWinClip); - REGION_TRANSLATE(pScreen, pRegion, nx - oldx, ny - oldy); - REGION_INTERSECT(pScreen, oldWinClip, pRegion, &pWin->clipList); + RegionCopy(pRegion, oldWinClip); + RegionTranslate(pRegion, nx - oldx, ny - oldy); + RegionIntersect(oldWinClip, pRegion, &pWin->clipList); /* * don't step on any gravity bits which will be copied after this * region. Note -- this assumes that the regions will be copied @@ -580,17 +580,17 @@ miSlideAndSizeWindow(WindowPtr pWin, for (g = pWin->bitGravity + 1; g <= StaticGravity; g++) { if (gravitate[g]) - REGION_SUBTRACT(pScreen, oldWinClip, oldWinClip, + RegionSubtract(oldWinClip, oldWinClip, gravitate[g]); } - REGION_TRANSLATE(pScreen, oldWinClip, oldx - nx, oldy - ny); + RegionTranslate(oldWinClip, oldx - nx, oldy - ny); g = pWin->bitGravity; if (!gravitate[g]) gravitate[g] = oldWinClip; else { - REGION_UNION(pScreen, gravitate[g], gravitate[g], oldWinClip); - REGION_DESTROY(pScreen, oldWinClip); + RegionUnion(gravitate[g], gravitate[g], oldWinClip); + RegionDestroy(oldWinClip); } } @@ -614,14 +614,14 @@ miSlideAndSizeWindow(WindowPtr pWin, /* only copy the remaining useful bits */ - REGION_INTERSECT(pScreen, gravitate[g], gravitate[g], oldRegion); + RegionIntersect(gravitate[g], gravitate[g], oldRegion); /* clip to not overwrite already copied areas */ if (destClip) { - REGION_TRANSLATE(pScreen, destClip, oldpt.x - x, oldpt.y - y); - REGION_SUBTRACT(pScreen, gravitate[g], gravitate[g], destClip); - REGION_TRANSLATE(pScreen, destClip, x - oldpt.x, y - oldpt.y); + RegionTranslate(destClip, oldpt.x - x, oldpt.y - y); + RegionSubtract(gravitate[g], gravitate[g], destClip); + RegionTranslate(destClip, x - oldpt.x, y - oldpt.y); } /* and move those bits */ @@ -637,7 +637,7 @@ miSlideAndSizeWindow(WindowPtr pWin, /* remove any overwritten bits from the remaining useful bits */ - REGION_SUBTRACT(pScreen, oldRegion, oldRegion, gravitate[g]); + RegionSubtract(oldRegion, oldRegion, gravitate[g]); /* * recompute exposed regions of child windows @@ -647,7 +647,7 @@ miSlideAndSizeWindow(WindowPtr pWin, { if (pChild->winGravity != g) continue; - REGION_INTERSECT(pScreen, pRegion, + RegionIntersect(pRegion, &pChild->borderClip, gravitate[g]); TraverseTree (pChild, miRecomputeExposures, (pointer)pRegion); } @@ -658,21 +658,21 @@ miSlideAndSizeWindow(WindowPtr pWin, */ if (g == pWin->bitGravity) - REGION_SUBTRACT(pScreen, &pWin->valdata->after.exposed, + RegionSubtract(&pWin->valdata->after.exposed, &pWin->valdata->after.exposed, gravitate[g]); if (!destClip) destClip = gravitate[g]; else { - REGION_UNION(pScreen, destClip, destClip, gravitate[g]); - REGION_DESTROY(pScreen, gravitate[g]); + RegionUnion(destClip, destClip, gravitate[g]); + RegionDestroy(gravitate[g]); } } - REGION_DESTROY(pScreen, oldRegion); - REGION_DESTROY(pScreen, pRegion); + RegionDestroy(oldRegion); + RegionDestroy(pRegion); if (destClip) - REGION_DESTROY(pScreen, destClip); + RegionDestroy(destClip); if (anyMarked) (*pScreen->HandleExposures)(pLayerWin->parent); if (anyMarked && pScreen->PostValidateTree) @@ -715,8 +715,8 @@ miSetShape(WindowPtr pWin, int kind) { RegionPtr borderVisible; - borderVisible = REGION_CREATE(pScreen, NullBox, 1); - REGION_SUBTRACT(pScreen, borderVisible, + borderVisible = RegionCreate(NullBox, 1); + RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); pWin->valdata->before.borderVisible = borderVisible; } @@ -789,8 +789,8 @@ miChangeBorderWidth(WindowPtr pWin, unsigned int width) if (pWin->valdata && HadBorder) { RegionPtr borderVisible; - borderVisible = REGION_CREATE(pScreen, NULL, 1); - REGION_SUBTRACT(pScreen, borderVisible, + borderVisible = RegionCreate(NULL, 1); + RegionSubtract(borderVisible, &pWin->borderClip, &pWin->winSize); pWin->valdata->before.borderVisible = borderVisible; } @@ -814,10 +814,10 @@ miMarkUnrealizedWindow(WindowPtr pChild, WindowPtr pWin, Bool fromConfigure) { if ((pChild != pWin) || fromConfigure) { - REGION_EMPTY(pChild->drawable.pScreen, &pChild->clipList); + RegionEmpty(&pChild->clipList); if (pChild->drawable.pScreen->ClipNotify) (* pChild->drawable.pScreen->ClipNotify)(pChild, 0, 0); - REGION_EMPTY(pChild->drawable.pScreen, &pChild->borderClip); + RegionEmpty(&pChild->borderClip); } } @@ -832,7 +832,7 @@ miSegregateChildren(WindowPtr pWin, RegionPtr pReg, int depth) for (pChild = pWin->firstChild; pChild; pChild = pChild->nextSib) { if (pChild->drawable.depth == depth) - REGION_UNION(pScreen, pReg, pReg, &pChild->borderClip); + RegionUnion(pReg, pReg, &pChild->borderClip); if (pChild->firstChild) miSegregateChildren(pChild, pReg, depth); diff --git a/miext/cw/cw.c b/miext/cw/cw.c index 2d8fd12cfa..563831a49f 100644 --- a/miext/cw/cw.c +++ b/miext/cw/cw.c @@ -191,8 +191,8 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable) ChangeGCVal vals[2]; RegionPtr pCompositeClip; - pCompositeClip = REGION_CREATE (pScreen, NULL, 0); - REGION_COPY (pScreen, pCompositeClip, pGC->pCompositeClip); + pCompositeClip = RegionCreate(NULL, 0); + RegionCopy(pCompositeClip, pGC->pCompositeClip); /* Either the drawable has changed, or the clip list in the drawable has * changed. Copy the new clip list over and set the new translated @@ -403,7 +403,7 @@ cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; - pExtents = REGION_EXTENTS(pScreen, prgnSrc); + pExtents = RegionExtents(prgnSrc); pBackingPixmap = (PixmapPtr) cwGetBackingDrawable((DrawablePtr)pWin, &x_off, &y_off); @@ -416,15 +416,15 @@ cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) dst_y = src_y - dy; /* Translate region (as required by API) */ - REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy); + RegionTranslate(prgnSrc, -dx, -dy); pGC = GetScratchGC(pBackingPixmap->drawable.depth, pScreen); /* * Copy region to GC as clip, aligning as dest clip */ - pClip = REGION_CREATE (pScreen, NULL, 0); - REGION_INTERSECT(pScreen, pClip, &pWin->borderClip, prgnSrc); - REGION_TRANSLATE(pScreen, pClip, + pClip = RegionCreate(NULL, 0); + RegionIntersect(pClip, &pWin->borderClip, prgnSrc); + RegionTranslate(pClip, -pBackingPixmap->screen_x, -pBackingPixmap->screen_y); diff --git a/miext/damage/damage.c b/miext/damage/damage.c index 551cb721e6..935b1c048e 100644 --- a/miext/damage/damage.c +++ b/miext/damage/damage.c @@ -129,40 +129,40 @@ damageReportDamage (DamagePtr pDamage, RegionPtr pDamageRegion) switch (pDamage->damageLevel) { case DamageReportRawRegion: - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, + RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); (*pDamage->damageReport) (pDamage, pDamageRegion, pDamage->closure); break; case DamageReportDeltaRegion: - REGION_NULL (pScreen, &tmpRegion); - REGION_SUBTRACT (pScreen, &tmpRegion, pDamageRegion, &pDamage->damage); - if (REGION_NOTEMPTY (pScreen, &tmpRegion)) { - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, + RegionNull(&tmpRegion); + RegionSubtract(&tmpRegion, pDamageRegion, &pDamage->damage); + if (RegionNotEmpty(&tmpRegion)) { + RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); (*pDamage->damageReport) (pDamage, &tmpRegion, pDamage->closure); } - REGION_UNINIT(pScreen, &tmpRegion); + RegionUninit(&tmpRegion); break; case DamageReportBoundingBox: - tmpBox = *REGION_EXTENTS (pScreen, &pDamage->damage); - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, + tmpBox = *RegionExtents(&pDamage->damage); + RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); - if (!BOX_SAME (&tmpBox, REGION_EXTENTS (pScreen, &pDamage->damage))) { + if (!BOX_SAME (&tmpBox, RegionExtents(&pDamage->damage))) { (*pDamage->damageReport) (pDamage, &pDamage->damage, pDamage->closure); } break; case DamageReportNonEmpty: - was_empty = !REGION_NOTEMPTY(pScreen, &pDamage->damage); - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, + was_empty = !RegionNotEmpty(&pDamage->damage); + RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); - if (was_empty && REGION_NOTEMPTY(pScreen, &pDamage->damage)) { + if (was_empty && RegionNotEmpty(&pDamage->damage)) { (*pDamage->damageReport) (pDamage, &pDamage->damage, pDamage->closure); } break; case DamageReportNone: - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, + RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); break; } @@ -175,30 +175,30 @@ damageReportDamagePostRendering (DamagePtr pDamage, RegionPtr pOldDamage, Region RegionRec tmpRegion, newDamage; Bool was_empty; - REGION_UNION(pScreem, &newDamage, pOldDamage, pDamageRegion); + RegionUnion(&newDamage, pOldDamage, pDamageRegion); switch (pDamage->damageLevel) { case DamageReportRawRegion: (*pDamage->damageReportPostRendering) (pDamage, pDamageRegion, pDamage->closure); break; case DamageReportDeltaRegion: - REGION_NULL (pScreen, &tmpRegion); - REGION_SUBTRACT (pScreen, &tmpRegion, pDamageRegion, pOldDamage); - if (REGION_NOTEMPTY (pScreen, &tmpRegion)) { + RegionNull(&tmpRegion); + RegionSubtract(&tmpRegion, pDamageRegion, pOldDamage); + if (RegionNotEmpty(&tmpRegion)) { (*pDamage->damageReportPostRendering) (pDamage, &tmpRegion, pDamage->closure); } - REGION_UNINIT(pScreen, &tmpRegion); + RegionUninit(&tmpRegion); break; case DamageReportBoundingBox: - tmpBox = *REGION_EXTENTS (pScreen, pOldDamage); - if (!BOX_SAME (&tmpBox, REGION_EXTENTS (pScreen, &newDamage))) { + tmpBox = *RegionExtents(pOldDamage); + if (!BOX_SAME (&tmpBox, RegionExtents(&newDamage))) { (*pDamage->damageReportPostRendering) (pDamage, &newDamage, pDamage->closure); } break; case DamageReportNonEmpty: - was_empty = !REGION_NOTEMPTY(pScreen, pOldDamage); - if (was_empty && REGION_NOTEMPTY(pScreen, &newDamage)) { + was_empty = !RegionNotEmpty(pOldDamage); + if (was_empty && RegionNotEmpty(&newDamage)) { (*pDamage->damageReportPostRendering) (pDamage, &newDamage, pDamage->closure); } @@ -207,7 +207,7 @@ damageReportDamagePostRendering (DamagePtr pDamage, RegionPtr pOldDamage, Region break; } - REGION_UNINIT(pScreen, &newDamage); + RegionUninit(&newDamage); } #if DAMAGE_DEBUG_ENABLE @@ -233,7 +233,7 @@ damageRegionAppend (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, #endif /* short circuit for empty regions */ - if (!REGION_NOTEMPTY(pScreen, pRegion)) + if (!RegionNotEmpty(pRegion)) return; #ifdef COMPOSITE @@ -248,7 +248,7 @@ damageRegionAppend (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, screen_y = ((PixmapPtr) pDrawable)->screen_y - pDrawable->y; } if (screen_x || screen_y) - REGION_TRANSLATE (pScreen, pRegion, screen_x, screen_y); + RegionTranslate(pRegion, screen_x, screen_y); #endif if (pDrawable->type == DRAWABLE_WINDOW && @@ -256,22 +256,22 @@ damageRegionAppend (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, { if (subWindowMode == ClipByChildren) { - REGION_INTERSECT(pScreen, pRegion, pRegion, + RegionIntersect(pRegion, pRegion, &((WindowPtr)(pDrawable))->clipList); } else if (subWindowMode == IncludeInferiors) { RegionPtr pTempRegion = NotClippedByChildren((WindowPtr)(pDrawable)); - REGION_INTERSECT(pScreen, pRegion, pRegion, pTempRegion); - REGION_DESTROY(pScreen, pTempRegion); + RegionIntersect(pRegion, pRegion, pTempRegion); + RegionDestroy(pTempRegion); } /* If subWindowMode is set to an invalid value, don't perform * any drawable-based clipping. */ } - REGION_NULL (pScreen, &clippedRec); + RegionNull(&clippedRec); for (; pDamage; pDamage = pNext) { pNext = pDamage->pNext; @@ -316,7 +316,7 @@ damageRegionAppend (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, { pDamageRegion = &clippedRec; if (pDamage->pDrawable->type == DRAWABLE_WINDOW) { - REGION_INTERSECT (pScreen, pDamageRegion, pRegion, + RegionIntersect(pDamageRegion, pRegion, &((WindowPtr)(pDamage->pDrawable))->borderClip); } else { BoxRec box; @@ -324,14 +324,14 @@ damageRegionAppend (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, box.y1 = draw_y; box.x2 = draw_x + pDamage->pDrawable->width; box.y2 = draw_y + pDamage->pDrawable->height; - REGION_INIT(pScreen, &pixClip, &box, 1); - REGION_INTERSECT (pScreen, pDamageRegion, pRegion, &pixClip); - REGION_UNINIT(pScreen, &pixClip); + RegionInit(&pixClip, &box, 1); + RegionIntersect(pDamageRegion, pRegion, &pixClip); + RegionUninit(&pixClip); } /* * Short circuit empty results */ - if (!REGION_NOTEMPTY(pScreen, pDamageRegion)) + if (!RegionNotEmpty(pDamageRegion)) continue; } @@ -346,23 +346,23 @@ damageRegionAppend (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, * Move region to target coordinate space */ if (draw_x || draw_y) - REGION_TRANSLATE (pScreen, pDamageRegion, -draw_x, -draw_y); + RegionTranslate(pDamageRegion, -draw_x, -draw_y); /* Store damage region if needed after submission. */ if (pDamage->reportAfter || pDamage->damageMarker) - REGION_UNION(pScreen, &pDamage->pendingDamage, + RegionUnion(&pDamage->pendingDamage, &pDamage->pendingDamage, pDamageRegion); /* Duplicate current damage if needed. */ if (pDamage->damageMarker) - REGION_COPY(pScreen, &pDamage->backupDamage, &pDamage->damage); + RegionCopy(&pDamage->backupDamage, &pDamage->damage); /* Report damage now, if desired. */ if (!pDamage->reportAfter) { if (pDamage->damageReport) damageReportDamage (pDamage, pDamageRegion); else - REGION_UNION(pScreen, &pDamage->damage, + RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); } @@ -370,14 +370,14 @@ damageRegionAppend (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, * translate original region back */ if (pDamageRegion == pRegion && (draw_x || draw_y)) - REGION_TRANSLATE (pScreen, pDamageRegion, draw_x, draw_y); + RegionTranslate(pDamageRegion, draw_x, draw_y); } #ifdef COMPOSITE if (screen_x || screen_y) - REGION_TRANSLATE (pScreen, pRegion, -screen_x, -screen_y); + RegionTranslate(pRegion, -screen_x, -screen_y); #endif - REGION_UNINIT (pScreen, &clippedRec); + RegionUninit(&clippedRec); } static void @@ -395,14 +395,14 @@ damageRegionProcessPending (DrawablePtr pDrawable) if (pDamage->damageReport) damageReportDamage (pDamage, &pDamage->pendingDamage); else - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, + RegionUnion(&pDamage->damage, &pDamage->damage, &pDamage->pendingDamage); } if (pDamage->reportAfter || pDamage->damageMarker) - REGION_EMPTY (pScreen, &pDamage->pendingDamage); + RegionEmpty(&pDamage->pendingDamage); if (pDamage->damageMarker) - REGION_EMPTY (pScreen, &pDamage->backupDamage); + RegionEmpty(&pDamage->backupDamage); } } @@ -418,13 +418,13 @@ damageDamageBox (DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode) { RegionRec region; - REGION_INIT (pDrawable->pScreen, ®ion, pBox, 1); + RegionInit(®ion, pBox, 1); #if DAMAGE_DEBUG_ENABLE _damageRegionAppend (pDrawable, ®ion, TRUE, subWindowMode, where); #else damageRegionAppend (pDrawable, ®ion, TRUE, subWindowMode); #endif - REGION_UNINIT (pDrawable->pScreen, ®ion); + RegionUninit(®ion); } static void damageValidateGC(GCPtr, unsigned long, DrawablePtr); @@ -593,7 +593,7 @@ damageDestroyClip(GCPtr pGC) #define checkGCDamage(d,g) (getDrawableDamage(d) && \ (!g->pCompositeClip ||\ - REGION_NOTEMPTY(d->pScreen, \ + RegionNotEmpty(\ g->pCompositeClip))) #define TRIM_PICTURE_BOX(box, pDst) { \ @@ -605,7 +605,7 @@ damageDestroyClip(GCPtr pGC) } #define checkPictureDamage(p) (getDrawableDamage(p->pDrawable) && \ - REGION_NOTEMPTY(pScreen, p->pCompositeClip)) + RegionNotEmpty(p->pCompositeClip)) static void damageComposite (CARD8 op, @@ -1763,9 +1763,9 @@ damageCopyWindow(WindowPtr pWindow, * The region comes in source relative, but the damage occurs * at the destination location. Translate back and forth. */ - REGION_TRANSLATE (pScreen, prgnSrc, dx, dy); + RegionTranslate(prgnSrc, dx, dy); damageRegionAppend (&pWindow->drawable, prgnSrc, FALSE, -1); - REGION_TRANSLATE (pScreen, prgnSrc, -dx, -dy); + RegionTranslate(prgnSrc, -dx, -dy); } unwrap (pScrPriv, pScreen, CopyWindow); (*pScreen->CopyWindow) (pWindow, ptOldOrg, prgnSrc); @@ -1931,8 +1931,8 @@ DamageCreate (DamageReportFunc damageReport, return 0; pDamage->pNext = 0; pDamage->pNextWin = 0; - REGION_NULL(pScreen, &pDamage->damage); - REGION_NULL(pScreen, &pDamage->pendingDamage); + RegionNull(&pDamage->damage); + RegionNull(&pDamage->pendingDamage); pDamage->damageLevel = damageLevel; pDamage->isInternal = isInternal; @@ -2052,8 +2052,8 @@ DamageDestroy (DamagePtr pDamage) (*pScrPriv->funcs.Destroy) (pDamage); dixFreePrivates(pDamage->devPrivates); pDamage->devPrivates = NULL; - REGION_UNINIT (pScreen, &pDamage->damage); - REGION_UNINIT (pScreen, &pDamage->pendingDamage); + RegionUninit(&pDamage->damage); + RegionUninit(&pDamage->pendingDamage); free(pDamage); } @@ -2065,7 +2065,7 @@ DamageSubtract (DamagePtr pDamage, RegionRec pixmapClip; DrawablePtr pDrawable = pDamage->pDrawable; - REGION_SUBTRACT (pDrawable->pScreen, &pDamage->damage, &pDamage->damage, pRegion); + RegionSubtract(&pDamage->damage, &pDamage->damage, pRegion); if (pDrawable) { if (pDrawable->type == DRAWABLE_WINDOW) @@ -2078,22 +2078,22 @@ DamageSubtract (DamagePtr pDamage, box.y1 = pDrawable->y; box.x2 = pDrawable->x + pDrawable->width; box.y2 = pDrawable->y + pDrawable->height; - REGION_INIT (pDrawable->pScreen, &pixmapClip, &box, 1); + RegionInit(&pixmapClip, &box, 1); pClip = &pixmapClip; } - REGION_TRANSLATE (pDrawable->pScreen, &pDamage->damage, pDrawable->x, pDrawable->y); - REGION_INTERSECT (pDrawable->pScreen, &pDamage->damage, &pDamage->damage, pClip); - REGION_TRANSLATE (pDrawable->pScreen, &pDamage->damage, -pDrawable->x, -pDrawable->y); + RegionTranslate(&pDamage->damage, pDrawable->x, pDrawable->y); + RegionIntersect(&pDamage->damage, &pDamage->damage, pClip); + RegionTranslate(&pDamage->damage, -pDrawable->x, -pDrawable->y); if (pDrawable->type != DRAWABLE_WINDOW) - REGION_UNINIT(pDrawable->pScreen, &pixmapClip); + RegionUninit(&pixmapClip); } - return REGION_NOTEMPTY (pDrawable->pScreen, &pDamage->damage); + return RegionNotEmpty(&pDamage->damage); } void DamageEmpty (DamagePtr pDamage) { - REGION_EMPTY (pDamage->pDrawable->pScreen, &pDamage->damage); + RegionEmpty(&pDamage->damage); } RegionPtr diff --git a/miext/rootless/rootlessCommon.c b/miext/rootless/rootlessCommon.c index dd3f953ca2..4fb0e49706 100644 --- a/miext/rootless/rootlessCommon.c +++ b/miext/rootless/rootlessCommon.c @@ -286,30 +286,30 @@ RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion) drawing inside the clip, go to some lengths to avoid the general case intersection. */ - b1 = REGION_EXTENTS(pScreen, &pWindow->borderClip); - b2 = REGION_EXTENTS(pScreen, pRegion); + b1 = RegionExtents(&pWindow->borderClip); + b2 = RegionExtents(pRegion); if (EXTENTCHECK(b1, b2)) { /* Regions may overlap. */ - if (REGION_NUM_RECTS(pRegion) == 1) { + if (RegionNumRects(pRegion) == 1) { int in; /* Damaged region only has a single rect, so we can just compare that against the region */ - in = RECT_IN_REGION(pScreen, &pWindow->borderClip, - REGION_RECTS (pRegion)); + in = RegionContainsRect(&pWindow->borderClip, + RegionRects (pRegion)); if (in == rgnIN) { /* clip totally contains pRegion */ #ifdef ROOTLESS_TRACK_DAMAGE - REGION_UNION(pScreen, &winRec->damage, + RegionUnion(&winRec->damage, &winRec->damage, (pRegion)); #else SCREENREC(pScreen)->imp->DamageRects(winRec->wid, - REGION_NUM_RECTS(pRegion), - REGION_RECTS(pRegion), + RegionNumRects(pRegion), + RegionRects(pRegion), -winRec->x, -winRec->y); #endif @@ -325,20 +325,20 @@ RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion) /* clip overlaps pRegion, need to intersect */ - REGION_NULL(pScreen, &clipped); - REGION_INTERSECT(pScreen, &clipped, &pWindow->borderClip, pRegion); + RegionNull(&clipped); + RegionIntersect(&clipped, &pWindow->borderClip, pRegion); #ifdef ROOTLESS_TRACK_DAMAGE - REGION_UNION(pScreen, &winRec->damage, + RegionUnion(&winRec->damage, &winRec->damage, (pRegion)); #else SCREENREC(pScreen)->imp->DamageRects(winRec->wid, - REGION_NUM_RECTS(&clipped), - REGION_RECTS(&clipped), + RegionNumRects(&clipped), + RegionRects(&clipped), -winRec->x, -winRec->y); #endif - REGION_UNINIT(pScreen, &clipped); + RegionUninit(&clipped); RootlessQueueRedisplay(pTop->drawable.pScreen); } @@ -346,8 +346,8 @@ RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion) out: #ifdef ROOTLESSDEBUG { - BoxRec *box = REGION_RECTS(pRegion), *end; - int numBox = REGION_NUM_RECTS(pRegion); + BoxRec *box = RegionRects(pRegion), *end; + int numBox = RegionNumRects(pRegion); for (end = box+numBox; box < end; box++) { RL_DEBUG_MSG("Damage rect: %i, %i, %i, %i\n", @@ -369,11 +369,11 @@ RootlessDamageBox(WindowPtr pWindow, BoxPtr pBox) { RegionRec region; - REGION_INIT(pWindow->drawable.pScreen, ®ion, pBox, 1); + RegionInit(®ion, pBox, 1); RootlessDamageRegion(pWindow, ®ion); - REGION_UNINIT(pWindow->drawable.pScreen, ®ion); /* no-op */ + RegionUninit(®ion); /* no-op */ } @@ -396,11 +396,11 @@ RootlessDamageRect(WindowPtr pWindow, int x, int y, int w, int h) box.y1 = y; box.y2 = y + h; - REGION_INIT(pWindow->drawable.pScreen, ®ion, &box, 1); + RegionInit(®ion, &box, 1); RootlessDamageRegion(pWindow, ®ion); - REGION_UNINIT(pWindow->drawable.pScreen, ®ion); /* no-op */ + RegionUninit(®ion); /* no-op */ } @@ -418,18 +418,18 @@ RootlessRedisplay(WindowPtr pWindow) RootlessStopDrawing(pWindow, FALSE); - if (REGION_NOTEMPTY(pScreen, &winRec->damage)) { + if (RegionNotEmpty(&winRec->damage)) { RL_DEBUG_MSG("Redisplay Win 0x%x, %i x %i @ (%i, %i)\n", pWindow, winRec->width, winRec->height, winRec->x, winRec->y); // move region to window local coords - REGION_TRANSLATE(pScreen, &winRec->damage, + RegionTranslate(&winRec->damage, -winRec->x, -winRec->y); SCREENREC(pScreen)->imp->UpdateRegion(winRec->wid, &winRec->damage); - REGION_EMPTY(pScreen, &winRec->damage); + RegionEmpty(&winRec->damage); } #else /* !ROOTLESS_TRACK_DAMAGE */ diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c index d24ca04ade..24dcfe80a1 100644 --- a/miext/rootless/rootlessScreen.c +++ b/miext/rootless/rootlessScreen.c @@ -441,9 +441,9 @@ RootlessMarkOverlappedWindows(WindowPtr pWin, WindowPtr pFirst, pChild = pWin; while (1) { if (pChild->viewable) { - if (REGION_BROKEN (pScreen, &pChild->winSize)) + if (RegionBroken(&pChild->winSize)) SetWinSize (pChild); - if (REGION_BROKEN (pScreen, &pChild->borderSize)) + if (RegionBroken(&pChild->borderSize)) SetBorderSize (pChild); (* MarkWindow)(pChild); if (pChild->firstChild) { diff --git a/miext/rootless/rootlessValTree.c b/miext/rootless/rootlessValTree.c index 0ee4919e1d..0f62c28f48 100644 --- a/miext/rootless/rootlessValTree.c +++ b/miext/rootless/rootlessValTree.c @@ -122,8 +122,8 @@ RootlessShapedWindowIn (ScreenPtr pScreen, RegionPtr universe, Bool someIn, someOut; register int t, x1, y1, x2, y2; - nbox = REGION_NUM_RECTS (bounding); - boundBox = REGION_RECTS (bounding); + nbox = RegionNumRects (bounding); + boundBox = RegionRects (bounding); someIn = someOut = FALSE; x1 = rect->x1; y1 = rect->y1; @@ -147,7 +147,7 @@ RootlessShapedWindowIn (ScreenPtr pScreen, RegionPtr universe, box.x2 = box.x1; if (box.y1 > box.y2) box.y2 = box.y1; - switch (RECT_IN_REGION(pScreen, universe, &box)) + switch (RegionContainsRect(universe, &box)) { case rgnIN: if (someOut) @@ -224,7 +224,7 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen, borderSize.y2 = dy; oldVis = pParent->visibility; - switch (RECT_IN_REGION( pScreen, universe, &borderSize)) + switch (RegionContainsRect(universe, &borderSize)) { case rgnIN: newVis = VisibilityUnobscured; @@ -285,9 +285,9 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen, { if (pChild->visibility != VisibilityFullyObscured) { - REGION_TRANSLATE( pScreen, &pChild->borderClip, + RegionTranslate(&pChild->borderClip, dx, dy); - REGION_TRANSLATE( pScreen, &pChild->clipList, + RegionTranslate(&pChild->clipList, dx, dy); pChild->drawable.serialNumber = NEXT_SERIAL_NUMBER; if (pScreen->ClipNotify) @@ -296,16 +296,16 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen, } if (pChild->valdata) { - REGION_NULL(pScreen, + RegionNull( &pChild->valdata->after.borderExposed); if (HasParentRelativeBorder(pChild)) { - REGION_SUBTRACT(pScreen, + RegionSubtract( &pChild->valdata->after.borderExposed, &pChild->borderClip, &pChild->winSize); } - REGION_NULL(pScreen, &pChild->valdata->after.exposed); + RegionNull(&pChild->valdata->after.exposed); } if (pChild->firstChild) { @@ -334,20 +334,20 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen, * We translate the old clipList because that will be exposed or copied * if gravity is right. */ - REGION_TRANSLATE( pScreen, &pParent->borderClip, dx, dy); - REGION_TRANSLATE( pScreen, &pParent->clipList, dx, dy); + RegionTranslate(&pParent->borderClip, dx, dy); + RegionTranslate(&pParent->clipList, dx, dy); } break; case VTBroken: - REGION_EMPTY (pScreen, &pParent->borderClip); - REGION_EMPTY (pScreen, &pParent->clipList); + RegionEmpty(&pParent->borderClip); + RegionEmpty(&pParent->clipList); break; } borderVisible = pParent->valdata->before.borderVisible; resized = pParent->valdata->before.resized; - REGION_NULL(pScreen, &pParent->valdata->after.borderExposed); - REGION_NULL(pScreen, &pParent->valdata->after.exposed); + RegionNull(&pParent->valdata->after.borderExposed); + RegionNull(&pParent->valdata->after.exposed); /* * Since the borderClip must not be clipped by the children, we do @@ -367,23 +367,23 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen, * of the border will be saved by DIX in borderVisible -- * use that region and destroy it */ - REGION_SUBTRACT( pScreen, exposed, universe, borderVisible); - REGION_DESTROY( pScreen, borderVisible); + RegionSubtract(exposed, universe, borderVisible); + RegionDestroy(borderVisible); } else { - REGION_SUBTRACT( pScreen, exposed, universe, &pParent->borderClip); + RegionSubtract(exposed, universe, &pParent->borderClip); } if (HasParentRelativeBorder(pParent) && (dx || dy)) { - REGION_SUBTRACT( pScreen, &pParent->valdata->after.borderExposed, + RegionSubtract(&pParent->valdata->after.borderExposed, universe, &pParent->winSize); } else { - REGION_SUBTRACT( pScreen, &pParent->valdata->after.borderExposed, + RegionSubtract(&pParent->valdata->after.borderExposed, exposed, &pParent->winSize); } - REGION_COPY( pScreen, &pParent->borderClip, universe); + RegionCopy(&pParent->borderClip, universe); /* * To get the right clipList for the parent, and to make doubly sure @@ -391,15 +391,15 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen, * border from the universe before proceeding. */ - REGION_INTERSECT( pScreen, universe, universe, &pParent->winSize); + RegionIntersect(universe, universe, &pParent->winSize); } else - REGION_COPY( pScreen, &pParent->borderClip, universe); + RegionCopy(&pParent->borderClip, universe); if ((pChild = pParent->firstChild) && pParent->mapped) { - REGION_NULL(pScreen, &childUniverse); - REGION_NULL(pScreen, &childUnion); + RegionNull(&childUniverse); + RegionNull(&childUnion); if ((pChild->drawable.y < pParent->lastChild->drawable.y) || ((pChild->drawable.y == pParent->lastChild->drawable.y) && (pChild->drawable.x < pParent->lastChild->drawable.x))) @@ -407,7 +407,7 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen, for (; pChild; pChild = pChild->nextSib) { if (pChild->viewable) - REGION_APPEND( pScreen, &childUnion, &pChild->borderSize); + RegionAppend(&childUnion, &pChild->borderSize); } } else @@ -415,10 +415,10 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen, for (pChild = pParent->lastChild; pChild; pChild = pChild->prevSib) { if (pChild->viewable) - REGION_APPEND( pScreen, &childUnion, &pChild->borderSize); + RegionAppend(&childUnion, &pChild->borderSize); } } - REGION_VALIDATE( pScreen, &childUnion, &overlap); + RegionValidate(&childUnion, &overlap); for (pChild = pParent->firstChild; pChild; @@ -435,7 +435,7 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen, * Figure out the new universe from the child's * perspective and recurse. */ - REGION_INTERSECT( pScreen, &childUniverse, + RegionIntersect(&childUniverse, universe, &pChild->borderSize); RootlessComputeClips (pChild, pScreen, &childUniverse, @@ -447,14 +447,14 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen, * other sibling. */ if (overlap) - REGION_SUBTRACT( pScreen, universe, universe, + RegionSubtract(universe, universe, &pChild->borderSize); } } if (!overlap) - REGION_SUBTRACT( pScreen, universe, universe, &childUnion); - REGION_UNINIT( pScreen, &childUnion); - REGION_UNINIT( pScreen, &childUniverse); + RegionSubtract(universe, universe, &childUnion); + RegionUninit(&childUnion); + RegionUninit(&childUniverse); } /* if any children */ /* @@ -467,12 +467,12 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen, if (oldVis == VisibilityFullyObscured || oldVis == VisibilityNotViewable) { - REGION_COPY( pScreen, &pParent->valdata->after.exposed, universe); + RegionCopy(&pParent->valdata->after.exposed, universe); } else if (newVis != VisibilityFullyObscured && newVis != VisibilityNotViewable) { - REGION_SUBTRACT( pScreen, &pParent->valdata->after.exposed, + RegionSubtract(&pParent->valdata->after.exposed, universe, &pParent->clipList); } @@ -484,7 +484,7 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen, */ if (pParent->backStorage && !resized) { - REGION_SUBTRACT( pScreen, exposed, &pParent->clipList, universe); + RegionSubtract(exposed, &pParent->clipList, universe); (* pScreen->SaveDoomedAreas)(pParent, exposed, dx, dy); } @@ -498,7 +498,7 @@ RootlessComputeClips (WindowPtr pParent, ScreenPtr pScreen, } #ifdef NOTDEF - REGION_COPY( pScreen, &pParent->clipList, universe); + RegionCopy(&pParent->clipList, universe); #endif pParent->drawable.serialNumber = NEXT_SERIAL_NUMBER; @@ -589,15 +589,15 @@ RootlessMiValidateTree (WindowPtr pRoot, /* Parent to validate */ if (pChild == NullWindow) pChild = pRoot->firstChild; - REGION_NULL(pScreen, &childClip); - REGION_NULL(pScreen, &exposed); + RegionNull(&childClip); + RegionNull(&exposed); - if (REGION_BROKEN (pScreen, &pRoot->clipList) && - !REGION_BROKEN (pScreen, &pRoot->borderClip)) + if (RegionBroken(&pRoot->clipList) && + !RegionBroken(&pRoot->borderClip)) { // fixme this might not work, but hopefully doesn't happen anyway. kind = VTBroken; - REGION_EMPTY (pScreen, &pRoot->clipList); + RegionEmpty(&pRoot->clipList); ErrorF("ValidateTree: BUSTED!\n"); } @@ -613,28 +613,28 @@ RootlessMiValidateTree (WindowPtr pRoot, /* Parent to validate */ { if (pWin->viewable) { if (pWin->valdata) { - REGION_COPY( pScreen, &childClip, &pWin->borderSize); + RegionCopy(&childClip, &pWin->borderSize); RootlessComputeClips (pWin, pScreen, &childClip, kind, &exposed); } else if (pWin->visibility == VisibilityNotViewable) { RootlessTreeObscured(pWin); } } else { if (pWin->valdata) { - REGION_EMPTY( pScreen, &pWin->clipList); + RegionEmpty(&pWin->clipList); if (pScreen->ClipNotify) (* pScreen->ClipNotify) (pWin, 0, 0); - REGION_EMPTY( pScreen, &pWin->borderClip); + RegionEmpty(&pWin->borderClip); pWin->valdata = NULL; } } } - REGION_UNINIT(pScreen, &childClip); + RegionUninit(&childClip); /* The root is never clipped by its children, so nothing on the root is ever exposed by moving or mapping its children. */ - REGION_NULL(pScreen, &pRoot->valdata->after.exposed); - REGION_NULL(pScreen, &pRoot->valdata->after.borderExposed); + RegionNull(&pRoot->valdata->after.exposed); + RegionNull(&pRoot->valdata->after.borderExposed); return 1; } diff --git a/miext/rootless/rootlessWindow.c b/miext/rootless/rootlessWindow.c index 4d541f404f..7f0321434c 100644 --- a/miext/rootless/rootlessWindow.c +++ b/miext/rootless/rootlessWindow.c @@ -184,7 +184,7 @@ RootlessDestroyFrame(WindowPtr pWin, RootlessWindowPtr winRec) SCREENREC(pScreen)->imp->DestroyFrame(winRec->wid); #ifdef ROOTLESS_TRACK_DAMAGE - REGION_UNINIT(pScreen, &winRec->damage); + RegionUninit(&winRec->damage); #endif free(winRec); @@ -232,9 +232,9 @@ RootlessGetShape(WindowPtr pWin, RegionPtr pShape) /* wBoundingShape is relative to *inner* origin of window. Translate by borderWidth to get the outside-relative position. */ - REGION_NULL(pScreen, pShape); - REGION_COPY(pScreen, pShape, wBoundingShape(pWin)); - REGION_TRANSLATE(pScreen, pShape, pWin->borderWidth, pWin->borderWidth); + RegionNull(pShape); + RegionCopy(pShape, wBoundingShape(pWin)); + RegionTranslate(pShape, pWin->borderWidth, pWin->borderWidth); return TRUE; } @@ -266,7 +266,7 @@ static void RootlessReshapeFrame(WindowPtr pWin) RL_DEBUG_MSG("reshaping..."); if (pShape != NULL) { RL_DEBUG_MSG("numrects %d, extents %d %d %d %d ", - REGION_NUM_RECTS(&newShape), + RegionNumRects(&newShape), newShape.extents.x1, newShape.extents.y1, newShape.extents.x2, newShape.extents.y2); } else { @@ -277,7 +277,7 @@ static void RootlessReshapeFrame(WindowPtr pWin) SCREENREC(pScreen)->imp->ReshapeFrame(winRec->wid, pShape); if (pShape != NULL) - REGION_UNINIT(pScreen, &newShape); + RegionUninit(&newShape); } @@ -355,8 +355,8 @@ RootlessPositionWindow(WindowPtr pWin, int x, int y) #ifdef ROOTLESS_TRACK_DAMAGE // Move damaged region to correspond to new window position - if (REGION_NOTEMPTY(pScreen, &winRec->damage)) { - REGION_TRANSLATE(pScreen, &winRec->damage, + if (RegionNotEmpty(&winRec->damage)) { + RegionTranslate(&winRec->damage, x - bw - winRec->x, y - bw - winRec->y); } @@ -394,7 +394,7 @@ RootlessInitializeFrame(WindowPtr pWin, RootlessWindowRec *winRec) winRec->borderWidth = bw; #ifdef ROOTLESS_TRACK_DAMAGE - REGION_NULL(pScreen, &winRec->damage); + RegionNull(&winRec->damage); #endif } @@ -457,7 +457,7 @@ RootlessEnsureFrame(WindowPtr pWin) RootlessFlushWindowColormap(pWin); if (pShape != NULL) - REGION_UNINIT(pScreen, &shape); + RegionUninit(&shape); return winRec; } @@ -673,7 +673,7 @@ RootlessNoCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RL_DEBUG_MSG("ROOTLESSNOCOPYWINDOW "); - REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, -dx, -dy); + RegionTranslate(prgnSrc, -dx, -dy); } @@ -705,9 +705,9 @@ RootlessResizeCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; - REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy); - REGION_NULL(pScreen, &rgnDst); - REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc); + RegionTranslate(prgnSrc, -dx, -dy); + RegionNull(&rgnDst); + RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); if (gResizeDeathCount == 1) { /* Simple case, we only have a single source pixmap. */ @@ -724,21 +724,21 @@ RootlessResizeCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, intersect the destination with each source and copy those bits. */ for (i = 0; i < gResizeDeathCount; i++) { - REGION_INIT(pScreen, &clip, gResizeDeathBounds + 0, 1); - REGION_NULL(pScreen, &clipped); - REGION_INTERSECT(pScreen, &rgnDst, &clip, &clipped); + RegionInit(&clip, gResizeDeathBounds + 0, 1); + RegionNull(&clipped); + RegionIntersect(&rgnDst, &clip, &clipped); fbCopyRegion(&gResizeDeathPix[i]->drawable, &pScreen->GetWindowPixmap(pWin)->drawable, 0, &clipped, dx, dy, fbCopyWindowProc, 0, 0); - REGION_UNINIT(pScreen, &clipped); - REGION_UNINIT(pScreen, &clip); + RegionUninit(&clipped); + RegionUninit(&clip); } } /* Don't update - resize will update everything */ - REGION_UNINIT(pScreen, &rgnDst); + RegionUninit(&rgnDst); fbValidateDrawable(&pWin->drawable); @@ -768,12 +768,12 @@ RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) dx = ptOldOrg.x - pWin->drawable.x; dy = ptOldOrg.y - pWin->drawable.y; - REGION_TRANSLATE(pScreen, prgnSrc, -dx, -dy); + RegionTranslate(prgnSrc, -dx, -dy); - REGION_NULL(pScreen, &rgnDst); - REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc); + RegionNull(&rgnDst); + RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); - extents = REGION_EXTENTS(pScreen, &rgnDst); + extents = RegionExtents(&rgnDst); area = (extents->x2 - extents->x1) * (extents->y2 - extents->y1); /* If the area exceeds threshold, use the implementation's @@ -797,13 +797,13 @@ RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) } /* Move region to window local coords */ - REGION_TRANSLATE(pScreen, &rgnDst, -winRec->x, -winRec->y); + RegionTranslate(&rgnDst, -winRec->x, -winRec->y); RootlessStopDrawing(pWin, FALSE); SCREENREC(pScreen)->imp->CopyWindow(winRec->wid, - REGION_NUM_RECTS(&rgnDst), - REGION_RECTS(&rgnDst), + RegionNumRects(&rgnDst), + RegionRects(&rgnDst), dx, dy); } else { @@ -817,7 +817,7 @@ RootlessCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) } out: - REGION_UNINIT(pScreen, &rgnDst); + RegionUninit(&rgnDst); fbValidateDrawable(&pWin->drawable); SCREEN_WRAP(pScreen, CopyWindow); @@ -1320,11 +1320,11 @@ RootlessResizeWindow(WindowPtr pWin, int x, int y, box.x1 = x; box.y1 = y; box.x2 = x + w; box.y2 = y + h; - REGION_UNINIT(pScreen, &pWin->winSize); - REGION_INIT(pScreen, &pWin->winSize, &box, 1); - REGION_COPY(pScreen, &pWin->borderSize, &pWin->winSize); - REGION_COPY(pScreen, &pWin->clipList, &pWin->winSize); - REGION_COPY(pScreen, &pWin->borderClip, &pWin->winSize); + RegionUninit(&pWin->winSize); + RegionInit(&pWin->winSize, &box, 1); + RegionCopy(&pWin->borderSize, &pWin->winSize); + RegionCopy(&pWin->clipList, &pWin->winSize); + RegionCopy(&pWin->borderClip, &pWin->winSize); miSendExposures(pWin, &pWin->borderClip, pWin->drawable.x, pWin->drawable.y); diff --git a/miext/shadow/shadow.c b/miext/shadow/shadow.c index e027e76d98..893014bf40 100644 --- a/miext/shadow/shadow.c +++ b/miext/shadow/shadow.c @@ -57,7 +57,7 @@ shadowRedisplay(ScreenPtr pScreen) if (!pBuf || !pBuf->pDamage || !pBuf->update) return; pRegion = DamageRegion(pBuf->pDamage); - if (REGION_NOTEMPTY(pScreen, pRegion)) { + if (RegionNotEmpty(pRegion)) { (*pBuf->update)(pScreen, pBuf); DamageEmpty(pBuf->pDamage); } @@ -103,7 +103,7 @@ shadowCloseScreen(int i, ScreenPtr pScreen) shadowRemove(pScreen, pBuf->pPixmap); DamageDestroy(pBuf->pDamage); #ifdef BACKWARDS_COMPATIBILITY - REGION_UNINIT(pScreen, &pBuf->damage); /* bc */ + RegionUninit(&pBuf->damage); /* bc */ #endif if (pBuf->pPixmap) pScreen->DestroyPixmap(pBuf->pPixmap); @@ -121,13 +121,13 @@ shadowReportFunc(DamagePtr pDamage, RegionPtr pRegion, void *closure) /* Register the damaged region, use DamageReportNone below when we * want to break BC below... */ - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, pRegion); + RegionUnion(&pDamage->damage, &pDamage->damage, pRegion); /* * BC hack. In 7.0 and earlier several drivers would inspect the * 'damage' member directly, so we have to keep it existing. */ - REGION_COPY(pScreen, &pBuf->damage, pRegion); + RegionCopy(&pBuf->damage, pRegion); } #endif @@ -166,7 +166,7 @@ shadowSetup(ScreenPtr pScreen) pBuf->closure = 0; pBuf->randr = 0; #ifdef BACKWARDS_COMPATIBILITY - REGION_NULL(pScreen, &pBuf->damage); /* bc */ + RegionNull(&pBuf->damage); /* bc */ #endif dixSetPrivate(&pScreen->devPrivates, shadowScrPrivateKey, pBuf); diff --git a/miext/shadow/shpacked.c b/miext/shadow/shpacked.c index 6736162e24..20d2ea19e0 100644 --- a/miext/shadow/shpacked.c +++ b/miext/shadow/shpacked.c @@ -46,8 +46,8 @@ shadowUpdatePacked (ScreenPtr pScreen, { RegionPtr damage = shadowDamage (pBuf); PixmapPtr pShadow = pBuf->pPixmap; - int nbox = REGION_NUM_RECTS (damage); - BoxPtr pbox = REGION_RECTS (damage); + int nbox = RegionNumRects (damage); + BoxPtr pbox = RegionRects (damage); FbBits *shaBase, *shaLine, *sha; FbStride shaStride; int scrBase, scrLine, scr; diff --git a/miext/shadow/shplanar.c b/miext/shadow/shplanar.c index b5983dc73f..9ca3f3f898 100644 --- a/miext/shadow/shplanar.c +++ b/miext/shadow/shplanar.c @@ -92,8 +92,8 @@ shadowUpdatePlanar4 (ScreenPtr pScreen, { RegionPtr damage = shadowDamage (pBuf); PixmapPtr pShadow = pBuf->pPixmap; - int nbox = REGION_NUM_RECTS (damage); - BoxPtr pbox = REGION_RECTS (damage); + int nbox = RegionNumRects (damage); + BoxPtr pbox = RegionRects (damage); CARD32 *shaBase, *shaLine, *sha; FbStride shaStride; int scrBase, scrLine, scr; diff --git a/miext/shadow/shplanar8.c b/miext/shadow/shplanar8.c index 6d8defa586..f8b255d8fc 100644 --- a/miext/shadow/shplanar8.c +++ b/miext/shadow/shplanar8.c @@ -95,8 +95,8 @@ shadowUpdatePlanar4x8 (ScreenPtr pScreen, { RegionPtr damage = shadowDamage (pBuf); PixmapPtr pShadow = pBuf->pPixmap; - int nbox = REGION_NUM_RECTS (damage); - BoxPtr pbox = REGION_RECTS (damage); + int nbox = RegionNumRects (damage); + BoxPtr pbox = RegionRects (damage); CARD32 *shaBase, *shaLine, *sha; CARD8 s1, s2, s3, s4; FbStride shaStride; diff --git a/miext/shadow/shrotate.c b/miext/shadow/shrotate.c index 673cd76b5a..c3898266c8 100644 --- a/miext/shadow/shrotate.c +++ b/miext/shadow/shrotate.c @@ -54,8 +54,8 @@ shadowUpdateRotatePacked (ScreenPtr pScreen, { RegionPtr damage = shadowDamage (pBuf); PixmapPtr pShadow = pBuf->pPixmap; - int nbox = REGION_NUM_RECTS (damage); - BoxPtr pbox = REGION_RECTS (damage); + int nbox = RegionNumRects (damage); + BoxPtr pbox = RegionRects (damage); FbBits *shaBits; FbStride shaStride; int shaBpp; diff --git a/miext/shadow/shrotpack.h b/miext/shadow/shrotpack.h index 015a985950..2d1a87c191 100644 --- a/miext/shadow/shrotpack.h +++ b/miext/shadow/shrotpack.h @@ -99,8 +99,8 @@ FUNC (ScreenPtr pScreen, { RegionPtr damage = shadowDamage (pBuf); PixmapPtr pShadow = pBuf->pPixmap; - int nbox = REGION_NUM_RECTS (damage); - BoxPtr pbox = REGION_RECTS (damage); + int nbox = RegionNumRects (damage); + BoxPtr pbox = RegionRects (damage); FbBits *shaBits; Data *shaBase, *shaLine, *sha; FbStride shaStride; diff --git a/miext/shadow/shrotpackYX.h b/miext/shadow/shrotpackYX.h index 8ef70f1675..7d36bd1bd1 100644 --- a/miext/shadow/shrotpackYX.h +++ b/miext/shadow/shrotpackYX.h @@ -63,8 +63,8 @@ FUNC (ScreenPtr pScreen, { RegionPtr damage = shadowDamage(pBuf); PixmapPtr pShadow = pBuf->pPixmap; - int nbox = REGION_NUM_RECTS (damage); - BoxPtr pbox = REGION_RECTS (damage); + int nbox = RegionNumRects (damage); + BoxPtr pbox = RegionRects (damage); FbBits *shaBits; Data *shaBase, *shaLine, *sha; FbStride shaStride, winStride; diff --git a/render/mipict.c b/render/mipict.c index 1dad88eba0..b5b8970374 100644 --- a/render/mipict.c +++ b/render/mipict.c @@ -47,7 +47,7 @@ void miDestroyPicture (PicturePtr pPicture) { if (pPicture->freeCompClip) - REGION_DESTROY(pPicture->pDrawable->pScreen, pPicture->pCompositeClip); + RegionDestroy(pPicture->pCompositeClip); } void @@ -64,7 +64,7 @@ miDestroyPictureClip (PicturePtr pPicture) * we know we'll never have a list of rectangles, since ChangeClip * immediately turns them into a region */ - REGION_DESTROY(pPicture->pDrawable->pScreen, pPicture->clientClip); + RegionDestroy(pPicture->clientClip); break; } pPicture->clientClip = NULL; @@ -85,7 +85,7 @@ miChangePictureClip (PicturePtr pPicture, switch (type) { case CT_PIXMAP: /* convert the pixmap to a region */ - clientClip = (pointer) BITMAP_TO_REGION(pScreen, (PixmapPtr) value); + clientClip = (pointer) BitmapToRegion(pScreen, (PixmapPtr) value); if (!clientClip) return BadAlloc; clientClipType = CT_REGION; @@ -100,7 +100,7 @@ miChangePictureClip (PicturePtr pPicture, clientClipType = CT_NONE; break; default: - clientClip = (pointer) RECTS_TO_REGION(pScreen, n, + clientClip = (pointer) RegionFromRects(n, (xRectangle *) value, type); if (!clientClip) @@ -160,7 +160,7 @@ miValidatePicture (PicturePtr pPicture, if (pPicture->clientClipType == CT_NONE) { if (freeCompClip) - REGION_DESTROY(pScreen, pPicture->pCompositeClip); + RegionDestroy(pPicture->pCompositeClip); pPicture->pCompositeClip = pregWin; pPicture->freeCompClip = freeTmpClip; } @@ -175,30 +175,30 @@ miValidatePicture (PicturePtr pPicture, * clip. if neither is real, create a new region. */ - REGION_TRANSLATE(pScreen, pPicture->clientClip, + RegionTranslate(pPicture->clientClip, pDrawable->x + pPicture->clipOrigin.x, pDrawable->y + pPicture->clipOrigin.y); if (freeCompClip) { - REGION_INTERSECT(pScreen, pPicture->pCompositeClip, + RegionIntersect(pPicture->pCompositeClip, pregWin, pPicture->clientClip); if (freeTmpClip) - REGION_DESTROY(pScreen, pregWin); + RegionDestroy(pregWin); } else if (freeTmpClip) { - REGION_INTERSECT(pScreen, pregWin, pregWin, pPicture->clientClip); + RegionIntersect(pregWin, pregWin, pPicture->clientClip); pPicture->pCompositeClip = pregWin; } else { - pPicture->pCompositeClip = REGION_CREATE(pScreen, NullBox, 0); - REGION_INTERSECT(pScreen, pPicture->pCompositeClip, + pPicture->pCompositeClip = RegionCreate(NullBox, 0); + RegionIntersect(pPicture->pCompositeClip, pregWin, pPicture->clientClip); } pPicture->freeCompClip = TRUE; - REGION_TRANSLATE(pScreen, pPicture->clientClip, + RegionTranslate(pPicture->clientClip, -(pDrawable->x + pPicture->clipOrigin.x), -(pDrawable->y + pPicture->clipOrigin.y)); } @@ -216,31 +216,31 @@ miValidatePicture (PicturePtr pPicture, if (pPicture->freeCompClip) { - REGION_RESET(pScreen, pPicture->pCompositeClip, &pixbounds); + RegionReset(pPicture->pCompositeClip, &pixbounds); } else { pPicture->freeCompClip = TRUE; - pPicture->pCompositeClip = REGION_CREATE(pScreen, &pixbounds, 1); + pPicture->pCompositeClip = RegionCreate(&pixbounds, 1); } if (pPicture->clientClipType == CT_REGION) { if(pDrawable->x || pDrawable->y) { - REGION_TRANSLATE(pScreen, pPicture->clientClip, + RegionTranslate(pPicture->clientClip, pDrawable->x + pPicture->clipOrigin.x, pDrawable->y + pPicture->clipOrigin.y); - REGION_INTERSECT(pScreen, pPicture->pCompositeClip, + RegionIntersect(pPicture->pCompositeClip, pPicture->pCompositeClip, pPicture->clientClip); - REGION_TRANSLATE(pScreen, pPicture->clientClip, + RegionTranslate(pPicture->clientClip, -(pDrawable->x + pPicture->clipOrigin.x), -(pDrawable->y + pPicture->clipOrigin.y)); } else { - REGION_TRANSLATE(pScreen, pPicture->pCompositeClip, + RegionTranslate(pPicture->pCompositeClip, -pPicture->clipOrigin.x, -pPicture->clipOrigin.y); - REGION_INTERSECT(pScreen, pPicture->pCompositeClip, + RegionIntersect(pPicture->pCompositeClip, pPicture->pCompositeClip, pPicture->clientClip); - REGION_TRANSLATE(pScreen, pPicture->pCompositeClip, + RegionTranslate(pPicture->pCompositeClip, pPicture->clipOrigin.x, pPicture->clipOrigin.y); } } @@ -321,7 +321,7 @@ miClipPictureSrc (RegionPtr pRegion, pPicture->clipOrigin.x + dx, pPicture->clipOrigin.y + dy); - result = REGION_INTERSECT (pScreen, pRegion, pRegion, pPicture->clientClip); + result = RegionIntersect(pRegion, pRegion, pPicture->clientClip); pixman_region_translate ( pPicture->clientClip, - (pPicture->clipOrigin.x + dx), diff --git a/render/mirect.c b/render/mirect.c index 13d7fa6028..6a3112a090 100644 --- a/render/mirect.c +++ b/render/mirect.c @@ -64,8 +64,8 @@ miColorRects (PicturePtr pDst, tmpval[4].val = pDst->clipOrigin.y - yoff; mask |= GCClipXOrigin|GCClipYOrigin; - pClip = REGION_CREATE (pScreen, NULL, 1); - REGION_COPY (pScreen, pClip, + pClip = RegionCreate(NULL, 1); + RegionCopy(pClip, (RegionPtr) pClipPict->clientClip); (*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0); } diff --git a/render/picture.c b/render/picture.c index 211fa38b33..ca5e18e74c 100644 --- a/render/picture.c +++ b/render/picture.c @@ -1298,7 +1298,7 @@ SetPictureClipRects (PicturePtr pPicture, RegionPtr clientClip; int result; - clientClip = RECTS_TO_REGION(pScreen, + clientClip = RegionFromRects( nRect, rects, CT_UNSORTED); if (!clientClip) return BadAlloc; @@ -1329,14 +1329,14 @@ SetPictureClipRegion (PicturePtr pPicture, if (pRegion) { type = CT_REGION; - clientClip = REGION_CREATE (pScreen, - REGION_EXTENTS(pScreen, pRegion), - REGION_NUM_RECTS(pRegion)); + clientClip = RegionCreate( + RegionExtents(pRegion), + RegionNumRects(pRegion)); if (!clientClip) return BadAlloc; - if (!REGION_COPY (pSCreen, clientClip, pRegion)) + if (!RegionCopy(clientClip, pRegion)) { - REGION_DESTROY (pScreen, clientClip); + RegionDestroy(clientClip); return BadAlloc; } } @@ -1462,9 +1462,9 @@ CopyPicture (PicturePtr pSrc, RegionPtr clientClip; RegionPtr srcClientClip = (RegionPtr)pSrc->clientClip; - clientClip = REGION_CREATE(pSrc->pDrawable->pScreen, - REGION_EXTENTS(pSrc->pDrawable->pScreen, srcClientClip), - REGION_NUM_RECTS(srcClientClip)); + clientClip = RegionCreate( + RegionExtents(srcClientClip), + RegionNumRects(srcClientClip)); (*ps->ChangePictureClip)(pDst, CT_REGION, clientClip, 0); } break; diff --git a/xfixes/region.c b/xfixes/region.c index b034ad01da..4fdfa203a1 100644 --- a/xfixes/region.c +++ b/xfixes/region.c @@ -39,20 +39,20 @@ RegionResFree (pointer data, XID id) { RegionPtr pRegion = (RegionPtr) data; - REGION_DESTROY (0, pRegion); + RegionDestroy(pRegion); return Success; } RegionPtr XFixesRegionCopy (RegionPtr pRegion) { - RegionPtr pNew = REGION_CREATE (0, REGION_EXTENTS(0, pRegion), - REGION_NUM_RECTS(pRegion)); + RegionPtr pNew = RegionCreate(RegionExtents(pRegion), + RegionNumRects(pRegion)); if (!pNew) return 0; - if (!REGION_COPY (0, pNew, pRegion)) + if (!RegionCopy(pNew, pRegion)) { - REGION_DESTROY (0, pNew); + RegionDestroy(pNew); return 0; } return pNew; @@ -81,7 +81,7 @@ ProcXFixesCreateRegion (ClientPtr client) return BadLength; things >>= 3; - pRegion = RECTS_TO_REGION(0, things, (xRectangle *) (stuff + 1), CT_UNSORTED); + pRegion = RegionFromRects(things, (xRectangle *) (stuff + 1), CT_UNSORTED); if (!pRegion) return BadAlloc; if (!AddResource (stuff->region, RegionResType, (pointer) pRegion)) @@ -124,7 +124,7 @@ ProcXFixesCreateRegionFromBitmap (ClientPtr client) if (pPixmap->drawable.depth != 1) return BadMatch; - pRegion = BITMAP_TO_REGION(pPixmap->drawable.pScreen, pPixmap); + pRegion = BitmapToRegion(pPixmap->drawable.pScreen, pPixmap); if (!pRegion) return BadAlloc; @@ -227,7 +227,7 @@ ProcXFixesCreateRegionFromGC (ClientPtr client) switch (pGC->clientClipType) { case CT_PIXMAP: - pRegion = BITMAP_TO_REGION(pGC->pScreen, (PixmapPtr) pGC->clientClip); + pRegion = BitmapToRegion(pGC->pScreen, (PixmapPtr) pGC->clientClip); if (!pRegion) return BadAlloc; break; @@ -274,7 +274,7 @@ ProcXFixesCreateRegionFromPicture (ClientPtr client) switch (pPicture->clientClipType) { case CT_PIXMAP: - pRegion = BITMAP_TO_REGION(pPicture->pDrawable->pScreen, + pRegion = BitmapToRegion(pPicture->pDrawable->pScreen, (PixmapPtr) pPicture->clientClip); if (!pRegion) return BadAlloc; @@ -346,15 +346,15 @@ ProcXFixesSetRegion (ClientPtr client) return BadLength; things >>= 3; - pNew = RECTS_TO_REGION(0, things, (xRectangle *) (stuff + 1), CT_UNSORTED); + pNew = RegionFromRects(things, (xRectangle *) (stuff + 1), CT_UNSORTED); if (!pNew) return BadAlloc; - if (!REGION_COPY (0, pRegion, pNew)) + if (!RegionCopy(pRegion, pNew)) { - REGION_DESTROY (0, pNew); + RegionDestroy(pNew); return BadAlloc; } - REGION_DESTROY (0, pNew); + RegionDestroy(pNew); return Success; } @@ -380,7 +380,7 @@ ProcXFixesCopyRegion (ClientPtr client) VERIFY_REGION(pSource, stuff->source, client, DixReadAccess); VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); - if (!REGION_COPY(pScreen, pDestination, pSource)) + if (!RegionCopy(pDestination, pSource)) return BadAlloc; return Success; @@ -412,15 +412,15 @@ ProcXFixesCombineRegion (ClientPtr client) switch (stuff->xfixesReqType) { case X_XFixesUnionRegion: - if (!REGION_UNION (0, pDestination, pSource1, pSource2)) + if (!RegionUnion(pDestination, pSource1, pSource2)) return BadAlloc; break; case X_XFixesIntersectRegion: - if (!REGION_INTERSECT (0, pDestination, pSource1, pSource2)) + if (!RegionIntersect(pDestination, pSource1, pSource2)) return BadAlloc; break; case X_XFixesSubtractRegion: - if (!REGION_SUBTRACT (0, pDestination, pSource1, pSource2)) + if (!RegionSubtract(pDestination, pSource1, pSource2)) return BadAlloc; break; } @@ -466,7 +466,7 @@ ProcXFixesInvertRegion (ClientPtr client) else bounds.y2 = stuff->y + stuff->height; - if (!REGION_INVERSE(0, pDestination, pSource, &bounds)) + if (!RegionInverse(pDestination, pSource, &bounds)) return BadAlloc; return Success; @@ -498,7 +498,7 @@ ProcXFixesTranslateRegion (ClientPtr client) REQUEST_SIZE_MATCH(xXFixesTranslateRegionReq); VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess); - REGION_TRANSLATE(pScreen, pRegion, stuff->dx, stuff->dy); + RegionTranslate(pRegion, stuff->dx, stuff->dy); return Success; } @@ -526,7 +526,7 @@ ProcXFixesRegionExtents (ClientPtr client) VERIFY_REGION(pSource, stuff->source, client, DixReadAccess); VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); - REGION_RESET (0, pDestination, REGION_EXTENTS (0, pSource)); + RegionReset(pDestination, RegionExtents(pSource)); return Success; } @@ -558,9 +558,9 @@ ProcXFixesFetchRegion (ClientPtr client) REQUEST_SIZE_MATCH(xXFixesFetchRegionReq); VERIFY_REGION(pRegion, stuff->region, client, DixReadAccess); - pExtent = REGION_EXTENTS (0, pRegion); - pBox = REGION_RECTS (pRegion); - nBox = REGION_NUM_RECTS (pRegion); + pExtent = RegionExtents(pRegion); + pBox = RegionRects (pRegion); + nBox = RegionNumRects (pRegion); reply = malloc(sizeof (xXFixesFetchRegionReply) + nBox * sizeof (xRectangle)); @@ -708,7 +708,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) break; } if (stuff->xOff || stuff->yOff) - REGION_TRANSLATE (0, pRegion, stuff->xOff, stuff->yOff); + RegionTranslate(pRegion, stuff->xOff, stuff->yOff); } else { @@ -731,7 +731,7 @@ ProcXFixesSetWindowShapeRegion (ClientPtr client) pDestRegion = &pRegion; /* a NULL region pointer */ } if (*pDestRegion) - REGION_DESTROY(pScreen, *pDestRegion); + RegionDestroy(*pDestRegion); *pDestRegion = pRegion; (*pScreen->SetShape) (pWin, stuff->destKind); SendShapeNotify (pWin, stuff->destKind); @@ -801,8 +801,8 @@ ProcXFixesExpandRegion (ClientPtr client) VERIFY_REGION(pSource, stuff->source, client, DixReadAccess); VERIFY_REGION(pDestination, stuff->destination, client, DixWriteAccess); - nBoxes = REGION_NUM_RECTS(pSource); - pSrc = REGION_RECTS(pSource); + nBoxes = RegionNumRects(pSource); + pSrc = RegionRects(pSource); if (nBoxes) { pTmp = malloc(nBoxes * sizeof (BoxRec)); @@ -815,12 +815,12 @@ ProcXFixesExpandRegion (ClientPtr client) pTmp[i].y1 = pSrc[i].y1 - stuff->top; pTmp[i].y2 = pSrc[i].y2 + stuff->bottom; } - REGION_EMPTY (pScreen, pDestination); + RegionEmpty(pDestination); for (i = 0; i < nBoxes; i++) { RegionRec r; - REGION_INIT (pScreen, &r, &pTmp[i], 0); - REGION_UNION (pScreen, pDestination, pDestination, &r); + RegionInit(&r, &pTmp[i], 0); + RegionUnion(pDestination, pDestination, &r); } free(pTmp); }