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