Commit 63f1fff8 authored by Mike Gabriel's avatar Mike Gabriel

Rename region macros to eliminate screen argument

This is 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 nx-X11/programs/Xserver tree: $ cd nx-X11/programs/Xserver && ( 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. v1: Keith Packard <keithp@keithp.com> (X.Org xserver commit: 2dc138922b7588515d5f2447e4b9dcdc0bef15e0) v2: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> (apply fix-region script to nx-libs)
parent 28ba8778
......@@ -903,9 +903,9 @@ ProcClearImageBufferArea (client)
box.y1 = clearRect.y;
box.x2 = clearRect.x + clearRect.width;
box.y2 = clearRect.y + clearRect.height;
REGION_INIT(pScreen, &region, &box, 1);
RegionInit(&region, &box, 1);
MultibufferExpose(pMultibuffer, &region);
REGION_UNINIT(pScreen, &region);
RegionUninit(&region);
}
return Success;
}
......@@ -1202,13 +1202,13 @@ PerformDisplayRequest (ppMultibuffers, pMultibuffer, nbuf)
* window-relative so that region ops involving
* pExposed and pWinSize behave sensibly.
*/
REGION_TRANSLATE(pWin->drawable.pScreen, pWinSize,
RegionTranslate(pWinSize,
-pWin->drawable.x, -pWin->drawable.y);
REGION_INTERSECT(pWin->drawable.pScreen, pExposed,
RegionIntersect(pExposed,
pExposed, pWinSize);
REGION_DESTROY(pWin->drawable.pScreen, pWinSize);
RegionDestroy(pWinSize);
MultibufferExpose (pPrevMultibuffer, pExposed);
REGION_DESTROY(pWin->drawable.pScreen, pExposed);
RegionDestroy(pExposed);
}
graphicsExpose = FALSE;
DoChangeGC (pGC, GCGraphicsExposures, &graphicsExpose, FALSE);
......@@ -1371,7 +1371,7 @@ MultibufferExpose (pMultibuffer, pRegion)
MultibufferPtr pMultibuffer;
RegionPtr pRegion;
{
if (pRegion && !REGION_NIL(pRegion))
if (pRegion && !RegionNil(pRegion))
{
xEvent *pEvent;
PixmapPtr pPixmap;
......@@ -1381,11 +1381,11 @@ MultibufferExpose (pMultibuffer, pRegion)
int numRects;
pPixmap = pMultibuffer->pPixmap;
REGION_TRANSLATE(pPixmap->drawable.pScreen, pRegion,
RegionTranslate(pRegion,
-pPixmap->drawable.x, -pPixmap->drawable.y);
/* XXX MultibufferExpose "knows" the region representation */
numRects = REGION_NUM_RECTS(pRegion);
pBox = REGION_RECTS(pRegion);
numRects = RegionNumRects(pRegion);
pBox = RegionRects(pRegion);
pEvent = (xEvent *) ALLOCATE_LOCAL(numRects * sizeof(xEvent));
if (pEvent) {
......
......@@ -245,9 +245,9 @@ bufMultibufferInit(pScreen, pMBScreen)
box.y2 = pScreen->height;
pMBPriv->rgnChanged = TRUE;
REGION_INIT(pScreen, &pMBPriv->backBuffer, &box, 1);
REGION_INIT(pScreen, &pMBPriv->subtractRgn, &box, 1);
REGION_NULL(pScreen, &pMBPriv->unionRgn);
RegionInit(&pMBPriv->backBuffer, &box, 1);
RegionInit(&pMBPriv->subtractRgn, &box, 1);
RegionNull(&pMBPriv->unionRgn);
/* Misc functions */
pMBPriv->CopyBufferBits = bufCopyBufferBitsFunc[pScreen->myNum];
......@@ -374,10 +374,10 @@ bufCreateImageBuffers (pWin, nbuf, ids, action, hint)
pMBScreen = MB_SCREEN_PRIV(pScreen);
pMBWindow = MB_WINDOW_PRIV(pWin);
pMBWindow->devPrivate.ptr = (void *) REGION_CREATE(pScreen, 0,0);
pMBWindow->devPrivate.ptr = (void *) RegionCreate(0,0);
if (!pMBWindow->devPrivate.ptr)
return(0);
REGION_COPY(pScreen, (RegionPtr) pMBWindow->devPrivate.ptr,
RegionCopy((RegionPtr) pMBWindow->devPrivate.ptr,
&pWin->clipList);
for (i = 0; i < nbuf; i++)
......@@ -429,7 +429,7 @@ bufDestroyImageBuffers(pWin)
if (pWin->realized && (pMBWindow->displayedMultibuffer == BACK_BUFFER))
{
(* pMBPriv->CopyBufferBits)(pMBWindow, BACK_BUFFER, FRONT_BUFFER);
REGION_SUBTRACT(pScreen, &pMBPriv->backBuffer,
RegionSubtract(&pMBPriv->backBuffer,
&pMBPriv->backBuffer, &pWin->clipList);
(* pMBPriv->DrawSelectPlane)(pScreen, pMBPriv->selectPlane,
&pWin->clipList, FRONT_BUFFER);
......@@ -439,7 +439,7 @@ bufDestroyImageBuffers(pWin)
pWin->devPrivates[frameWindowPrivateIndex] =
pMBPriv->frameBuffer[FRONT_BUFFER];
REGION_DESTROY(pScreen, (RegionPtr) pMBWindow->devPrivate.ptr);
RegionDestroy((RegionPtr) pMBWindow->devPrivate.ptr);
pMBWindow->devPrivate.ptr = NULL;
}
}
......@@ -506,7 +506,7 @@ bufClearImageBufferArea(pMBBuffer, x,y, w,h, generateExposures)
box.y2 = y2;
pScreen = pBuffer->drawable.pScreen;
REGION_INIT(pScreen, &reg, &box, 1);
RegionInit(&reg, &box, 1);
if (pBuffer->backStorage)
{
/*
......@@ -520,7 +520,7 @@ bufClearImageBufferArea(pMBBuffer, x,y, w,h, generateExposures)
generateExposures);
}
REGION_INTERSECT(pScreen, &reg, &reg, &pBuffer->clipList);
RegionIntersect(&reg, &reg, &pBuffer->clipList);
if (pBuffer->backgroundState != None)
(*pScreen->PaintWindowBackground)(pBuffer, &reg, PW_BACKGROUND);
if (generateExposures)
......@@ -537,9 +537,9 @@ bufClearImageBufferArea(pMBBuffer, x,y, w,h, generateExposures)
else if (pBuffer->backgroundState != None)
(*pScreen->PaintWindowBackground)(pBuffer, &reg, PW_BACKGROUND);
#endif
REGION_UNINIT(pScreen, &reg);
RegionUninit(&reg);
if (pBSReg)
REGION_DESTROY(pScreen, pBSReg);
RegionDestroy(pBSReg);
}
static void
......@@ -567,9 +567,9 @@ bufResetProc(pScreen)
* whoever called RegisterDoubleBufferHardware
*/
REGION_UNINIT(pScreen, &pMBPriv->backBuffer);
REGION_UNINIT(pScreen, &pMBPriv->subtractRgn);
REGION_UNINIT(pScreen, &pMBPriv->unionRgn);
RegionUninit(&pMBPriv->backBuffer);
RegionUninit(&pMBPriv->subtractRgn);
RegionUninit(&pMBPriv->unionRgn);
xfree(pMBPriv);
}
......@@ -624,7 +624,7 @@ bufDrawSelectPlane(pScreen, selectPlane, prgn, bufferNum)
int numRects;
XID value;
if (REGION_NUM_RECTS(prgn) == 0)
if (RegionNumRects(prgn) == 0)
return;
pDrawable = (DrawablePtr) selectPlane.ptr;
......@@ -632,7 +632,7 @@ bufDrawSelectPlane(pScreen, selectPlane, prgn, bufferNum)
if (!pGC)
return;
prect = (xRectangle *)ALLOCATE_LOCAL(REGION_NUM_RECTS(prgn) *
prect = (xRectangle *)ALLOCATE_LOCAL(RegionNumRects(prgn) *
sizeof(xRectangle));
if (!prect)
{
......@@ -644,8 +644,8 @@ bufDrawSelectPlane(pScreen, selectPlane, prgn, bufferNum)
DoChangeGC(pGC, GCForeground, &value, 0);
ValidateGC(pDrawable, pGC);
numRects = REGION_NUM_RECTS(prgn);
pbox = REGION_RECTS(prgn);
numRects = RegionNumRects(prgn);
pbox = RegionRects(prgn);
for (i= numRects; --i >= 0; pbox++, prect++)
{
prect->x = pbox->x1;
......@@ -697,10 +697,10 @@ bufDisplayImageBuffers(pScreen, ppMBWindow, ppMBBuffer, nbuf)
&pWin->clipList, number);
if (number == BACK_BUFFER)
REGION_UNION(pScreen, backBuffer, backBuffer,
RegionUnion(backBuffer, backBuffer,
&pWin->clipList);
else
REGION_SUBTRACT(pScreen, backBuffer, backBuffer,
RegionSubtract(backBuffer, backBuffer,
&pWin->clipList);
/* Switch which framebuffer the window draws into */
......@@ -764,36 +764,36 @@ bufPostValidateTree(pParent, pChild, kind)
pSubtractRgn = &pMBPriv->subtractRgn;
pUnionRgn = &pMBPriv->unionRgn;
REGION_VALIDATE(pScreen, pSubtractRgn, &overlap);
RegionValidate(pSubtractRgn, &overlap);
#ifdef DEBUG
if (overlap)
FatalError("bufPostValidateTree: subtractRgn overlaps");
#endif
REGION_VALIDATE(pScreen, pUnionRgn, &overlap);
RegionValidate(pUnionRgn, &overlap);
#ifdef DEBUG
if (overlap)
FatalError("bufPostValidateTree: unionRgn overlaps");
#endif
/* Update backBuffer: subtract must come before union */
REGION_SUBTRACT(pScreen, &pMBPriv->backBuffer, &pMBPriv->backBuffer,
RegionSubtract(&pMBPriv->backBuffer, &pMBPriv->backBuffer,
pSubtractRgn);
REGION_UNION(pScreen, &pMBPriv->backBuffer, &pMBPriv->backBuffer,
RegionUnion(&pMBPriv->backBuffer, &pMBPriv->backBuffer,
pUnionRgn);
/* Paint gained and lost backbuffer areas in select plane */
REGION_NULL(pScreen, &exposed);
REGION_SUBTRACT(pScreen, &exposed, pSubtractRgn, pUnionRgn);
RegionNull(&exposed);
RegionSubtract(&exposed, pSubtractRgn, pUnionRgn);
(* pMBPriv->DrawSelectPlane)(pScreen, pMBPriv->selectPlane,
&exposed, FRONT_BUFFER);
REGION_SUBTRACT(pScreen, &exposed, pUnionRgn, pSubtractRgn);
RegionSubtract(&exposed, pUnionRgn, pSubtractRgn);
(* pMBPriv->DrawSelectPlane)(pScreen, pMBPriv->selectPlane,
&exposed, BACK_BUFFER);
REGION_UNINIT(pScreen, &exposed);
REGION_EMPTY(pScreen, pSubtractRgn);
REGION_EMPTY(pScreen, pUnionRgn);
RegionUninit(&exposed);
RegionEmpty(pSubtractRgn);
RegionEmpty(pUnionRgn);
}
}
......@@ -826,16 +826,16 @@ bufClipNotify(pWin, dx,dy)
{
RegionPtr pOldClipList = (RegionPtr) pMBWindow->devPrivate.ptr;
if (! REGION_EQUAL(pScreen, pOldClipList, &pWin->clipList))
if (! RegionEqual(pOldClipList, &pWin->clipList))
{
if (pMBWindow->displayedMultibuffer == BACK_BUFFER)
{
pMBPriv->rgnChanged = TRUE;
REGION_APPEND(pScreen, &pMBPriv->subtractRgn, pOldClipList);
REGION_APPEND(pScreen, &pMBPriv->unionRgn, &pWin->clipList);
RegionAppend(&pMBPriv->subtractRgn, pOldClipList);
RegionAppend(&pMBPriv->unionRgn, &pWin->clipList);
}
REGION_COPY(pScreen, pOldClipList,&pWin->clipList);
RegionCopy(pOldClipList,&pWin->clipList);
}
/* Update buffer x,y,w,h, and clipList */
......@@ -912,13 +912,13 @@ bufWindowExposures(pWin, prgn, other_exposed)
handleBuffers = (!pMBPriv->inClearToBackground) &&
(pWin->drawable.type == DRAWABLE_WINDOW) &&
pMBWindow && (prgn && !REGION_NIL(prgn));
pMBWindow && (prgn && !RegionNil(prgn));
/* miWindowExposures munges prgn and other_exposed. */
if (handleBuffers)
{
REGION_NULL(pScreen, &tmp_rgn);
REGION_COPY(pScreen, &tmp_rgn, prgn);
RegionNull(&tmp_rgn);
RegionCopy(&tmp_rgn, prgn);
}
UNWRAP_SCREEN_FUNC(pScreen, pMBPriv, void, WindowExposures);
......@@ -950,7 +950,7 @@ bufWindowExposures(pWin, prgn, other_exposed)
MultibufferExpose(pMBBuffer, &tmp_rgn);
}
REGION_UNINIT(pScreen, &tmp_rgn);
RegionUninit(&tmp_rgn);
}
/*
......@@ -1018,7 +1018,7 @@ bufCopyWindow(pWin, ptOldOrg, prgnSrc)
*/
/* CopyWindow translates prgnSrc... translate it back for 2nd call. */
REGION_TRANSLATE(pScreen, prgnSrc,
RegionTranslate(prgnSrc,
ptOldOrg.x - pWin->drawable.x,
ptOldOrg.y - pWin->drawable.y);
pwinroot->devPrivates[frameWindowPrivateIndex] =
......
......@@ -262,8 +262,8 @@ MultibufferPaintBackgroundRegion(pWin, pDrawable, pRegion)
RegionPtr pRegion;
{
xRectangle *pRects;
int nrects = REGION_NUM_RECTS(pRegion);
BoxPtr pbox = REGION_RECTS(pRegion);
int nrects = RegionNumRects(pRegion);
BoxPtr pbox = RegionRects(pRegion);
pRects = (xRectangle *)ALLOCATE_LOCAL(nrects * sizeof(xRectangle));
if (pRects)
......@@ -390,13 +390,13 @@ pixDisplayImageBuffers(pScreen, ppMBWindow, ppMBBuffer, nbuf)
* window-relative so that region ops involving
* pExposed and pWinSize behave sensibly.
*/
REGION_TRANSLATE(pScreen, pWinSize,
RegionTranslate(pWinSize,
-pWin->drawable.x,
-pWin->drawable.y);
REGION_INTERSECT(pScreen, pExposed, pExposed, pWinSize);
REGION_DESTROY(pScreen, pWinSize);
RegionIntersect(pExposed, pExposed, pWinSize);
RegionDestroy(pWinSize);
MultibufferExpose (pPrevMBBuffer, pExposed);
REGION_DESTROY(pScreen, pExposed);
RegionDestroy(pExposed);
}
bool = FALSE;
DoChangeGC (pGC, GCGraphicsExposures, &bool, FALSE);
......@@ -522,7 +522,7 @@ pixPositionWindow (pWin, x, y)
box.x1 = box.y1 = 0;
box.x2 = width;
box.y2 = height;
REGION_INIT(pScreen, &exposedRegion, &box, 1);
RegionInit(&exposedRegion, &box, 1);
if (pWin->bitGravity != ForgetGravity)
{
RegionRec preservedRegion;
......@@ -530,9 +530,9 @@ pixPositionWindow (pWin, x, y)
box.y1 = desty;
box.x2 = destx + savewidth;
box.y2 = desty + saveheight;
REGION_INIT(pScreen, &preservedRegion, &box, 1);
REGION_SUBTRACT(pScreen, &exposedRegion, &exposedRegion, &preservedRegion);
REGION_UNINIT(pScreen, &preservedRegion);
RegionInit(&preservedRegion, &box, 1);
RegionSubtract(&exposedRegion, &exposedRegion, &preservedRegion);
RegionUninit(&preservedRegion);
}
} /* end if (clear) */
......@@ -575,7 +575,7 @@ pixPositionWindow (pWin, x, y)
}
FreeScratchGC (pGC);
if (clear)
REGION_UNINIT(pScreen, &exposedRegion);
RegionUninit(&exposedRegion);
return TRUE;
}
......@@ -628,7 +628,7 @@ pixClearImageBufferArea(pMBBuffer, x,y, width,height, exposures)
if (box.x2 > w_width) box.x2 = w_width;
if (box.y2 > w_height) box.y2 = w_height;
REGION_INIT(pScreen, &region, &box, 1);
RegionInit(&region, &box, 1);
if (pMBBuffer->number == pMBBuffer->pMBWindow->displayedMultibuffer)
pDrawable = (DrawablePtr) pWin;
......@@ -640,7 +640,7 @@ pixClearImageBufferArea(pMBBuffer, x,y, width,height, exposures)
if (exposures)
MultibufferExpose(pMBBuffer, &region);
REGION_UNINIT(pScreen, &region);
RegionUninit(&region);
}
static void
......
......@@ -161,9 +161,9 @@ XineramaCloseScreen (int i, ScreenPtr pScreen)
pScreen->CloseScreen = pScreenPriv->CloseScreen;
pScreen->CreateGC = pScreenPriv->CreateGC;
REGION_UNINIT(pScreen, &XineramaScreenRegions[pScreen->myNum]);
RegionUninit(&XineramaScreenRegions[pScreen->myNum]);
if (pScreen->myNum == 0)
REGION_UNINIT(pScreen, &PanoramiXScreenRegion);
RegionUninit(&PanoramiXScreenRegion);
xfree ((void *) pScreenPriv);
......@@ -434,7 +434,7 @@ static void XineramaInitData(ScreenPtr pScreen)
{
int i, w, h;
REGION_NULL(pScreen, &PanoramiXScreenRegion)
RegionNull(&PanoramiXScreenRegion);
for (i = 0; i < PanoramiXNumScreens; i++) {
BoxRec TheBox;
......@@ -450,8 +450,8 @@ static void XineramaInitData(ScreenPtr pScreen)
TheBox.y1 = panoramiXdataPtr[i].y;
TheBox.y2 = TheBox.y1 + panoramiXdataPtr[i].height;
REGION_INIT(pScreen, &XineramaScreenRegions[i], &TheBox, 1);
REGION_UNION(pScreen, &PanoramiXScreenRegion, &PanoramiXScreenRegion,
RegionInit(&XineramaScreenRegions[i], &TheBox, 1);
RegionUnion(&PanoramiXScreenRegion, &PanoramiXScreenRegion,
&XineramaScreenRegions[i]);
}
......@@ -473,9 +473,9 @@ void XineramaReinitData(ScreenPtr pScreen)
{
int i;
REGION_UNINIT(pScreen, &PanoramiXScreenRegion);
RegionUninit(&PanoramiXScreenRegion);
for (i = 0; i < PanoramiXNumScreens; i++)
REGION_UNINIT(pScreen, &XineramaScreenRegions[i]);
RegionUninit(&XineramaScreenRegions[i]);
XineramaInitData(pScreen);
}
......@@ -1182,15 +1182,15 @@ 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;
for(i = 0; i < PanoramiXNumScreens; i++) {
pDraw = pDrawables[i];
inOut = RECT_IN_REGION(pScreen,&XineramaScreenRegions[i],&SrcBox);
inOut = RegionContainsRect(&XineramaScreenRegions[i],&SrcBox);
if(inOut == rgnIN) {
(*pDraw->pScreen->GetImage)(pDraw,
......@@ -1201,13 +1201,13 @@ XineramaGetImageData(
} else if (inOut == rgnOUT)
continue;
REGION_INTERSECT(pScreen, &GrabRegion, &SrcRegion,
RegionIntersect(&GrabRegion, &SrcRegion,
&XineramaScreenRegions[i]);
nbox = REGION_NUM_RECTS(&GrabRegion);
nbox = RegionNumRects(&GrabRegion);
if(nbox) {
pbox = REGION_RECTS(&GrabRegion);
pbox = RegionRects(&GrabRegion);
while(nbox--) {
w = pbox->x2 - pbox->x1;
......@@ -1284,8 +1284,8 @@ XineramaGetImageData(
pbox++;
}
REGION_SUBTRACT(pScreen, &SrcRegion, &SrcRegion, &GrabRegion);
if(!REGION_NOTEMPTY(pScreen, &SrcRegion))
RegionSubtract(&SrcRegion, &SrcRegion, &GrabRegion);
if(!RegionNotEmpty(&SrcRegion))
break;
}
......@@ -1294,6 +1294,6 @@ XineramaGetImageData(
if(ScratchMem)
xfree(ScratchMem);
REGION_UNINIT(pScreen, &SrcRegion);
REGION_UNINIT(pScreen, &GrabRegion);
RegionUninit(&SrcRegion);
RegionUninit(&GrabRegion);
}
......@@ -621,7 +621,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))
......@@ -1109,21 +1109,21 @@ int PanoramiXCopyArea(ClientPtr client)
RegionRec totalReg;
Bool overlap;
REGION_NULL(pScreen, &totalReg);
RegionNull(&totalReg);
FOR_NSCREENS_BACKWARD(j) {
if(pRgn[j]) {
if(srcIsRoot) {
REGION_TRANSLATE(pScreen, pRgn[j],
RegionTranslate(pRgn[j],
panoramiXdataPtr[j].x, panoramiXdataPtr[j].y);
}
REGION_APPEND(pScreen, &totalReg, pRgn[j]);
REGION_DESTROY(pScreen, pRgn[j]);
RegionAppend(&totalReg, pRgn[j]);
RegionDestroy(pRgn[j]);
}
}
REGION_VALIDATE(pScreen, &totalReg, &overlap);
RegionValidate(&totalReg, &overlap);
(*pScreen->SendGraphicsExpose)(
client, &totalReg, stuff->dstDrawable, X_CopyArea, 0);
REGION_UNINIT(pScreen, &totalReg);
RegionUninit(&totalReg);
}
result = client->noClientException;
......@@ -1220,17 +1220,17 @@ int PanoramiXCopyPlane(ClientPtr client)
RegionRec totalReg;
Bool overlap;
REGION_NULL(pScreen, &totalReg);
RegionNull(&totalReg);
FOR_NSCREENS_BACKWARD(j) {
if(pRgn[j]) {
REGION_APPEND(pScreen, &totalReg, pRgn[j]);
REGION_DESTROY(pScreen, pRgn[j]);
RegionAppend(&totalReg, pRgn[j]);
RegionDestroy(pRgn[j]);
}
}
REGION_VALIDATE(pScreen, &totalReg, &overlap);
RegionValidate(&totalReg, &overlap);
(*pScreen->SendGraphicsExpose)(
client, &totalReg, stuff->dstDrawable, X_CopyPlane, 0);
REGION_UNINIT(pScreen, &totalReg);
RegionUninit(&totalReg);
}
return (client->noClientException);
......
......@@ -1400,12 +1400,12 @@ SecurityCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h,
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;
......@@ -1425,7 +1425,7 @@ SecurityCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h,
failed = TRUE;
goto failSafe;
}
for (pBox = REGION_RECTS(&censorRegion), i = 0;
for (pBox = RegionRects(&censorRegion), i = 0;
i < nRects;
i++, pBox++)
{
......@@ -1475,8 +1475,8 @@ SecurityCensorImage(client, pVisibleRegion, widthBytesLine, pDraw, x, y, w, h,
if (pScratchGC) FreeScratchGC(pScratchGC);
if (pPix) FreeScratchPixmapHeader(pPix);
}
REGION_UNINIT(pScreen, &imageRegion);
REGION_UNINIT(pScreen, &censorRegion);
RegionUninit(&imageRegion);
RegionUninit(&censorRegion);
} /* SecurityCensorImage */
/**********************************************************************/
......
......@@ -186,11 +186,11 @@ RegionOperate (client, pWin, kind, destRgnp, srcRgn, op, xoff, yoff, create)
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;
}
......@@ -201,7 +201,7 @@ RegionOperate (client, pWin, kind, destRgnp, srcRgn, op, xoff, yoff, create)
*/
if (srcRgn == NULL) {
if (*destRgnp != NULL) {
REGION_DESTROY (pScreen, *destRgnp);
RegionDestroy(*destRgnp);
*destRgnp = 0;
/* go on to remove shape and generate ShapeNotify */
}
......@@ -220,17 +220,17 @@ RegionOperate (client, pWin, kind, destRgnp, srcRgn, op, xoff, yoff, create)
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;
......@@ -239,20 +239,20 @@ RegionOperate (client, pWin, kind, destRgnp, srcRgn, op, xoff, yoff, create)
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);
SendShapeNotify (pWin, kind);
return Success;
......@@ -268,7 +268,7 @@ CreateBoundingShape (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
......@@ -281,7 +281,7 @@ CreateClipShape (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
......@@ -360,7 +360,7 @@ ProcShapeRectangles (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);
......@@ -455,7 +455,7 @@ ProcShapeMask (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;
}
......@@ -581,8 +581,8 @@ ProcShapeCombine (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);
......@@ -673,7 +673,7 @@ ProcShapeOffset (client)
pScreen = pWin->drawable.pScreen;
if (srcRgn)
{
REGION_TRANSLATE(pScreen, srcRgn, stuff->xOff, stuff->yOff);
RegionTranslate(srcRgn, stuff->xOff, stuff->yOff);
(*pScreen->SetShape) (pWin);
}
SendShapeNotify (pWin, (int)stuff->destKind);
......@@ -729,7 +729,7 @@ ProcShapeQueryExtents (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);
......@@ -743,7 +743,7 @@ ProcShapeQueryExtents (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;
......@@ -932,7 +932,7 @@ SendShapeNotify (pWin, 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);
......@@ -945,7 +945,7 @@ SendShapeNotify (pWin, which)
case ShapeClip:
region = wClipShape(pWin);
if (region) {
extents = *REGION_EXTENTS(pWin->drawable.pScreen, region);
extents = *RegionExtents(region);
shaped = xTrue;
} else {
extents.x1 = 0;
......@@ -958,7 +958,7 @@ SendShapeNotify (pWin, 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);
......@@ -1087,8 +1087,8 @@ ProcShapeGetRectangles (client)
}
} else {
BoxPtr box;
nrects = REGION_NUM_RECTS(region);
box = REGION_RECTS(region);
nrects = RegionNumRects(region);
box = RegionRects(region);
rects = (xRectangle *) ALLOCATE_LOCAL (nrects * sizeof (xRectangle));
if (!rects && nrects)
return BadAlloc;
......
......@@ -402,11 +402,11 @@ ProcXTestFakeInput(client)
int i;
int x = ev->u.keyButtonPointer.rootX + panoramiXdataPtr[0].x;
int y = ev->u.keyButtonPointer.rootY + panoramiXdataPtr[0].y;
if (!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum],
if (!RegionContainsPoint(&XineramaScreenRegions[pScreen->myNum],
x, y, &box)) {
FOR_NSCREENS(i) {
if (i == pScreen->myNum) continue;
if (POINT_IN_REGION(pScreen,
if (RegionContainsPoint(
&XineramaScreenRegions[i],
x, y, &box)) {
root = WindowTable[i];
......
......@@ -103,7 +103,7 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update)
if (wasMapped)
UnmapWindow (pWin, FALSE);
REGION_NULL (pScreen, &cw->borderClip);
RegionNull(&cw->borderClip);
cw->update = CompositeRedirectAutomatic;
cw->clients = 0;
cw->oldx = COMP_ORIGIN_INVALID;
......@@ -177,7 +177,7 @@ compFreeClientWindow (WindowPtr pWin, XID id)
if (cw->damage)
DamageDestroy (cw->damage);
REGION_UNINIT (pScreen, &cw->borderClip);
RegionUninit(&cw->borderClip);
pWin->devPrivates[CompWindowPrivateIndex].ptr = 0;
xfree (cw);
......@@ -503,7 +503,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 = FALSE;
......
......@@ -201,7 +201,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, (void *) pRegion))
return BadAlloc;
......
......@@ -79,10 +79,10 @@ compRepaintBorder (ClientPtr pClient, void * closure)
{
RegionRec exposed;
REGION_NULL(pScreen, &exposed);
REGION_SUBTRACT(pScreen, &exposed, &pWindow->borderClip, &pWindow->winSize);
RegionNull(&exposed);
RegionSubtract(&exposed, &pWindow->borderClip, &pWindow->winSize);
(*pWindow->drawable.pScreen->PaintWindowBorder)(pWindow, &exposed, PW_BORDER);
REGION_UNINIT(pScreen, &exposed);
RegionUninit(&exposed);
}
return TRUE;
}
......@@ -245,7 +245,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;
......@@ -492,14 +492,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;
......@@ -507,8 +507,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--)
......@@ -536,16 +536,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);
DamageDamageRegion (&pWin->drawable, prgnSrc);
......@@ -613,26 +613,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
*/
DamageDamageRegion (&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;
}
......@@ -694,18 +694,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);
/*
......
......@@ -99,10 +99,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);
}
}
......
......@@ -1266,11 +1266,11 @@ ProcTranslateCoords(register 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))
......@@ -1758,7 +1758,7 @@ ProcCopyArea(register ClientPtr client)
(*pDst->pScreen->SendGraphicsExpose)
(client, pRgn, stuff->dstDrawable, X_CopyArea, 0);
if (pRgn)
REGION_DESTROY(pDst->pScreen, pRgn);
RegionDestroy(pRgn);
}
return(client->noClientException);
......@@ -1806,7 +1806,7 @@ ProcCopyPlane(register ClientPtr client)
(*pdstDraw->pScreen->SendGraphicsExpose)
(client, pRgn, stuff->dstDrawable, X_CopyPlane, 0);
if (pRgn)
REGION_DESTROY(pdstDraw->pScreen, pRgn);
RegionDestroy(pRgn);
}
return(client->noClientException);
}
......@@ -2228,7 +2228,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable,
pVisibleRegion = NotClippedByChildren((WindowPtr)pDraw);
if (pVisibleRegion)
{
REGION_TRANSLATE(pDraw->pScreen, pVisibleRegion, -pDraw->x, -pDraw->y);
RegionTranslate(pVisibleRegion, -pDraw->x, -pDraw->y);
}
}
#endif
......@@ -2322,7 +2322,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable,
}
#ifdef XCSECURITY
if (pVisibleRegion)
REGION_DESTROY(pDraw->pScreen, pVisibleRegion);
RegionDestroy(pVisibleRegion);
#endif
if (!im_return)
DEALLOCATE_LOCAL(pBuf);
......
......@@ -346,14 +346,14 @@ XineramaSetCursorPosition(
x += panoramiXdataPtr[0].x;
y += panoramiXdataPtr[0].y;
if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum],
if(!RegionContainsPoint(&XineramaScreenRegions[pScreen->myNum],
x, y, &box))
{
FOR_NSCREENS(i)
{
if(i == pScreen->myNum)
continue;
if(POINT_IN_REGION(pScreen, &XineramaScreenRegions[i], x, y, &box))
if(RegionContainsPoint(&XineramaScreenRegions[i], x, y, &box))
{
pScreen = screenInfo.screens[i];
break;
......@@ -483,7 +483,7 @@ XineramaCheckVirtualMotion(
i = PanoramiXNumScreens - 1;
REGION_COPY(sprite.screen, &sprite.Reg2,
RegionCopy(&sprite.Reg2,
&sprite.windows[i]->borderSize);
off_x = panoramiXdataPtr[i].x;
off_y = panoramiXdataPtr[i].y;
......@@ -493,16 +493,16 @@ XineramaCheckVirtualMotion(
y = off_y - panoramiXdataPtr[i].y;
if(x || y)
REGION_TRANSLATE(sprite.screen, &sprite.Reg2, x, y);
RegionTranslate(&sprite.Reg2, x, y);
REGION_UNION(sprite.screen, &sprite.Reg2, &sprite.Reg2,
RegionUnion(&sprite.Reg2, &sprite.Reg2,
&sprite.windows[i]->borderSize);
off_x = panoramiXdataPtr[i].x;
off_y = panoramiXdataPtr[i].y;
}
lims = *REGION_EXTENTS(sprite.screen, &sprite.Reg2);
lims = *RegionExtents(&sprite.Reg2);
if (sprite.hot.x < lims.x1)
#ifdef XEVIE
......@@ -525,7 +525,7 @@ XineramaCheckVirtualMotion(
#endif
sprite.hot.y = lims.y2 - 1;
if (REGION_NUM_RECTS(&sprite.Reg2) > 1)
if (RegionNumRects(&sprite.Reg2) > 1)
ConfineToShape(&sprite.Reg2, &sprite.hot.x, &sprite.hot.y);
if (qe)
......@@ -632,7 +632,7 @@ XineramaConfineCursorToWindow(WindowPtr pWin, Bool generateEvents)
i = PanoramiXNumScreens - 1;
REGION_COPY(sprite.screen, &sprite.Reg1,
RegionCopy(&sprite.Reg1,
&sprite.windows[i]->borderSize);
off_x = panoramiXdataPtr[i].x;
off_y = panoramiXdataPtr[i].y;
......@@ -642,18 +642,18 @@ XineramaConfineCursorToWindow(WindowPtr pWin, Bool generateEvents)
y = off_y - panoramiXdataPtr[i].y;
if(x || y)
REGION_TRANSLATE(sprite.screen, &sprite.Reg1, x, y);
RegionTranslate(&sprite.Reg1, x, y);
REGION_UNION(sprite.screen, &sprite.Reg1, &sprite.Reg1,
RegionUnion(&sprite.Reg1, &sprite.Reg1,
&sprite.windows[i]->borderSize);
off_x = panoramiXdataPtr[i].x;
off_y = panoramiXdataPtr[i].y;
}
sprite.hotLimits = *REGION_EXTENTS(sprite.screen, &sprite.Reg1);
sprite.hotLimits = *RegionExtents(&sprite.Reg1);
if(REGION_NUM_RECTS(&sprite.Reg1) > 1)
if(RegionNumRects(&sprite.Reg1) > 1)
sprite.hotShape = &sprite.Reg1;
else
sprite.hotShape = NullRegion;
......@@ -732,9 +732,9 @@ ConfineToShape(RegionPtr shape, int *px, int *py)
int x = *px, y = *py;
int incx = 1, incy = 1;
if (POINT_IN_REGION(sprite.hot.pScreen, shape, x, y, &box))
if (RegionContainsPoint(shape, x, y, &box))
return;
box = *REGION_EXTENTS(sprite.hot.pScreen, shape);
box = *RegionExtents(shape);
/* this is rather crude */
do {
x += incx;
......@@ -756,7 +756,7 @@ ConfineToShape(RegionPtr shape, int *px, int *py)
else if (y < box.y1)
return; /* should never get here! */
}
} while (!POINT_IN_REGION(sprite.hot.pScreen, shape, x, y, &box));
} while (!RegionContainsPoint(shape, x, y, &box));
*px = x;
*py = y;
}
......@@ -844,7 +844,7 @@ CheckVirtualMotion(
#endif
sprite.hot.x = sprite.hot.y = 0;
}
lims = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin->borderSize);
lims = *RegionExtents(&pWin->borderSize);
if (sprite.hot.x < lims.x1)
#ifdef XEVIE
xeviehot.x =
......@@ -898,7 +898,7 @@ ConfineCursorToWindow(WindowPtr pWin, Bool generateEvents, Bool confineToScreen)
}
else
{
sprite.hotLimits = *REGION_EXTENTS( pScreen, &pWin->borderSize);
sprite.hotLimits = *RegionExtents(&pWin->borderSize);
#ifdef SHAPE
sprite.hotShape = wBoundingShape(pWin) ? &pWin->borderSize
: NullRegion;
......@@ -1972,7 +1972,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
......@@ -1980,7 +1980,7 @@ PointInBorderSize(WindowPtr pWin, int x, int y)
int i;
for(i = 1; i < PanoramiXNumScreens; i++) {
if(POINT_IN_REGION(sprite.screen,
if(RegionContainsPoint(
&sprite.windows[i]->borderSize,
x + panoramiXdataPtr[0].x - panoramiXdataPtr[i].x,
y + panoramiXdataPtr[0].y - panoramiXdataPtr[i].y,
......@@ -2016,7 +2016,7 @@ XYToWindow(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))
......@@ -2156,10 +2156,10 @@ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff)
sprite.hotLimits.x2 -= xoff;
sprite.hotLimits.y2 -= yoff;
if (REGION_NOTEMPTY(sprite.screen, &sprite.Reg1))
REGION_TRANSLATE(sprite.screen, &sprite.Reg1, xoff, yoff);
if (REGION_NOTEMPTY(sprite.screen, &sprite.Reg2))
REGION_TRANSLATE(sprite.screen, &sprite.Reg2, xoff, yoff);
if (RegionNotEmpty(&sprite.Reg1))
RegionTranslate(&sprite.Reg1, xoff, yoff);
if (RegionNotEmpty(&sprite.Reg2))
RegionTranslate(&sprite.Reg2, xoff, yoff);
/* FIXME: if we call ConfineCursorToWindow, must we do anything else? */
if ((grab = inputInfo.pointer->grab) && grab->confineTo) {
......@@ -2211,8 +2211,8 @@ DefineInitialRootWindow(register WindowPtr win)
#endif
sprite.screen = pScreen;
/* gotta UNINIT these someplace */
REGION_NULL(pScreen, &sprite.Reg1);
REGION_NULL(pScreen, &sprite.Reg2);
RegionNull(&sprite.Reg1);
RegionNull(&sprite.Reg2);
}
#endif
}
......@@ -2278,7 +2278,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(pWin)) return FALSE;
......@@ -2292,9 +2292,9 @@ XineramaPointInWindowIsVisible(
x = xoff - panoramiXdataPtr[i].x;
y = yoff - panoramiXdataPtr[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)))
......@@ -2470,7 +2470,7 @@ ProcWarpPointer(ClientPtr client)
static Bool
BorderSizeNotEmpty(WindowPtr pWin)
{
if(REGION_NOTEMPTY(sprite.hotPhys.pScreen, &pWin->borderSize))
if(RegionNotEmpty(&pWin->borderSize))
return TRUE;
#ifdef PANORAMIX
......@@ -2478,7 +2478,7 @@ BorderSizeNotEmpty(WindowPtr pWin)
int i;
for(i = 1; i < PanoramiXNumScreens; i++) {
if(REGION_NOTEMPTY(sprite.screen, &sprite.windows[i]->borderSize))
if(RegionNotEmpty(&sprite.windows[i]->borderSize))
return TRUE;
}
}
......
......@@ -703,7 +703,7 @@ typedef struct {
*/
#define fbWindowEnabled(pWin) \
REGION_NOTEMPTY((pWin)->drawable.pScreen, \
RegionNotEmpty(\
&WindowTable[(pWin)->drawable.pScreen->myNum]->borderClip)
#define fbDrawableEnabled(pDrawable) \
......
......@@ -338,8 +338,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)
......@@ -400,8 +400,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++)
{
......
......@@ -101,7 +101,7 @@ fbPolyArc (DrawablePtr pDrawable,
y2 = box.y1 + (int)parcs->height + 1;
box.y2 = y2;
if ( (x2 <= MAXSHORT) && (y2 <= MAXSHORT) &&
(RECT_IN_REGION(pDrawable->pScreen, cclip, &box) == rgnIN) )
(RegionContainsRect(cclip, &box) == rgnIN) )
(*arc) (dst, dstStride, dstBpp,
parcs, pDrawable->x + dstXoff, pDrawable->y + dstYoff,
pPriv->and, pPriv->xor);
......
......@@ -668,7 +668,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;
......@@ -800,7 +800,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;
......
......@@ -39,8 +39,8 @@ fbSaveAreas(PixmapPtr pPixmap,
fbCopyWindowProc (&pWin->drawable,
&pPixmap->drawable,
0,
REGION_RECTS(prgnSave),
REGION_NUM_RECTS(prgnSave),
RegionRects(prgnSave),
RegionNumRects(prgnSave),
xorg, yorg,
FALSE,
FALSE,
......@@ -57,8 +57,8 @@ fbRestoreAreas(PixmapPtr pPixmap,
fbCopyWindowProc (&pPixmap->drawable,
&pWin->drawable,
0,
REGION_RECTS(prgnRestore),
REGION_NUM_RECTS(prgnRestore),
RegionRects(prgnRestore),
RegionNumRects(prgnRestore),
-xorg, -yorg,
FALSE,
FALSE,
......
......@@ -2896,7 +2896,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
if (pict->filter == PictFilterNearest)
{
if (pict->repeatType == RepeatNormal) {
if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) {
if (RegionNumRects(pict->pCompositeClip) == 1) {
box = pict->pCompositeClip->extents;
for (i = 0; i < width; ++i) {
if (!v.vector[2]) {
......@@ -2927,7 +2927,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
y = MOD(v.vector[1]>>16, pict->pDrawable->height);
x = MOD(v.vector[0]>>16, pict->pDrawable->width);
}
if (POINT_IN_REGION (0, pict->pCompositeClip, x, y, &box))
if (RegionContainsPoint(pict->pCompositeClip, x, y, &box))
buffer[i] = fetch(bits + (y + pict->pDrawable->y)*stride, x + pict->pDrawable->x, indexed);
else
buffer[i] = 0;
......@@ -2938,7 +2938,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
}
}
} else {
if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) {
if (RegionNumRects(pict->pCompositeClip) == 1) {
box = pict->pCompositeClip->extents;
for (i = 0; i < width; ++i) {
if (!v.vector[2]) {
......@@ -2970,7 +2970,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
y = v.vector[1]>>16;
x = v.vector[0]>>16;
}
if (POINT_IN_REGION (0, pict->pCompositeClip, x, y, &box))
if (RegionContainsPoint(pict->pCompositeClip, x, y, &box))
buffer[i] = fetch(bits + (y + pict->pDrawable->y)*stride, x + pict->pDrawable->x, indexed);
else
buffer[i] = 0;
......@@ -2983,7 +2983,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
}
} else if (pict->filter == PictFilterBilinear) {
if (pict->repeatType == RepeatNormal) {
if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) {
if (RegionNumRects(pict->pCompositeClip) == 1) {
box = pict->pCompositeClip->extents;
for (i = 0; i < width; ++i) {
if (!v.vector[2]) {
......@@ -3082,14 +3082,14 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
b = bits + (y1 + pict->pDrawable->y)*stride;
tl = POINT_IN_REGION(0, pict->pCompositeClip, x1, y1, &box)
tl = RegionContainsPoint(pict->pCompositeClip, x1, y1, &box)
? fetch(b, x1 + pict->pDrawable->x, indexed) : 0;
tr = POINT_IN_REGION(0, pict->pCompositeClip, x2, y1, &box)
tr = RegionContainsPoint(pict->pCompositeClip, x2, y1, &box)
? fetch(b, x2 + pict->pDrawable->x, indexed) : 0;
b = bits + (y2 + pict->pDrawable->y)*stride;
bl = POINT_IN_REGION(0, pict->pCompositeClip, x1, y2, &box)
bl = RegionContainsPoint(pict->pCompositeClip, x1, y2, &box)
? fetch(b, x1 + pict->pDrawable->x, indexed) : 0;
br = POINT_IN_REGION(0, pict->pCompositeClip, x2, y2, &box)
br = RegionContainsPoint(pict->pCompositeClip, x2, y2, &box)
? fetch(b, x2 + pict->pDrawable->x, indexed) : 0;
ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx;
......@@ -3112,7 +3112,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
}
}
} else {
if (REGION_NUM_RECTS(pict->pCompositeClip) == 1) {
if (RegionNumRects(pict->pCompositeClip) == 1) {
box = pict->pCompositeClip->extents;
for (i = 0; i < width; ++i) {
if (!v.vector[2]) {
......@@ -3209,14 +3209,14 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
b = bits + (y1 + pict->pDrawable->y)*stride;
x_off = x1 + pict->pDrawable->x;
tl = POINT_IN_REGION(0, pict->pCompositeClip, x1, y1, &box)
tl = RegionContainsPoint(pict->pCompositeClip, x1, y1, &box)
? fetch(b, x_off, indexed) : 0;
tr = POINT_IN_REGION(0, pict->pCompositeClip, x2, y1, &box)
tr = RegionContainsPoint(pict->pCompositeClip, x2, y1, &box)
? fetch(b, x_off + 1, indexed) : 0;
b += stride;
bl = POINT_IN_REGION(0, pict->pCompositeClip, x1, y2, &box)
bl = RegionContainsPoint(pict->pCompositeClip, x1, y2, &box)
? fetch(b, x_off, indexed) : 0;
br = POINT_IN_REGION(0, pict->pCompositeClip, x2, y2, &box)
br = RegionContainsPoint(pict->pCompositeClip, x2, y2, &box)
? fetch(b, x_off + 1, indexed) : 0;
ft = FbGet8(tl,0) * idistx + FbGet8(tr,0) * distx;
......@@ -3274,7 +3274,7 @@ static void fbFetchTransformed(PicturePtr pict, int x, int y, int width, CARD32
for (x = x1; x < x2; x++) {
if (*p) {
int tx = (pict->repeatType == RepeatNormal) ? MOD (x, pict->pDrawable->width) : x;
if (POINT_IN_REGION (0, pict->pCompositeClip, tx, ty, &box)) {
if (RegionContainsPoint(pict->pCompositeClip, tx, ty, &box)) {
FbBits *b = bits + (ty + pict->pDrawable->y)*stride;
CARD32 c = fetch(b, tx + pict->pDrawable->x, indexed);
......@@ -3563,8 +3563,8 @@ fbCompositeGeneral (CARD8 op,
if (width > SCANLINE_BUFFER_LENGTH)
scanline_buffer = (CARD32 *) malloc(width * 3 * sizeof(CARD32));
n = REGION_NUM_RECTS (&region);
pbox = REGION_RECTS (&region);
n = RegionNumRects (&region);
pbox = RegionRects (&region);
while (n--)
{
h = pbox->y2 - pbox->y1;
......@@ -3618,7 +3618,7 @@ fbCompositeGeneral (CARD8 op,
}
pbox++;
}
REGION_UNINIT (pDst->pDrawable->pScreen, &region);
RegionUninit(&region);
if (scanline_buffer != _scanline_buffer)
free(scanline_buffer);
......
......@@ -306,8 +306,8 @@ fbCopyRegion (DrawablePtr pSrcDrawable,
int nbox;
BoxPtr pboxNew1, pboxNew2, pboxBase, pboxNext, pboxTmp;
pbox = REGION_RECTS(pDstRegion);
nbox = REGION_NUM_RECTS(pDstRegion);
pbox = RegionRects(pDstRegion);
nbox = RegionNumRects(pDstRegion);
/* XXX we have to err on the side of safety when both are windows,
* because we don't know if IncludeInferiors is being used.
......@@ -466,7 +466,7 @@ fbDoCopy (DrawablePtr pSrcDrawable,
* VT is inactive, make sure the region isn't empty
*/
if (!((WindowPtr) pSrcDrawable)->parent &&
REGION_NOTEMPTY (pSrcDrawable->pScreen,
RegionNotEmpty(
&((WindowPtr) pSrcDrawable)->borderClip))
{
/*
......@@ -548,9 +548,9 @@ fbDoCopy (DrawablePtr pSrcDrawable,
blown region and call intersect */
cclip = fbGetCompositeClip(pGC);
if (REGION_NUM_RECTS(cclip) == 1)
if (RegionNumRects(cclip) == 1)
{
BoxPtr pBox = REGION_RECTS(cclip);
BoxPtr pBox = RegionRects(cclip);
if (box_x1 < pBox->x1) box_x1 = pBox->x1;
if (box_x2 > pBox->x2) box_x2 = pBox->x2;
......@@ -563,7 +563,7 @@ fbDoCopy (DrawablePtr pSrcDrawable,
/* Check to see if the region is empty */
if (box_x1 >= box_x2 || box_y1 >= box_y2)
{
REGION_NULL(pGC->pScreen, &rgnDst);
RegionNull(&rgnDst);
}
else
{
......@@ -572,25 +572,25 @@ fbDoCopy (DrawablePtr pSrcDrawable,
box.y1 = box_y1;
box.x2 = box_x2;
box.y2 = box_y2;
REGION_INIT(pGC->pScreen, &rgnDst, &box, 1);
RegionInit(&rgnDst, &box, 1);
}
/* Clip against complex source if needed */
if (!fastSrc)
{
REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip);
REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy);
RegionIntersect(&rgnDst, &rgnDst, prgnSrcClip);
RegionTranslate(&rgnDst, -dx, -dy);
}
/* Clip against complex dest if needed */
if (!fastDst)
{
REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst,
RegionIntersect(&rgnDst, &rgnDst,
fbGetCompositeClip(pGC));
}
/* Do bit blitting */
numRects = REGION_NUM_RECTS(&rgnDst);
numRects = RegionNumRects(&rgnDst);
if (numRects && widthSrc && heightSrc)
fbCopyRegion (pSrcDrawable, pDstDrawable, pGC,
&rgnDst, dx, dy, copyProc, bitPlane, closure);
......@@ -604,9 +604,9 @@ fbDoCopy (DrawablePtr pSrcDrawable,
xOut - pDstDrawable->x,
yOut - pDstDrawable->y,
(unsigned long) bitPlane);
REGION_UNINIT(pGC->pScreen, &rgnDst);
RegionUninit(&rgnDst);
if (freeSrcClip)
REGION_DESTROY(pGC->pScreen, prgnSrcClip);
RegionDestroy(prgnSrcClip);
fbValidateDrawable (pDstDrawable);
return prgnExposed;
}
......
......@@ -184,7 +184,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++)
{
......
......@@ -47,7 +47,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;
......@@ -74,7 +74,7 @@ fbPolyFillRect(DrawablePtr pDrawable,
if ((fullX1 >= fullX2) || (fullY1 >= fullY2))
continue;
n = REGION_NUM_RECTS (pClip);
n = RegionNumRects (pClip);
if (n == 1)
{
fbFill (pDrawable,
......@@ -83,7 +83,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()
......
......@@ -44,7 +44,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;
......@@ -69,7 +69,7 @@ fbFillSpans (DrawablePtr pDrawable,
if (fullX1 >= fullX2)
continue;
nbox = REGION_NUM_RECTS (pClip);
nbox = RegionNumRects (pClip);
if (nbox == 1)
{
fbFill (pDrawable,
......@@ -78,7 +78,7 @@ fbFillSpans (DrawablePtr pDrawable,
}
else
{
pbox = REGION_RECTS(pClip);
pbox = RegionRects(pClip);
while(nbox--)
{
if (pbox->y1 <= fullY1 && fullY1 < pbox->y2)
......
......@@ -211,7 +211,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
......
......@@ -41,7 +41,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
......@@ -58,7 +58,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
......
......@@ -140,8 +140,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++)
{
......@@ -228,8 +228,8 @@ fbPutXYImage (DrawablePtr pDrawable,
}
}
for (nbox = REGION_NUM_RECTS (pClip),
pbox = REGION_RECTS(pClip);
for (nbox = RegionNumRects (pClip),
pbox = RegionRects(pClip);
nbox--;
pbox++)
{
......
......@@ -119,7 +119,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;
......@@ -156,7 +156,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;
......
......@@ -74,7 +74,7 @@ fbOverlayCreateWindow(WindowPtr pWin)
*/
if (!pWin->parent)
{
REGION_EMPTY (pWin->drawable.pScreen,
RegionEmpty(
&pScrPriv->layer[i].u.run.region);
}
return TRUE;
......@@ -92,7 +92,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;
}
......@@ -146,7 +146,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;
......@@ -174,24 +174,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);
......@@ -199,9 +199,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);
......@@ -231,21 +231,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;
fbCopyRegion (&pPixmap->drawable, &pPixmap->drawable,
0,
......@@ -258,12 +258,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
......
......@@ -1248,8 +1248,8 @@ fbComposite (CARD8 op,
height))
return;
n = REGION_NUM_RECTS (&region);
pbox = REGION_RECTS (&region);
n = RegionNumRects (&region);
pbox = RegionRects (&region);
while (n--)
{
h = pbox->y2 - pbox->y1;
......@@ -1309,7 +1309,7 @@ fbComposite (CARD8 op,
}
pbox++;
}
REGION_UNINIT (pDst->pDrawable->pScreen, &region);
RegionUninit(&region);
}
#endif /* RENDER */
......
......@@ -119,7 +119,7 @@ if (((rx1) < (rx2)) && ((ry1) < (ry2)) && \
if ((reg)->data->numRects == (reg)->data->size) \
{ \
miRectAlloc(reg, 1); \
fr = REGION_BOXPTR(reg); \
fr = RegionBoxptr(reg); \
r = fr + (reg)->data->numRects; \
} \
r->x1 = (rx1); \
......@@ -156,10 +156,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;
pwLine = (FbBits *) pPix->devPrivate.ptr;
......@@ -305,8 +305,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)
{
xfree(pReg->data);
......
......@@ -157,7 +157,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);
......
......@@ -192,8 +192,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++)
{
......
......@@ -615,8 +615,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);
......
......@@ -63,8 +63,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)
......
......@@ -132,15 +132,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
......@@ -148,7 +148,7 @@ fbCopyWindow(WindowPtr pWin,
0,
&rgnDst, dx, dy, fbCopyWindowProc, 0, 0);
REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
RegionUninit(&rgnDst);
fbValidateDrawable (&pWin->drawable);
}
......@@ -215,8 +215,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);
fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
......@@ -253,8 +253,8 @@ fbFillRegionTiled (DrawablePtr pDrawable,
int tileBpp;
int tileXoff, tileYoff; /* XXX assumed to be zero */
int tileWidth, tileHeight;
int n = REGION_NUM_RECTS(pRegion);
BoxPtr pbox = REGION_RECTS(pRegion);
int n = RegionNumRects(pRegion);
BoxPtr pbox = RegionRects(pRegion);
int xRot = pDrawable->x;
int yRot = pDrawable->y;
......
#!/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_NUM_RECTS *([^,]*, */RegionNumRects(/g' \
-e 's/REGION_RECTS *([^,]*, */RegionRects(/g' \
-e 's/REGION_NULL *([^,]*, */RegionNull(/g' \
-e 's/REGION_NULL$/RegionNull/g' \
"$@"
......@@ -107,7 +107,7 @@ enum SynchronizationPredicate
nxagentWindowCorruptedRegion((WindowPtr) pDrawable))
#define nxagentDrawableStatus(pDrawable) \
(REGION_NIL(nxagentCorruptedRegion(pDrawable)) ? \
(RegionNil(nxagentCorruptedRegion(pDrawable)) ? \
Synchronized : NotSynchronized)
#define nxagentDrawableContainGlyphs(pDrawable) \
......@@ -155,7 +155,7 @@ extern RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, in
int width, int height);
#define nxagentFreeRegion(pDrawable, pRegion) \
REGION_DESTROY((pDrawable) -> pScreen, pRegion);
RegionDestroy(pRegion);
extern void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion);
extern void nxagentUnmarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion);
......@@ -204,8 +204,8 @@ do \
break; \
} \
\
numRects = REGION_NUM_RECTS(pRegion); \
pBox = REGION_RECTS(pRegion); \
numRects = RegionNumRects(pRegion); \
pBox = RegionRects(pRegion); \
\
fprintf(stderr, "printRegionBoxes:: Region " strRegion " at [%p] has [%d] boxes:\n", \
(void *) (pRegion), numRects); \
......
......@@ -2414,7 +2414,7 @@ int nxagentHandleExposeEvent(XEvent *X)
if (pWin != NULL)
{
REGION_INIT(pWin -> drawable.pScreen, &sum, (BoxRec *) NULL, 1);
RegionInit(&sum, (BoxRec *) NULL, 1);
/*
FIXME: This can be maybe optimized by consuming the
events that do not match the predicate.
......@@ -2445,11 +2445,11 @@ FIXME: This can be maybe optimized by consuming the
box.x2 = box.x1 + X -> xexpose.width;
box.y2 = box.y1 + X -> xexpose.height;
REGION_INIT(pWin -> drawable.pScreen, &add, &box, 1);
RegionInit(&add, &box, 1);
REGION_APPEND(pWin -> drawable.pScreen, &sum, &add);
RegionAppend(&sum, &add);
REGION_UNINIT(pWin -> drawable.pScreen, &add);
RegionUninit(&add);
if (X -> xexpose.count == 0)
{
......@@ -2459,9 +2459,9 @@ FIXME: This can be maybe optimized by consuming the
while (nxagentCheckEvents(nxagentDisplay, X, nxagentExposurePredicate,
(XPointer) &window) == 1);
REGION_VALIDATE(pWin -> drawable.pScreen, &sum, &overlap);
RegionValidate(&sum, &overlap);
REGION_INTERSECT(pWin->drawable.pScreen, &sum, &sum,
RegionIntersect(&sum, &sum,
&WindowTable[pWin->drawable.pScreen->myNum]->winSize);
#ifdef DEBUG
......@@ -2482,14 +2482,14 @@ FIXME: This can be maybe optimized by consuming the
}
else
{
REGION_TRANSLATE(pWin -> drawable.pScreen, &sum, -pWin -> drawable.x, -pWin -> drawable.y);
RegionTranslate(&sum, -pWin -> drawable.x, -pWin -> drawable.y);
if (nxagentExposeQueue.exposures[index].remoteRegion == NullRegion)
{
nxagentExposeQueue.exposures[index].remoteRegion = REGION_CREATE(pwin -> drawable.pScreen, NULL, 1);
nxagentExposeQueue.exposures[index].remoteRegion = RegionCreate(NULL, 1);
}
REGION_UNION(pWin -> drawable.pScreen, nxagentExposeQueue.exposures[index].remoteRegion,
RegionUnion(nxagentExposeQueue.exposures[index].remoteRegion,
nxagentExposeQueue.exposures[index].remoteRegion, &sum);
#ifdef TEST
......@@ -2521,7 +2521,7 @@ FIXME: This can be maybe optimized by consuming the
}
}
REGION_UNINIT(pWin -> drawable.pScreen, &sum);
RegionUninit(&sum);
}
return 1;
......@@ -2593,7 +2593,7 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X)
rect.x2 = rect.x1 + X -> xgraphicsexpose.width;
rect.y2 = rect.y1 + X -> xgraphicsexpose.height;
exposeRegion = REGION_CREATE(pScreen, &rect, 0);
exposeRegion = RegionCreate(&rect, 0);
if (drawableType == DRAWABLE_PIXMAP)
{
......@@ -2610,7 +2610,7 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X)
* window.
*/
REGION_TRANSLATE(pScreen, exposeRegion, pStoringPixmapRec -> backingStoreX,
RegionTranslate(exposeRegion, pStoringPixmapRec -> backingStoreX,
pStoringPixmapRec -> backingStoreY);
/*
......@@ -2618,7 +2618,7 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X)
* affected by the GraphicsExpose event.
*/
REGION_SUBTRACT(pScreen, &(pBSwindow -> SavedRegion), &(pBSwindow -> SavedRegion),
RegionSubtract(&(pBSwindow -> SavedRegion), &(pBSwindow -> SavedRegion),
exposeRegion);
}
......@@ -2628,11 +2628,11 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X)
* must be relative to the screen.
*/
REGION_TRANSLATE(pScreen, exposeRegion, pWin -> drawable.x, pWin -> drawable.y);
RegionTranslate(exposeRegion, pWin -> drawable.x, pWin -> drawable.y);
REGION_UNION(pScreen, nxagentRemoteExposeRegion, nxagentRemoteExposeRegion, exposeRegion);
RegionUnion(nxagentRemoteExposeRegion, nxagentRemoteExposeRegion, exposeRegion);
REGION_DESTROY(pScreen, exposeRegion);
RegionDestroy(exposeRegion);
return 1;
}
......@@ -4091,30 +4091,30 @@ void nxagentSynchronizeExpose(void)
{
if ((nxagentExposeQueueHead.localRegion) != NullRegion)
{
REGION_TRANSLATE(pWin -> drawable.pScreen, (nxagentExposeQueueHead.localRegion),
RegionTranslate((nxagentExposeQueueHead.localRegion),
pWin -> drawable.x, pWin -> drawable.y);
}
if ((nxagentExposeQueueHead.remoteRegion) != NullRegion)
{
REGION_TRANSLATE(pWin -> drawable.pScreen, (nxagentExposeQueueHead.remoteRegion),
RegionTranslate((nxagentExposeQueueHead.remoteRegion),
pWin -> drawable.x, pWin -> drawable.y);
}
if ((nxagentExposeQueueHead.localRegion) != NullRegion &&
(nxagentExposeQueueHead.remoteRegion) != NullRegion)
{
REGION_SUBTRACT(pWin -> drawable.pScreen, (nxagentExposeQueueHead.remoteRegion),
RegionSubtract((nxagentExposeQueueHead.remoteRegion),
(nxagentExposeQueueHead.remoteRegion),
(nxagentExposeQueueHead.localRegion));
if (REGION_NIL(nxagentExposeQueueHead.remoteRegion) == 0 &&
if (RegionNil(nxagentExposeQueueHead.remoteRegion) == 0 &&
((pWin -> eventMask|wOtherEventMasks(pWin)) & ExposureMask))
{
#ifdef TEST
fprintf(stderr, "nxagentSynchronizeExpose: Going to call miWindowExposures"
" for window [%ld] - rects [%ld].\n", nxagentWindow(pWin),
REGION_NUM_RECTS(nxagentExposeQueueHead.remoteRegion));
RegionNumRects(nxagentExposeQueueHead.remoteRegion));
#endif
miWindowExposures(pWin, nxagentExposeQueueHead.remoteRegion, NullRegion);
......@@ -4126,14 +4126,14 @@ void nxagentSynchronizeExpose(void)
if (nxagentExposeQueueHead.localRegion != NullRegion)
{
REGION_DESTROY(nxagentDefaultScreen, nxagentExposeQueueHead.localRegion);
RegionDestroy(nxagentExposeQueueHead.localRegion);
}
nxagentExposeQueueHead.localRegion = NullRegion;
if (nxagentExposeQueueHead.remoteRegion != NullRegion)
{
REGION_DESTROY(nxagentDefaultScreen, nxagentExposeQueueHead.remoteRegion);
RegionDestroy(nxagentExposeQueueHead.remoteRegion);
}
nxagentExposeQueueHead.remoteRegion = NullRegion;
......@@ -4260,7 +4260,7 @@ void nxagentInitRemoteExposeRegion(void)
{
if (nxagentRemoteExposeRegion == NULL)
{
nxagentRemoteExposeRegion = REGION_CREATE(pWin -> drawable.pScreen, NULL, 1);
nxagentRemoteExposeRegion = RegionCreate(NULL, 1);
if (nxagentRemoteExposeRegion == NULL)
{
......@@ -4273,7 +4273,7 @@ void nxagentInitRemoteExposeRegion(void)
void nxagentForwardRemoteExpose(void)
{
if (REGION_NOTEMPTY(WindowTable[0] -> drawable.pScreen, nxagentRemoteExposeRegion))
if (RegionNotEmpty(nxagentRemoteExposeRegion))
{
#ifdef DEBUG
fprintf(stderr, "nxagentForwardRemoteExpose: Going to forward events.\n");
......@@ -4285,7 +4285,7 @@ void nxagentForwardRemoteExpose(void)
* Now this region should be empty.
*/
REGION_EMPTY(WindowTable[0] -> drawable.pScreen, nxagentRemoteExposeRegion);
RegionEmpty(nxagentRemoteExposeRegion);
}
}
......@@ -4298,12 +4298,12 @@ void nxagentAddRectToRemoteExposeRegion(BoxPtr rect)
return;
}
REGION_INIT(nxagentDefaultScreen, &exposeRegion, rect, 1);
RegionInit(&exposeRegion, rect, 1);
REGION_UNION(nxagentDefaultScreen, nxagentRemoteExposeRegion,
RegionUnion(nxagentRemoteExposeRegion,
nxagentRemoteExposeRegion, &exposeRegion);
REGION_UNINIT(nxagentDefaultScreen, &exposeRegion);
RegionUninit(&exposeRegion);
}
int nxagentClipAndSendExpose(WindowPtr pWin, void * ptr)
......@@ -4320,25 +4320,25 @@ int nxagentClipAndSendExpose(WindowPtr pWin, void * ptr)
if (pWin -> drawable.class != InputOnly)
{
exposeRgn = REGION_CREATE(pWin -> drawable.pScreen, NULL, 1);
exposeRgn = RegionCreate(NULL, 1);
box = *REGION_EXTENTS(pWin->drawable.pScreen, remoteExposeRgn);
box = *RegionExtents(remoteExposeRgn);
#ifdef DEBUG
fprintf(stderr, "nxagentClipAndSendExpose: Root expose extents: [%d] [%d] [%d] [%d].\n",
box.x1, box.y1, box.x2, box.y2);
#endif
box = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin -> clipList);
box = *RegionExtents(&pWin -> clipList);
#ifdef DEBUG
fprintf(stderr, "nxagentClipAndSendExpose: Clip list extents for window at [%p]: [%d] [%d] [%d] [%d].\n",
pWin, box.x1, box.y1, box.x2, box.y2);
#endif
REGION_INTERSECT(pWin -> drawable.pScreen, exposeRgn, remoteExposeRgn, &pWin -> clipList);
RegionIntersect(exposeRgn, remoteExposeRgn, &pWin -> clipList);
if (REGION_NOTEMPTY(pWin -> drawable.pScreen, exposeRgn))
if (RegionNotEmpty(exposeRgn))
{
#ifdef DEBUG
fprintf(stderr, "nxagentClipAndSendExpose: Forwarding expose to window at [%p] pWin.\n",
......@@ -4351,15 +4351,15 @@ int nxagentClipAndSendExpose(WindowPtr pWin, void * ptr)
* ration must be done before calling it.
*/
REGION_SUBTRACT(pWin -> drawable.pScreen, remoteExposeRgn, remoteExposeRgn, exposeRgn);
RegionSubtract(remoteExposeRgn, remoteExposeRgn, exposeRgn);
miWindowExposures(pWin, exposeRgn, NullRegion);
}
REGION_DESTROY(pWin -> drawable.pScreen, exposeRgn);
RegionDestroy(exposeRgn);
}
if (REGION_NOTEMPTY(pWin -> drawable.pScreen, remoteExposeRgn))
if (RegionNotEmpty(remoteExposeRgn))
{
#ifdef DEBUG
fprintf(stderr, "nxagentClipAndSendExpose: Region not empty. Walk children.\n");
......
......@@ -633,11 +633,11 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
case CT_YXSORTED:
case CT_YXBANDED:
{
RegionPtr pReg = RECTS_TO_REGION(pGC->pScreen, nRects, (xRectangle *)pValue, type);
RegionPtr pReg = RegionFromRects(nRects, (xRectangle *)pValue, type);
clipsMatch = nxagentCompareRegions(pGC -> clientClip, pReg);
REGION_DESTROY(pGC->pScreen, pReg);
RegionDestroy(pReg);
break;
}
......@@ -671,10 +671,10 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
{
if (clipsMatch == 0 && nxagentGCTrap == 0)
{
nRects = REGION_NUM_RECTS((RegionPtr)pValue);
nRects = RegionNumRects((RegionPtr)pValue);
size = nRects * sizeof(*pRects);
pRects = (XRectangle *) xalloc(size);
pBox = REGION_RECTS((RegionPtr)pValue);
pBox = RegionRects((RegionPtr)pValue);
for (i = nRects; i-- > 0;)
{
......@@ -768,7 +768,7 @@ void nxagentChangeClip(GCPtr pGC, int type, void * pValue, int nRects)
* CT_REGION client clips.
*/
pGC->clientClip = (void *) RECTS_TO_REGION(pGC->pScreen, nRects,
pGC->clientClip = (void *) RegionFromRects(nRects,
(xRectangle *)pValue, type);
xfree(pValue);
......@@ -820,7 +820,7 @@ void nxagentDestroyClipHelper(GCPtr pGC)
case CT_NONE:
break;
case CT_REGION:
REGION_DESTROY(pGC->pScreen, pGC->clientClip);
RegionDestroy(pGC->clientClip);
break;
case CT_PIXMAP:
nxagentDestroyPixmap((PixmapPtr)pGC->clientClip);
......@@ -848,8 +848,8 @@ void nxagentCopyClip(GCPtr pGCDst, GCPtr pGCSrc)
case CT_REGION:
if (nxagentGCPriv(pGCSrc)->pPixmap == NULL)
{
pRgn = REGION_CREATE(pGCDst->pScreen, NULL, 1);
REGION_COPY(pGCDst->pScreen, pRgn, pGCSrc->clientClip);
pRgn = RegionCreate(NULL, 1);
RegionCopy(pRgn, pGCSrc->clientClip);
nxagentChangeClip(pGCDst, CT_REGION, pRgn, 0);
}
else
......@@ -1281,10 +1281,10 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
case CT_REGION:
if (nxagentGCPriv(pGC)->pPixmap == NULL)
{
nRects = REGION_NUM_RECTS((RegionPtr)pValue);
nRects = RegionNumRects((RegionPtr)pValue);
size = nRects * sizeof(*pRects);
pRects = (XRectangle *) xalloc(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;
......@@ -1370,7 +1370,7 @@ static void nxagentReconnectClip(GCPtr pGC, int type, void * pValue, int nRects)
* CT_PIXMAP and CT_REGION client clips.
*/
pGC->clientClip = (void *) RECTS_TO_REGION(pGC->pScreen, nRects,
pGC->clientClip = (void *) RegionFromRects(nRects,
(xRectangle *)pValue, type);
xfree(pValue);
pValue = pGC->clientClip;
......@@ -1403,26 +1403,26 @@ static int nxagentCompareRegions(RegionPtr r1, RegionPtr r2)
return 0;
}
if (REGION_NUM_RECTS(r1) != REGION_NUM_RECTS(r2))
if (RegionNumRects(r1) != RegionNumRects(r2))
{
return 0;
}
else if (REGION_NUM_RECTS(r1) == 0)
else if (RegionNumRects(r1) == 0)
{
return 1;
}
else if ((*REGION_EXTENTS(pScreen, r1)).x1 != (*REGION_EXTENTS(pScreen, r2)).x1) return 0;
else if ((*REGION_EXTENTS(pScreen, r1)).x2 != (*REGION_EXTENTS(pScreen, r2)).x2) return 0;
else if ((*REGION_EXTENTS(pScreen, r1)).y1 != (*REGION_EXTENTS(pScreen, r2)).y1) return 0;
else if ((*REGION_EXTENTS(pScreen, r1)).y2 != (*REGION_EXTENTS(pScreen, r2)).y2) return 0;
else if ((*RegionExtents(r1)).x1 != (*RegionExtents(r2)).x1) return 0;
else if ((*RegionExtents(r1)).x2 != (*RegionExtents(r2)).x2) return 0;
else if ((*RegionExtents(r1)).y1 != (*RegionExtents(r2)).y1) return 0;
else if ((*RegionExtents(r1)).y2 != (*RegionExtents(r2)).y2) return 0;
else
{
for (i = 0; i < REGION_NUM_RECTS(r1); i++)
for (i = 0; i < RegionNumRects(r1); i++)
{
if (REGION_RECTS(r1)[i].x1 != REGION_RECTS(r2)[i].x1) return 0;
else if (REGION_RECTS(r1)[i].x2 != REGION_RECTS(r2)[i].x2) return 0;
else if (REGION_RECTS(r1)[i].y1 != REGION_RECTS(r2)[i].y1) return 0;
else if (REGION_RECTS(r1)[i].y2 != REGION_RECTS(r2)[i].y2) return 0;
if (RegionRects(r1)[i].x1 != RegionRects(r2)[i].x1) return 0;
else if (RegionRects(r1)[i].x2 != RegionRects(r2)[i].x2) return 0;
else if (RegionRects(r1)[i].y1 != RegionRects(r2)[i].y1) return 0;
else if (RegionRects(r1)[i].y2 != RegionRects(r2)[i].y2) return 0;
}
}
......
......@@ -306,12 +306,12 @@ FIXME: The popup could be synchronized with one
pSrcRegion -> extents.x2, pSrcRegion -> extents.y2);
#endif
REGION_INIT(pSrcDrawable -> pScreen, &corruptedRegion, NullBox, 1);
RegionInit(&corruptedRegion, NullBox, 1);
REGION_INTERSECT(pSrcDrawable -> pScreen, &corruptedRegion,
RegionIntersect(&corruptedRegion,
pSrcRegion, nxagentCorruptedRegion(pSrcDrawable));
if (REGION_NIL(&corruptedRegion) == 0)
if (RegionNil(&corruptedRegion) == 0)
{
#ifdef TEST
fprintf(stderr, "nxagentDeferCopyArea: Forcing the synchronization of source drawable at [%p].\n",
......@@ -321,7 +321,7 @@ FIXME: The popup could be synchronized with one
nxagentSynchronizeRegion(pSrcDrawable, &corruptedRegion, EVENT_BREAK, NULL);
}
REGION_UNINIT(pSrcDrawable -> pScreen, &corruptedRegion);
RegionUninit(&corruptedRegion);
nxagentFreeRegion(pSrcDrawable, pSrcRegion);
......@@ -361,7 +361,7 @@ FIXME: The popup could be synchronized with one
pClipRegion -> extents.x2, pClipRegion -> extents.y2);
#endif
REGION_SUBTRACT(pSrcDrawable -> pScreen, pClipRegion, pClipRegion, nxagentCorruptedRegion(pSrcDrawable));
RegionSubtract(pClipRegion, pClipRegion, nxagentCorruptedRegion(pSrcDrawable));
#ifdef DEBUG
fprintf(stderr, "nxagentDeferCopyArea: Usable copy area source region is [%d,%d,%d,%d].\n",
......@@ -381,11 +381,11 @@ FIXME: The popup could be synchronized with one
#endif
REGION_TRANSLATE(pSrcDrawable -> pScreen, pClipRegion, dstx - srcx, dsty - srcy);
RegionTranslate(pClipRegion, dstx - srcx, dsty - srcy);
}
else
{
REGION_INIT(pDstDrawable -> pScreen, &tmpRegion, NullBox, 1);
RegionInit(&tmpRegion, NullBox, 1);
#ifdef DEBUG
fprintf(stderr, "nxagentDeferCopyArea: Going to modify the original GC [%p] with clip mask "
......@@ -396,18 +396,18 @@ FIXME: The popup could be synchronized with one
pGC -> clipOrg.x, pGC -> clipOrg.y);
#endif
REGION_COPY(pDstDrawable -> pScreen, &tmpRegion, (RegionPtr) pGC -> clientClip);
RegionCopy(&tmpRegion, (RegionPtr) pGC -> clientClip);
if (pGC -> clipOrg.x != 0 || pGC -> clipOrg.y != 0)
{
REGION_TRANSLATE(pDstDrawable -> pScreen, &tmpRegion, pGC -> clipOrg.x, pGC -> clipOrg.y);
RegionTranslate(&tmpRegion, pGC -> clipOrg.x, pGC -> clipOrg.y);
}
REGION_TRANSLATE(pSrcDrawable -> pScreen, pClipRegion, dstx - srcx, dsty - srcy);
RegionTranslate(pClipRegion, dstx - srcx, dsty - srcy);
REGION_INTERSECT(pSrcDrawable -> pScreen, pClipRegion, &tmpRegion, pClipRegion);
RegionIntersect(pClipRegion, &tmpRegion, pClipRegion);
REGION_UNINIT(pSrcDrawable -> pScreen, &tmpRegion);
RegionUninit(&tmpRegion);
}
/*
......@@ -416,18 +416,18 @@ FIXME: The popup could be synchronized with one
* destination that we are not going to copy.
*/
REGION_SUBTRACT(pSrcDrawable -> pScreen, pCorruptedRegion, pCorruptedRegion, pClipRegion);
RegionSubtract(pCorruptedRegion, pCorruptedRegion, pClipRegion);
#ifdef DEBUG
fprintf(stderr, "nxagentDeferCopyArea: Recomputed clip region is [%d,%d,%d,%d][%ld].\n",
pClipRegion -> extents.x1, pClipRegion -> extents.y1,
pClipRegion -> extents.x2, pClipRegion -> extents.y2,
REGION_NUM_RECTS(pClipRegion));
RegionNumRects(pClipRegion));
fprintf(stderr, "nxagentDeferCopyArea: Inherited corrupted region is [%d,%d,%d,%d][%ld].\n",
pCorruptedRegion -> extents.x1, pCorruptedRegion -> extents.y1,
pCorruptedRegion -> extents.x2, pCorruptedRegion -> extents.y2,
REGION_NUM_RECTS(pCorruptedRegion));
RegionNumRects(pCorruptedRegion));
#endif
/*
......@@ -435,17 +435,17 @@ FIXME: The popup could be synchronized with one
* synchronized and the corrupted region.
*/
if (REGION_NIL(pClipRegion) == 0)
if (RegionNil(pClipRegion) == 0)
{
nxagentUnmarkCorruptedRegion(pDstDrawable, pClipRegion);
}
if (REGION_NIL(pCorruptedRegion) == 0)
if (RegionNil(pCorruptedRegion) == 0)
{
nxagentMarkCorruptedRegion(pDstDrawable, pCorruptedRegion);
}
if (REGION_NIL(pClipRegion) == 0)
if (RegionNil(pClipRegion) == 0)
{
GCPtr targetGC;
......@@ -468,7 +468,7 @@ FIXME: The popup could be synchronized with one
GCClipXOrigin | GCClipYOrigin | GCClipMask | GCForeground |
GCBackground | GCGraphicsExposures);
if (REGION_NUM_RECTS(pClipRegion) == 1)
if (RegionNumRects(pClipRegion) == 1)
{
/*
* If the region to copy is formed by one
......@@ -563,12 +563,12 @@ FIXME: The popup could be synchronized with one
pSrcRegion -> extents.x2, pSrcRegion -> extents.y2);
#endif
REGION_INIT(pSrcDrawable -> pScreen, &corruptedRegion, NullBox, 1);
RegionInit(&corruptedRegion, NullBox, 1);
REGION_INTERSECT(pSrcDrawable -> pScreen, &corruptedRegion,
RegionIntersect(&corruptedRegion,
pSrcRegion, nxagentCorruptedRegion(pSrcDrawable));
if (REGION_NIL(&corruptedRegion) == 0)
if (RegionNil(&corruptedRegion) == 0)
{
#ifdef TEST
fprintf(stderr, "nxagentDeferCopyArea: Forcing the synchronization of source drawable at [%p].\n",
......@@ -578,7 +578,7 @@ FIXME: The popup could be synchronized with one
nxagentSynchronizeRegion(pSrcDrawable, &corruptedRegion /*pSrcRegion*/, NEVER_BREAK, NULL);
}
REGION_UNINIT(pSrcDrawable -> pScreen, &corruptedRegion);
RegionUninit(&corruptedRegion);
nxagentFreeRegion(pSrcDrawable, pSrcRegion);
}
......@@ -1032,12 +1032,12 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
{
pSrcRegion = nxagentCreateRegion(pSrcDrawable, NULL, srcx, srcy, width, height);
REGION_INIT(pSrcDrawable -> pScreen, &corruptedRegion, NullBox, 1);
RegionInit(&corruptedRegion, NullBox, 1);
REGION_INTERSECT(pSrcDrawable -> pScreen, &corruptedRegion,
RegionIntersect(&corruptedRegion,
pSrcRegion, nxagentCorruptedRegion(pSrcDrawable));
if (REGION_NIL(&corruptedRegion) == 0)
if (RegionNil(&corruptedRegion) == 0)
{
#ifdef TEST
fprintf(stderr, "nxagentCopyPlane: Forcing the synchronization of source drawable at [%p].\n",
......@@ -1053,7 +1053,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
nxagentFreeRegion(pDstDrawable, pDstRegion);
}
REGION_UNINIT(pSrcDrawable -> pScreen, &corruptedRegion);
RegionUninit(&corruptedRegion);
nxagentFreeRegion(pSrcDrawable, pSrcRegion);
}
......@@ -1615,24 +1615,24 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
if (inheritCorruptedRegion == 1 || nxagentDrawableStatus(pDrawable) == NotSynchronized)
{
rectRegion = RECTS_TO_REGION(pDrawable -> pScreen, nRectangles, pRectangles, CT_REGION);
rectRegion = RegionFromRects(nRectangles, pRectangles, CT_REGION);
if (pGC -> clientClip != NULL)
{
RegionRec tmpRegion;
REGION_INIT(pDrawable -> pScreen, &tmpRegion, NullBox, 1);
RegionInit(&tmpRegion, NullBox, 1);
REGION_COPY(pDrawable -> pScreen, &tmpRegion, ((RegionPtr) pGC -> clientClip));
RegionCopy(&tmpRegion, ((RegionPtr) pGC -> clientClip));
if (pGC -> clipOrg.x != 0 || pGC -> clipOrg.y != 0)
{
REGION_TRANSLATE(pDrawable -> pScreen, &tmpRegion, pGC -> clipOrg.x, pGC -> clipOrg.y);
RegionTranslate(&tmpRegion, pGC -> clipOrg.x, pGC -> clipOrg.y);
}
REGION_INTERSECT(pDrawable -> pScreen, rectRegion, rectRegion, &tmpRegion);
RegionIntersect(rectRegion, rectRegion, &tmpRegion);
REGION_UNINIT(pDrawable -> pScreen, &tmpRegion);
RegionUninit(&tmpRegion);
}
if (inheritCorruptedRegion == 1)
......@@ -1672,7 +1672,7 @@ void nxagentPolyFillRect(DrawablePtr pDrawable, GCPtr pGC,
}
}
REGION_DESTROY(pDrawable -> pScreen, rectRegion);
RegionDestroy(rectRegion);
}
if ((pDrawable)->type == DRAWABLE_PIXMAP)
......
......@@ -566,7 +566,7 @@ void nxagentPutImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
pRegion = nxagentCreateRegion(pDrawable, pGC, dstX, dstY, dstWidth, dstHeight);
if (REGION_NIL(pRegion) == 1)
if (RegionNil(pRegion) == 1)
{
#ifdef TEST
fprintf(stderr, "nxagentPutImage: WARNING! Prevented operation on fully clipped "
......@@ -1036,7 +1036,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
clipRegion = nxagentCreateRegion(pDrawable, pGC, x, y, w, h);
}
if (clipRegion == NullRegion || REGION_NIL(clipRegion) == 0)
if (clipRegion == NullRegion || RegionNil(clipRegion) == 0)
{
nxagentPutSubImage(pDrawable, pGC, depth, x, y, w, h,
leftPad, format, data, pVisual);
......
......@@ -154,7 +154,7 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
#endif
/* short circuit for empty regions */
if (!REGION_NOTEMPTY(pScreen, pRegion))
if (!RegionNotEmpty(pRegion))
return;
#ifdef COMPOSITE
......@@ -169,7 +169,7 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
screen_y = ((PixmapPtr) pDrawable)->screen_y - pDrawable->y;
}
if (screen_x || screen_y)
REGION_TRANSLATE (pScreen, pRegion, screen_x, screen_y);
RegionTranslate(pRegion, screen_x, screen_y);
#endif
if (pDrawable->type == DRAWABLE_WINDOW &&
......@@ -177,22 +177,22 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
{
if (subWindowMode == ClipByChildren)
{
REGION_INTERSECT(pScreen, pRegion, pRegion,
RegionIntersect(pRegion, pRegion,
&((WindowPtr)(pDrawable))->clipList);
}
else if (subWindowMode == IncludeInferiors)
{
RegionPtr pTempRegion =
NotClippedByChildren((WindowPtr)(pDrawable));
REGION_INTERSECT(pScreen, pRegion, pRegion, pTempRegion);
REGION_DESTROY(pScreen, pTempRegion);
RegionIntersect(pRegion, pRegion, pTempRegion);
RegionDestroy(pTempRegion);
}
/* If subWindowMode is set to an invalid value, don't perform
* any drawable-based clipping. */
}
REGION_NULL (pScreen, &clippedRec);
RegionNull(&clippedRec);
for (; pDamage; pDamage = pNext)
{
pNext = pDamage->pNext;
......@@ -240,7 +240,7 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
{
pDamageRegion = &clippedRec;
if (pDamage->pDrawable->type == DRAWABLE_WINDOW) {
REGION_INTERSECT (pScreen, pDamageRegion, pRegion,
RegionIntersect(pDamageRegion, pRegion,
&((WindowPtr)(pDamage->pDrawable))->borderClip);
} else {
BoxRec box;
......@@ -248,14 +248,14 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
box.y1 = draw_y;
box.x2 = draw_x + pDamage->pDrawable->width;
box.y2 = draw_y + pDamage->pDrawable->height;
REGION_INIT(pScreen, &pixClip, &box, 1);
REGION_INTERSECT (pScreen, pDamageRegion, pRegion, &pixClip);
REGION_UNINIT(pScreen, &pixClip);
RegionInit(&pixClip, &box, 1);
RegionIntersect(pDamageRegion, pRegion, &pixClip);
RegionUninit(&pixClip);
}
/*
* Short circuit empty results
*/
if (!REGION_NOTEMPTY(pScreen, pDamageRegion))
if (!RegionNotEmpty(pDamageRegion))
continue;
}
......@@ -270,39 +270,39 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
* Move region to target coordinate space
*/
if (draw_x || draw_y)
REGION_TRANSLATE (pScreen, pDamageRegion, -draw_x, -draw_y);
RegionTranslate(pDamageRegion, -draw_x, -draw_y);
switch (pDamage->damageLevel) {
case DamageReportRawRegion:
(*pDamage->damageReport) (pDamage, pDamageRegion, pDamage->closure);
break;
case DamageReportDeltaRegion:
REGION_NULL (pScreen, &tmpRegion);
REGION_SUBTRACT (pScreen, &tmpRegion, pDamageRegion, &pDamage->damage);
if (REGION_NOTEMPTY (pScreen, &tmpRegion))
RegionNull(&tmpRegion);
RegionSubtract(&tmpRegion, pDamageRegion, &pDamage->damage);
if (RegionNotEmpty(&tmpRegion))
{
REGION_UNION(pScreen, &pDamage->damage,
RegionUnion(&pDamage->damage,
&pDamage->damage, pDamageRegion);
(*pDamage->damageReport) (pDamage, &tmpRegion, pDamage->closure);
}
REGION_UNINIT(pScreen, &tmpRegion);
RegionUninit(&tmpRegion);
break;
case DamageReportBoundingBox:
tmpBox = *REGION_EXTENTS (pScreen, &pDamage->damage);
REGION_UNION(pScreen, &pDamage->damage,
tmpBox = *RegionExtents(&pDamage->damage);
RegionUnion(&pDamage->damage,
&pDamage->damage, pDamageRegion);
if (!BOX_SAME (&tmpBox, REGION_EXTENTS (pScreen, &pDamage->damage)))
if (!BOX_SAME (&tmpBox, RegionExtents(&pDamage->damage)))
(*pDamage->damageReport) (pDamage, &pDamage->damage, pDamage->closure);
break;
case DamageReportNonEmpty:
was_empty = !REGION_NOTEMPTY(pScreen, &pDamage->damage);
REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage,
was_empty = !RegionNotEmpty(&pDamage->damage);
RegionUnion(&pDamage->damage, &pDamage->damage,
pDamageRegion);
if (was_empty && REGION_NOTEMPTY(pScreen, &pDamage->damage))
if (was_empty && RegionNotEmpty(&pDamage->damage))
(*pDamage->damageReport) (pDamage, &pDamage->damage, pDamage->closure);
break;
case DamageReportNone:
REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage,
RegionUnion(&pDamage->damage, &pDamage->damage,
pDamageRegion);
break;
}
......@@ -310,14 +310,14 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip,
* translate original region back
*/
if (pDamageRegion == pRegion && (draw_x || draw_y))
REGION_TRANSLATE (pScreen, pDamageRegion, draw_x, draw_y);
RegionTranslate(pDamageRegion, draw_x, draw_y);
}
#ifdef COMPOSITE
if (screen_x || screen_y)
REGION_TRANSLATE (pScreen, pRegion, -screen_x, -screen_y);
RegionTranslate(pRegion, -screen_x, -screen_y);
#endif
REGION_UNINIT (pScreen, &clippedRec);
RegionUninit(&clippedRec);
}
#if DAMAGE_DEBUG_ENABLE
......@@ -331,13 +331,13 @@ damageDamageBox (DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode)
{
RegionRec region;
REGION_INIT (pDrawable->pScreen, &region, pBox, 1);
RegionInit(&region, pBox, 1);
#if DAMAGE_DEBUG_ENABLE
_damageDamageRegion (pDrawable, &region, TRUE, subWindowMode, where);
#else
damageDamageRegion (pDrawable, &region, TRUE, subWindowMode);
#endif
REGION_UNINIT (pDrawable->pScreen, &region);
RegionUninit(&region);
}
static void damageValidateGC(GCPtr, unsigned long, DrawablePtr);
......@@ -506,7 +506,7 @@ damageDestroyClip(GCPtr pGC)
#define checkGCDamage(d,g) (getDrawableDamage(d) && \
(!g->pCompositeClip ||\
REGION_NOTEMPTY(d->pScreen, \
RegionNotEmpty(\
g->pCompositeClip)))
#ifdef RENDER
......@@ -520,7 +520,7 @@ damageDestroyClip(GCPtr pGC)
}
#define checkPictureDamage(p) (getDrawableDamage(p->pDrawable) && \
REGION_NOTEMPTY(pScreen, p->pCompositeClip))
RegionNotEmpty(p->pCompositeClip))
static void
damageComposite (CARD8 op,
......@@ -1722,9 +1722,9 @@ damageCopyWindow(WindowPtr pWindow,
* The region comes in source relative, but the damage occurs
* at the destination location. Translate back and forth.
*/
REGION_TRANSLATE (pScreen, prgnSrc, dx, dy);
RegionTranslate(prgnSrc, dx, dy);
damageDamageRegion (&pWindow->drawable, prgnSrc, FALSE, -1);
REGION_TRANSLATE (pScreen, prgnSrc, -dx, -dy);
RegionTranslate(prgnSrc, -dx, -dy);
}
unwrap (pScrPriv, pScreen, CopyWindow);
(*pScreen->CopyWindow) (pWindow, ptOldOrg, prgnSrc);
......@@ -1927,7 +1927,7 @@ DamageCreate (DamageReportFunc damageReport,
return 0;
pDamage->pNext = 0;
pDamage->pNextWin = 0;
REGION_NULL(pScreen, &pDamage->damage);
RegionNull(&pDamage->damage);
pDamage->damageLevel = damageLevel;
pDamage->isInternal = isInternal;
......@@ -2016,7 +2016,7 @@ DamageDestroy (DamagePtr pDamage)
{
if (pDamage->damageDestroy)
(*pDamage->damageDestroy) (pDamage, pDamage->closure);
REGION_UNINIT (pDamage->pDrawable->pScreen, &pDamage->damage);
RegionUninit(&pDamage->damage);
xfree (pDamage);
}
......@@ -2028,7 +2028,7 @@ DamageSubtract (DamagePtr pDamage,
RegionRec pixmapClip;
DrawablePtr pDrawable = pDamage->pDrawable;
REGION_SUBTRACT (pDrawable->pScreen, &pDamage->damage, &pDamage->damage, pRegion);
RegionSubtract(&pDamage->damage, &pDamage->damage, pRegion);
if (pDrawable)
{
if (pDrawable->type == DRAWABLE_WINDOW)
......@@ -2041,22 +2041,22 @@ DamageSubtract (DamagePtr pDamage,
box.y1 = pDrawable->y;
box.x2 = pDrawable->x + pDrawable->width;
box.y2 = pDrawable->y + pDrawable->height;
REGION_INIT (pDrawable->pScreen, &pixmapClip, &box, 1);
RegionInit(&pixmapClip, &box, 1);
pClip = &pixmapClip;
}
REGION_TRANSLATE (pDrawable->pScreen, &pDamage->damage, pDrawable->x, pDrawable->y);
REGION_INTERSECT (pDrawable->pScreen, &pDamage->damage, &pDamage->damage, pClip);
REGION_TRANSLATE (pDrawable->pScreen, &pDamage->damage, -pDrawable->x, -pDrawable->y);
RegionTranslate(&pDamage->damage, pDrawable->x, pDrawable->y);
RegionIntersect(&pDamage->damage, &pDamage->damage, pClip);
RegionTranslate(&pDamage->damage, -pDrawable->x, -pDrawable->y);
if (pDrawable->type != DRAWABLE_WINDOW)
REGION_UNINIT(pDrawable->pScreen, &pixmapClip);
RegionUninit(&pixmapClip);
}
return REGION_NOTEMPTY (pDrawable->pScreen, &pDamage->damage);
return RegionNotEmpty(&pDamage->damage);
}
void
DamageEmpty (DamagePtr pDamage)
{
REGION_EMPTY (pDamage->pDrawable->pScreen, &pDamage->damage);
RegionEmpty(&pDamage->damage);
}
RegionPtr
......
......@@ -1669,11 +1669,11 @@ ProcTranslateCoords(register 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))
......@@ -2291,7 +2291,7 @@ ProcCopyArea(register ClientPtr client)
(*pDst->pScreen->SendGraphicsExpose)
(client, pRgn, stuff->dstDrawable, X_CopyArea, 0);
if (pRgn)
REGION_DESTROY(pDst->pScreen, pRgn);
RegionDestroy(pRgn);
}
return(client->noClientException);
......@@ -2339,7 +2339,7 @@ ProcCopyPlane(register ClientPtr client)
(*pdstDraw->pScreen->SendGraphicsExpose)
(client, pRgn, stuff->dstDrawable, X_CopyPlane, 0);
if (pRgn)
REGION_DESTROY(pdstDraw->pScreen, pRgn);
RegionDestroy(pRgn);
}
return(client->noClientException);
}
......@@ -2777,7 +2777,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable,
pVisibleRegion = NotClippedByChildren((WindowPtr)pDraw);
if (pVisibleRegion)
{
REGION_TRANSLATE(pDraw->pScreen, pVisibleRegion, -pDraw->x, -pDraw->y);
RegionTranslate(pVisibleRegion, -pDraw->x, -pDraw->y);
}
}
#endif
......@@ -2871,7 +2871,7 @@ DoGetImage(register ClientPtr client, int format, Drawable drawable,
}
#ifdef XCSECURITY
if (pVisibleRegion)
REGION_DESTROY(pDraw->pScreen, pVisibleRegion);
RegionDestroy(pVisibleRegion);
#endif
if (!im_return)
DEALLOCATE_LOCAL(pBuf);
......
......@@ -379,14 +379,14 @@ XineramaSetCursorPosition(
x += panoramiXdataPtr[0].x;
y += panoramiXdataPtr[0].y;
if(!POINT_IN_REGION(pScreen, &XineramaScreenRegions[pScreen->myNum],
if(!RegionContainsPoint(&XineramaScreenRegions[pScreen->myNum],
x, y, &box))
{
FOR_NSCREENS(i)
{
if(i == pScreen->myNum)
continue;
if(POINT_IN_REGION(pScreen, &XineramaScreenRegions[i], x, y, &box))
if(RegionContainsPoint(&XineramaScreenRegions[i], x, y, &box))
{
pScreen = screenInfo.screens[i];
break;
......@@ -516,7 +516,7 @@ XineramaCheckVirtualMotion(
i = PanoramiXNumScreens - 1;
REGION_COPY(sprite.screen, &sprite.Reg2,
RegionCopy(&sprite.Reg2,
&sprite.windows[i]->borderSize);
off_x = panoramiXdataPtr[i].x;
off_y = panoramiXdataPtr[i].y;
......@@ -526,16 +526,16 @@ XineramaCheckVirtualMotion(
y = off_y - panoramiXdataPtr[i].y;
if(x || y)
REGION_TRANSLATE(sprite.screen, &sprite.Reg2, x, y);
RegionTranslate(&sprite.Reg2, x, y);
REGION_UNION(sprite.screen, &sprite.Reg2, &sprite.Reg2,
RegionUnion(&sprite.Reg2, &sprite.Reg2,
&sprite.windows[i]->borderSize);
off_x = panoramiXdataPtr[i].x;
off_y = panoramiXdataPtr[i].y;
}
lims = *REGION_EXTENTS(sprite.screen, &sprite.Reg2);
lims = *RegionExtents(&sprite.Reg2);
if (sprite.hot.x < lims.x1)
#ifdef XEVIE
......@@ -558,7 +558,7 @@ XineramaCheckVirtualMotion(
#endif
sprite.hot.y = lims.y2 - 1;
if (REGION_NUM_RECTS(&sprite.Reg2) > 1)
if (RegionNumRects(&sprite.Reg2) > 1)
ConfineToShape(&sprite.Reg2, &sprite.hot.x, &sprite.hot.y);
if (qe)
......@@ -665,7 +665,7 @@ XineramaConfineCursorToWindow(WindowPtr pWin, Bool generateEvents)
i = PanoramiXNumScreens - 1;
REGION_COPY(sprite.screen, &sprite.Reg1,
RegionCopy(&sprite.Reg1,
&sprite.windows[i]->borderSize);
off_x = panoramiXdataPtr[i].x;
off_y = panoramiXdataPtr[i].y;
......@@ -675,18 +675,18 @@ XineramaConfineCursorToWindow(WindowPtr pWin, Bool generateEvents)
y = off_y - panoramiXdataPtr[i].y;
if(x || y)
REGION_TRANSLATE(sprite.screen, &sprite.Reg1, x, y);
RegionTranslate(&sprite.Reg1, x, y);
REGION_UNION(sprite.screen, &sprite.Reg1, &sprite.Reg1,
RegionUnion(&sprite.Reg1, &sprite.Reg1,
&sprite.windows[i]->borderSize);
off_x = panoramiXdataPtr[i].x;
off_y = panoramiXdataPtr[i].y;
}
sprite.hotLimits = *REGION_EXTENTS(sprite.screen, &sprite.Reg1);
sprite.hotLimits = *RegionExtents(&sprite.Reg1);
if(REGION_NUM_RECTS(&sprite.Reg1) > 1)
if(RegionNumRects(&sprite.Reg1) > 1)
sprite.hotShape = &sprite.Reg1;
else
sprite.hotShape = NullRegion;
......@@ -765,9 +765,9 @@ ConfineToShape(RegionPtr shape, int *px, int *py)
int x = *px, y = *py;
int incx = 1, incy = 1;
if (POINT_IN_REGION(sprite.hot.pScreen, shape, x, y, &box))
if (RegionContainsPoint(shape, x, y, &box))
return;
box = *REGION_EXTENTS(sprite.hot.pScreen, shape);
box = *RegionExtents(shape);
/* this is rather crude */
do {
x += incx;
......@@ -789,7 +789,7 @@ ConfineToShape(RegionPtr shape, int *px, int *py)
else if (y < box.y1)
return; /* should never get here! */
}
} while (!POINT_IN_REGION(sprite.hot.pScreen, shape, x, y, &box));
} while (!RegionContainsPoint(shape, x, y, &box));
*px = x;
*py = y;
}
......@@ -877,7 +877,7 @@ CheckVirtualMotion(
#endif
sprite.hot.x = sprite.hot.y = 0;
}
lims = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin->borderSize);
lims = *RegionExtents(&pWin->borderSize);
if (sprite.hot.x < lims.x1)
#ifdef XEVIE
xeviehot.x =
......@@ -931,7 +931,7 @@ ConfineCursorToWindow(WindowPtr pWin, Bool generateEvents, Bool confineToScreen)
}
else
{
sprite.hotLimits = *REGION_EXTENTS( pScreen, &pWin->borderSize);
sprite.hotLimits = *RegionExtents(&pWin->borderSize);
#ifdef SHAPE
sprite.hotShape = wBoundingShape(pWin) ? &pWin->borderSize
: NullRegion;
......@@ -2117,7 +2117,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
......@@ -2125,7 +2125,7 @@ PointInBorderSize(WindowPtr pWin, int x, int y)
int i;
for(i = 1; i < PanoramiXNumScreens; i++) {
if(POINT_IN_REGION(sprite.screen,
if(RegionContainsPoint(
&sprite.windows[i]->borderSize,
x + panoramiXdataPtr[0].x - panoramiXdataPtr[i].x,
y + panoramiXdataPtr[0].y - panoramiXdataPtr[i].y,
......@@ -2180,7 +2180,7 @@ XYToWindow(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))
......@@ -2329,10 +2329,10 @@ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff)
sprite.hotLimits.x2 -= xoff;
sprite.hotLimits.y2 -= yoff;
if (REGION_NOTEMPTY(sprite.screen, &sprite.Reg1))
REGION_TRANSLATE(sprite.screen, &sprite.Reg1, xoff, yoff);
if (REGION_NOTEMPTY(sprite.screen, &sprite.Reg2))
REGION_TRANSLATE(sprite.screen, &sprite.Reg2, xoff, yoff);
if (RegionNotEmpty(&sprite.Reg1))
RegionTranslate(&sprite.Reg1, xoff, yoff);
if (RegionNotEmpty(&sprite.Reg2))
RegionTranslate(&sprite.Reg2, xoff, yoff);
/* FIXME: if we call ConfineCursorToWindow, must we do anything else? */
if ((grab = inputInfo.pointer->grab) && grab->confineTo) {
......@@ -2388,8 +2388,8 @@ DefineInitialRootWindow(register WindowPtr win)
#endif
sprite.screen = pScreen;
/* gotta UNINIT these someplace */
REGION_NULL(pScreen, &sprite.Reg1);
REGION_NULL(pScreen, &sprite.Reg2);
RegionNull(&sprite.Reg1);
RegionNull(&sprite.Reg2);
}
#endif
......@@ -2467,7 +2467,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(pWin)) return FALSE;
......@@ -2481,9 +2481,9 @@ XineramaPointInWindowIsVisible(
x = xoff - panoramiXdataPtr[i].x;
y = yoff - panoramiXdataPtr[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)))
......@@ -2659,7 +2659,7 @@ ProcWarpPointer(ClientPtr client)
static Bool
BorderSizeNotEmpty(WindowPtr pWin)
{
if(REGION_NOTEMPTY(sprite.hotPhys.pScreen, &pWin->borderSize))
if(RegionNotEmpty(&pWin->borderSize))
return TRUE;
#ifdef PANORAMIX
......@@ -2667,7 +2667,7 @@ BorderSizeNotEmpty(WindowPtr pWin)
int i;
for(i = 1; i < PanoramiXNumScreens; i++) {
if(REGION_NOTEMPTY(sprite.screen, &sprite.windows[i]->borderSize))
if(RegionNotEmpty(&sprite.windows[i]->borderSize))
return TRUE;
}
}
......
......@@ -1537,7 +1537,7 @@ SetPictureClipRects (PicturePtr pPicture,
RegionPtr clientClip;
int result;
clientClip = RECTS_TO_REGION(pScreen,
clientClip = RegionFromRects(
nRect, rects, CT_UNSORTED);
if (!clientClip)
return BadAlloc;
......@@ -1568,14 +1568,14 @@ SetPictureClipRegion (PicturePtr pPicture,
if (pRegion)
{
type = CT_REGION;
clientClip = REGION_CREATE (pScreen,
REGION_EXTENTS(pScreen, pRegion),
REGION_NUM_RECTS(pRegion));
clientClip = RegionCreate(
RegionExtents(pRegion),
RegionNumRects(pRegion));
if (!clientClip)
return BadAlloc;
if (!REGION_COPY (pSCreen, clientClip, pRegion))
if (!RegionCopy(clientClip, pRegion))
{
REGION_DESTROY (pScreen, clientClip);
RegionDestroy(clientClip);
return BadAlloc;
}
}
......@@ -1685,9 +1685,9 @@ CopyPicture (PicturePtr pSrc,
RegionPtr clientClip;
RegionPtr srcClientClip = (RegionPtr)pSrc->clientClip;
clientClip = REGION_CREATE(pSrc->pDrawable->pScreen,
REGION_EXTENTS(pSrc->pDrawable->pScreen, srcClientClip),
REGION_NUM_RECTS(srcClientClip));
clientClip = RegionCreate(
RegionExtents(srcClientClip),
RegionNumRects(srcClientClip));
(*ps->ChangePictureClip)(pDst, CT_REGION, clientClip, 0);
}
break;
......
......@@ -160,11 +160,11 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
box.x2 = width;
box.y2 = height;
pPixmapPriv -> corruptedRegion = REGION_CREATE(pPixmap -> drawable.pScreen, &box, 1);
pPixmapPriv -> corruptedRegion = RegionCreate(&box, 1);
}
else
{
pPixmapPriv -> corruptedRegion = REGION_CREATE(pPixmap -> drawable.pScreen, (BoxRec *) NULL, 1);
pPixmapPriv -> corruptedRegion = RegionCreate((BoxRec *) NULL, 1);
}
pPixmapPriv -> corruptedBackground = 0;
......@@ -269,7 +269,7 @@ PixmapPtr nxagentCreatePixmap(ScreenPtr pScreen, int width,
pVirtualPriv -> isVirtual = True;
pVirtualPriv -> isShared = nxagentShmPixmapTrap;
pVirtualPriv -> corruptedRegion = REGION_CREATE(pVirtual -> drawable.pScreen, (BoxRec *) NULL, 1);
pVirtualPriv -> corruptedRegion = RegionCreate((BoxRec *) NULL, 1);
pVirtualPriv -> corruptedBackground = 0;
......@@ -444,7 +444,7 @@ Bool nxagentDestroyPixmap(PixmapPtr pPixmap)
if (pPixmapPriv -> corruptedRegion != NullRegion)
{
REGION_DESTROY(pPixmap -> drawable.pScreen, pPixmapPriv -> corruptedRegion);
RegionDestroy(pPixmapPriv -> corruptedRegion);
pPixmapPriv -> corruptedRegion = NullRegion;
}
......@@ -512,7 +512,7 @@ Bool nxagentDestroyVirtualPixmap(PixmapPtr pPixmap)
if (pVirtualPriv -> corruptedRegion != NullRegion)
{
REGION_DESTROY(pVirtual -> drawable.pScreen, pVirtualPriv -> corruptedRegion);
RegionDestroy(pVirtualPriv -> corruptedRegion);
pVirtualPriv -> corruptedRegion = NullRegion;
}
......
......@@ -1240,7 +1240,7 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
pRegion = nxagentCreateRegion(pDst -> pDrawable, NULL, glyphBox.x1, glyphBox.y1,
glyphBox.x2 - glyphBox.x1, glyphBox.y2 - glyphBox.y1);
if (REGION_NIL(pRegion) == 1)
if (RegionNil(pRegion) == 1)
{
#ifdef TEST
fprintf(stderr, "nxagentGlyphs: WARNING! Glyphs prevented on hidden window at [%p].\n",
......@@ -1602,24 +1602,24 @@ void nxagentCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color,
(op == PictOpSrc ||
(op == PictOpOver && color -> alpha == 0xffff)))
{
rectRegion = RECTS_TO_REGION(pDst -> pDrawable -> pScreen, nRect, rects, CT_REGION);
rectRegion = RegionFromRects(nRect, rects, CT_REGION);
if (pDst -> clientClipType != CT_NONE)
{
RegionRec tmpRegion;
REGION_INIT(pDst -> pDrawable -> pScreen, &tmpRegion, NullBox, 1);
RegionInit(&tmpRegion, NullBox, 1);
REGION_COPY(pDst -> pDrawable -> pScreen, &tmpRegion, (RegionPtr) pDst -> clientClip);
RegionCopy(&tmpRegion, (RegionPtr) pDst -> clientClip);
if (pDst -> clipOrigin.x != 0 || pDst -> clipOrigin.y != 0)
{
REGION_TRANSLATE(pDst -> pDrawable -> pScreen, &tmpRegion, pDst -> clipOrigin.x, pDst -> clipOrigin.y);
RegionTranslate(&tmpRegion, pDst -> clipOrigin.x, pDst -> clipOrigin.y);
}
REGION_INTERSECT(pDst -> pDrawable -> pScreen, rectRegion, rectRegion, &tmpRegion);
RegionIntersect(rectRegion, rectRegion, &tmpRegion);
REGION_UNINIT(pDst -> pDrawable -> pScreen, &tmpRegion);
RegionUninit(&tmpRegion);
}
#ifdef TEST
......@@ -1629,7 +1629,7 @@ void nxagentCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color,
nxagentUnmarkCorruptedRegion(pDst -> pDrawable, rectRegion);
REGION_DESTROY(pDrawable -> pScreen, rectRegion);
RegionDestroy(rectRegion);
}
XRenderFillRectangles(nxagentDisplay,
......@@ -1716,7 +1716,7 @@ FIXME: Is this useful or just a waste of bandwidth?
*/
if (nxagentDrawableStatus(pDst -> pDrawable) == NotSynchronized &&
RECT_IN_REGION(pDst -> pDrawable -> pScreen, nxagentCorruptedRegion(pDst -> pDrawable),
RegionContainsRect(nxagentCorruptedRegion(pDst -> pDrawable),
nxagentTrapezoidExtents) == rgnIN)
{
#ifdef TEST
......
......@@ -502,7 +502,7 @@ void nxagentReleaseSplit(DrawablePtr pDrawable)
(void *) pDrawable);
#endif
REGION_DESTROY(pDrawable -> pScreen, pResource -> region);
RegionDestroy(pResource -> region);
pResource -> region = NullRegion;
}
......@@ -623,11 +623,11 @@ void nxagentValidateSplit(DrawablePtr pDrawable, RegionPtr pRegion)
* streamed.
*/
REGION_INIT(pDrawable -> pScreen, &tmpRegion, NullBox, 1);
RegionInit(&tmpRegion, NullBox, 1);
REGION_INTERSECT(pDrawable -> pScreen, &tmpRegion, pResource -> region, pRegion);
RegionIntersect(&tmpRegion, pResource -> region, pRegion);
if (REGION_NIL(&tmpRegion) == 0)
if (RegionNil(&tmpRegion) == 0)
{
#ifdef TEST
fprintf(stderr, "nxagentValidateSplit: Marking the overlapping commits as invalid "
......@@ -644,7 +644,7 @@ void nxagentValidateSplit(DrawablePtr pDrawable, RegionPtr pRegion)
}
#endif
REGION_UNINIT(pDrawable -> pScreen, &tmpRegion);
RegionUninit(&tmpRegion);
}
}
......@@ -1097,9 +1097,9 @@ void nxagentHandleEndSplitEvent(int resource)
if (pResource -> drawable != NULL &&
pResource -> region != NullRegion)
{
if (REGION_NIL(pResource -> region) == 0)
if (RegionNil(pResource -> region) == 0)
{
REGION_SUBTRACT(pResource -> drawable -> pScreen,
RegionSubtract(
nxagentCorruptedRegion(pResource -> drawable),
nxagentCorruptedRegion(pResource -> drawable),
pResource -> region);
......
......@@ -103,73 +103,73 @@ extern RegDataRec miBrokenData;
#ifdef NEED_SCREEN_REGIONS
#define REGION_CREATE(_pScreen, _rect, _size) \
#define RegionCreate(_rect, _size) \
(*(REG_pScreen)->RegionCreate)(_rect, _size)
#define REGION_INIT(_pScreen, _pReg, _rect, _size) \
#define RegionInit(_pReg, _rect, _size) \
(*(REG_pScreen)->RegionInit)(_pReg, _rect, _size)
#define REGION_COPY(_pScreen, dst, src) \
#define RegionCopy(dst, src) \
(*(REG_pScreen)->RegionCopy)(dst, src)
#define REGION_DESTROY(_pScreen, _pReg) \
#define RegionDestroy(_pReg) \
(*(REG_pScreen)->RegionDestroy)(_pReg)
#define REGION_UNINIT(_pScreen, _pReg) \
#define RegionUninit(_pReg) \
(*(REG_pScreen)->RegionUninit)(_pReg)
#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \
#define RegionIntersect(newReg, reg1, reg2) \
(*(REG_pScreen)->Intersect)(newReg, reg1, reg2)
#define REGION_UNION(_pScreen, newReg, reg1, reg2) \
#define RegionUnion(newReg, reg1, reg2) \
(*(REG_pScreen)->Union)(newReg, reg1, reg2)
#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \
#define RegionSubtract(newReg, reg1, reg2) \
(*(REG_pScreen)->Subtract)(newReg, reg1, reg2)
#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \
#define RegionInverse(newReg, reg1, invRect) \
(*(REG_pScreen)->Inverse)(newReg, reg1, invRect)
#define REGION_RESET(_pScreen, _pReg, _pBox) \
#define RegionReset(_pReg, _pBox) \
(*(REG_pScreen)->RegionReset)(_pReg, _pBox)
#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \
#define RegionTranslate(_pReg, _x, _y) \
(*(REG_pScreen)->TranslateRegion)(_pReg, _x, _y)
#define RECT_IN_REGION(_pScreen, _pReg, prect) \
#define RegionContainsRect(_pReg, prect) \
(*(REG_pScreen)->RectIn)(_pReg, prect)
#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \
#define RegionContainsPoint(_pReg, _x, _y, prect) \
(*(REG_pScreen)->PointInRegion)(_pReg, _x, _y, prect)
#define REGION_NOTEMPTY(_pScreen, _pReg) \
#define RegionNotEmpty(_pReg) \
(*(REG_pScreen)->RegionNotEmpty)(_pReg)
#define REGION_EQUAL(_pScreen, _pReg1, _pReg2) \
#define RegionEqual(_pReg1, _pReg2) \
(*(REG_pScreen)->RegionEqual)(_pReg1, _pReg2)
#define REGION_BROKEN(_pScreen, _pReg) \
#define RegionBroken(_pReg) \
(*(REG_pScreen)->RegionBroken)(_pReg)
#define REGION_BREAK(_pScreen, _pReg) \
#define RegionBreak(_pReg) \
(*(REG_pScreen)->RegionBreak)(_pReg)
#define REGION_EMPTY(_pScreen, _pReg) \
#define RegionEmpty(_pReg) \
(*(REG_pScreen)->RegionEmpty)(_pReg)
#define REGION_EXTENTS(_pScreen, _pReg) \
#define RegionExtents(_pReg) \
(*(REG_pScreen)->RegionExtents)(_pReg)
#define REGION_APPEND(_pScreen, dstrgn, rgn) \
#define RegionAppend(dstrgn, rgn) \
(*(REG_pScreen)->RegionAppend)(dstrgn, rgn)
#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \
#define RegionValidate(badreg, pOverlap) \
(*(REG_pScreen)->RegionValidate)(badreg, pOverlap)
#define BITMAP_TO_REGION(_pScreen, pPix) \
(*(REG_pScreen)->BitmapToRegion)(pPix)
#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \
#define RegionFromRects(nrects, prect, ctype) \
(*(REG_pScreen)->RectsToRegion)(nrects, prect, ctype)
#else /* !NEED_SCREEN_REGIONS */
......@@ -177,80 +177,80 @@ extern RegDataRec miBrokenData;
/* Reference _pScreen macro argument and check its type */
#define REGION_SCREEN(_pScreen) (void)((REG_pScreen)->myNum)
#define REGION_CREATE(_pScreen, _rect, _size) \
#define RegionCreate(_rect, _size) \
(REGION_SCREEN(_pScreen), miRegionCreate(_rect, _size))
#define REGION_COPY(_pScreen, dst, src) \
#define RegionCopy(dst, src) \
(REGION_SCREEN(_pScreen), miRegionCopy(dst, src))
#define REGION_DESTROY(_pScreen, _pReg) \
#define RegionDestroy(_pReg) \
(REGION_SCREEN(_pScreen), miRegionDestroy(_pReg))
#define REGION_INTERSECT(_pScreen, newReg, reg1, reg2) \
#define RegionIntersect(newReg, reg1, reg2) \
(REGION_SCREEN(_pScreen), miIntersect(newReg, reg1, reg2))
#define REGION_UNION(_pScreen, newReg, reg1, reg2) \
#define RegionUnion(newReg, reg1, reg2) \
(REGION_SCREEN(_pScreen), miUnion(newReg, reg1, reg2))
#define REGION_SUBTRACT(_pScreen, newReg, reg1, reg2) \
#define RegionSubtract(newReg, reg1, reg2) \
(REGION_SCREEN(_pScreen), miSubtract(newReg, reg1, reg2))
#define REGION_INVERSE(_pScreen, newReg, reg1, invRect) \
#define RegionInverse(newReg, reg1, invRect) \
(REGION_SCREEN(_pScreen), miInverse(newReg, reg1, invRect))
#define REGION_TRANSLATE(_pScreen, _pReg, _x, _y) \
#define RegionTranslate(_pReg, _x, _y) \
(REGION_SCREEN(_pScreen), miTranslateRegion(_pReg, _x, _y))
#define RECT_IN_REGION(_pScreen, _pReg, prect) \
#define RegionContainsRect(_pReg, prect) \
(REGION_SCREEN(_pScreen), miRectIn(_pReg, prect))
#define POINT_IN_REGION(_pScreen, _pReg, _x, _y, prect) \
#define RegionContainsPoint(_pReg, _x, _y, prect) \
(REGION_SCREEN(_pScreen), miPointInRegion(_pReg, _x, _y, prect))
#define REGION_APPEND(_pScreen, dstrgn, rgn) \
#define RegionAppend(dstrgn, rgn) \
(REGION_SCREEN(_pScreen), miRegionAppend(dstrgn, rgn))
#define REGION_VALIDATE(_pScreen, badreg, pOverlap) \
#define RegionValidate(badreg, pOverlap) \
(REGION_SCREEN(_pScreen), miRegionValidate(badreg, pOverlap))
#define BITMAP_TO_REGION(_pScreen, pPix) \
(*(_pScreen)->BitmapToRegion)(pPix) /* no mi version?! */
#define RECTS_TO_REGION(_pScreen, nrects, prect, ctype) \
#define RegionFromRects(nrects, prect, ctype) \
(REGION_SCREEN(_pScreen), miRectsToRegion(nrects, prect, ctype))
#define REGION_EQUAL(_pScreen, _pReg1, _pReg2) \
#define RegionEqual(_pReg1, _pReg2) \
(REGION_SCREEN(_pScreen), miRegionEqual(_pReg1, _pReg2))
#define REGION_BREAK(_pScreen, _pReg) \
#define RegionBreak(_pReg) \
(REGION_SCREEN(_pScreen), miRegionBreak(_pReg))
#ifdef DONT_INLINE_REGION_OPS
#define REGION_INIT(_pScreen, _pReg, _rect, _size) \
#define RegionInit(_pReg, _rect, _size) \
(REGION_SCREEN(_pScreen), miRegionInit(_pReg, _rect, _size))
#define REGION_UNINIT(_pScreen, _pReg) \
#define RegionUninit(_pReg) \
(REGION_SCREEN(_pScreen), miRegionUninit(_pReg))
#define REGION_RESET(_pScreen, _pReg, _pBox) \
#define RegionReset(_pReg, _pBox) \
(REGION_SCREEN(_pScreen), miRegionReset(_pReg, _pBox))
#define REGION_NOTEMPTY(_pScreen, _pReg) \
#define RegionNotEmpty(_pReg) \
(REGION_SCREEN(_pScreen), miRegionNotEmpty(_pReg))
#define REGION_BROKEN(_pScreen, _pReg) \
#define RegionBroken(_pReg) \
(REGION_SCREEN(_pScreen), miRegionBroken(_pReg))
#define REGION_EMPTY(_pScreen, _pReg) \
#define RegionEmpty(_pReg) \
(REGION_SCREEN(_pScreen), miRegionEmpty(_pReg))
#define REGION_EXTENTS(_pScreen, _pReg) \
#define RegionExtents(_pReg) \
(REGION_SCREEN(_pScreen), miRegionExtents(_pReg))
#else /* inline certain simple region ops for performance */
#define REGION_INIT(_pScreen, _pReg, _rect, _size) \
#define RegionInit(_pReg, _rect, _size) \
{ \
REGION_SCREEN(_pScreen); \
if (_rect) \
......@@ -274,7 +274,7 @@ extern RegDataRec miBrokenData;
}
#define REGION_UNINIT(_pScreen, _pReg) \
#define RegionUninit(_pReg) \
{ \
REGION_SCREEN(_pScreen); \
if ((_pReg)->data && (_pReg)->data->size) { \
......@@ -283,32 +283,32 @@ extern RegDataRec miBrokenData;
} \
}
#define REGION_RESET(_pScreen, _pReg, _pBox) \
#define RegionReset(_pReg, _pBox) \
{ \
REGION_SCREEN(_pScreen); \
(_pReg)->extents = *(_pBox); \
REGION_UNINIT(_pScreen, _pReg); \
RegionUninit(_pReg); \
(_pReg)->data = (RegDataPtr)NULL; \
}
#define REGION_NOTEMPTY(_pScreen, _pReg) \
#define RegionNotEmpty(_pReg) \
(REGION_SCREEN(_pScreen), !REGION_NIL(_pReg))
#define REGION_BROKEN(_pScreen, _pReg) \
#define RegionBroken(_pReg) \
(REGION_SCREEN(_pScreen), REGION_NAR(_pReg))
#define REGION_EMPTY(_pScreen, _pReg) \
#define RegionEmpty(_pReg) \
{ \
REGION_UNINIT(_pScreen, _pReg); \
RegionUninit(_pReg); \
(_pReg)->extents.x2 = (_pReg)->extents.x1; \
(_pReg)->extents.y2 = (_pReg)->extents.y1; \
(_pReg)->data = &miEmptyData; \
}
#define REGION_EXTENTS(_pScreen, _pReg) \
#define RegionExtents(_pReg) \
(REGION_SCREEN(_pScreen), &(_pReg)->extents)
#define REGION_NULL(_pScreen, _pReg) \
#define RegionNull(_pReg) \
{ \
REGION_SCREEN(_pScreen); \
(_pReg)->extents = miEmptyBox; \
......@@ -319,9 +319,9 @@ extern RegDataRec miBrokenData;
#endif /* NEED_SCREEN_REGIONS */
#ifndef REGION_NULL
#define REGION_NULL(_pScreen, _pReg) \
REGION_INIT(_pScreen, _pReg, NullBox, 1)
#ifndef RegionNull
#define RegionNull(_pReg) \
RegionInit(_pReg, NullBox, 1)
#endif
/* moved from mi.h */
......
......@@ -607,8 +607,8 @@ miBankCopy(
if (!pScreenPriv->pBanks[ns])
continue;
nBox = REGION_NUM_RECTS(pScreenPriv->pBanks[ns]);
pBox = REGION_RECTS(pScreenPriv->pBanks[ns]);
nBox = RegionNumRects(pScreenPriv->pBanks[ns]);
pBox = RegionRects(pScreenPriv->pBanks[ns]);
for (; nBox--; pBox++)
{
......@@ -668,8 +668,8 @@ miBankCopy(
* It's faster to let the lower-level CopyArea do the clipping
* within each bank.
*/
nBox = REGION_NUM_RECTS(pScreenPriv->pBanks[nd]);
pBox = REGION_RECTS(pScreenPriv->pBanks[nd]);
nBox = RegionNumRects(pScreenPriv->pBanks[nd]);
pBox = RegionRects(pScreenPriv->pBanks[nd]);
for (; nBox--; pBox++)
{
......@@ -775,10 +775,10 @@ miBankCopy(
}
else
{
REGION_INIT(pScreen, &rgnDst, &fastBox, 1);
REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrcClip);
pBox = REGION_RECTS(&rgnDst);
nBox = REGION_NUM_RECTS(&rgnDst);
RegionInit(&rgnDst, &fastBox, 1);
RegionIntersect(&rgnDst, &rgnDst, prgnSrcClip);
pBox = RegionRects(&rgnDst);
nBox = RegionNumRects(&rgnDst);
}
/*
......@@ -804,8 +804,8 @@ miBankCopy(
if (!pScreenPriv->pBanks[ns])
continue;
nBoxClipSrc = REGION_NUM_RECTS(pScreenPriv->pBanks[ns]);
pBoxClipSrc = REGION_RECTS(pScreenPriv->pBanks[ns]);
nBoxClipSrc = RegionNumRects(pScreenPriv->pBanks[ns]);
pBoxClipSrc = RegionRects(pScreenPriv->pBanks[ns]);
for (; nBoxClipSrc--; pBoxClipSrc++)
{
......@@ -836,9 +836,9 @@ miBankCopy(
* so use the bank clips here instead.
*/
nBoxClipDst =
REGION_NUM_RECTS(pScreenPriv->pBanks[nd]);
RegionNumRects(pScreenPriv->pBanks[nd]);
pBoxClipDst =
REGION_RECTS(pScreenPriv->pBanks[nd]);
RegionRects(pScreenPriv->pBanks[nd]);
for (; nBoxClipDst--; pBoxClipDst++)
{
......@@ -878,7 +878,7 @@ miBankCopy(
pScreenPriv->nPixelsPerScanlinePadUnit) ||
(ccBox.x2 %
pScreenPriv->nPixelsPerScanlinePadUnit) ||
(RECT_IN_REGION(pScreen,
(RegionContainsRect(
pGCPriv->pBankedClips[nd], &ccBox) !=
rgnIN)))
pQueue->fastBlit = FALSE;
......@@ -892,9 +892,9 @@ miBankCopy(
if (!fastClip)
{
REGION_UNINIT(pScreen, &rgnDst);
RegionUninit(&rgnDst);
if (freeSrcClip)
REGION_DESTROY(pScreen, prgnSrcClip);
RegionDestroy(prgnSrcClip);
}
pQueueNew = pQueue;
......@@ -1405,16 +1405,16 @@ miBankValidateGC(
continue;
if (!(prgnClip = pGCPriv->pBankedClips[i]))
prgnClip = REGION_CREATE(pScreen, NULL, 1);
prgnClip = RegionCreate(NULL, 1);
REGION_INTERSECT(pScreen, prgnClip,
RegionIntersect(prgnClip,
pScreenPriv->pBanks[i], pGC->pCompositeClip);
if ((REGION_NUM_RECTS(prgnClip) <= 1) &&
if ((RegionNumRects(prgnClip) <= 1) &&
((prgnClip->extents.x1 == prgnClip->extents.x2) ||
(prgnClip->extents.y1 == prgnClip->extents.y2)))
{
REGION_DESTROY(pScreen, prgnClip);
RegionDestroy(prgnClip);
pGCPriv->pBankedClips[i] = NULL;
}
else
......@@ -1469,7 +1469,7 @@ miBankValidateGC(
if (!pGCPriv->pBankedClips[i])
continue;
REGION_DESTROY(pScreen, pGCPriv->pBankedClips[i]);
RegionDestroy(pGCPriv->pBankedClips[i]);
pGCPriv->pBankedClips[i] = NULL;
}
}
......@@ -1528,7 +1528,7 @@ miBankDestroyGC(
if (!pGCPriv->pBankedClips[i])
continue;
REGION_DESTROY(pScreen, pGCPriv->pBankedClips[i]);
RegionDestroy(pGCPriv->pBankedClips[i]);
pGCPriv->pBankedClips[i] = NULL;
}
......@@ -1707,7 +1707,7 @@ miBankCloseScreen(
/* Delete bank clips */
for (i = 0; i < pScreenPriv->nBanks; i++)
if (pScreenPriv->pBanks[i])
REGION_DESTROY(pScreen, pScreenPriv->pBanks[i]);
RegionDestroy(pScreenPriv->pBanks[i]);
Xfree(pScreenPriv->pBanks);
......@@ -1915,17 +1915,17 @@ miBankPaintWindow(
}
else
{
REGION_NULL(pScreen, &tmpReg);
RegionNull(&tmpReg);
for (i = 0; i < pScreenPriv->nBanks; i++)
{
if (!pScreenPriv->pBanks[i])
continue;
REGION_INTERSECT(pScreen, &tmpReg, pRegion,
RegionIntersect(&tmpReg, pRegion,
pScreenPriv->pBanks[i]);
if (REGION_NIL(&tmpReg))
if (RegionNil(&tmpReg))
continue;
SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, i);
......@@ -1933,7 +1933,7 @@ miBankPaintWindow(
(*PaintWindow)(pWin, &tmpReg, what);
}
REGION_UNINIT(pScreen, &tmpReg);
RegionUninit(&tmpReg);
}
if (what == PW_BORDER)
......@@ -1968,15 +1968,15 @@ miBankCopyWindow(
ChangeGC(pGC, GCSubwindowMode, &subWindowMode);
ValidateGC(pDrawable, pGC);
pRgnDst = REGION_CREATE(pScreen, NULL, 1);
pRgnDst = RegionCreate(NULL, 1);
dx = ptOldOrg.x - pWindow->drawable.x;
dy = ptOldOrg.y - pWindow->drawable.y;
REGION_TRANSLATE(pScreen, pRgnSrc, -dx, -dy);
REGION_INTERSECT(pScreen, pRgnDst, &pWindow->borderClip, pRgnSrc);
RegionTranslate(pRgnSrc, -dx, -dy);
RegionIntersect(pRgnDst, &pWindow->borderClip, pRgnSrc);
pBox = REGION_RECTS(pRgnDst);
nBox = REGION_NUM_RECTS(pRgnDst);
pBox = RegionRects(pRgnDst);
nBox = RegionNumRects(pRgnDst);
pBoxNew1 = NULL;
pBoxNew2 = NULL;
......@@ -2052,7 +2052,7 @@ miBankCopyWindow(
FreeScratchGC(pGC);
REGION_DESTROY(pScreen, pRgnDst);
RegionDestroy(pRgnDst);
DEALLOCATE_LOCAL(pBoxNew2);
DEALLOCATE_LOCAL(pBoxNew1);
......@@ -2086,30 +2086,30 @@ miBankSaveAreas(
}
else
{
REGION_NULL(pScreen, &rgnClipped);
REGION_TRANSLATE(pScreen, prgnSave, xorg, yorg);
RegionNull(&rgnClipped);
RegionTranslate(prgnSave, xorg, yorg);
for (i = 0; i < pScreenPriv->nBanks; i++)
{
if (!pScreenPriv->pBanks[i])
continue;
REGION_INTERSECT(pScreen, &rgnClipped,
RegionIntersect(&rgnClipped,
prgnSave, pScreenPriv->pBanks[i]);
if (REGION_NIL(&rgnClipped))
if (RegionNil(&rgnClipped))
continue;
SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, i);
REGION_TRANSLATE(pScreen, &rgnClipped, -xorg, -yorg);
RegionTranslate(&rgnClipped, -xorg, -yorg);
(*pScreen->BackingStoreFuncs.SaveAreas)(pPixmap, &rgnClipped,
xorg, yorg, pWin);
}
REGION_TRANSLATE(pScreen, prgnSave, -xorg, -yorg);
REGION_UNINIT(pScreen, &rgnClipped);
RegionTranslate(prgnSave, -xorg, -yorg);
RegionUninit(&rgnClipped);
}
SCREEN_WRAP(BackingStoreFuncs.SaveAreas, miBankSaveAreas);
......@@ -2140,17 +2140,17 @@ miBankRestoreAreas(
}
else
{
REGION_NULL(pScreen, &rgnClipped);
RegionNull(&rgnClipped);
for (i = 0; i < pScreenPriv->nBanks; i++)
{
if (!pScreenPriv->pBanks[i])
continue;
REGION_INTERSECT(pScreen, &rgnClipped,
RegionIntersect(&rgnClipped,
prgnRestore, pScreenPriv->pBanks[i]);
if (REGION_NIL(&rgnClipped))
if (RegionNil(&rgnClipped))
continue;
SET_SINGLE_BANK(pScreenPriv->pScreenPixmap, -1, -1, i);
......@@ -2159,7 +2159,7 @@ miBankRestoreAreas(
xorg, yorg, pWin);
}
REGION_UNINIT(pScreen, &rgnClipped);
RegionUninit(&rgnClipped);
}
SCREEN_WRAP(BackingStoreFuncs.RestoreAreas, miBankRestoreAreas);
......@@ -2345,9 +2345,9 @@ miInitializeBanking(
}
pScreenPriv->pBanks[iBank] =
RECTS_TO_REGION(pScreen, pRect - pRects, pRects, 0);
RegionFromRects(pRect - pRects, pRects, 0);
if (!pScreenPriv->pBanks[iBank] ||
REGION_NAR(pScreenPriv->pBanks[iBank]))
RegionNar(pScreenPriv->pBanks[iBank]))
{
we = 1;
break;
......@@ -2358,7 +2358,7 @@ miInitializeBanking(
{
for (i = iBank; i >= 0; i--)
if (pScreenPriv->pBanks[i])
REGION_DESTROY(pScreen, pScreenPriv->pBanks[i]);
RegionDestroy(pScreenPriv->pBanks[i]);
Xfree(pScreenPriv->pBanks);
Xfree(pScreenPriv);
......
......@@ -117,7 +117,7 @@ miCopyArea(pSrcDrawable, pDstDrawable,
box.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
box.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
prgnSrcClip = REGION_CREATE(pGC->pScreen, &box, 1);
prgnSrcClip = RegionCreate(&box, 1);
realSrcClip = 1;
}
else
......@@ -148,8 +148,8 @@ miCopyArea(pSrcDrawable, pDstDrawable,
ALLOCATE_LOCAL(heightSrc * sizeof(DDXPointRec));
pwidthFirst = pwidth = (unsigned int *)
ALLOCATE_LOCAL(heightSrc * sizeof(unsigned int));
numRects = REGION_NUM_RECTS(prgnSrcClip);
boxes = REGION_RECTS(prgnSrcClip);
numRects = RegionNumRects(prgnSrcClip);
boxes = RegionRects(prgnSrcClip);
ordering = (unsigned int *)
ALLOCATE_LOCAL(numRects * sizeof(unsigned int));
if(!pptFirst || !pwidthFirst || !ordering)
......@@ -264,7 +264,7 @@ miCopyArea(pSrcDrawable, pDstDrawable,
prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, xIn, yIn,
widthSrc, heightSrc, xOut, yOut, (unsigned long)0);
if(realSrcClip)
REGION_DESTROY(pGC->pScreen, prgnSrcClip);
RegionDestroy(prgnSrcClip);
DEALLOCATE_LOCAL(ordering);
DEALLOCATE_LOCAL(pwidthFirst);
......@@ -452,9 +452,9 @@ miOpqStipDrawable(pDraw, pGC, prgnSrc, pbits, srcx, w, h, dstx, dsty)
to destroy what it's sent. note that this means we don't
have to free prgnSrcClip ourselves.
*/
prgnSrcClip = REGION_CREATE(pGCT->pScreen, NULL, 0);
REGION_COPY(pGCT->pScreen, prgnSrcClip, prgnSrc);
REGION_TRANSLATE(pGCT->pScreen, prgnSrcClip, srcx, 0);
prgnSrcClip = RegionCreate(NULL, 0);
RegionCopy(prgnSrcClip, prgnSrc);
RegionTranslate(prgnSrcClip, srcx, 0);
(*pGCT->funcs->ChangeClip)(pGCT, CT_REGION, prgnSrcClip, 0);
ValidateGC((DrawablePtr)pPixmap, pGCT);
......@@ -587,7 +587,7 @@ miCopyPlane(pSrcDrawable, pDstDrawable,
box.x2 = box.x1;
if (box.y1 > box.y2)
box.y2 = box.y1;
prgnSrc = REGION_CREATE(pGC->pScreen, &box, 1);
prgnSrc = RegionCreate(&box, 1);
if (pSrcDrawable->type != DRAWABLE_PIXMAP) {
/* clip to visible drawable */
......@@ -595,15 +595,15 @@ miCopyPlane(pSrcDrawable, pDstDrawable,
if (pGC->subWindowMode == IncludeInferiors)
{
RegionPtr clipList = NotClippedByChildren ((WindowPtr) pSrcDrawable);
REGION_INTERSECT(pGC->pScreen, prgnSrc, prgnSrc, clipList);
REGION_DESTROY(pGC->pScreen, clipList);
RegionIntersect(prgnSrc, prgnSrc, clipList);
RegionDestroy(clipList);
} else
REGION_INTERSECT(pGC->pScreen, prgnSrc, prgnSrc,
RegionIntersect(prgnSrc, prgnSrc,
&((WindowPtr)pSrcDrawable)->clipList);
}
box = *REGION_EXTENTS(pGC->pScreen, prgnSrc);
REGION_TRANSLATE(pGC->pScreen, prgnSrc, -box.x1, -box.y1);
box = *RegionExtents(prgnSrc);
RegionTranslate(prgnSrc, -box.x1, -box.y1);
if ((box.x2 > box.x1) && (box.y2 > box.y1))
{
......@@ -627,7 +627,7 @@ miCopyPlane(pSrcDrawable, pDstDrawable,
}
prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, srcx, srcy,
width, height, dstx, dsty, bitPlane);
REGION_DESTROY(pGC->pScreen, prgnSrc);
RegionDestroy(prgnSrc);
return prgnExposed;
}
......@@ -776,11 +776,11 @@ miPutImage(pDraw, pGC, depth, x, y, w, h, leftPad, format, pImage)
box.y1 = 0;
box.x2 = w;
box.y2 = h;
prgnSrc = REGION_CREATE(pGC->pScreen, &box, 1);
prgnSrc = RegionCreate(&box, 1);
miOpqStipDrawable(pDraw, pGC, prgnSrc, (MiBits *) pImage,
leftPad, w, h, x, y);
REGION_DESTROY(pGC->pScreen, prgnSrc);
RegionDestroy(prgnSrc);
break;
case XYPixmap:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment