Commit 2dc13892 authored by Keith Packard's avatar Keith Packard

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: default avatarJamey Sharp <jamey@minilop.net>
Signed-off-by: default avatarKeith Packard <keithp@keithp.com>
parent d17e726e
......@@ -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);
}
......@@ -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;
......
......@@ -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;
......
......@@ -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 */
/*
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
/*
......
......@@ -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;
}
......
......@@ -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;
......
......@@ -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)