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 <jamey@minilop.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Keith Packard 2010-05-21 15:05:48 -07:00
parent d17e726e89
commit 2dc138922b
130 changed files with 1817 additions and 1865 deletions

View File

@ -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);
}

View File

@ -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;

View File

@ -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;

View File

@ -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 */
/*

View File

@ -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;

View File

@ -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;

View File

@ -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);
/*

View File

@ -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;
}

View File

@ -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;

View File

@ -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;
}

View File

@ -83,8 +83,6 @@ Equipment Corporation.
#include <X11/Xprotostr.h>
#include <X11/Xfuncproto.h>
#include "gc.h"
#include "mi.h"
#include "mispans.h"
#include <pixman.h>
#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();

View File

@ -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);
}

View File

@ -2101,7 +2101,7 @@ Making direct calls is faster on many architectures.</para>
BoxPtr rect;
int size;
macro: RegionPtr REGION_CREATE(pScreen, rect, size)
macro: RegionPtr RegionCreate(rect, size)
</programlisting></blockquote>
RegionCreate creates a region that describes ONE rectangle. The
@ -2122,7 +2122,7 @@ applicable.</para>
BoxPtr rect;
int size;
macro: REGION_INIT(pScreen, pRegion, rect, size)
macro: RegionInit(pRegion, rect, size)
</programlisting></blockquote>
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)
</programlisting></blockquote>
RegionCopy copies the description of one region, srcrgn, to another
@ -2148,7 +2148,7 @@ dstrgn; returning TRUE if the copy succeeded, and FALSE otherwise.</para>
void pScreen->RegionDestroy( pRegion)
RegionPtr pRegion;
macro: REGION_DESTROY(pScreen, pRegion)
macro: RegionDestroy(pRegion)
</programlisting></blockquote>
RegionDestroy destroys a region and frees all allocated memory.</para>
@ -2158,7 +2158,7 @@ RegionDestroy destroys a region and frees all allocated memory.</para>
void pScreen->RegionUninit (pRegion)
RegionPtr pRegion;
macro: REGION_UNINIT(pScreen, pRegion)
macro: RegionUninit(pRegion)
</programlisting></blockquote>
Frees everything except the region structure itself, useful when the
@ -2171,23 +2171,23 @@ it has been RegionInit'ed again.</para>
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)
</programlisting></blockquote>
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.</para>
RegionPtr pRegion;
BoxPtr pBox;
macro: REGION_RESET(pScreen, pRegion, pBox)
macro: RegionReset(pRegion, pBox)
</programlisting></blockquote>
RegionReset sets the region to describe
@ -2225,7 +2225,7 @@ one rectangle and reallocates it to a size of one rectangle, if applicable.</par
RegionPtr pRegion;
int x, y;
macro: REGION_TRANSLATE(pScreen, pRegion, x, y)
macro: RegionTranslate(pRegion, x, y)
</programlisting></blockquote>
TranslateRegion simply moves a region +x in the x direction and +y in the y
@ -2237,7 +2237,7 @@ direction.</para>
RegionPtr pRegion;
BoxPtr pBox;
macro: int RECT_IN_REGION(pScreen, pRegion, pBox)
macro: int RegionContainsRect(pRegion, pBox)
</programlisting></blockquote>
RectIn returns one of the defined constants rgnIN, rgnOUT, or rgnPART,
@ -2252,7 +2252,7 @@ These constants are defined in Xserver/include/region.h.</para>
int x, y;
BoxPtr pBox;
macro: Bool POINT_IN_REGION(pScreen, pRegion, x, y, pBox)
macro: Bool RegionContainsPoint(pRegion, x, y, pBox)
</programlisting></blockquote>
PointInRegion returns true if the point x, y is in the region. In
@ -2275,7 +2275,7 @@ returned box.</para>
Bool pScreen->RegionNotEmpty(pRegion)
RegionPtr pRegion;
macro: Bool REGION_NOTEMPTY(pScreen, pRegion)
macro: Bool RegionNotEmpty(pRegion)
</programlisting></blockquote>
RegionNotEmpty is a boolean function that returns
@ -2286,7 +2286,7 @@ true or false depending upon whether the region encloses any pixels.</para>
void pScreen->RegionEmpty(pRegion)
RegionPtr pRegion;
macro: REGION_EMPTY(pScreen, pRegion)
macro: RegionEmpty(pRegion)
</programlisting></blockquote>
RegionEmpty sets the region to be empty.</para>
@ -2296,7 +2296,7 @@ RegionEmpty sets the region to be empty.</para>
BoxPtr pScreen->RegionExtents(pRegion)
RegionPtr pRegion;
macro: REGION_EXTENTS(pScreen, pRegion)
macro: RegionExtents(pRegion)
</programlisting></blockquote>
RegionExtents returns a rectangle that is the smallest
@ -2310,13 +2310,13 @@ in your region struct.</para>
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)
</programlisting></blockquote>
These functions provide an optimization for clip list generation and
@ -2332,7 +2332,7 @@ regions overlap; FALSE otherwise.</para>
RegionPtr pScreen->BitmapToRegion (pPixmap)
PixmapPtr pPixmap;
macro: RegionPtr BITMAP_TO_REGION(pScreen, pPixmap)
macro: RegionPtr BitmapToRegion(pScreen, pPixmap)
</programlisting></blockquote>
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.</para>
xRectangle *pRects;
int ordering;
macro: RegionPtr RECTS_TO_REGION(pScreen, nrects, pRects, ordering)
macro: RegionPtr RegionFromRects(nrects, pRects, ordering)
</programlisting></blockquote>
Given a client-supplied list of rectangles, produces a region which includes

View File

@ -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, &region, &box, 1);
RegionInit(&region, &box, 1);
DamageRegionAppend(&pPix->drawable, &region);
DamageRegionProcessPending(&pPix->drawable);
REGION_UNINIT(pScreen, &region);
RegionUninit(&region);
}
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);

View File

@ -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;

View File

@ -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);

View File

@ -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;
}

View File

@ -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;

View File

@ -292,7 +292,7 @@ exaTryDriverSolidFill(PicturePtr pSrc,
exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y);
REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);
RegionTranslate(&region, 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, &region);
RegionUninit(&region);
return -1;
}
@ -320,18 +320,18 @@ exaTryDriverSolidFill(PicturePtr pSrc,
}
if (!exaPixmapHasGpuCopy(pDstPix)) {
REGION_UNINIT(pDst->pDrawable->pScreen, &region);
RegionUninit(&region);
return 0;
}
if (!(*pExaScr->info->PrepareSolid) (pDstPix, GXcopy, 0xffffffff, pixel))
{
REGION_UNINIT(pDst->pDrawable->pScreen, &region);
RegionUninit(&region);
return -1;
}
nbox = REGION_NUM_RECTS(&region);
pbox = REGION_RECTS(&region);
nbox = RegionNumRects(&region);
pbox = RegionRects(&region);
while (nbox--)
{
@ -342,7 +342,7 @@ exaTryDriverSolidFill(PicturePtr pSrc,
(*pExaScr->info->DoneSolid) (pDstPix);
exaMarkSync(pDst->pDrawable->pScreen);
REGION_UNINIT(pDst->pDrawable->pScreen, &region);
RegionUninit(&region);
return 1;
}
@ -469,10 +469,10 @@ exaTryDriverCompositeRects(CARD8 op,
rects->width, rects->height))
goto next_rect;
REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);
RegionTranslate(&region, dst_off_x, dst_off_y);
nbox = REGION_NUM_RECTS(&region);
pbox = REGION_RECTS(&region);
nbox = RegionNumRects(&region);
pbox = RegionRects(&region);
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, &region);
RegionUninit(&region);
rects++;
}
@ -575,11 +575,11 @@ exaCompositeRects(CARD8 op,
* (see use of DamagePendingRegion in exaCopyDirty)
*/
REGION_INIT(pScreen, &region, &box, 1);
RegionInit(&region, &box, 1);
DamageRegionAppend(pDst->pDrawable, &region);
REGION_UNINIT(pScreen, &region);
RegionUninit(&region);
}
/************************************************************/
@ -703,7 +703,7 @@ exaTryDriverComposite(CARD8 op,
exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y);
REGION_TRANSLATE(pScreen, &region, dst_off_x, dst_off_y);
RegionTranslate(&region, 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, &region);
RegionUninit(&region);
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, &region);
RegionUninit(&region);
return 0;
}
}
if (!exaPixmapHasGpuCopy(pDstPix)) {
REGION_UNINIT(pDst->pDrawable->pScreen, &region);
RegionUninit(&region);
return 0;
}
if (!(*pExaScr->info->PrepareComposite) (op, pSrc, pMask, pDst, pSrcPix,
pMaskPix, pDstPix))
{
REGION_UNINIT(pDst->pDrawable->pScreen, &region);
RegionUninit(&region);
return -1;
}
nbox = REGION_NUM_RECTS(&region);
pbox = REGION_RECTS(&region);
nbox = RegionNumRects(&region);
pbox = RegionRects(&region);
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, &region);
RegionUninit(&region);
return 1;
}
@ -953,9 +953,9 @@ exaComposite(CARD8 op,
goto done;
ret = exaHWCopyNtoN(pSrc->pDrawable, pDst->pDrawable, NULL,
REGION_RECTS(&region), REGION_NUM_RECTS(&region),
RegionRects(&region), RegionNumRects(&region),
xSrc - xDst, ySrc - yDst, FALSE, FALSE);
REGION_UNINIT(pDst->pDrawable->pScreen, &region);
RegionUninit(&region);
/* 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, &region);
RegionUninit(&region);
if (ret)
goto done;

View File

@ -131,10 +131,10 @@ ExaCheckCopyNtoN (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
PixmapPtr pPixmap = exaGetDrawablePixmap(pSrc);
exaGetDrawableDeltas(pSrc, pPixmap, &xoff, &yoff);
REGION_INIT(pScreen, &reg, pbox, nbox);
REGION_TRANSLATE(pScreen, &reg, xoff + dx, yoff + dy);
RegionInit(&reg, pbox, nbox);
RegionTranslate(&reg, xoff + dx, yoff + dy);
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_SRC, &reg);
REGION_UNINIT(pScreen, &reg);
RegionUninit(&reg);
} 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, &reg, pbox, nbox);
REGION_TRANSLATE(pScreen, &reg, xoff, yoff);
RegionInit(&reg, pbox, nbox);
RegionTranslate(&reg, xoff, yoff);
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_DEST, &reg);
REGION_UNINIT(pScreen, &reg);
RegionUninit(&reg);
} 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, &reg, &box, 1);
RegionInit(&reg, &box, 1);
pExaScr->prepare_access_reg(pPixmap, index, &reg);
REGION_UNINIT(pScreen, &reg);
RegionUninit(&reg);
} 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, &reg, &box, 1);
REGION_UNION(pScreen, dst, dst, &reg);
REGION_UNINIT(pScreen, &reg);
RegionInit(&reg, &box, 1);
RegionUnion(dst, dst, &reg);
RegionUninit(&reg);
if (pExaScr->SavedSourceValidate) {
swap(pExaScr, pScreen, SourceValidate);
@ -495,30 +495,30 @@ ExaPrepareCompositeReg(ScreenPtr pScreen,
Bool ret;
REGION_NULL(pScreen, &region);
RegionNull(&region);
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, &region, pDst->pDrawable->x + xoff,
RegionTranslate(&region, pDst->pDrawable->x + xoff,
pDst->pDrawable->y + yoff);
dstReg = &region;
}
@ -598,7 +598,7 @@ ExaPrepareCompositeReg(ScreenPtr pScreen,
dstReg);
pExaScr->prepare_access_reg(pDstPix, EXA_PREPARE_DEST, dstReg);
REGION_UNINIT(pScreen, &region);
RegionUninit(&region);
return TRUE;
}

View File

@ -739,7 +739,7 @@ typedef struct {
*/
#define fbWindowEnabled(pWin) \
REGION_NOTEMPTY((pWin)->drawable.pScreen, \
RegionNotEmpty(\
&(pWin)->drawable.pScreen->root->borderClip)
#define fbDrawableEnabled(pDrawable) \

View File

@ -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++)
{

View File

@ -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);

View File

@ -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;

View File

@ -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++)
{

View File

@ -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()

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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++)
{

View File

@ -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;

View File

@ -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

View File

@ -77,8 +77,8 @@ fbWalkCompositeRegion (CARD8 op,
xMask, yMask, xDst, yDst, width, height))
return;
n = REGION_NUM_RECTS (&region);
pbox = REGION_RECTS (&region);
n = RegionNumRects (&region);
pbox = RegionRects (&region);
while (n--)
{
h = pbox->y2 - pbox->y1;
@ -138,7 +138,7 @@ fbWalkCompositeRegion (CARD8 op,
}
pbox++;
}
REGION_UNINIT (pDst->pDrawable->pScreen, &region);
RegionUninit(&region);
}
void

View File

@ -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);

View File

@ -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);

View File

@ -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++)
{

View File

@ -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);

View File

@ -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)

View File

@ -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;

4
fix-patch-whitespace Executable file
View File

@ -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

38
fix-region Executable file
View File

@ -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' \
"$@"

View File

@ -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, &region, (BoxPtr) rects, num_rects);
REGION_TRANSLATE(pScreen, &region, pDraw->x, pDraw->y);
RegionInit(&region, (BoxPtr) rects, num_rects);
RegionTranslate(&region, pDraw->x, pDraw->y);
DamageRegionAppend(pDraw, &region);
/* This is wrong, this needs a seperate function. */
DamageRegionProcessPending(pDraw);
REGION_UNINIT(pDraw->pScreen, &region);
RegionUninit(&region);
__glXleaveServer(GL_FALSE);
}

View File

@ -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, &region, &box, 0);
RegionInit(&region, &box, 0);
DRI2CopyRegion(drawable->pDraw, &region,
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, &region, &box, 0);
RegionInit(&region, &box, 0);
DRI2CopyRegion(drawable->pDraw, &region,
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, &region, &box, 0);
RegionInit(&region, &box, 0);
DRI2CopyRegion(drawable->pDraw, &region,
DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft);

View File

@ -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)

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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)

View File

@ -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;

View File

@ -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);

View File

@ -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, &reg);
REGION_COPY (screen, &reg, &pair->local->clipList);
RegionNull(&reg);
RegionCopy(&reg, &pair->local->clipList);
screen->WindowExposures (pair->local, &reg, NullRegion);
REGION_UNINIT (screen, &reg);
RegionUninit(&reg);
}
#endif /* XF86DRI */

View File

@ -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],
&REGION_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,

View File

@ -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 ;

View File

@ -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

View File

@ -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:

View File

@ -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);

View File

@ -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) {

View File

@ -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;
}

View File

@ -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, &reg);
RegionNull(&reg);
pDRIPriv->nrWalked = 0;
TraverseTree(pWin, DRITreeTraversal, (pointer)(&reg));
if(REGION_NOTEMPTY(pScreen, &reg)) {
REGION_TRANSLATE(pScreen, &reg, ptOldOrg.x - pWin->drawable.x,
if(RegionNotEmpty(&reg)) {
RegionTranslate(&reg, ptOldOrg.x - pWin->drawable.x,
ptOldOrg.y - pWin->drawable.y);
REGION_INTERSECT(pScreen, &reg, &reg, prgnSrc);
RegionIntersect(&reg, &reg, prgnSrc);
/* The MoveBuffers interface is not ideal */
(*pDRIPriv->pDriverInfo->MoveBuffers)(pWin, ptOldOrg, &reg,
pDRIPriv->pDriverInfo->ddxDrawableTableEntry);
}
REGION_UNINIT(pScreen, &reg);
RegionUninit(&reg);
}
/* 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;

View File

@ -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, &region, &box, 0);
RegionInit(&region, &box, 0);
DRI2CopyRegion(pDraw, &region, 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, &region, &box, 0);
RegionInit(&region, &box, 0);
DRI2CopyRegion(pDraw, &region, 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, &region, &box, 0);
RegionInit(&region, &box, 0);
pPriv->swapsPending++;

View File

@ -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;
}

View File

@ -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;

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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 */

View File

@ -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;

View File

@ -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);
}

View File

@ -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;

View File

@ -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))

View File

@ -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;
}

View File

@ -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()

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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) {

View File

@ -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;

View File

@ -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(&region);
pbox = REGION_RECTS(&region);
nbox = RegionNumRects(&region);
pbox = RegionRects(&region);
if(!nbox)
return TRUE;
@ -298,7 +298,7 @@ XAADoComposite (
}
/* WriteBitmap sets the Sync flag */
REGION_UNINIT(pScreen, &region);
RegionUninit(&region);
return TRUE;
}
@ -340,11 +340,11 @@ XAADoComposite (
width, height))
return TRUE;
nbox = REGION_NUM_RECTS(&region);
pbox = REGION_RECTS(&region);
nbox = RegionNumRects(&region);
pbox = RegionRects(&region);
if(!nbox) {
REGION_UNINIT(pScreen, &region);
RegionUninit(&region);
return TRUE;
}
@ -355,7 +355,7 @@ XAADoComposite (
((PixmapPtr)(pMask->pDrawable))->devKind,
w, h, flags))
{
REGION_UNINIT(pScreen, &region);
RegionUninit(&region);
return FALSE;
}
@ -371,7 +371,7 @@ XAADoComposite (
}
SET_SYNC_FLAG(infoRec);
REGION_UNINIT(pScreen, &region);
RegionUninit(&region);
return TRUE;
}
} else {
@ -409,11 +409,11 @@ XAADoComposite (
width, height))
return TRUE;
nbox = REGION_NUM_RECTS(&region);
pbox = REGION_RECTS(&region);
nbox = RegionNumRects(&region);
pbox = RegionRects(&region);
if(!nbox) {
REGION_UNINIT(pScreen, &region);
RegionUninit(&region);
return TRUE;
}
@ -423,7 +423,7 @@ XAADoComposite (
((PixmapPtr)(pSrc->pDrawable))->devKind,
w, h, flags))
{
REGION_UNINIT(pScreen, &region);
RegionUninit(&region);
return FALSE;
}
@ -440,7 +440,7 @@ XAADoComposite (
}
SET_SYNC_FLAG(infoRec);
REGION_UNINIT(pScreen, &region);
RegionUninit(&region);
return TRUE;
}
@ -476,16 +476,16 @@ XAACompositeSrcCopy (PicturePtr pSrc,
width, height))
return;
nbox = REGION_NUM_RECTS(&region);
pbox = REGION_RECTS(&region);
nbox = RegionNumRects(&region);
pbox = RegionRects(&region);
if(!nbox) {
REGION_UNINIT(pScreen, &region);
RegionUninit(&region);
return;
}
pptSrc = malloc(sizeof(DDXPointRec) * nbox);
if (!pptSrc) {
REGION_UNINIT(pScreen, &region);
RegionUninit(&region);
return;
}
xoff = xSrc - xDst;
@ -502,7 +502,7 @@ XAACompositeSrcCopy (PicturePtr pSrc,
pptSrc);
free(pptSrc);
REGION_UNINIT(pScreen, &region);
RegionUninit(&region);
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 ||

View File

@ -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;

View File

@ -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)) {

View File

@ -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);

View File

@ -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;
}

View File

@ -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

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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),

View File

@ -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)

View File

@ -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);

View File

@ -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
{

View File

@ -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;

View File

@ -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)

View File

@ -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;
}

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -185,7 +185,7 @@ winSetupImageVideo (ScreenPtr pScreen)
#if 0
/* gotta uninit this someplace */
REGION_NULL(pScreen, &pPriv->clip);
RegionNull(&pPriv->clip);
#endif
#if 0

Some files were not shown because too many files have changed in this diff Show More