Rename region macros to eliminate screen argument
This is a combination of a huge mechanical patch and a few small fixups required to finish the job. They were reviewed separately, but because the server does not build without both pieces, I've merged them together at this time. The mechanical changes were performed by running the included 'fix-region' script over the whole tree: $ git ls-files | grep -v '^fix-' | xargs ./fix-region And then, the white space errors in the resulting patch were fixed using the provided fix-patch-whitespace script. $ sh ./fix-patch-whitespace Thanks to Jamey Sharp for the mighty fine sed-generating sed script. The hand-done changes involve removing functions from dix/region.c that duplicate inline functions in include/regionstr.h, along with their declarations in regionstr.h, mi.h and mispans.h. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
d17e726e89
commit
2dc138922b
|
@ -152,7 +152,7 @@ XineramaCloseScreen (int i, ScreenPtr pScreen)
|
||||||
pScreen->CreateGC = pScreenPriv->CreateGC;
|
pScreen->CreateGC = pScreenPriv->CreateGC;
|
||||||
|
|
||||||
if (pScreen->myNum == 0)
|
if (pScreen->myNum == 0)
|
||||||
REGION_UNINIT(pScreen, &PanoramiXScreenRegion);
|
RegionUninit(&PanoramiXScreenRegion);
|
||||||
|
|
||||||
free((pointer) pScreenPriv);
|
free((pointer) pScreenPriv);
|
||||||
|
|
||||||
|
@ -386,7 +386,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;
|
||||||
RegionRec ScreenRegion;
|
RegionRec ScreenRegion;
|
||||||
|
@ -398,10 +398,10 @@ static void XineramaInitData(ScreenPtr pScreen)
|
||||||
TheBox.y1 = pScreen->y;
|
TheBox.y1 = pScreen->y;
|
||||||
TheBox.y2 = TheBox.y1 + pScreen->height;
|
TheBox.y2 = TheBox.y1 + pScreen->height;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &ScreenRegion, &TheBox, 1);
|
RegionInit(&ScreenRegion, &TheBox, 1);
|
||||||
REGION_UNION(pScreen, &PanoramiXScreenRegion, &PanoramiXScreenRegion,
|
RegionUnion(&PanoramiXScreenRegion, &PanoramiXScreenRegion,
|
||||||
&ScreenRegion);
|
&ScreenRegion);
|
||||||
REGION_UNINIT(pScreen, &ScreenRegion);
|
RegionUninit(&ScreenRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
PanoramiXPixWidth = screenInfo.screens[0]->x + screenInfo.screens[0]->width;
|
PanoramiXPixWidth = screenInfo.screens[0]->x + screenInfo.screens[0]->width;
|
||||||
|
@ -421,7 +421,7 @@ static void XineramaInitData(ScreenPtr pScreen)
|
||||||
|
|
||||||
void XineramaReinitData(ScreenPtr pScreen)
|
void XineramaReinitData(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
REGION_UNINIT(pScreen, &PanoramiXScreenRegion);
|
RegionUninit(&PanoramiXScreenRegion);
|
||||||
XineramaInitData(pScreen);
|
XineramaInitData(pScreen);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1153,8 +1153,8 @@ 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;
|
||||||
|
|
||||||
|
@ -1169,11 +1169,11 @@ XineramaGetImageData(
|
||||||
TheBox.y1 = pScreen->y;
|
TheBox.y1 = pScreen->y;
|
||||||
TheBox.y2 = TheBox.y1 + pScreen->height;
|
TheBox.y2 = TheBox.y1 + pScreen->height;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &ScreenRegion, &TheBox, 1);
|
RegionInit(&ScreenRegion, &TheBox, 1);
|
||||||
inOut = RECT_IN_REGION(pScreen, &ScreenRegion, &SrcBox);
|
inOut = RegionContainsRect(&ScreenRegion, &SrcBox);
|
||||||
if(inOut == rgnPART)
|
if(inOut == rgnPART)
|
||||||
REGION_INTERSECT(pScreen, &GrabRegion, &SrcRegion, &ScreenRegion);
|
RegionIntersect(&GrabRegion, &SrcRegion, &ScreenRegion);
|
||||||
REGION_UNINIT(pScreen, &ScreenRegion);
|
RegionUninit(&ScreenRegion);
|
||||||
|
|
||||||
if(inOut == rgnIN) {
|
if(inOut == rgnIN) {
|
||||||
(*pScreen->GetImage)(pDraw,
|
(*pScreen->GetImage)(pDraw,
|
||||||
|
@ -1184,10 +1184,10 @@ XineramaGetImageData(
|
||||||
} else if (inOut == rgnOUT)
|
} else if (inOut == rgnOUT)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
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;
|
||||||
|
@ -1264,8 +1264,8 @@ XineramaGetImageData(
|
||||||
pbox++;
|
pbox++;
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_SUBTRACT(pScreen, &SrcRegion, &SrcRegion, &GrabRegion);
|
RegionSubtract(&SrcRegion, &SrcRegion, &GrabRegion);
|
||||||
if(!REGION_NOTEMPTY(pScreen, &SrcRegion))
|
if(!RegionNotEmpty(&SrcRegion))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1274,6 +1274,6 @@ XineramaGetImageData(
|
||||||
if(ScratchMem)
|
if(ScratchMem)
|
||||||
free(ScratchMem);
|
free(ScratchMem);
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &SrcRegion);
|
RegionUninit(&SrcRegion);
|
||||||
REGION_UNINIT(pScreen, &GrabRegion);
|
RegionUninit(&GrabRegion);
|
||||||
}
|
}
|
||||||
|
|
|
@ -620,7 +620,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))
|
||||||
|
@ -1087,7 +1087,7 @@ int PanoramiXCopyArea(ClientPtr client)
|
||||||
RegionRec totalReg;
|
RegionRec totalReg;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
REGION_NULL(unusedScreen, &totalReg);
|
RegionNull(&totalReg);
|
||||||
FOR_NSCREENS_BACKWARD(j) {
|
FOR_NSCREENS_BACKWARD(j) {
|
||||||
RegionPtr pRgn;
|
RegionPtr pRgn;
|
||||||
stuff->dstDrawable = dst->info[j].id;
|
stuff->dstDrawable = dst->info[j].id;
|
||||||
|
@ -1124,11 +1124,11 @@ int PanoramiXCopyArea(ClientPtr client)
|
||||||
stuff->dstX, stuff->dstY);
|
stuff->dstX, stuff->dstY);
|
||||||
if(pGC->graphicsExposures && pRgn) {
|
if(pGC->graphicsExposures && pRgn) {
|
||||||
if(srcIsRoot) {
|
if(srcIsRoot) {
|
||||||
REGION_TRANSLATE(unusedScreen, pRgn,
|
RegionTranslate(pRgn,
|
||||||
screenInfo.screens[j]->x, screenInfo.screens[j]->y);
|
screenInfo.screens[j]->x, screenInfo.screens[j]->y);
|
||||||
}
|
}
|
||||||
REGION_APPEND(unusedScreen, &totalReg, pRgn);
|
RegionAppend(&totalReg, pRgn);
|
||||||
REGION_DESTROY(unusedScreen, pRgn);
|
RegionDestroy(pRgn);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dstShared)
|
if(dstShared)
|
||||||
|
@ -1138,10 +1138,10 @@ int PanoramiXCopyArea(ClientPtr client)
|
||||||
if(pGC->graphicsExposures) {
|
if(pGC->graphicsExposures) {
|
||||||
ScreenPtr pScreen = pDst->pScreen;
|
ScreenPtr pScreen = pDst->pScreen;
|
||||||
Bool overlap;
|
Bool overlap;
|
||||||
REGION_VALIDATE(unusedScreen, &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(unusedScreen, &totalReg);
|
RegionUninit(&totalReg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1193,7 +1193,7 @@ int PanoramiXCopyPlane(ClientPtr client)
|
||||||
srcx = stuff->srcX; srcy = stuff->srcY;
|
srcx = stuff->srcX; srcy = stuff->srcY;
|
||||||
dstx = stuff->dstX; dsty = stuff->dstY;
|
dstx = stuff->dstX; dsty = stuff->dstY;
|
||||||
|
|
||||||
REGION_NULL(unusedScreen, &totalReg);
|
RegionNull(&totalReg);
|
||||||
FOR_NSCREENS_BACKWARD(j) {
|
FOR_NSCREENS_BACKWARD(j) {
|
||||||
RegionPtr pRgn;
|
RegionPtr pRgn;
|
||||||
stuff->dstDrawable = dst->info[j].id;
|
stuff->dstDrawable = dst->info[j].id;
|
||||||
|
@ -1233,8 +1233,8 @@ int PanoramiXCopyPlane(ClientPtr client)
|
||||||
stuff->width, stuff->height,
|
stuff->width, stuff->height,
|
||||||
stuff->dstX, stuff->dstY, stuff->bitPlane);
|
stuff->dstX, stuff->dstY, stuff->bitPlane);
|
||||||
if(pGC->graphicsExposures && pRgn) {
|
if(pGC->graphicsExposures && pRgn) {
|
||||||
REGION_APPEND(unusedScreen, &totalReg, pRgn);
|
RegionAppend(&totalReg, pRgn);
|
||||||
REGION_DESTROY(unusedScreen, pRgn);
|
RegionDestroy(pRgn);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(dstShared)
|
if(dstShared)
|
||||||
|
@ -1244,10 +1244,10 @@ int PanoramiXCopyPlane(ClientPtr client)
|
||||||
if(pGC->graphicsExposures) {
|
if(pGC->graphicsExposures) {
|
||||||
ScreenPtr pScreen = pdstDraw->pScreen;
|
ScreenPtr pScreen = pdstDraw->pScreen;
|
||||||
Bool overlap;
|
Bool overlap;
|
||||||
REGION_VALIDATE(unusedScreen, &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(unusedScreen, &totalReg);
|
RegionUninit(&totalReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
|
|
48
Xext/shape.c
48
Xext/shape.c
|
@ -153,11 +153,11 @@ RegionOperate (
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ RegionOperate (
|
||||||
*/
|
*/
|
||||||
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 */
|
||||||
}
|
}
|
||||||
|
@ -187,17 +187,17 @@ RegionOperate (
|
||||||
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;
|
||||||
|
@ -206,20 +206,20 @@ RegionOperate (
|
||||||
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, kind);
|
(*pScreen->SetShape) (pWin, kind);
|
||||||
SendShapeNotify (pWin, kind);
|
SendShapeNotify (pWin, kind);
|
||||||
return Success;
|
return Success;
|
||||||
|
@ -234,7 +234,7 @@ CreateBoundingShape (WindowPtr 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
|
||||||
|
@ -246,7 +246,7 @@ CreateClipShape (WindowPtr 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
|
||||||
|
@ -323,7 +323,7 @@ ProcShapeRectangles (ClientPtr 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);
|
||||||
|
@ -419,7 +419,7 @@ ProcShapeMask (ClientPtr 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;
|
||||||
}
|
}
|
||||||
|
@ -547,8 +547,8 @@ ProcShapeCombine (ClientPtr 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);
|
||||||
|
@ -641,7 +641,7 @@ ProcShapeOffset (ClientPtr 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, stuff->destKind);
|
(*pScreen->SetShape) (pWin, stuff->destKind);
|
||||||
}
|
}
|
||||||
SendShapeNotify (pWin, (int)stuff->destKind);
|
SendShapeNotify (pWin, (int)stuff->destKind);
|
||||||
|
@ -697,7 +697,7 @@ ProcShapeQueryExtents (ClientPtr 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);
|
||||||
|
@ -711,7 +711,7 @@ ProcShapeQueryExtents (ClientPtr 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;
|
||||||
|
@ -899,7 +899,7 @@ SendShapeNotify (WindowPtr pWin, int 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);
|
||||||
|
@ -912,7 +912,7 @@ SendShapeNotify (WindowPtr pWin, int 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;
|
||||||
|
@ -925,7 +925,7 @@ SendShapeNotify (WindowPtr pWin, int 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);
|
||||||
|
@ -1050,8 +1050,8 @@ ProcShapeGetRectangles (ClientPtr client)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
BoxPtr box;
|
BoxPtr box;
|
||||||
nrects = REGION_NUM_RECTS(region);
|
nrects = RegionNumRects(region);
|
||||||
box = REGION_RECTS(region);
|
box = RegionRects(region);
|
||||||
rects = malloc(nrects * sizeof (xRectangle));
|
rects = malloc(nrects * sizeof (xRectangle));
|
||||||
if (!rects && nrects)
|
if (!rects && nrects)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
14
Xext/xace.c
14
Xext/xace.c
|
@ -255,12 +255,12 @@ XaceCensorImage(
|
||||||
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;
|
||||||
|
@ -280,7 +280,7 @@ XaceCensorImage(
|
||||||
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++)
|
||||||
{
|
{
|
||||||
|
@ -330,8 +330,8 @@ XaceCensorImage(
|
||||||
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);
|
||||||
} /* XaceCensorImage */
|
} /* XaceCensorImage */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -134,7 +134,7 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update)
|
||||||
EnableMapUnmapEvents (pWin);
|
EnableMapUnmapEvents (pWin);
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_NULL (pScreen, &cw->borderClip);
|
RegionNull(&cw->borderClip);
|
||||||
cw->borderClipX = 0;
|
cw->borderClipX = 0;
|
||||||
cw->borderClipY = 0;
|
cw->borderClipY = 0;
|
||||||
cw->update = CompositeRedirectAutomatic;
|
cw->update = CompositeRedirectAutomatic;
|
||||||
|
@ -227,7 +227,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);
|
||||||
|
|
||||||
dixSetPrivate(&pWin->devPrivates, CompWindowPrivateKey, NULL);
|
dixSetPrivate(&pWin->devPrivates, CompWindowPrivateKey, NULL);
|
||||||
free(cw);
|
free(cw);
|
||||||
|
@ -599,7 +599,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 = RedirectDrawNone;
|
pWin->redirectDraw = RedirectDrawNone;
|
||||||
|
|
|
@ -218,7 +218,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, (pointer) pRegion))
|
if (!AddResource (stuff->region, RegionResType, (pointer) pRegion))
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
|
@ -98,10 +98,10 @@ compRepaintBorder (ClientPtr pClient, pointer closure)
|
||||||
if (rc == Success) {
|
if (rc == Success) {
|
||||||
RegionRec exposed;
|
RegionRec exposed;
|
||||||
|
|
||||||
REGION_NULL(pScreen, &exposed);
|
RegionNull(&exposed);
|
||||||
REGION_SUBTRACT(pScreen, &exposed, &pWindow->borderClip, &pWindow->winSize);
|
RegionSubtract(&exposed, &pWindow->borderClip, &pWindow->winSize);
|
||||||
miPaintWindow(pWindow, &exposed, PW_BORDER);
|
miPaintWindow(pWindow, &exposed, PW_BORDER);
|
||||||
REGION_UNINIT(pScreen, &exposed);
|
RegionUninit(&exposed);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -283,7 +283,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;
|
||||||
|
@ -404,14 +404,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;
|
||||||
|
@ -419,8 +419,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--)
|
||||||
|
@ -448,16 +448,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);
|
||||||
DamageRegionAppend(&pWin->drawable, prgnSrc);
|
DamageRegionAppend(&pWin->drawable, prgnSrc);
|
||||||
|
@ -525,26 +525,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
|
||||||
*/
|
*/
|
||||||
DamageRegionAppend(&pWin->drawable, &damage);
|
DamageRegionAppend(&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;
|
||||||
}
|
}
|
||||||
|
@ -606,18 +606,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);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -94,10 +94,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)
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -293,9 +293,9 @@ ProcDamageAdd (ClientPtr client)
|
||||||
/* The region is relative to the drawable origin, so translate it out to
|
/* The region is relative to the drawable origin, so translate it out to
|
||||||
* screen coordinates like damage expects.
|
* screen coordinates like damage expects.
|
||||||
*/
|
*/
|
||||||
REGION_TRANSLATE(pScreen, pRegion, pDrawable->x, pDrawable->y);
|
RegionTranslate(pRegion, pDrawable->x, pDrawable->y);
|
||||||
DamageRegionAppend(pDrawable, pRegion);
|
DamageRegionAppend(pDrawable, pRegion);
|
||||||
REGION_TRANSLATE(pScreen, pRegion, -pDrawable->x, -pDrawable->y);
|
RegionTranslate(pRegion, -pDrawable->x, -pDrawable->y);
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1179,11 +1179,11 @@ ProcTranslateCoords(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))
|
||||||
|
@ -1661,7 +1661,7 @@ ProcCopyArea(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 Success;
|
return Success;
|
||||||
|
@ -1711,7 +1711,7 @@ ProcCopyPlane(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 Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
@ -2151,7 +2151,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
|
||||||
pVisibleRegion = NotClippedByChildren((WindowPtr)pDraw);
|
pVisibleRegion = NotClippedByChildren((WindowPtr)pDraw);
|
||||||
if (pVisibleRegion)
|
if (pVisibleRegion)
|
||||||
{
|
{
|
||||||
REGION_TRANSLATE(pDraw->pScreen, pVisibleRegion,
|
RegionTranslate(pVisibleRegion,
|
||||||
-pDraw->x, -pDraw->y);
|
-pDraw->x, -pDraw->y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2240,7 +2240,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pVisibleRegion)
|
if (pVisibleRegion)
|
||||||
REGION_DESTROY(pDraw->pScreen, pVisibleRegion);
|
RegionDestroy(pVisibleRegion);
|
||||||
if (!im_return)
|
if (!im_return)
|
||||||
free(pBuf);
|
free(pBuf);
|
||||||
return Success;
|
return Success;
|
||||||
|
|
56
dix/events.c
56
dix/events.c
|
@ -598,7 +598,7 @@ XineramaConfineCursorToWindow(DeviceIntPtr pDev,
|
||||||
|
|
||||||
i = PanoramiXNumScreens - 1;
|
i = PanoramiXNumScreens - 1;
|
||||||
|
|
||||||
REGION_COPY(pSprite->screen, &pSprite->Reg1,
|
RegionCopy(&pSprite->Reg1,
|
||||||
&pSprite->windows[i]->borderSize);
|
&pSprite->windows[i]->borderSize);
|
||||||
off_x = screenInfo.screens[i]->x;
|
off_x = screenInfo.screens[i]->x;
|
||||||
off_y = screenInfo.screens[i]->y;
|
off_y = screenInfo.screens[i]->y;
|
||||||
|
@ -608,18 +608,18 @@ XineramaConfineCursorToWindow(DeviceIntPtr pDev,
|
||||||
y = off_y - screenInfo.screens[i]->y;
|
y = off_y - screenInfo.screens[i]->y;
|
||||||
|
|
||||||
if(x || y)
|
if(x || y)
|
||||||
REGION_TRANSLATE(pSprite->screen, &pSprite->Reg1, x, y);
|
RegionTranslate(&pSprite->Reg1, x, y);
|
||||||
|
|
||||||
REGION_UNION(pSprite->screen, &pSprite->Reg1, &pSprite->Reg1,
|
RegionUnion(&pSprite->Reg1, &pSprite->Reg1,
|
||||||
&pSprite->windows[i]->borderSize);
|
&pSprite->windows[i]->borderSize);
|
||||||
|
|
||||||
off_x = screenInfo.screens[i]->x;
|
off_x = screenInfo.screens[i]->x;
|
||||||
off_y = screenInfo.screens[i]->y;
|
off_y = screenInfo.screens[i]->y;
|
||||||
}
|
}
|
||||||
|
|
||||||
pSprite->hotLimits = *REGION_EXTENTS(pSprite->screen, &pSprite->Reg1);
|
pSprite->hotLimits = *RegionExtents(&pSprite->Reg1);
|
||||||
|
|
||||||
if(REGION_NUM_RECTS(&pSprite->Reg1) > 1)
|
if(RegionNumRects(&pSprite->Reg1) > 1)
|
||||||
pSprite->hotShape = &pSprite->Reg1;
|
pSprite->hotShape = &pSprite->Reg1;
|
||||||
else
|
else
|
||||||
pSprite->hotShape = NullRegion;
|
pSprite->hotShape = NullRegion;
|
||||||
|
@ -671,9 +671,9 @@ ConfineToShape(DeviceIntPtr pDev, RegionPtr shape, int *px, int *py)
|
||||||
SpritePtr pSprite;
|
SpritePtr pSprite;
|
||||||
|
|
||||||
pSprite = pDev->spriteInfo->sprite;
|
pSprite = pDev->spriteInfo->sprite;
|
||||||
if (POINT_IN_REGION(pSprite->hot.pScreen, shape, x, y, &box))
|
if (RegionContainsPoint(shape, x, y, &box))
|
||||||
return;
|
return;
|
||||||
box = *REGION_EXTENTS(pSprite->hot.pScreen, shape);
|
box = *RegionExtents(shape);
|
||||||
/* this is rather crude */
|
/* this is rather crude */
|
||||||
do {
|
do {
|
||||||
x += incx;
|
x += incx;
|
||||||
|
@ -695,7 +695,7 @@ ConfineToShape(DeviceIntPtr pDev, 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(pSprite->hot.pScreen, shape, x, y, &box));
|
} while (!RegionContainsPoint(shape, x, y, &box));
|
||||||
*px = x;
|
*px = x;
|
||||||
*py = y;
|
*py = y;
|
||||||
}
|
}
|
||||||
|
@ -817,7 +817,7 @@ CheckVirtualMotion(
|
||||||
|
|
||||||
i = PanoramiXNumScreens - 1;
|
i = PanoramiXNumScreens - 1;
|
||||||
|
|
||||||
REGION_COPY(pSprite->screen, &pSprite->Reg2,
|
RegionCopy(&pSprite->Reg2,
|
||||||
&pSprite->windows[i]->borderSize);
|
&pSprite->windows[i]->borderSize);
|
||||||
off_x = screenInfo.screens[i]->x;
|
off_x = screenInfo.screens[i]->x;
|
||||||
off_y = screenInfo.screens[i]->y;
|
off_y = screenInfo.screens[i]->y;
|
||||||
|
@ -827,9 +827,9 @@ CheckVirtualMotion(
|
||||||
y = off_y - screenInfo.screens[i]->y;
|
y = off_y - screenInfo.screens[i]->y;
|
||||||
|
|
||||||
if(x || y)
|
if(x || y)
|
||||||
REGION_TRANSLATE(pSprite->screen, &pSprite->Reg2, x, y);
|
RegionTranslate(&pSprite->Reg2, x, y);
|
||||||
|
|
||||||
REGION_UNION(pSprite->screen, &pSprite->Reg2, &pSprite->Reg2,
|
RegionUnion(&pSprite->Reg2, &pSprite->Reg2,
|
||||||
&pSprite->windows[i]->borderSize);
|
&pSprite->windows[i]->borderSize);
|
||||||
|
|
||||||
off_x = screenInfo.screens[i]->x;
|
off_x = screenInfo.screens[i]->x;
|
||||||
|
@ -845,7 +845,7 @@ CheckVirtualMotion(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lims = *REGION_EXTENTS(pWin->drawable.pScreen, &pWin->borderSize);
|
lims = *RegionExtents(&pWin->borderSize);
|
||||||
if (pSprite->hot.x < lims.x1)
|
if (pSprite->hot.x < lims.x1)
|
||||||
pSprite->hot.x = lims.x1;
|
pSprite->hot.x = lims.x1;
|
||||||
else if (pSprite->hot.x >= lims.x2)
|
else if (pSprite->hot.x >= lims.x2)
|
||||||
|
@ -858,7 +858,7 @@ CheckVirtualMotion(
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
if (!noPanoramiXExtension)
|
if (!noPanoramiXExtension)
|
||||||
{
|
{
|
||||||
if (REGION_NUM_RECTS(&pSprite->Reg2) > 1)
|
if (RegionNumRects(&pSprite->Reg2) > 1)
|
||||||
reg = &pSprite->Reg2;
|
reg = &pSprite->Reg2;
|
||||||
|
|
||||||
} else
|
} else
|
||||||
|
@ -903,7 +903,7 @@ ConfineCursorToWindow(DeviceIntPtr pDev, WindowPtr pWin, Bool generateEvents, Bo
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
pSprite->hotLimits = *REGION_EXTENTS( pScreen, &pWin->borderSize);
|
pSprite->hotLimits = *RegionExtents(&pWin->borderSize);
|
||||||
pSprite->hotShape = wBoundingShape(pWin) ? &pWin->borderSize
|
pSprite->hotShape = wBoundingShape(pWin) ? &pWin->borderSize
|
||||||
: NullRegion;
|
: NullRegion;
|
||||||
CheckPhysLimits(pDev, pSprite->current, generateEvents,
|
CheckPhysLimits(pDev, pSprite->current, generateEvents,
|
||||||
|
@ -2552,7 +2552,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
|
||||||
|
@ -2562,7 +2562,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(pSprite->screen,
|
if(RegionContainsPoint(
|
||||||
&pSprite->windows[i]->borderSize,
|
&pSprite->windows[i]->borderSize,
|
||||||
x + screenInfo.screens[0]->x - screenInfo.screens[i]->x,
|
x + screenInfo.screens[0]->x - screenInfo.screens[i]->x,
|
||||||
y + screenInfo.screens[0]->y - screenInfo.screens[i]->y,
|
y + screenInfo.screens[0]->y - screenInfo.screens[i]->y,
|
||||||
|
@ -2610,7 +2610,7 @@ XYToWindow(DeviceIntPtr pDev, int x, int y)
|
||||||
*/
|
*/
|
||||||
&& (!wBoundingShape(pWin) || PointInBorderSize(pWin, x, y))
|
&& (!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))
|
||||||
|
@ -2880,10 +2880,10 @@ void ReinitializeRootWindow(WindowPtr win, int xoff, int yoff)
|
||||||
pSprite->hotLimits.x2 -= xoff;
|
pSprite->hotLimits.x2 -= xoff;
|
||||||
pSprite->hotLimits.y2 -= yoff;
|
pSprite->hotLimits.y2 -= yoff;
|
||||||
|
|
||||||
if (REGION_NOTEMPTY(pSprite->screen, &pSprite->Reg1))
|
if (RegionNotEmpty(&pSprite->Reg1))
|
||||||
REGION_TRANSLATE(pSprite->screen, &pSprite->Reg1, xoff, yoff);
|
RegionTranslate(&pSprite->Reg1, xoff, yoff);
|
||||||
if (REGION_NOTEMPTY(pSprite->screen, &pSprite->Reg2))
|
if (RegionNotEmpty(&pSprite->Reg2))
|
||||||
REGION_TRANSLATE(pSprite->screen, &pSprite->Reg2, xoff, yoff);
|
RegionTranslate(&pSprite->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 = pDev->deviceGrab.grab) && grab->confineTo) {
|
if ((grab = pDev->deviceGrab.grab) && grab->confineTo) {
|
||||||
|
@ -3018,8 +3018,8 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin)
|
||||||
pSprite->hotShape = NullRegion;
|
pSprite->hotShape = NullRegion;
|
||||||
pSprite->screen = pScreen;
|
pSprite->screen = pScreen;
|
||||||
/* gotta UNINIT these someplace */
|
/* gotta UNINIT these someplace */
|
||||||
REGION_NULL(pScreen, &pSprite->Reg1);
|
RegionNull(&pSprite->Reg1);
|
||||||
REGION_NULL(pScreen, &pSprite->Reg2);
|
RegionNull(&pSprite->Reg2);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -3157,7 +3157,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(inputInfo.pointer, pWin)) return FALSE;
|
if(!XineramaSetWindowPntrs(inputInfo.pointer, pWin)) return FALSE;
|
||||||
|
@ -3171,9 +3171,9 @@ XineramaPointInWindowIsVisible(
|
||||||
x = xoff - screenInfo.screens[i]->x;
|
x = xoff - screenInfo.screens[i]->x;
|
||||||
y = yoff - screenInfo.screens[i]->y;
|
y = yoff - screenInfo.screens[i]->y;
|
||||||
|
|
||||||
if(POINT_IN_REGION(pScreen, &pWin->borderClip, x, y, &box)
|
if(RegionContainsPoint(&pWin->borderClip, x, y, &box)
|
||||||
&& (!wInputShape(pWin) ||
|
&& (!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)))
|
||||||
|
@ -3367,7 +3367,7 @@ ProcWarpPointer(ClientPtr client)
|
||||||
static Bool
|
static Bool
|
||||||
BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin)
|
BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin)
|
||||||
{
|
{
|
||||||
if(REGION_NOTEMPTY(pDev->spriteInfo->sprite->hotPhys.pScreen, &pWin->borderSize))
|
if(RegionNotEmpty(&pWin->borderSize))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
#ifdef PANORAMIX
|
#ifdef PANORAMIX
|
||||||
|
@ -3375,7 +3375,7 @@ BorderSizeNotEmpty(DeviceIntPtr pDev, WindowPtr pWin)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i = 1; i < PanoramiXNumScreens; i++) {
|
for(i = 1; i < PanoramiXNumScreens; i++) {
|
||||||
if(REGION_NOTEMPTY(pDev->spriteInfo->sprite->screen,
|
if(RegionNotEmpty(
|
||||||
&pDev->spriteInfo->sprite->windows[i]->borderSize))
|
&pDev->spriteInfo->sprite->windows[i]->borderSize))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
144
dix/region.c
144
dix/region.c
|
@ -83,8 +83,6 @@ Equipment Corporation.
|
||||||
#include <X11/Xprotostr.h>
|
#include <X11/Xprotostr.h>
|
||||||
#include <X11/Xfuncproto.h>
|
#include <X11/Xfuncproto.h>
|
||||||
#include "gc.h"
|
#include "gc.h"
|
||||||
#include "mi.h"
|
|
||||||
#include "mispans.h"
|
|
||||||
#include <pixman.h>
|
#include <pixman.h>
|
||||||
|
|
||||||
#undef assert
|
#undef assert
|
||||||
|
@ -171,7 +169,7 @@ Equipment Corporation.
|
||||||
((r1)->y1 <= (r2)->y1) && \
|
((r1)->y1 <= (r2)->y1) && \
|
||||||
((r1)->y2 >= (r2)->y2) )
|
((r1)->y2 >= (r2)->y2) )
|
||||||
|
|
||||||
#define xallocData(n) malloc(REGION_SZOF(n))
|
#define xallocData(n) malloc(RegionSizeof(n))
|
||||||
#define xfreeData(reg) if ((reg)->data && (reg)->data->size) free((reg)->data)
|
#define xfreeData(reg) if ((reg)->data && (reg)->data->size) free((reg)->data)
|
||||||
|
|
||||||
#define RECTALLOC_BAIL(pReg,n,bail) \
|
#define RECTALLOC_BAIL(pReg,n,bail) \
|
||||||
|
@ -197,7 +195,7 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
|
||||||
{ \
|
{ \
|
||||||
if (!RegionRectAlloc(pReg, 1)) \
|
if (!RegionRectAlloc(pReg, 1)) \
|
||||||
return FALSE; \
|
return FALSE; \
|
||||||
pNextRect = REGION_TOP(pReg); \
|
pNextRect = RegionTop(pReg); \
|
||||||
} \
|
} \
|
||||||
ADDRECT(pNextRect,nx1,ny1,nx2,ny2); \
|
ADDRECT(pNextRect,nx1,ny1,nx2,ny2); \
|
||||||
pReg->data->numRects++; \
|
pReg->data->numRects++; \
|
||||||
|
@ -209,7 +207,7 @@ if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \
|
||||||
if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \
|
if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \
|
||||||
{ \
|
{ \
|
||||||
RegDataPtr NewData; \
|
RegDataPtr NewData; \
|
||||||
NewData = (RegDataPtr)realloc((reg)->data, REGION_SZOF(numRects)); \
|
NewData = (RegDataPtr)realloc((reg)->data, RegionSizeof(numRects)); \
|
||||||
if (NewData) \
|
if (NewData) \
|
||||||
{ \
|
{ \
|
||||||
NewData->size = (numRects); \
|
NewData->size = (numRects); \
|
||||||
|
@ -265,9 +263,9 @@ RegionPrint(RegionPtr rgn)
|
||||||
int i;
|
int i;
|
||||||
BoxPtr rects;
|
BoxPtr rects;
|
||||||
|
|
||||||
num = REGION_NUM_RECTS(rgn);
|
num = RegionNumRects(rgn);
|
||||||
size = REGION_SIZE(rgn);
|
size = RegionSize(rgn);
|
||||||
rects = REGION_RECTS(rgn);
|
rects = RegionRects(rgn);
|
||||||
ErrorF("[mi] num: %d size: %d\n", num, size);
|
ErrorF("[mi] num: %d size: %d\n", num, size);
|
||||||
ErrorF("[mi] extents: %d %d %d %d\n",
|
ErrorF("[mi] extents: %d %d %d %d\n",
|
||||||
rgn->extents.x1, rgn->extents.y1, rgn->extents.x2, rgn->extents.y2);
|
rgn->extents.x1, rgn->extents.y1, rgn->extents.x2, rgn->extents.y2);
|
||||||
|
@ -292,7 +290,7 @@ RegionIsValid(RegionPtr reg)
|
||||||
if ((reg->extents.x1 > reg->extents.x2) ||
|
if ((reg->extents.x1 > reg->extents.x2) ||
|
||||||
(reg->extents.y1 > reg->extents.y2))
|
(reg->extents.y1 > reg->extents.y2))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
numRects = REGION_NUM_RECTS(reg);
|
numRects = RegionNumRects(reg);
|
||||||
if (!numRects)
|
if (!numRects)
|
||||||
return ((reg->extents.x1 == reg->extents.x2) &&
|
return ((reg->extents.x1 == reg->extents.x2) &&
|
||||||
(reg->extents.y1 == reg->extents.y2) &&
|
(reg->extents.y1 == reg->extents.y2) &&
|
||||||
|
@ -304,7 +302,7 @@ RegionIsValid(RegionPtr reg)
|
||||||
BoxPtr pboxP, pboxN;
|
BoxPtr pboxP, pboxN;
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
|
|
||||||
pboxP = REGION_RECTS(reg);
|
pboxP = RegionRects(reg);
|
||||||
box = *pboxP;
|
box = *pboxP;
|
||||||
box.y2 = pboxP[numRects-1].y2;
|
box.y2 = pboxP[numRects-1].y2;
|
||||||
pboxN = pboxP + 1;
|
pboxN = pboxP + 1;
|
||||||
|
@ -330,26 +328,6 @@ RegionIsValid(RegionPtr reg)
|
||||||
}
|
}
|
||||||
#endif /* DEBUG */
|
#endif /* DEBUG */
|
||||||
|
|
||||||
/*****************************************************************
|
|
||||||
* RegionInit(pReg, rect, size)
|
|
||||||
* Outer region rect is statically allocated.
|
|
||||||
*****************************************************************/
|
|
||||||
|
|
||||||
void
|
|
||||||
RegionInit(RegionPtr pReg, BoxPtr rect, int size)
|
|
||||||
{
|
|
||||||
if (rect)
|
|
||||||
pixman_region_init_with_extents (pReg, rect);
|
|
||||||
else
|
|
||||||
pixman_region_init (pReg);
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
RegionUninit(RegionPtr pReg)
|
|
||||||
{
|
|
||||||
pixman_region_fini (pReg);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
RegionBreak (RegionPtr pReg)
|
RegionBreak (RegionPtr pReg)
|
||||||
{
|
{
|
||||||
|
@ -371,7 +349,7 @@ RegionRectAlloc(RegionPtr pRgn, int n)
|
||||||
if (!pRgn->data)
|
if (!pRgn->data)
|
||||||
return RegionBreak (pRgn);
|
return RegionBreak (pRgn);
|
||||||
pRgn->data->numRects = 1;
|
pRgn->data->numRects = 1;
|
||||||
*REGION_BOXPTR(pRgn) = pRgn->extents;
|
*RegionBoxptr(pRgn) = pRgn->extents;
|
||||||
}
|
}
|
||||||
else if (!pRgn->data->size)
|
else if (!pRgn->data->size)
|
||||||
{
|
{
|
||||||
|
@ -389,7 +367,7 @@ RegionRectAlloc(RegionPtr pRgn, int n)
|
||||||
n = 250;
|
n = 250;
|
||||||
}
|
}
|
||||||
n += pRgn->data->numRects;
|
n += pRgn->data->numRects;
|
||||||
data = (RegDataPtr)realloc(pRgn->data, REGION_SZOF(n));
|
data = (RegDataPtr)realloc(pRgn->data, RegionSizeof(n));
|
||||||
if (!data)
|
if (!data)
|
||||||
return RegionBreak (pRgn);
|
return RegionBreak (pRgn);
|
||||||
pRgn->data = data;
|
pRgn->data = data;
|
||||||
|
@ -448,8 +426,8 @@ RegionCoalesce (
|
||||||
* The bands may only be coalesced if the bottom of the previous
|
* The bands may only be coalesced if the bottom of the previous
|
||||||
* matches the top scanline of the current.
|
* matches the top scanline of the current.
|
||||||
*/
|
*/
|
||||||
pPrevBox = REGION_BOX(pReg, prevStart);
|
pPrevBox = RegionBox(pReg, prevStart);
|
||||||
pCurBox = REGION_BOX(pReg, curStart);
|
pCurBox = RegionBox(pReg, curStart);
|
||||||
if (pPrevBox->y2 != pCurBox->y1) return curStart;
|
if (pPrevBox->y2 != pCurBox->y1) return curStart;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -528,7 +506,7 @@ RegionAppendNonO (
|
||||||
|
|
||||||
/* Make sure we have enough space for all rectangles to be added */
|
/* Make sure we have enough space for all rectangles to be added */
|
||||||
RECTALLOC(pReg, newRects);
|
RECTALLOC(pReg, newRects);
|
||||||
pNextRect = REGION_TOP(pReg);
|
pNextRect = RegionTop(pReg);
|
||||||
pReg->data->numRects += newRects;
|
pReg->data->numRects += newRects;
|
||||||
do {
|
do {
|
||||||
assert(r->x1 < r->x2);
|
assert(r->x1 < r->x2);
|
||||||
|
@ -553,7 +531,7 @@ RegionAppendNonO (
|
||||||
int newRects; \
|
int newRects; \
|
||||||
if ((newRects = rEnd - r)) { \
|
if ((newRects = rEnd - r)) { \
|
||||||
RECTALLOC(newReg, newRects); \
|
RECTALLOC(newReg, newRects); \
|
||||||
memmove((char *)REGION_TOP(newReg),(char *)r, \
|
memmove((char *)RegionTop(newReg),(char *)r, \
|
||||||
newRects * sizeof(BoxRec)); \
|
newRects * sizeof(BoxRec)); \
|
||||||
newReg->data->numRects += newRects; \
|
newReg->data->numRects += newRects; \
|
||||||
} \
|
} \
|
||||||
|
@ -634,7 +612,7 @@ RegionOp(
|
||||||
/*
|
/*
|
||||||
* Break any region computed from a broken region
|
* Break any region computed from a broken region
|
||||||
*/
|
*/
|
||||||
if (REGION_NAR (reg1) || REGION_NAR(reg2))
|
if (RegionNar (reg1) || RegionNar(reg2))
|
||||||
return RegionBreak (newReg);
|
return RegionBreak (newReg);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -645,11 +623,11 @@ RegionOp(
|
||||||
* another array of rectangles for it to use.
|
* another array of rectangles for it to use.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
r1 = REGION_RECTS(reg1);
|
r1 = RegionRects(reg1);
|
||||||
newSize = REGION_NUM_RECTS(reg1);
|
newSize = RegionNumRects(reg1);
|
||||||
r1End = r1 + newSize;
|
r1End = r1 + newSize;
|
||||||
numRects = REGION_NUM_RECTS(reg2);
|
numRects = RegionNumRects(reg2);
|
||||||
r2 = REGION_RECTS(reg2);
|
r2 = RegionRects(reg2);
|
||||||
r2End = r2 + numRects;
|
r2End = r2 + numRects;
|
||||||
assert(r1 != r1End);
|
assert(r1 != r1End);
|
||||||
assert(r2 != r2End);
|
assert(r2 != r2End);
|
||||||
|
@ -806,7 +784,7 @@ RegionOp(
|
||||||
}
|
}
|
||||||
else if (numRects == 1)
|
else if (numRects == 1)
|
||||||
{
|
{
|
||||||
newReg->extents = *REGION_BOXPTR(newReg);
|
newReg->extents = *RegionBoxptr(newReg);
|
||||||
xfreeData(newReg);
|
xfreeData(newReg);
|
||||||
newReg->data = NULL;
|
newReg->data = NULL;
|
||||||
}
|
}
|
||||||
|
@ -847,8 +825,8 @@ RegionSetExtents (RegionPtr pReg)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pBox = REGION_BOXPTR(pReg);
|
pBox = RegionBoxptr(pReg);
|
||||||
pBoxEnd = REGION_END(pReg);
|
pBoxEnd = RegionEnd(pReg);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Since pBox is the first rectangle in the region, it must have the
|
* Since pBox is the first rectangle in the region, it must have the
|
||||||
|
@ -953,7 +931,7 @@ RegionUnionO (
|
||||||
assert (y1 < y2);
|
assert (y1 < y2);
|
||||||
assert(r1 != r1End && r2 != r2End);
|
assert(r1 != r1End && r2 != r2End);
|
||||||
|
|
||||||
pNextRect = REGION_TOP(pReg);
|
pNextRect = RegionTop(pReg);
|
||||||
|
|
||||||
/* Start off current rectangle */
|
/* Start off current rectangle */
|
||||||
if (r1->x1 < r2->x1)
|
if (r1->x1 < r2->x1)
|
||||||
|
@ -1033,7 +1011,7 @@ RegionAppend(RegionPtr dstrgn, RegionPtr rgn)
|
||||||
BoxPtr new, old;
|
BoxPtr new, old;
|
||||||
Bool prepend;
|
Bool prepend;
|
||||||
|
|
||||||
if (REGION_NAR(rgn))
|
if (RegionNar(rgn))
|
||||||
return RegionBreak (dstrgn);
|
return RegionBreak (dstrgn);
|
||||||
|
|
||||||
if (!rgn->data && (dstrgn->data == &RegionEmptyData))
|
if (!rgn->data && (dstrgn->data == &RegionEmptyData))
|
||||||
|
@ -1043,16 +1021,16 @@ RegionAppend(RegionPtr dstrgn, RegionPtr rgn)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
numRects = REGION_NUM_RECTS(rgn);
|
numRects = RegionNumRects(rgn);
|
||||||
if (!numRects)
|
if (!numRects)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
prepend = FALSE;
|
prepend = FALSE;
|
||||||
size = numRects;
|
size = numRects;
|
||||||
dnumRects = REGION_NUM_RECTS(dstrgn);
|
dnumRects = RegionNumRects(dstrgn);
|
||||||
if (!dnumRects && (size < 200))
|
if (!dnumRects && (size < 200))
|
||||||
size = 200; /* XXX pick numbers out of a hat */
|
size = 200; /* XXX pick numbers out of a hat */
|
||||||
RECTALLOC(dstrgn, size);
|
RECTALLOC(dstrgn, size);
|
||||||
old = REGION_RECTS(rgn);
|
old = RegionRects(rgn);
|
||||||
if (!dnumRects)
|
if (!dnumRects)
|
||||||
dstrgn->extents = rgn->extents;
|
dstrgn->extents = rgn->extents;
|
||||||
else if (dstrgn->extents.x2 > dstrgn->extents.x1)
|
else if (dstrgn->extents.x2 > dstrgn->extents.x1)
|
||||||
|
@ -1060,7 +1038,7 @@ RegionAppend(RegionPtr dstrgn, RegionPtr rgn)
|
||||||
BoxPtr first, last;
|
BoxPtr first, last;
|
||||||
|
|
||||||
first = old;
|
first = old;
|
||||||
last = REGION_BOXPTR(dstrgn) + (dnumRects - 1);
|
last = RegionBoxptr(dstrgn) + (dnumRects - 1);
|
||||||
if ((first->y1 > last->y2) ||
|
if ((first->y1 > last->y2) ||
|
||||||
((first->y1 == last->y1) && (first->y2 == last->y2) &&
|
((first->y1 == last->y1) && (first->y2 == last->y2) &&
|
||||||
(first->x1 > last->x2)))
|
(first->x1 > last->x2)))
|
||||||
|
@ -1073,7 +1051,7 @@ RegionAppend(RegionPtr dstrgn, RegionPtr rgn)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
first = REGION_BOXPTR(dstrgn);
|
first = RegionBoxptr(dstrgn);
|
||||||
last = old + (numRects - 1);
|
last = old + (numRects - 1);
|
||||||
if ((first->y1 > last->y2) ||
|
if ((first->y1 > last->y2) ||
|
||||||
((first->y1 == last->y1) && (first->y2 == last->y2) &&
|
((first->y1 == last->y1) && (first->y2 == last->y2) &&
|
||||||
|
@ -1092,16 +1070,16 @@ RegionAppend(RegionPtr dstrgn, RegionPtr rgn)
|
||||||
}
|
}
|
||||||
if (prepend)
|
if (prepend)
|
||||||
{
|
{
|
||||||
new = REGION_BOX(dstrgn, numRects);
|
new = RegionBox(dstrgn, numRects);
|
||||||
if (dnumRects == 1)
|
if (dnumRects == 1)
|
||||||
*new = *REGION_BOXPTR(dstrgn);
|
*new = *RegionBoxptr(dstrgn);
|
||||||
else
|
else
|
||||||
memmove((char *)new,(char *)REGION_BOXPTR(dstrgn),
|
memmove((char *)new,(char *)RegionBoxptr(dstrgn),
|
||||||
dnumRects * sizeof(BoxRec));
|
dnumRects * sizeof(BoxRec));
|
||||||
new = REGION_BOXPTR(dstrgn);
|
new = RegionBoxptr(dstrgn);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
new = REGION_BOXPTR(dstrgn) + dnumRects;
|
new = RegionBoxptr(dstrgn) + dnumRects;
|
||||||
if (numRects == 1)
|
if (numRects == 1)
|
||||||
*new = *old;
|
*new = *old;
|
||||||
else
|
else
|
||||||
|
@ -1242,7 +1220,7 @@ RegionValidate(RegionPtr badreg, Bool *pOverlap)
|
||||||
numRects = badreg->data->numRects;
|
numRects = badreg->data->numRects;
|
||||||
if (!numRects)
|
if (!numRects)
|
||||||
{
|
{
|
||||||
if (REGION_NAR(badreg))
|
if (RegionNar(badreg))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
good(badreg);
|
good(badreg);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -1263,7 +1241,7 @@ RegionValidate(RegionPtr badreg, Bool *pOverlap)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Step 1: Sort the rects array into ascending (y1, x1) order */
|
/* Step 1: Sort the rects array into ascending (y1, x1) order */
|
||||||
QuickSortRects(REGION_BOXPTR(badreg), numRects);
|
QuickSortRects(RegionBoxptr(badreg), numRects);
|
||||||
|
|
||||||
/* Step 2: Scatter the sorted array into the minimum number of regions */
|
/* Step 2: Scatter the sorted array into the minimum number of regions */
|
||||||
|
|
||||||
|
@ -1277,7 +1255,7 @@ RegionValidate(RegionPtr badreg, Bool *pOverlap)
|
||||||
ri[0].prevBand = 0;
|
ri[0].prevBand = 0;
|
||||||
ri[0].curBand = 0;
|
ri[0].curBand = 0;
|
||||||
ri[0].reg = *badreg;
|
ri[0].reg = *badreg;
|
||||||
box = REGION_BOXPTR(&ri[0].reg);
|
box = RegionBoxptr(&ri[0].reg);
|
||||||
ri[0].reg.extents = *box;
|
ri[0].reg.extents = *box;
|
||||||
ri[0].reg.data->numRects = 1;
|
ri[0].reg.data->numRects = 1;
|
||||||
|
|
||||||
|
@ -1294,7 +1272,7 @@ RegionValidate(RegionPtr badreg, Bool *pOverlap)
|
||||||
for (j = numRI, rit = ri; --j >= 0; rit++)
|
for (j = numRI, rit = ri; --j >= 0; rit++)
|
||||||
{
|
{
|
||||||
reg = &rit->reg;
|
reg = &rit->reg;
|
||||||
riBox = REGION_END(reg);
|
riBox = RegionEnd(reg);
|
||||||
|
|
||||||
if (box->y1 == riBox->y1 && box->y2 == riBox->y2)
|
if (box->y1 == riBox->y1 && box->y2 == riBox->y2)
|
||||||
{
|
{
|
||||||
|
@ -1308,7 +1286,7 @@ RegionValidate(RegionPtr badreg, Bool *pOverlap)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
RECTALLOC_BAIL(reg, 1, bail);
|
RECTALLOC_BAIL(reg, 1, bail);
|
||||||
*REGION_TOP(reg) = *box;
|
*RegionTop(reg) = *box;
|
||||||
reg->data->numRects++;
|
reg->data->numRects++;
|
||||||
}
|
}
|
||||||
goto NextRect; /* So sue me */
|
goto NextRect; /* So sue me */
|
||||||
|
@ -1321,7 +1299,7 @@ RegionValidate(RegionPtr badreg, Bool *pOverlap)
|
||||||
Coalesce(reg, rit->prevBand, rit->curBand);
|
Coalesce(reg, rit->prevBand, rit->curBand);
|
||||||
rit->curBand = reg->data->numRects;
|
rit->curBand = reg->data->numRects;
|
||||||
RECTALLOC_BAIL(reg, 1, bail);
|
RECTALLOC_BAIL(reg, 1, bail);
|
||||||
*REGION_TOP(reg) = *box;
|
*RegionTop(reg) = *box;
|
||||||
reg->data->numRects++;
|
reg->data->numRects++;
|
||||||
goto NextRect;
|
goto NextRect;
|
||||||
}
|
}
|
||||||
|
@ -1355,7 +1333,7 @@ NextRect: ;
|
||||||
for (j = numRI, rit = ri; --j >= 0; rit++)
|
for (j = numRI, rit = ri; --j >= 0; rit++)
|
||||||
{
|
{
|
||||||
reg = &rit->reg;
|
reg = &rit->reg;
|
||||||
riBox = REGION_END(reg);
|
riBox = RegionEnd(reg);
|
||||||
reg->extents.y2 = riBox->y2;
|
reg->extents.y2 = riBox->y2;
|
||||||
if (reg->extents.x2 < riBox->x2) reg->extents.x2 = riBox->x2;
|
if (reg->extents.x2 < riBox->x2) reg->extents.x2 = riBox->x2;
|
||||||
Coalesce(reg, rit->prevBand, rit->curBand);
|
Coalesce(reg, rit->prevBand, rit->curBand);
|
||||||
|
@ -1410,7 +1388,7 @@ RegionFromRects(int nrects, xRectangle *prect, int ctype)
|
||||||
int x1, y1, x2, y2;
|
int x1, y1, x2, y2;
|
||||||
|
|
||||||
pRgn = RegionCreate(NullBox, 0);
|
pRgn = RegionCreate(NullBox, 0);
|
||||||
if (REGION_NAR (pRgn))
|
if (RegionNar (pRgn))
|
||||||
return pRgn;
|
return pRgn;
|
||||||
if (!nrects)
|
if (!nrects)
|
||||||
return pRgn;
|
return pRgn;
|
||||||
|
@ -1563,12 +1541,6 @@ RegionTranslate(RegionPtr pReg, int x, int y)
|
||||||
pixman_region_translate (pReg, x, y);
|
pixman_region_translate (pReg, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
RegionReset(RegionPtr pReg, BoxPtr pBox)
|
|
||||||
{
|
|
||||||
pixman_region_reset (pReg, pBox);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool
|
Bool
|
||||||
RegionContainsPoint(
|
RegionContainsPoint(
|
||||||
RegionPtr pReg,
|
RegionPtr pReg,
|
||||||
|
@ -1580,36 +1552,6 @@ RegionContainsPoint(
|
||||||
return pixman_region_contains_point (pReg, x, y, box);
|
return pixman_region_contains_point (pReg, x, y, box);
|
||||||
}
|
}
|
||||||
|
|
||||||
Bool
|
|
||||||
RegionNotEmpty(RegionPtr pReg)
|
|
||||||
{
|
|
||||||
return pixman_region_not_empty (pReg);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bool
|
|
||||||
RegionBroken(RegionPtr pReg)
|
|
||||||
{
|
|
||||||
good(pReg);
|
|
||||||
return (REGION_NAR(pReg));
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
RegionEmpty(RegionPtr pReg)
|
|
||||||
{
|
|
||||||
good(pReg);
|
|
||||||
xfreeData(pReg);
|
|
||||||
pReg->extents.x2 = pReg->extents.x1;
|
|
||||||
pReg->extents.y2 = pReg->extents.y1;
|
|
||||||
pReg->data = &RegionEmptyData;
|
|
||||||
}
|
|
||||||
|
|
||||||
BoxPtr
|
|
||||||
RegionExtents(RegionPtr pReg)
|
|
||||||
{
|
|
||||||
good(pReg);
|
|
||||||
return(&pReg->extents);
|
|
||||||
}
|
|
||||||
|
|
||||||
#define ExchangeSpans(a, b) \
|
#define ExchangeSpans(a, b) \
|
||||||
{ \
|
{ \
|
||||||
DDXPointRec tpt; \
|
DDXPointRec tpt; \
|
||||||
|
@ -1795,7 +1737,7 @@ RegionClipSpans(
|
||||||
if ((! fSorted) && (nspans > 1))
|
if ((! fSorted) && (nspans > 1))
|
||||||
QuickSortSpans(ppt, pwidth, nspans);
|
QuickSortSpans(ppt, pwidth, nspans);
|
||||||
|
|
||||||
pboxBandStart = REGION_BOXPTR(prgnDst);
|
pboxBandStart = RegionBoxptr(prgnDst);
|
||||||
pboxLast = pboxBandStart + numRects;
|
pboxLast = pboxBandStart + numRects;
|
||||||
|
|
||||||
NextBand();
|
NextBand();
|
||||||
|
|
100
dix/window.c
100
dix/window.c
|
@ -416,10 +416,10 @@ CreateRootWindow(ScreenPtr pScreen)
|
||||||
box.y1 = 0;
|
box.y1 = 0;
|
||||||
box.x2 = pScreen->width;
|
box.x2 = pScreen->width;
|
||||||
box.y2 = pScreen->height;
|
box.y2 = pScreen->height;
|
||||||
REGION_INIT(pScreen, &pWin->clipList, &box, 1);
|
RegionInit(&pWin->clipList, &box, 1);
|
||||||
REGION_INIT(pScreen, &pWin->winSize, &box, 1);
|
RegionInit(&pWin->winSize, &box, 1);
|
||||||
REGION_INIT(pScreen, &pWin->borderSize, &box, 1);
|
RegionInit(&pWin->borderSize, &box, 1);
|
||||||
REGION_INIT(pScreen, &pWin->borderClip, &box, 1);
|
RegionInit(&pWin->borderClip, &box, 1);
|
||||||
|
|
||||||
pWin->drawable.class = InputOutput;
|
pWin->drawable.class = InputOutput;
|
||||||
pWin->optional->visual = pScreen->rootVisual;
|
pWin->optional->visual = pScreen->rootVisual;
|
||||||
|
@ -499,7 +499,7 @@ ClippedRegionFromBox(WindowPtr pWin, RegionPtr Rgn,
|
||||||
|
|
||||||
pScreen = pWin->drawable.pScreen;
|
pScreen = pWin->drawable.pScreen;
|
||||||
|
|
||||||
box = *(REGION_EXTENTS(pScreen, &pWin->winSize));
|
box = *(RegionExtents(&pWin->winSize));
|
||||||
/* we do these calculations to avoid overflows */
|
/* we do these calculations to avoid overflows */
|
||||||
if (x > box.x1)
|
if (x > box.x1)
|
||||||
box.x1 = x;
|
box.x1 = x;
|
||||||
|
@ -515,8 +515,8 @@ ClippedRegionFromBox(WindowPtr pWin, RegionPtr Rgn,
|
||||||
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;
|
||||||
REGION_RESET(pScreen, Rgn, &box);
|
RegionReset(Rgn, &box);
|
||||||
REGION_INTERSECT(pScreen, Rgn, Rgn, &pWin->winSize);
|
RegionIntersect(Rgn, Rgn, &pWin->winSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
static RealChildHeadProc realChildHeadProc = NULL;
|
static RealChildHeadProc realChildHeadProc = NULL;
|
||||||
|
@ -703,10 +703,10 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w,
|
||||||
pWin->drawable.y = pParent->drawable.y + y + (int)bw;
|
pWin->drawable.y = pParent->drawable.y + y + (int)bw;
|
||||||
|
|
||||||
/* set up clip list correctly for unobscured WindowPtr */
|
/* set up clip list correctly for unobscured WindowPtr */
|
||||||
REGION_NULL(pScreen, &pWin->clipList);
|
RegionNull(&pWin->clipList);
|
||||||
REGION_NULL(pScreen, &pWin->borderClip);
|
RegionNull(&pWin->borderClip);
|
||||||
REGION_NULL(pScreen, &pWin->winSize);
|
RegionNull(&pWin->winSize);
|
||||||
REGION_NULL(pScreen, &pWin->borderSize);
|
RegionNull(&pWin->borderSize);
|
||||||
|
|
||||||
pHead = RealChildHead(pParent);
|
pHead = RealChildHead(pParent);
|
||||||
if (pHead)
|
if (pHead)
|
||||||
|
@ -824,16 +824,16 @@ FreeWindowResources(WindowPtr pWin)
|
||||||
DeleteWindowFromAnySaveSet(pWin);
|
DeleteWindowFromAnySaveSet(pWin);
|
||||||
DeleteWindowFromAnySelections(pWin);
|
DeleteWindowFromAnySelections(pWin);
|
||||||
DeleteWindowFromAnyEvents(pWin, TRUE);
|
DeleteWindowFromAnyEvents(pWin, TRUE);
|
||||||
REGION_UNINIT(pScreen, &pWin->clipList);
|
RegionUninit(&pWin->clipList);
|
||||||
REGION_UNINIT(pScreen, &pWin->winSize);
|
RegionUninit(&pWin->winSize);
|
||||||
REGION_UNINIT(pScreen, &pWin->borderClip);
|
RegionUninit(&pWin->borderClip);
|
||||||
REGION_UNINIT(pScreen, &pWin->borderSize);
|
RegionUninit(&pWin->borderSize);
|
||||||
if (wBoundingShape (pWin))
|
if (wBoundingShape (pWin))
|
||||||
REGION_DESTROY(pScreen, wBoundingShape (pWin));
|
RegionDestroy(wBoundingShape (pWin));
|
||||||
if (wClipShape (pWin))
|
if (wClipShape (pWin))
|
||||||
REGION_DESTROY(pScreen, wClipShape (pWin));
|
RegionDestroy(wClipShape (pWin));
|
||||||
if (wInputShape (pWin))
|
if (wInputShape (pWin))
|
||||||
REGION_DESTROY(pScreen, wInputShape (pWin));
|
RegionDestroy(wInputShape (pWin));
|
||||||
if (pWin->borderIsPixel == FALSE)
|
if (pWin->borderIsPixel == FALSE)
|
||||||
(*pScreen->DestroyPixmap)(pWin->border.pixmap);
|
(*pScreen->DestroyPixmap)(pWin->border.pixmap);
|
||||||
if (pWin->backgroundState == BackgroundPixmap)
|
if (pWin->backgroundState == BackgroundPixmap)
|
||||||
|
@ -1431,10 +1431,10 @@ PatchUp:
|
||||||
{
|
{
|
||||||
RegionRec exposed;
|
RegionRec exposed;
|
||||||
|
|
||||||
REGION_NULL(pScreen, &exposed);
|
RegionNull(&exposed);
|
||||||
REGION_SUBTRACT(pScreen, &exposed, &pWin->borderClip, &pWin->winSize);
|
RegionSubtract(&exposed, &pWin->borderClip, &pWin->winSize);
|
||||||
miPaintWindow(pWin, &exposed, PW_BORDER);
|
miPaintWindow(pWin, &exposed, PW_BORDER);
|
||||||
REGION_UNINIT(pScreen, &exposed);
|
RegionUninit(&exposed);
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
@ -1581,7 +1581,7 @@ SetWinSize (WindowPtr pWin)
|
||||||
box.y1 = pWin->drawable.y;
|
box.y1 = pWin->drawable.y;
|
||||||
box.x2 = pWin->drawable.x + pWin->drawable.width;
|
box.x2 = pWin->drawable.x + pWin->drawable.width;
|
||||||
box.y2 = pWin->drawable.y + pWin->drawable.height;
|
box.y2 = pWin->drawable.y + pWin->drawable.height;
|
||||||
REGION_RESET (pScreen, &pWin->winSize, &box);
|
RegionReset(&pWin->winSize, &box);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@ -1593,15 +1593,15 @@ SetWinSize (WindowPtr pWin)
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
pScreen = pWin->drawable.pScreen;
|
pScreen = pWin->drawable.pScreen;
|
||||||
|
|
||||||
REGION_TRANSLATE(pScreen, &pWin->winSize, - pWin->drawable.x,
|
RegionTranslate(&pWin->winSize, - pWin->drawable.x,
|
||||||
- pWin->drawable.y);
|
- pWin->drawable.y);
|
||||||
if (wBoundingShape (pWin))
|
if (wBoundingShape (pWin))
|
||||||
REGION_INTERSECT(pScreen, &pWin->winSize, &pWin->winSize,
|
RegionIntersect(&pWin->winSize, &pWin->winSize,
|
||||||
wBoundingShape (pWin));
|
wBoundingShape (pWin));
|
||||||
if (wClipShape (pWin))
|
if (wClipShape (pWin))
|
||||||
REGION_INTERSECT(pScreen, &pWin->winSize, &pWin->winSize,
|
RegionIntersect(&pWin->winSize, &pWin->winSize,
|
||||||
wClipShape (pWin));
|
wClipShape (pWin));
|
||||||
REGION_TRANSLATE(pScreen, &pWin->winSize, pWin->drawable.x,
|
RegionTranslate(&pWin->winSize, pWin->drawable.x,
|
||||||
pWin->drawable.y);
|
pWin->drawable.y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1626,7 +1626,7 @@ SetBorderSize (WindowPtr pWin)
|
||||||
box.y1 = pWin->drawable.y - bw;
|
box.y1 = pWin->drawable.y - bw;
|
||||||
box.x2 = pWin->drawable.x + pWin->drawable.width + bw;
|
box.x2 = pWin->drawable.x + pWin->drawable.width + bw;
|
||||||
box.y2 = pWin->drawable.y + pWin->drawable.height + bw;
|
box.y2 = pWin->drawable.y + pWin->drawable.height + bw;
|
||||||
REGION_RESET (pScreen, &pWin->borderSize, &box);
|
RegionReset(&pWin->borderSize, &box);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
@ -1638,17 +1638,17 @@ SetBorderSize (WindowPtr pWin)
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
pScreen = pWin->drawable.pScreen;
|
pScreen = pWin->drawable.pScreen;
|
||||||
|
|
||||||
REGION_TRANSLATE(pScreen, &pWin->borderSize, - pWin->drawable.x,
|
RegionTranslate(&pWin->borderSize, - pWin->drawable.x,
|
||||||
- pWin->drawable.y);
|
- pWin->drawable.y);
|
||||||
REGION_INTERSECT(pScreen, &pWin->borderSize, &pWin->borderSize,
|
RegionIntersect(&pWin->borderSize, &pWin->borderSize,
|
||||||
wBoundingShape (pWin));
|
wBoundingShape (pWin));
|
||||||
REGION_TRANSLATE(pScreen, &pWin->borderSize, pWin->drawable.x,
|
RegionTranslate(&pWin->borderSize, pWin->drawable.x,
|
||||||
pWin->drawable.y);
|
pWin->drawable.y);
|
||||||
REGION_UNION(pScreen, &pWin->borderSize, &pWin->borderSize,
|
RegionUnion(&pWin->borderSize, &pWin->borderSize,
|
||||||
&pWin->winSize);
|
&pWin->winSize);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
REGION_COPY(pWin->drawable.pScreen, &pWin->borderSize,
|
RegionCopy(&pWin->borderSize,
|
||||||
&pWin->winSize);
|
&pWin->winSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1848,12 +1848,12 @@ MakeBoundingRegion (
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
pScreen = pWin->drawable.pScreen;
|
pScreen = pWin->drawable.pScreen;
|
||||||
|
|
||||||
pRgn = REGION_CREATE(pScreen, pBox, 1);
|
pRgn = RegionCreate(pBox, 1);
|
||||||
if (wBoundingShape (pWin)) {
|
if (wBoundingShape (pWin)) {
|
||||||
REGION_TRANSLATE(pScreen, pRgn, -pWin->origin.x,
|
RegionTranslate(pRgn, -pWin->origin.x,
|
||||||
-pWin->origin.y);
|
-pWin->origin.y);
|
||||||
REGION_INTERSECT(pScreen, pRgn, pRgn, wBoundingShape (pWin));
|
RegionIntersect(pRgn, pRgn, wBoundingShape (pWin));
|
||||||
REGION_TRANSLATE(pScreen, pRgn, pWin->origin.x,
|
RegionTranslate(pRgn, pWin->origin.x,
|
||||||
pWin->origin.y);
|
pWin->origin.y);
|
||||||
}
|
}
|
||||||
return pRgn;
|
return pRgn;
|
||||||
|
@ -1875,10 +1875,10 @@ ShapeOverlap (
|
||||||
pScreen = pWin->drawable.pScreen;
|
pScreen = pWin->drawable.pScreen;
|
||||||
pWinRgn = MakeBoundingRegion (pWin, pWinBox);
|
pWinRgn = MakeBoundingRegion (pWin, pWinBox);
|
||||||
pSibRgn = MakeBoundingRegion (pSib, pSibBox);
|
pSibRgn = MakeBoundingRegion (pSib, pSibBox);
|
||||||
REGION_INTERSECT(pScreen, pWinRgn, pWinRgn, pSibRgn);
|
RegionIntersect(pWinRgn, pWinRgn, pSibRgn);
|
||||||
ret = REGION_NOTEMPTY(pScreen, pWinRgn);
|
ret = RegionNotEmpty(pWinRgn);
|
||||||
REGION_DESTROY(pScreen, pWinRgn);
|
RegionDestroy(pWinRgn);
|
||||||
REGION_DESTROY(pScreen, pSibRgn);
|
RegionDestroy(pSibRgn);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2004,7 +2004,7 @@ WhereDoIGoInTheStack(
|
||||||
else if (pSib)
|
else if (pSib)
|
||||||
{
|
{
|
||||||
if ((IsSiblingAboveMe(pWin, pSib) == Above) &&
|
if ((IsSiblingAboveMe(pWin, pSib) == Above) &&
|
||||||
(RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT))
|
(RegionContainsRect(&pSib->borderSize, &box) != rgnOUT))
|
||||||
return(pFirst);
|
return(pFirst);
|
||||||
else
|
else
|
||||||
return(pWin->nextSib);
|
return(pWin->nextSib);
|
||||||
|
@ -2019,7 +2019,7 @@ WhereDoIGoInTheStack(
|
||||||
else if (pSib)
|
else if (pSib)
|
||||||
{
|
{
|
||||||
if ((IsSiblingAboveMe(pWin, pSib) == Below) &&
|
if ((IsSiblingAboveMe(pWin, pSib) == Below) &&
|
||||||
(RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT))
|
(RegionContainsRect(&pSib->borderSize, &box) != rgnOUT))
|
||||||
return NullWindow;
|
return NullWindow;
|
||||||
else
|
else
|
||||||
return(pWin->nextSib);
|
return(pWin->nextSib);
|
||||||
|
@ -2033,7 +2033,7 @@ WhereDoIGoInTheStack(
|
||||||
return(pWin->nextSib);
|
return(pWin->nextSib);
|
||||||
else if (pSib)
|
else if (pSib)
|
||||||
{
|
{
|
||||||
if (RECT_IN_REGION(pScreen, &pSib->borderSize, &box) != rgnOUT)
|
if (RegionContainsRect(&pSib->borderSize, &box) != rgnOUT)
|
||||||
{
|
{
|
||||||
if (IsSiblingAboveMe(pWin, pSib) == Above)
|
if (IsSiblingAboveMe(pWin, pSib) == Above)
|
||||||
return(pFirst);
|
return(pFirst);
|
||||||
|
@ -2681,10 +2681,10 @@ MapWindow(WindowPtr pWin, ClientPtr client)
|
||||||
(*pScreen->ClipNotify) (pWin, 0, 0);
|
(*pScreen->ClipNotify) (pWin, 0, 0);
|
||||||
if (pScreen->PostValidateTree)
|
if (pScreen->PostValidateTree)
|
||||||
(*pScreen->PostValidateTree)(NullWindow, pWin, VTMap);
|
(*pScreen->PostValidateTree)(NullWindow, pWin, VTMap);
|
||||||
REGION_NULL(pScreen, &temp);
|
RegionNull(&temp);
|
||||||
REGION_COPY(pScreen, &temp, &pWin->clipList);
|
RegionCopy(&temp, &pWin->clipList);
|
||||||
(*pScreen->WindowExposures) (pWin, &temp, NullRegion);
|
(*pScreen->WindowExposures) (pWin, &temp, NullRegion);
|
||||||
REGION_UNINIT(pScreen, &temp);
|
RegionUninit(&temp);
|
||||||
}
|
}
|
||||||
|
|
||||||
return(Success);
|
return(Success);
|
||||||
|
@ -3017,10 +3017,10 @@ PointInWindowIsVisible(WindowPtr pWin, int x, int y)
|
||||||
|
|
||||||
if (!pWin->realized)
|
if (!pWin->realized)
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
if (POINT_IN_REGION(pWin->drawable.pScreen, &pWin->borderClip,
|
if (RegionContainsPoint(&pWin->borderClip,
|
||||||
x, y, &box)
|
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)))
|
||||||
|
@ -3036,12 +3036,12 @@ NotClippedByChildren(WindowPtr pWin)
|
||||||
RegionPtr pReg;
|
RegionPtr pReg;
|
||||||
|
|
||||||
pScreen = pWin->drawable.pScreen;
|
pScreen = pWin->drawable.pScreen;
|
||||||
pReg = REGION_CREATE(pScreen, NullBox, 1);
|
pReg = RegionCreate(NullBox, 1);
|
||||||
if (pWin->parent ||
|
if (pWin->parent ||
|
||||||
screenIsSaved != SCREEN_SAVER_ON ||
|
screenIsSaved != SCREEN_SAVER_ON ||
|
||||||
!HasSaverWindow (pWin->drawable.pScreen))
|
!HasSaverWindow (pWin->drawable.pScreen))
|
||||||
{
|
{
|
||||||
REGION_INTERSECT(pScreen, pReg, &pWin->borderClip, &pWin->winSize);
|
RegionIntersect(pReg, &pWin->borderClip, &pWin->winSize);
|
||||||
}
|
}
|
||||||
return(pReg);
|
return(pReg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2101,7 +2101,7 @@ Making direct calls is faster on many architectures.</para>
|
||||||
BoxPtr rect;
|
BoxPtr rect;
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
macro: RegionPtr REGION_CREATE(pScreen, rect, size)
|
macro: RegionPtr RegionCreate(rect, size)
|
||||||
|
|
||||||
</programlisting></blockquote>
|
</programlisting></blockquote>
|
||||||
RegionCreate creates a region that describes ONE rectangle. The
|
RegionCreate creates a region that describes ONE rectangle. The
|
||||||
|
@ -2122,7 +2122,7 @@ applicable.</para>
|
||||||
BoxPtr rect;
|
BoxPtr rect;
|
||||||
int size;
|
int size;
|
||||||
|
|
||||||
macro: REGION_INIT(pScreen, pRegion, rect, size)
|
macro: RegionInit(pRegion, rect, size)
|
||||||
|
|
||||||
</programlisting></blockquote>
|
</programlisting></blockquote>
|
||||||
Given an existing raw region structure (such as an local variable), this
|
Given an existing raw region structure (such as an local variable), this
|
||||||
|
@ -2136,7 +2136,7 @@ allocation overhead for the region structure itself.
|
||||||
Bool pScreen->RegionCopy(dstrgn, srcrgn)
|
Bool pScreen->RegionCopy(dstrgn, srcrgn)
|
||||||
RegionPtr dstrgn, srcrgn;
|
RegionPtr dstrgn, srcrgn;
|
||||||
|
|
||||||
macro: Bool REGION_COPY(pScreen, dstrgn, srcrgn)
|
macro: Bool RegionCopy(dstrgn, srcrgn)
|
||||||
|
|
||||||
</programlisting></blockquote>
|
</programlisting></blockquote>
|
||||||
RegionCopy copies the description of one region, srcrgn, to another
|
RegionCopy copies the description of one region, srcrgn, to another
|
||||||
|
@ -2148,7 +2148,7 @@ dstrgn; returning TRUE if the copy succeeded, and FALSE otherwise.</para>
|
||||||
void pScreen->RegionDestroy( pRegion)
|
void pScreen->RegionDestroy( pRegion)
|
||||||
RegionPtr pRegion;
|
RegionPtr pRegion;
|
||||||
|
|
||||||
macro: REGION_DESTROY(pScreen, pRegion)
|
macro: RegionDestroy(pRegion)
|
||||||
|
|
||||||
</programlisting></blockquote>
|
</programlisting></blockquote>
|
||||||
RegionDestroy destroys a region and frees all allocated memory.</para>
|
RegionDestroy destroys a region and frees all allocated memory.</para>
|
||||||
|
@ -2158,7 +2158,7 @@ RegionDestroy destroys a region and frees all allocated memory.</para>
|
||||||
void pScreen->RegionUninit (pRegion)
|
void pScreen->RegionUninit (pRegion)
|
||||||
RegionPtr pRegion;
|
RegionPtr pRegion;
|
||||||
|
|
||||||
macro: REGION_UNINIT(pScreen, pRegion)
|
macro: RegionUninit(pRegion)
|
||||||
|
|
||||||
</programlisting></blockquote>
|
</programlisting></blockquote>
|
||||||
Frees everything except the region structure itself, useful when the
|
Frees everything except the region structure itself, useful when the
|
||||||
|
@ -2171,23 +2171,23 @@ it has been RegionInit'ed again.</para>
|
||||||
Bool pScreen->Intersect(newReg, reg1, reg2)
|
Bool pScreen->Intersect(newReg, reg1, reg2)
|
||||||
RegionPtr newReg, reg1, reg2;
|
RegionPtr newReg, reg1, reg2;
|
||||||
|
|
||||||
macro: Bool REGION_INTERSECT(pScreen, newReg, reg1, reg2)
|
macro: Bool RegionIntersect(newReg, reg1, reg2)
|
||||||
|
|
||||||
Bool pScreen->Union(newReg, reg1, reg2)
|
Bool pScreen->Union(newReg, reg1, reg2)
|
||||||
RegionPtr newReg, reg1, reg2;
|
RegionPtr newReg, reg1, reg2;
|
||||||
|
|
||||||
macro: Bool REGION_UNION(pScreen, newReg, reg1, reg2)
|
macro: Bool RegionUnion(newReg, reg1, reg2)
|
||||||
|
|
||||||
Bool pScreen->Subtract(newReg, regMinuend, regSubtrahend)
|
Bool pScreen->Subtract(newReg, regMinuend, regSubtrahend)
|
||||||
RegionPtr newReg, regMinuend, regSubtrahend;
|
RegionPtr newReg, regMinuend, regSubtrahend;
|
||||||
|
|
||||||
macro: Bool REGION_UNION(pScreen, newReg, regMinuend, regSubtrahend)
|
macro: Bool RegionUnion(newReg, regMinuend, regSubtrahend)
|
||||||
|
|
||||||
Bool pScreen->Inverse(newReg, pReg, pBox)
|
Bool pScreen->Inverse(newReg, pReg, pBox)
|
||||||
RegionPtr newReg, pReg;
|
RegionPtr newReg, pReg;
|
||||||
BoxPtr pBox;
|
BoxPtr pBox;
|
||||||
|
|
||||||
macro: Bool REGION_INVERSE(pScreen, newReg, pReg, pBox)
|
macro: Bool RegionInverse(newReg, pReg, pBox)
|
||||||
|
|
||||||
</programlisting></blockquote>
|
</programlisting></blockquote>
|
||||||
The above four calls all do basic logical operations on regions. They
|
The above four calls all do basic logical operations on regions. They
|
||||||
|
@ -2213,7 +2213,7 @@ Each routine must return the value TRUE for success.</para>
|
||||||
RegionPtr pRegion;
|
RegionPtr pRegion;
|
||||||
BoxPtr pBox;
|
BoxPtr pBox;
|
||||||
|
|
||||||
macro: REGION_RESET(pScreen, pRegion, pBox)
|
macro: RegionReset(pRegion, pBox)
|
||||||
|
|
||||||
</programlisting></blockquote>
|
</programlisting></blockquote>
|
||||||
RegionReset sets the region to describe
|
RegionReset sets the region to describe
|
||||||
|
@ -2225,7 +2225,7 @@ one rectangle and reallocates it to a size of one rectangle, if applicable.</par
|
||||||
RegionPtr pRegion;
|
RegionPtr pRegion;
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
macro: REGION_TRANSLATE(pScreen, pRegion, x, y)
|
macro: RegionTranslate(pRegion, x, y)
|
||||||
|
|
||||||
</programlisting></blockquote>
|
</programlisting></blockquote>
|
||||||
TranslateRegion simply moves a region +x in the x direction and +y in the y
|
TranslateRegion simply moves a region +x in the x direction and +y in the y
|
||||||
|
@ -2237,7 +2237,7 @@ direction.</para>
|
||||||
RegionPtr pRegion;
|
RegionPtr pRegion;
|
||||||
BoxPtr pBox;
|
BoxPtr pBox;
|
||||||
|
|
||||||
macro: int RECT_IN_REGION(pScreen, pRegion, pBox)
|
macro: int RegionContainsRect(pRegion, pBox)
|
||||||
|
|
||||||
</programlisting></blockquote>
|
</programlisting></blockquote>
|
||||||
RectIn returns one of the defined constants rgnIN, rgnOUT, or rgnPART,
|
RectIn returns one of the defined constants rgnIN, rgnOUT, or rgnPART,
|
||||||
|
@ -2252,7 +2252,7 @@ These constants are defined in Xserver/include/region.h.</para>
|
||||||
int x, y;
|
int x, y;
|
||||||
BoxPtr pBox;
|
BoxPtr pBox;
|
||||||
|
|
||||||
macro: Bool POINT_IN_REGION(pScreen, pRegion, x, y, pBox)
|
macro: Bool RegionContainsPoint(pRegion, x, y, pBox)
|
||||||
|
|
||||||
</programlisting></blockquote>
|
</programlisting></blockquote>
|
||||||
PointInRegion returns true if the point x, y is in the region. In
|
PointInRegion returns true if the point x, y is in the region. In
|
||||||
|
@ -2275,7 +2275,7 @@ returned box.</para>
|
||||||
Bool pScreen->RegionNotEmpty(pRegion)
|
Bool pScreen->RegionNotEmpty(pRegion)
|
||||||
RegionPtr pRegion;
|
RegionPtr pRegion;
|
||||||
|
|
||||||
macro: Bool REGION_NOTEMPTY(pScreen, pRegion)
|
macro: Bool RegionNotEmpty(pRegion)
|
||||||
|
|
||||||
</programlisting></blockquote>
|
</programlisting></blockquote>
|
||||||
RegionNotEmpty is a boolean function that returns
|
RegionNotEmpty is a boolean function that returns
|
||||||
|
@ -2286,7 +2286,7 @@ true or false depending upon whether the region encloses any pixels.</para>
|
||||||
void pScreen->RegionEmpty(pRegion)
|
void pScreen->RegionEmpty(pRegion)
|
||||||
RegionPtr pRegion;
|
RegionPtr pRegion;
|
||||||
|
|
||||||
macro: REGION_EMPTY(pScreen, pRegion)
|
macro: RegionEmpty(pRegion)
|
||||||
|
|
||||||
</programlisting></blockquote>
|
</programlisting></blockquote>
|
||||||
RegionEmpty sets the region to be empty.</para>
|
RegionEmpty sets the region to be empty.</para>
|
||||||
|
@ -2296,7 +2296,7 @@ RegionEmpty sets the region to be empty.</para>
|
||||||
BoxPtr pScreen->RegionExtents(pRegion)
|
BoxPtr pScreen->RegionExtents(pRegion)
|
||||||
RegionPtr pRegion;
|
RegionPtr pRegion;
|
||||||
|
|
||||||
macro: REGION_EXTENTS(pScreen, pRegion)
|
macro: RegionExtents(pRegion)
|
||||||
|
|
||||||
</programlisting></blockquote>
|
</programlisting></blockquote>
|
||||||
RegionExtents returns a rectangle that is the smallest
|
RegionExtents returns a rectangle that is the smallest
|
||||||
|
@ -2310,13 +2310,13 @@ in your region struct.</para>
|
||||||
RegionPtr pDstRgn;
|
RegionPtr pDstRgn;
|
||||||
RegionPtr pRegion;
|
RegionPtr pRegion;
|
||||||
|
|
||||||
macro: Bool REGION_APPEND(pScreen, pDstRgn, pRegion)
|
macro: Bool RegionAppend(pDstRgn, pRegion)
|
||||||
|
|
||||||
Bool pScreen->RegionValidate (pRegion, pOverlap)
|
Bool pScreen->RegionValidate (pRegion, pOverlap)
|
||||||
RegionPtr pRegion;
|
RegionPtr pRegion;
|
||||||
Bool *pOverlap;
|
Bool *pOverlap;
|
||||||
|
|
||||||
macro: Bool REGION_VALIDATE(pScreen, pRegion, pOverlap)
|
macro: Bool RegionValidate(pRegion, pOverlap)
|
||||||
|
|
||||||
</programlisting></blockquote>
|
</programlisting></blockquote>
|
||||||
These functions provide an optimization for clip list generation and
|
These functions provide an optimization for clip list generation and
|
||||||
|
@ -2332,7 +2332,7 @@ regions overlap; FALSE otherwise.</para>
|
||||||
RegionPtr pScreen->BitmapToRegion (pPixmap)
|
RegionPtr pScreen->BitmapToRegion (pPixmap)
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
|
|
||||||
macro: RegionPtr BITMAP_TO_REGION(pScreen, pPixmap)
|
macro: RegionPtr BitmapToRegion(pScreen, pPixmap)
|
||||||
|
|
||||||
</programlisting></blockquote>
|
</programlisting></blockquote>
|
||||||
Given a depth-1 pixmap, this routine must create a valid region which
|
Given a depth-1 pixmap, this routine must create a valid region which
|
||||||
|
@ -2346,7 +2346,7 @@ areas filled with 0's. This routine returns NULL if out of memory.</para>
|
||||||
xRectangle *pRects;
|
xRectangle *pRects;
|
||||||
int ordering;
|
int ordering;
|
||||||
|
|
||||||
macro: RegionPtr RECTS_TO_REGION(pScreen, nrects, pRects, ordering)
|
macro: RegionPtr RegionFromRects(nrects, pRects, ordering)
|
||||||
|
|
||||||
</programlisting></blockquote>
|
</programlisting></blockquote>
|
||||||
Given a client-supplied list of rectangles, produces a region which includes
|
Given a client-supplied list of rectangles, produces a region which includes
|
||||||
|
|
|
@ -161,10 +161,10 @@ exaPixmapDirty (PixmapPtr pPix, int x1, int y1, int x2, int y2)
|
||||||
if (box.x1 >= box.x2 || box.y1 >= box.y2)
|
if (box.x1 >= box.x2 || box.y1 >= box.y2)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
REGION_INIT(pScreen, ®ion, &box, 1);
|
RegionInit(®ion, &box, 1);
|
||||||
DamageRegionAppend(&pPix->drawable, ®ion);
|
DamageRegionAppend(&pPix->drawable, ®ion);
|
||||||
DamageRegionProcessPending(&pPix->drawable);
|
DamageRegionProcessPending(&pPix->drawable);
|
||||||
REGION_UNINIT(pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -658,7 +658,7 @@ exaBitmapToRegion(PixmapPtr pPix)
|
||||||
|
|
||||||
exaPrepareAccess(&pPix->drawable, EXA_PREPARE_SRC);
|
exaPrepareAccess(&pPix->drawable, EXA_PREPARE_SRC);
|
||||||
swap(pExaScr, pScreen, BitmapToRegion);
|
swap(pExaScr, pScreen, BitmapToRegion);
|
||||||
ret = pScreen->BitmapToRegion(pPix);
|
ret = (*pScreen->BitmapToRegion)(pPix);
|
||||||
swap(pExaScr, pScreen, BitmapToRegion);
|
swap(pExaScr, pScreen, BitmapToRegion);
|
||||||
exaFinishAccess(&pPix->drawable, EXA_PREPARE_SRC);
|
exaFinishAccess(&pPix->drawable, EXA_PREPARE_SRC);
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
@ -106,7 +106,7 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
|
||||||
if (fullX1 >= fullX2)
|
if (fullX1 >= fullX2)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
nbox = REGION_NUM_RECTS (pClip);
|
nbox = RegionNumRects (pClip);
|
||||||
if (nbox == 1)
|
if (nbox == 1)
|
||||||
{
|
{
|
||||||
(*pExaScr->info->Solid) (pPixmap,
|
(*pExaScr->info->Solid) (pPixmap,
|
||||||
|
@ -115,7 +115,7 @@ exaFillSpans(DrawablePtr pDrawable, GCPtr pGC, int n,
|
||||||
}
|
}
|
||||||
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)
|
||||||
|
@ -192,8 +192,8 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
|
||||||
y += pDrawable->y;
|
y += pDrawable->y;
|
||||||
|
|
||||||
pClip = fbGetCompositeClip(pGC);
|
pClip = fbGetCompositeClip(pGC);
|
||||||
for (nbox = REGION_NUM_RECTS(pClip),
|
for (nbox = RegionNumRects(pClip),
|
||||||
pbox = REGION_RECTS(pClip);
|
pbox = RegionRects(pClip);
|
||||||
nbox--;
|
nbox--;
|
||||||
pbox++)
|
pbox++)
|
||||||
{
|
{
|
||||||
|
@ -416,15 +416,15 @@ exaHWCopyNtoN (DrawablePtr pSrcDrawable,
|
||||||
else
|
else
|
||||||
ordering = CT_UNSORTED;
|
ordering = CT_UNSORTED;
|
||||||
|
|
||||||
srcregion = RECTS_TO_REGION(pScreen, nbox, rects, ordering);
|
srcregion = RegionFromRects(nbox, rects, ordering);
|
||||||
free(rects);
|
free(rects);
|
||||||
|
|
||||||
if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask,
|
if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask,
|
||||||
pGC->fillStyle, pGC->alu,
|
pGC->fillStyle, pGC->alu,
|
||||||
pGC->clientClipType)) {
|
pGC->clientClipType)) {
|
||||||
dstregion = REGION_CREATE(pScreen, NullBox, 0);
|
dstregion = RegionCreate(NullBox, 0);
|
||||||
REGION_COPY(pScreen, dstregion, srcregion);
|
RegionCopy(dstregion, srcregion);
|
||||||
REGION_TRANSLATE(pScreen, dstregion, dst_off_x - dx - src_off_x,
|
RegionTranslate(dstregion, dst_off_x - dx - src_off_x,
|
||||||
dst_off_y - dy - src_off_y);
|
dst_off_y - dy - src_off_y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -551,12 +551,12 @@ fallback:
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (dstregion) {
|
if (dstregion) {
|
||||||
REGION_UNINIT(pScreen, dstregion);
|
RegionUninit(dstregion);
|
||||||
REGION_DESTROY(pScreen, dstregion);
|
RegionDestroy(dstregion);
|
||||||
}
|
}
|
||||||
if (srcregion) {
|
if (srcregion) {
|
||||||
REGION_UNINIT(pScreen, srcregion);
|
RegionUninit(srcregion);
|
||||||
REGION_DESTROY(pScreen, srcregion);
|
RegionDestroy(srcregion);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -788,13 +788,13 @@ exaPolyFillRect(DrawablePtr pDrawable,
|
||||||
int xoff, yoff;
|
int xoff, yoff;
|
||||||
int xorg, yorg;
|
int xorg, yorg;
|
||||||
int n;
|
int n;
|
||||||
RegionPtr pReg = RECTS_TO_REGION(pScreen, nrect, prect, CT_UNSORTED);
|
RegionPtr pReg = RegionFromRects(nrect, prect, CT_UNSORTED);
|
||||||
|
|
||||||
/* Compute intersection of rects and clip region */
|
/* Compute intersection of rects and clip region */
|
||||||
REGION_TRANSLATE(pScreen, pReg, pDrawable->x, pDrawable->y);
|
RegionTranslate(pReg, pDrawable->x, pDrawable->y);
|
||||||
REGION_INTERSECT(pScreen, pReg, pClip, pReg);
|
RegionIntersect(pReg, pClip, pReg);
|
||||||
|
|
||||||
if (!REGION_NUM_RECTS(pReg)) {
|
if (!RegionNumRects(pReg)) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -856,7 +856,7 @@ fallback:
|
||||||
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;
|
||||||
|
@ -883,7 +883,7 @@ fallback:
|
||||||
|
|
||||||
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)
|
||||||
{
|
{
|
||||||
(*pExaScr->info->Solid) (pPixmap,
|
(*pExaScr->info->Solid) (pPixmap,
|
||||||
|
@ -892,7 +892,7 @@ fallback:
|
||||||
}
|
}
|
||||||
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(),
|
||||||
|
@ -927,8 +927,8 @@ fallback:
|
||||||
exaMarkSync(pDrawable->pScreen);
|
exaMarkSync(pDrawable->pScreen);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
REGION_UNINIT(pScreen, pReg);
|
RegionUninit(pReg);
|
||||||
REGION_DESTROY(pScreen, pReg);
|
RegionDestroy(pReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
const GCOps exaOps = {
|
const GCOps exaOps = {
|
||||||
|
@ -964,14 +964,14 @@ exaCopyWindow(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_INIT (pWin->drawable.pScreen, &rgnDst, NullBox, 0);
|
RegionInit(&rgnDst, NullBox, 0);
|
||||||
|
|
||||||
REGION_INTERSECT(pWin->drawable.pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
|
RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc);
|
||||||
#ifdef COMPOSITE
|
#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
|
||||||
|
|
||||||
|
@ -987,11 +987,11 @@ exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
||||||
pExaScr->fallback_flags &= ~EXA_ACCEL_COPYWINDOW;
|
pExaScr->fallback_flags &= ~EXA_ACCEL_COPYWINDOW;
|
||||||
|
|
||||||
fallback:
|
fallback:
|
||||||
REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
|
RegionUninit(&rgnDst);
|
||||||
|
|
||||||
if (pExaScr->fallback_flags & EXA_FALLBACK_COPYWINDOW) {
|
if (pExaScr->fallback_flags & EXA_FALLBACK_COPYWINDOW) {
|
||||||
pExaScr->fallback_flags &= ~EXA_FALLBACK_COPYWINDOW;
|
pExaScr->fallback_flags &= ~EXA_FALLBACK_COPYWINDOW;
|
||||||
REGION_TRANSLATE(pWin->drawable.pScreen, prgnSrc, dx, dy);
|
RegionTranslate(prgnSrc, dx, dy);
|
||||||
ExaCheckCopyWindow(pWin, ptOldOrg, prgnSrc);
|
ExaCheckCopyWindow(pWin, ptOldOrg, prgnSrc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1007,7 +1007,7 @@ exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel,
|
||||||
Bool ret = FALSE;
|
Bool ret = FALSE;
|
||||||
|
|
||||||
exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff);
|
exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff);
|
||||||
REGION_TRANSLATE(pScreen, pRegion, xoff, yoff);
|
RegionTranslate(pRegion, xoff, yoff);
|
||||||
|
|
||||||
if (pExaScr->fallback_counter || pExaPixmap->accel_blocked)
|
if (pExaScr->fallback_counter || pExaPixmap->accel_blocked)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -1030,8 +1030,8 @@ exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel,
|
||||||
int nbox;
|
int nbox;
|
||||||
BoxPtr pBox;
|
BoxPtr pBox;
|
||||||
|
|
||||||
nbox = REGION_NUM_RECTS (pRegion);
|
nbox = RegionNumRects (pRegion);
|
||||||
pBox = REGION_RECTS (pRegion);
|
pBox = RegionRects (pRegion);
|
||||||
|
|
||||||
while (nbox--)
|
while (nbox--)
|
||||||
{
|
{
|
||||||
|
@ -1060,18 +1060,18 @@ exaFillRegionSolid (DrawablePtr pDrawable, RegionPtr pRegion, Pixel pixel,
|
||||||
*(CARD8*)pExaPixmap->sys_ptr = pixel;
|
*(CARD8*)pExaPixmap->sys_ptr = pixel;
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_UNION(pScreen, &pExaPixmap->validSys, &pExaPixmap->validSys,
|
RegionUnion(&pExaPixmap->validSys, &pExaPixmap->validSys,
|
||||||
pRegion);
|
pRegion);
|
||||||
REGION_UNION(pScreen, &pExaPixmap->validFB, &pExaPixmap->validFB,
|
RegionUnion(&pExaPixmap->validFB, &pExaPixmap->validFB,
|
||||||
pRegion);
|
pRegion);
|
||||||
REGION_SUBTRACT(pScreen, pending_damage, pending_damage, pRegion);
|
RegionSubtract(pending_damage, pending_damage, pRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = TRUE;
|
ret = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
out:
|
out:
|
||||||
REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff);
|
RegionTranslate(pRegion, -xoff, -yoff);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1090,8 +1090,8 @@ exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
|
||||||
ExaPixmapPrivPtr pTileExaPixmap = ExaGetPixmapPriv(pTile);
|
ExaPixmapPrivPtr pTileExaPixmap = ExaGetPixmapPriv(pTile);
|
||||||
int xoff, yoff;
|
int xoff, yoff;
|
||||||
int tileWidth, tileHeight;
|
int tileWidth, tileHeight;
|
||||||
int nbox = REGION_NUM_RECTS (pRegion);
|
int nbox = RegionNumRects (pRegion);
|
||||||
BoxPtr pBox = REGION_RECTS (pRegion);
|
BoxPtr pBox = RegionRects (pRegion);
|
||||||
Bool ret = FALSE;
|
Bool ret = FALSE;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -1137,7 +1137,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
|
||||||
if ((*pExaScr->info->PrepareCopy) (pTile, pPixmap, 1, 1, alu, planemask))
|
if ((*pExaScr->info->PrepareCopy) (pTile, pPixmap, 1, 1, alu, planemask))
|
||||||
{
|
{
|
||||||
if (xoff || yoff)
|
if (xoff || yoff)
|
||||||
REGION_TRANSLATE(pScreen, pRegion, xoff, yoff);
|
RegionTranslate(pRegion, xoff, yoff);
|
||||||
|
|
||||||
for (i = 0; i < nbox; i++)
|
for (i = 0; i < nbox; i++)
|
||||||
{
|
{
|
||||||
|
@ -1245,7 +1245,7 @@ exaFillRegionTiled (DrawablePtr pDrawable, RegionPtr pRegion, PixmapPtr pTile,
|
||||||
exaMarkSync(pDrawable->pScreen);
|
exaMarkSync(pDrawable->pScreen);
|
||||||
|
|
||||||
if (xoff || yoff)
|
if (xoff || yoff)
|
||||||
REGION_TRANSLATE(pScreen, pRegion, -xoff, -yoff);
|
RegionTranslate(pRegion, -xoff, -yoff);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -131,8 +131,8 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
|
||||||
box.y1 = 0;
|
box.y1 = 0;
|
||||||
box.x2 = w;
|
box.x2 = w;
|
||||||
box.y2 = h;
|
box.y2 = h;
|
||||||
REGION_INIT(pScreen, &pExaPixmap->validSys, &box, 0);
|
RegionInit(&pExaPixmap->validSys, &box, 0);
|
||||||
REGION_INIT(pScreen, &pExaPixmap->validFB, &box, 0);
|
RegionInit(&pExaPixmap->validFB, &box, 0);
|
||||||
|
|
||||||
exaSetAccelBlock(pExaScr, pExaPixmap,
|
exaSetAccelBlock(pExaScr, pExaPixmap,
|
||||||
w, h, bpp);
|
w, h, bpp);
|
||||||
|
@ -237,8 +237,8 @@ exaDestroyPixmap_classic (PixmapPtr pPixmap)
|
||||||
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
|
pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr;
|
||||||
pPixmap->devKind = pExaPixmap->sys_pitch;
|
pPixmap->devKind = pExaPixmap->sys_pitch;
|
||||||
}
|
}
|
||||||
REGION_UNINIT(pPixmap->drawable.pScreen, &pExaPixmap->validSys);
|
RegionUninit(&pExaPixmap->validSys);
|
||||||
REGION_UNINIT(pPixmap->drawable.pScreen, &pExaPixmap->validFB);
|
RegionUninit(&pExaPixmap->validFB);
|
||||||
}
|
}
|
||||||
|
|
||||||
swap(pExaScr, pScreen, DestroyPixmap);
|
swap(pExaScr, pScreen, DestroyPixmap);
|
||||||
|
|
|
@ -78,8 +78,8 @@ exaPixmapIsDirty (PixmapPtr pPix)
|
||||||
if (!pExaPixmap->pDamage)
|
if (!pExaPixmap->pDamage)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return REGION_NOTEMPTY (pScreen, DamageRegion(pExaPixmap->pDamage)) ||
|
return RegionNotEmpty(DamageRegion(pExaPixmap->pDamage)) ||
|
||||||
!REGION_EQUAL(pScreen, &pExaPixmap->validSys, &pExaPixmap->validFB);
|
!RegionEqual(&pExaPixmap->validSys, &pExaPixmap->validFB);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -123,22 +123,22 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
|
||||||
|
|
||||||
/* Damaged bits are valid in current copy but invalid in other one */
|
/* Damaged bits are valid in current copy but invalid in other one */
|
||||||
if (pExaPixmap->use_gpu_copy) {
|
if (pExaPixmap->use_gpu_copy) {
|
||||||
REGION_UNION(pScreen, &pExaPixmap->validFB, &pExaPixmap->validFB,
|
RegionUnion(&pExaPixmap->validFB, &pExaPixmap->validFB,
|
||||||
damage);
|
damage);
|
||||||
REGION_SUBTRACT(pScreen, &pExaPixmap->validSys, &pExaPixmap->validSys,
|
RegionSubtract(&pExaPixmap->validSys, &pExaPixmap->validSys,
|
||||||
damage);
|
damage);
|
||||||
} else {
|
} else {
|
||||||
REGION_UNION(pScreen, &pExaPixmap->validSys, &pExaPixmap->validSys,
|
RegionUnion(&pExaPixmap->validSys, &pExaPixmap->validSys,
|
||||||
damage);
|
damage);
|
||||||
REGION_SUBTRACT(pScreen, &pExaPixmap->validFB, &pExaPixmap->validFB,
|
RegionSubtract(&pExaPixmap->validFB, &pExaPixmap->validFB,
|
||||||
damage);
|
damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_EMPTY(pScreen, damage);
|
RegionEmpty(damage);
|
||||||
|
|
||||||
/* Copy bits valid in source but not in destination */
|
/* Copy bits valid in source but not in destination */
|
||||||
REGION_NULL(pScreen, &CopyReg);
|
RegionNull(&CopyReg);
|
||||||
REGION_SUBTRACT(pScreen, &CopyReg, pValidSrc, pValidDst);
|
RegionSubtract(&CopyReg, pValidSrc, pValidDst);
|
||||||
|
|
||||||
if (migrate->as_dst) {
|
if (migrate->as_dst) {
|
||||||
ExaScreenPriv (pPixmap->drawable.pScreen);
|
ExaScreenPriv (pPixmap->drawable.pScreen);
|
||||||
|
@ -153,7 +153,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
|
||||||
RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage);
|
RegionPtr pending_damage = DamagePendingRegion(pExaPixmap->pDamage);
|
||||||
|
|
||||||
#if DEBUG_MIGRATE
|
#if DEBUG_MIGRATE
|
||||||
if (REGION_NIL(pending_damage)) {
|
if (RegionNil(pending_damage)) {
|
||||||
static Bool firsttime = TRUE;
|
static Bool firsttime = TRUE;
|
||||||
|
|
||||||
if (firsttime) {
|
if (firsttime) {
|
||||||
|
@ -167,23 +167,23 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
|
||||||
* rects by filling it up to the extents of the union of the
|
* rects by filling it up to the extents of the union of the
|
||||||
* destination valid region and the pending damage region.
|
* destination valid region and the pending damage region.
|
||||||
*/
|
*/
|
||||||
if (REGION_NUM_RECTS(pValidDst) > 10) {
|
if (RegionNumRects(pValidDst) > 10) {
|
||||||
BoxRec box;
|
BoxRec box;
|
||||||
BoxPtr pValidExt, pDamageExt;
|
BoxPtr pValidExt, pDamageExt;
|
||||||
RegionRec closure;
|
RegionRec closure;
|
||||||
|
|
||||||
pValidExt = REGION_EXTENTS(pScreen, pValidDst);
|
pValidExt = RegionExtents(pValidDst);
|
||||||
pDamageExt = REGION_EXTENTS(pScreen, pending_damage);
|
pDamageExt = RegionExtents(pending_damage);
|
||||||
|
|
||||||
box.x1 = min(pValidExt->x1, pDamageExt->x1);
|
box.x1 = min(pValidExt->x1, pDamageExt->x1);
|
||||||
box.y1 = min(pValidExt->y1, pDamageExt->y1);
|
box.y1 = min(pValidExt->y1, pDamageExt->y1);
|
||||||
box.x2 = max(pValidExt->x2, pDamageExt->x2);
|
box.x2 = max(pValidExt->x2, pDamageExt->x2);
|
||||||
box.y2 = max(pValidExt->y2, pDamageExt->y2);
|
box.y2 = max(pValidExt->y2, pDamageExt->y2);
|
||||||
|
|
||||||
REGION_INIT(pScreen, &closure, &box, 0);
|
RegionInit(&closure, &box, 0);
|
||||||
REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, &closure);
|
RegionIntersect(&CopyReg, &CopyReg, &closure);
|
||||||
} else
|
} else
|
||||||
REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, pending_damage);
|
RegionIntersect(&CopyReg, &CopyReg, pending_damage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The caller may provide a region to be subtracted from the calculated
|
/* The caller may provide a region to be subtracted from the calculated
|
||||||
|
@ -191,17 +191,17 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
|
||||||
* contribute to the result of the operation.
|
* contribute to the result of the operation.
|
||||||
*/
|
*/
|
||||||
if (migrate->pReg)
|
if (migrate->pReg)
|
||||||
REGION_SUBTRACT(pScreen, &CopyReg, &CopyReg, migrate->pReg);
|
RegionSubtract(&CopyReg, &CopyReg, migrate->pReg);
|
||||||
} else {
|
} else {
|
||||||
/* The caller may restrict the region to be migrated for source pixmaps
|
/* The caller may restrict the region to be migrated for source pixmaps
|
||||||
* to what's relevant for the operation.
|
* to what's relevant for the operation.
|
||||||
*/
|
*/
|
||||||
if (migrate->pReg)
|
if (migrate->pReg)
|
||||||
REGION_INTERSECT(pScreen, &CopyReg, &CopyReg, migrate->pReg);
|
RegionIntersect(&CopyReg, &CopyReg, migrate->pReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
pBox = REGION_RECTS(&CopyReg);
|
pBox = RegionRects(&CopyReg);
|
||||||
nbox = REGION_NUM_RECTS(&CopyReg);
|
nbox = RegionNumRects(&CopyReg);
|
||||||
|
|
||||||
save_use_gpu_copy = pExaPixmap->use_gpu_copy;
|
save_use_gpu_copy = pExaPixmap->use_gpu_copy;
|
||||||
save_pitch = pPixmap->devKind;
|
save_pitch = pPixmap->devKind;
|
||||||
|
@ -252,13 +252,13 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
|
||||||
* removing parts of it which are also in the destination valid region.
|
* removing parts of it which are also in the destination valid region.
|
||||||
* Removing anything beyond that would lead to data loss.
|
* Removing anything beyond that would lead to data loss.
|
||||||
*/
|
*/
|
||||||
if (REGION_NUM_RECTS(pValidSrc) > 20)
|
if (RegionNumRects(pValidSrc) > 20)
|
||||||
REGION_SUBTRACT(pScreen, pValidSrc, pValidSrc, pValidDst);
|
RegionSubtract(pValidSrc, pValidSrc, pValidDst);
|
||||||
|
|
||||||
/* The copied bits are now valid in destination */
|
/* The copied bits are now valid in destination */
|
||||||
REGION_UNION(pScreen, pValidDst, pValidDst, &CopyReg);
|
RegionUnion(pValidDst, pValidDst, &CopyReg);
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &CopyReg);
|
RegionUninit(&CopyReg);
|
||||||
|
|
||||||
if (access_prepared)
|
if (access_prepared)
|
||||||
exaFinishAccess(&pPixmap->drawable, fallback_index);
|
exaFinishAccess(&pPixmap->drawable, fallback_index);
|
||||||
|
@ -440,7 +440,7 @@ exaPixmapSave (ScreenPtr pScreen, ExaOffscreenArea *area)
|
||||||
|
|
||||||
/* Mark all FB bits as invalid, so all valid system bits get copied to FB
|
/* Mark all FB bits as invalid, so all valid system bits get copied to FB
|
||||||
* next time */
|
* next time */
|
||||||
REGION_EMPTY(pPixmap->drawable.pScreen, &pExaPixmap->validFB);
|
RegionEmpty(&pExaPixmap->validFB);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -531,15 +531,15 @@ exaAssertNotDirty (PixmapPtr pPixmap)
|
||||||
if (exaPixmapIsPinned(pPixmap) || pExaPixmap->area == NULL)
|
if (exaPixmapIsPinned(pPixmap) || pExaPixmap->area == NULL)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
REGION_NULL(pScreen, &ValidReg);
|
RegionNull(&ValidReg);
|
||||||
REGION_INTERSECT(pScreen, &ValidReg, &pExaPixmap->validFB,
|
RegionIntersect(&ValidReg, &pExaPixmap->validFB,
|
||||||
&pExaPixmap->validSys);
|
&pExaPixmap->validSys);
|
||||||
nbox = REGION_NUM_RECTS(&ValidReg);
|
nbox = RegionNumRects(&ValidReg);
|
||||||
|
|
||||||
if (!nbox)
|
if (!nbox)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
pBox = REGION_RECTS(&ValidReg);
|
pBox = RegionRects(&ValidReg);
|
||||||
|
|
||||||
dst_pitch = pExaPixmap->sys_pitch;
|
dst_pitch = pExaPixmap->sys_pitch;
|
||||||
src_pitch = pExaPixmap->fb_pitch;
|
src_pitch = pExaPixmap->fb_pitch;
|
||||||
|
@ -586,7 +586,7 @@ skip:
|
||||||
pPixmap->devKind = save_pitch;
|
pPixmap->devKind = save_pitch;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
REGION_UNINIT(pScreen, &ValidReg);
|
RegionUninit(&ValidReg);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -180,7 +180,7 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
|
||||||
|
|
||||||
exaSetAccelBlock(pExaScr, pExaPixmap,
|
exaSetAccelBlock(pExaScr, pExaPixmap,
|
||||||
width, height, bitsPerPixel);
|
width, height, bitsPerPixel);
|
||||||
REGION_EMPTY(pScreen, &pExaPixmap->validFB);
|
RegionEmpty(&pExaPixmap->validFB);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Need to re-create system copy if there's also a GPU copy */
|
/* Need to re-create system copy if there's also a GPU copy */
|
||||||
|
@ -192,7 +192,7 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
|
||||||
DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
|
DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
|
||||||
DamageDestroy(pExaPixmap->pDamage);
|
DamageDestroy(pExaPixmap->pDamage);
|
||||||
pExaPixmap->pDamage = NULL;
|
pExaPixmap->pDamage = NULL;
|
||||||
REGION_EMPTY(pScreen, &pExaPixmap->validSys);
|
RegionEmpty(&pExaPixmap->validSys);
|
||||||
|
|
||||||
if (pExaScr->deferred_mixed_pixmap == pPixmap)
|
if (pExaScr->deferred_mixed_pixmap == pPixmap)
|
||||||
pExaScr->deferred_mixed_pixmap = NULL;
|
pExaScr->deferred_mixed_pixmap = NULL;
|
||||||
|
|
|
@ -292,7 +292,7 @@ exaTryDriverSolidFill(PicturePtr pSrc,
|
||||||
|
|
||||||
exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y);
|
exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y);
|
||||||
|
|
||||||
REGION_TRANSLATE(pScreen, ®ion, dst_off_x, dst_off_y);
|
RegionTranslate(®ion, dst_off_x, dst_off_y);
|
||||||
|
|
||||||
if (pSrc->pDrawable) {
|
if (pSrc->pDrawable) {
|
||||||
pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable);
|
pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable);
|
||||||
|
@ -305,7 +305,7 @@ exaTryDriverSolidFill(PicturePtr pSrc,
|
||||||
!exaGetPixelFromRGBA(&pixel, red, green, blue, alpha,
|
!exaGetPixelFromRGBA(&pixel, red, green, blue, alpha,
|
||||||
pDst->pFormat))
|
pDst->pFormat))
|
||||||
{
|
{
|
||||||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -320,18 +320,18 @@ exaTryDriverSolidFill(PicturePtr pSrc,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!exaPixmapHasGpuCopy(pDstPix)) {
|
if (!exaPixmapHasGpuCopy(pDstPix)) {
|
||||||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(*pExaScr->info->PrepareSolid) (pDstPix, GXcopy, 0xffffffff, pixel))
|
if (!(*pExaScr->info->PrepareSolid) (pDstPix, GXcopy, 0xffffffff, pixel))
|
||||||
{
|
{
|
||||||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
nbox = REGION_NUM_RECTS(®ion);
|
nbox = RegionNumRects(®ion);
|
||||||
pbox = REGION_RECTS(®ion);
|
pbox = RegionRects(®ion);
|
||||||
|
|
||||||
while (nbox--)
|
while (nbox--)
|
||||||
{
|
{
|
||||||
|
@ -342,7 +342,7 @@ exaTryDriverSolidFill(PicturePtr pSrc,
|
||||||
(*pExaScr->info->DoneSolid) (pDstPix);
|
(*pExaScr->info->DoneSolid) (pDstPix);
|
||||||
exaMarkSync(pDst->pDrawable->pScreen);
|
exaMarkSync(pDst->pDrawable->pScreen);
|
||||||
|
|
||||||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -469,10 +469,10 @@ exaTryDriverCompositeRects(CARD8 op,
|
||||||
rects->width, rects->height))
|
rects->width, rects->height))
|
||||||
goto next_rect;
|
goto next_rect;
|
||||||
|
|
||||||
REGION_TRANSLATE(pScreen, ®ion, dst_off_x, dst_off_y);
|
RegionTranslate(®ion, dst_off_x, dst_off_y);
|
||||||
|
|
||||||
nbox = REGION_NUM_RECTS(®ion);
|
nbox = RegionNumRects(®ion);
|
||||||
pbox = REGION_RECTS(®ion);
|
pbox = RegionRects(®ion);
|
||||||
|
|
||||||
xMask = xMask + mask_off_x - xDst - dst_off_x;
|
xMask = xMask + mask_off_x - xDst - dst_off_x;
|
||||||
yMask = yMask + mask_off_y - yDst - dst_off_y;
|
yMask = yMask + mask_off_y - yDst - dst_off_y;
|
||||||
|
@ -494,7 +494,7 @@ exaTryDriverCompositeRects(CARD8 op,
|
||||||
}
|
}
|
||||||
|
|
||||||
next_rect:
|
next_rect:
|
||||||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
|
|
||||||
rects++;
|
rects++;
|
||||||
}
|
}
|
||||||
|
@ -575,11 +575,11 @@ exaCompositeRects(CARD8 op,
|
||||||
* (see use of DamagePendingRegion in exaCopyDirty)
|
* (see use of DamagePendingRegion in exaCopyDirty)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
REGION_INIT(pScreen, ®ion, &box, 1);
|
RegionInit(®ion, &box, 1);
|
||||||
|
|
||||||
DamageRegionAppend(pDst->pDrawable, ®ion);
|
DamageRegionAppend(pDst->pDrawable, ®ion);
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************/
|
/************************************************************/
|
||||||
|
@ -703,7 +703,7 @@ exaTryDriverComposite(CARD8 op,
|
||||||
|
|
||||||
exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y);
|
exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &dst_off_x, &dst_off_y);
|
||||||
|
|
||||||
REGION_TRANSLATE(pScreen, ®ion, dst_off_x, dst_off_y);
|
RegionTranslate(®ion, dst_off_x, dst_off_y);
|
||||||
|
|
||||||
if (pExaScr->do_migration) {
|
if (pExaScr->do_migration) {
|
||||||
ExaMigrationRec pixmaps[3];
|
ExaMigrationRec pixmaps[3];
|
||||||
|
@ -737,7 +737,7 @@ exaTryDriverComposite(CARD8 op,
|
||||||
if (pSrcPix) {
|
if (pSrcPix) {
|
||||||
pSrcPix = exaGetOffscreenPixmap (pSrc->pDrawable, &src_off_x, &src_off_y);
|
pSrcPix = exaGetOffscreenPixmap (pSrc->pDrawable, &src_off_x, &src_off_y);
|
||||||
if (!pSrcPix) {
|
if (!pSrcPix) {
|
||||||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -746,25 +746,25 @@ exaTryDriverComposite(CARD8 op,
|
||||||
pMaskPix = exaGetOffscreenPixmap (pMask->pDrawable, &mask_off_x,
|
pMaskPix = exaGetOffscreenPixmap (pMask->pDrawable, &mask_off_x,
|
||||||
&mask_off_y);
|
&mask_off_y);
|
||||||
if (!pMaskPix) {
|
if (!pMaskPix) {
|
||||||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!exaPixmapHasGpuCopy(pDstPix)) {
|
if (!exaPixmapHasGpuCopy(pDstPix)) {
|
||||||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(*pExaScr->info->PrepareComposite) (op, pSrc, pMask, pDst, pSrcPix,
|
if (!(*pExaScr->info->PrepareComposite) (op, pSrc, pMask, pDst, pSrcPix,
|
||||||
pMaskPix, pDstPix))
|
pMaskPix, pDstPix))
|
||||||
{
|
{
|
||||||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
nbox = REGION_NUM_RECTS(®ion);
|
nbox = RegionNumRects(®ion);
|
||||||
pbox = REGION_RECTS(®ion);
|
pbox = RegionRects(®ion);
|
||||||
|
|
||||||
xMask = xMask + mask_off_x - xDst - dst_off_x;
|
xMask = xMask + mask_off_x - xDst - dst_off_x;
|
||||||
yMask = yMask + mask_off_y - yDst - dst_off_y;
|
yMask = yMask + mask_off_y - yDst - dst_off_y;
|
||||||
|
@ -788,7 +788,7 @@ exaTryDriverComposite(CARD8 op,
|
||||||
(*pExaScr->info->DoneComposite) (pDstPix);
|
(*pExaScr->info->DoneComposite) (pDstPix);
|
||||||
exaMarkSync(pDst->pDrawable->pScreen);
|
exaMarkSync(pDst->pDrawable->pScreen);
|
||||||
|
|
||||||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -953,9 +953,9 @@ exaComposite(CARD8 op,
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
ret = exaHWCopyNtoN(pSrc->pDrawable, pDst->pDrawable, NULL,
|
ret = exaHWCopyNtoN(pSrc->pDrawable, pDst->pDrawable, NULL,
|
||||||
REGION_RECTS(®ion), REGION_NUM_RECTS(®ion),
|
RegionRects(®ion), RegionNumRects(®ion),
|
||||||
xSrc - xDst, ySrc - yDst, FALSE, FALSE);
|
xSrc - xDst, ySrc - yDst, FALSE, FALSE);
|
||||||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
|
|
||||||
/* Reset values to their original values. */
|
/* Reset values to their original values. */
|
||||||
xDst -= pDst->pDrawable->x;
|
xDst -= pDst->pDrawable->x;
|
||||||
|
@ -1005,7 +1005,7 @@ exaComposite(CARD8 op,
|
||||||
(PixmapPtr)pSrc->pDrawable,
|
(PixmapPtr)pSrc->pDrawable,
|
||||||
&patOrg, FB_ALLONES, GXcopy, CT_NONE);
|
&patOrg, FB_ALLONES, GXcopy, CT_NONE);
|
||||||
|
|
||||||
REGION_UNINIT(pDst->pDrawable->pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
|
|
||||||
if (ret)
|
if (ret)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
|
@ -131,10 +131,10 @@ ExaCheckCopyNtoN (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
||||||
PixmapPtr pPixmap = exaGetDrawablePixmap(pSrc);
|
PixmapPtr pPixmap = exaGetDrawablePixmap(pSrc);
|
||||||
|
|
||||||
exaGetDrawableDeltas(pSrc, pPixmap, &xoff, &yoff);
|
exaGetDrawableDeltas(pSrc, pPixmap, &xoff, &yoff);
|
||||||
REGION_INIT(pScreen, ®, pbox, nbox);
|
RegionInit(®, pbox, nbox);
|
||||||
REGION_TRANSLATE(pScreen, ®, xoff + dx, yoff + dy);
|
RegionTranslate(®, xoff + dx, yoff + dy);
|
||||||
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_SRC, ®);
|
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_SRC, ®);
|
||||||
REGION_UNINIT(pScreen, ®);
|
RegionUninit(®);
|
||||||
} else
|
} else
|
||||||
exaPrepareAccess (pSrc, EXA_PREPARE_SRC);
|
exaPrepareAccess (pSrc, EXA_PREPARE_SRC);
|
||||||
|
|
||||||
|
@ -144,10 +144,10 @@ ExaCheckCopyNtoN (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
|
||||||
PixmapPtr pPixmap = exaGetDrawablePixmap(pDst);
|
PixmapPtr pPixmap = exaGetDrawablePixmap(pDst);
|
||||||
|
|
||||||
exaGetDrawableDeltas(pSrc, pPixmap, &xoff, &yoff);
|
exaGetDrawableDeltas(pSrc, pPixmap, &xoff, &yoff);
|
||||||
REGION_INIT(pScreen, ®, pbox, nbox);
|
RegionInit(®, pbox, nbox);
|
||||||
REGION_TRANSLATE(pScreen, ®, xoff, yoff);
|
RegionTranslate(®, xoff, yoff);
|
||||||
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_DEST, ®);
|
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_DEST, ®);
|
||||||
REGION_UNINIT(pScreen, ®);
|
RegionUninit(®);
|
||||||
} else
|
} else
|
||||||
exaPrepareAccess (pDst, EXA_PREPARE_DEST);
|
exaPrepareAccess (pDst, EXA_PREPARE_DEST);
|
||||||
|
|
||||||
|
@ -188,9 +188,9 @@ ExaFallbackPrepareReg(DrawablePtr pDrawable,
|
||||||
box.x2 = box.x1 + width;
|
box.x2 = box.x1 + width;
|
||||||
box.y2 = box.y1 + height;
|
box.y2 = box.y1 + height;
|
||||||
|
|
||||||
REGION_INIT(pScreen, ®, &box, 1);
|
RegionInit(®, &box, 1);
|
||||||
pExaScr->prepare_access_reg(pPixmap, index, ®);
|
pExaScr->prepare_access_reg(pPixmap, index, ®);
|
||||||
REGION_UNINIT(pScreen, ®);
|
RegionUninit(®);
|
||||||
} else
|
} else
|
||||||
exaPrepareAccess(pDrawable, index);
|
exaPrepareAccess(pDrawable, index);
|
||||||
}
|
}
|
||||||
|
@ -382,9 +382,9 @@ ExaCheckCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
||||||
int xoff, yoff;
|
int xoff, yoff;
|
||||||
|
|
||||||
exaGetDrawableDeltas(&pWin->drawable, pPixmap, &xoff, &yoff);
|
exaGetDrawableDeltas(&pWin->drawable, pPixmap, &xoff, &yoff);
|
||||||
REGION_TRANSLATE(pScreen, prgnSrc, xoff, yoff);
|
RegionTranslate(prgnSrc, xoff, yoff);
|
||||||
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_SRC, prgnSrc);
|
pExaScr->prepare_access_reg(pPixmap, EXA_PREPARE_SRC, prgnSrc);
|
||||||
REGION_TRANSLATE(pScreen, prgnSrc, -xoff, -yoff);
|
RegionTranslate(prgnSrc, -xoff, -yoff);
|
||||||
} else
|
} else
|
||||||
exaPrepareAccess(pDrawable, EXA_PREPARE_SRC);
|
exaPrepareAccess(pDrawable, EXA_PREPARE_SRC);
|
||||||
|
|
||||||
|
@ -458,9 +458,9 @@ ExaSrcValidate(DrawablePtr pDrawable,
|
||||||
dst = (pExaScr->srcPix == pPix) ? &pExaScr->srcReg :
|
dst = (pExaScr->srcPix == pPix) ? &pExaScr->srcReg :
|
||||||
&pExaScr->maskReg;
|
&pExaScr->maskReg;
|
||||||
|
|
||||||
REGION_INIT(pScreen, ®, &box, 1);
|
RegionInit(®, &box, 1);
|
||||||
REGION_UNION(pScreen, dst, dst, ®);
|
RegionUnion(dst, dst, ®);
|
||||||
REGION_UNINIT(pScreen, ®);
|
RegionUninit(®);
|
||||||
|
|
||||||
if (pExaScr->SavedSourceValidate) {
|
if (pExaScr->SavedSourceValidate) {
|
||||||
swap(pExaScr, pScreen, SourceValidate);
|
swap(pExaScr, pScreen, SourceValidate);
|
||||||
|
@ -495,30 +495,30 @@ ExaPrepareCompositeReg(ScreenPtr pScreen,
|
||||||
Bool ret;
|
Bool ret;
|
||||||
|
|
||||||
|
|
||||||
REGION_NULL(pScreen, ®ion);
|
RegionNull(®ion);
|
||||||
|
|
||||||
if (pSrc->pDrawable) {
|
if (pSrc->pDrawable) {
|
||||||
pSrcPix = exaGetDrawablePixmap(pSrc->pDrawable);
|
pSrcPix = exaGetDrawablePixmap(pSrc->pDrawable);
|
||||||
REGION_NULL(pScreen, &pExaScr->srcReg);
|
RegionNull(&pExaScr->srcReg);
|
||||||
srcReg = &pExaScr->srcReg;
|
srcReg = &pExaScr->srcReg;
|
||||||
pExaScr->srcPix = pSrcPix;
|
pExaScr->srcPix = pSrcPix;
|
||||||
if (pSrc != pDst)
|
if (pSrc != pDst)
|
||||||
REGION_TRANSLATE(pScreen, pSrc->pCompositeClip,
|
RegionTranslate(pSrc->pCompositeClip,
|
||||||
-pSrc->pDrawable->x,
|
-pSrc->pDrawable->x,
|
||||||
-pSrc->pDrawable->y);
|
-pSrc->pDrawable->y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pMask && pMask->pDrawable) {
|
if (pMask && pMask->pDrawable) {
|
||||||
pMaskPix = exaGetDrawablePixmap(pMask->pDrawable);
|
pMaskPix = exaGetDrawablePixmap(pMask->pDrawable);
|
||||||
REGION_NULL(pScreen, &pExaScr->maskReg);
|
RegionNull(&pExaScr->maskReg);
|
||||||
maskReg = &pExaScr->maskReg;
|
maskReg = &pExaScr->maskReg;
|
||||||
if (pMask != pDst && pMask != pSrc)
|
if (pMask != pDst && pMask != pSrc)
|
||||||
REGION_TRANSLATE(pScreen, pMask->pCompositeClip,
|
RegionTranslate(pMask->pCompositeClip,
|
||||||
-pMask->pDrawable->x,
|
-pMask->pDrawable->x,
|
||||||
-pMask->pDrawable->y);
|
-pMask->pDrawable->y);
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_TRANSLATE(pScreen, pDst->pCompositeClip,
|
RegionTranslate(pDst->pCompositeClip,
|
||||||
-pDst->pDrawable->x,
|
-pDst->pDrawable->x,
|
||||||
-pDst->pDrawable->y);
|
-pDst->pDrawable->y);
|
||||||
|
|
||||||
|
@ -531,23 +531,23 @@ ExaPrepareCompositeReg(ScreenPtr pScreen,
|
||||||
width, height);
|
width, height);
|
||||||
swap(pExaScr, pScreen, SourceValidate);
|
swap(pExaScr, pScreen, SourceValidate);
|
||||||
|
|
||||||
REGION_TRANSLATE(pScreen, pDst->pCompositeClip,
|
RegionTranslate(pDst->pCompositeClip,
|
||||||
pDst->pDrawable->x,
|
pDst->pDrawable->x,
|
||||||
pDst->pDrawable->y);
|
pDst->pDrawable->y);
|
||||||
if (pSrc->pDrawable && pSrc != pDst)
|
if (pSrc->pDrawable && pSrc != pDst)
|
||||||
REGION_TRANSLATE(pScreen, pSrc->pCompositeClip,
|
RegionTranslate(pSrc->pCompositeClip,
|
||||||
pSrc->pDrawable->x,
|
pSrc->pDrawable->x,
|
||||||
pSrc->pDrawable->y);
|
pSrc->pDrawable->y);
|
||||||
if (pMask && pMask->pDrawable && pMask != pDst && pMask != pSrc)
|
if (pMask && pMask->pDrawable && pMask != pDst && pMask != pSrc)
|
||||||
REGION_TRANSLATE(pScreen, pMask->pCompositeClip,
|
RegionTranslate(pMask->pCompositeClip,
|
||||||
pMask->pDrawable->x,
|
pMask->pDrawable->x,
|
||||||
pMask->pDrawable->y);
|
pMask->pDrawable->y);
|
||||||
|
|
||||||
if (!ret) {
|
if (!ret) {
|
||||||
if (srcReg)
|
if (srcReg)
|
||||||
REGION_UNINIT(pScreen, srcReg);
|
RegionUninit(srcReg);
|
||||||
if (maskReg)
|
if (maskReg)
|
||||||
REGION_UNINIT(pScreen, maskReg);
|
RegionUninit(maskReg);
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -577,9 +577,9 @@ ExaPrepareCompositeReg(ScreenPtr pScreen,
|
||||||
maskReg);
|
maskReg);
|
||||||
|
|
||||||
if (srcReg)
|
if (srcReg)
|
||||||
REGION_UNINIT(pScreen, srcReg);
|
RegionUninit(srcReg);
|
||||||
if (maskReg)
|
if (maskReg)
|
||||||
REGION_UNINIT(pScreen, maskReg);
|
RegionUninit(maskReg);
|
||||||
|
|
||||||
pDstPix = exaGetDrawablePixmap(pDst->pDrawable);
|
pDstPix = exaGetDrawablePixmap(pDst->pDrawable);
|
||||||
if (!exaOpReadsDestination(op)) {
|
if (!exaOpReadsDestination(op)) {
|
||||||
|
@ -587,7 +587,7 @@ ExaPrepareCompositeReg(ScreenPtr pScreen,
|
||||||
int yoff;
|
int yoff;
|
||||||
|
|
||||||
exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &xoff, &yoff);
|
exaGetDrawableDeltas (pDst->pDrawable, pDstPix, &xoff, &yoff);
|
||||||
REGION_TRANSLATE(pScreen, ®ion, pDst->pDrawable->x + xoff,
|
RegionTranslate(®ion, pDst->pDrawable->x + xoff,
|
||||||
pDst->pDrawable->y + yoff);
|
pDst->pDrawable->y + yoff);
|
||||||
dstReg = ®ion;
|
dstReg = ®ion;
|
||||||
}
|
}
|
||||||
|
@ -598,7 +598,7 @@ ExaPrepareCompositeReg(ScreenPtr pScreen,
|
||||||
dstReg);
|
dstReg);
|
||||||
pExaScr->prepare_access_reg(pDstPix, EXA_PREPARE_DEST, dstReg);
|
pExaScr->prepare_access_reg(pDstPix, EXA_PREPARE_DEST, dstReg);
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
fb/fb.h
2
fb/fb.h
|
@ -739,7 +739,7 @@ typedef struct {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define fbWindowEnabled(pWin) \
|
#define fbWindowEnabled(pWin) \
|
||||||
REGION_NOTEMPTY((pWin)->drawable.pScreen, \
|
RegionNotEmpty(\
|
||||||
&(pWin)->drawable.pScreen->root->borderClip)
|
&(pWin)->drawable.pScreen->root->borderClip)
|
||||||
|
|
||||||
#define fbDrawableEnabled(pDrawable) \
|
#define fbDrawableEnabled(pDrawable) \
|
||||||
|
|
|
@ -335,8 +335,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)
|
||||||
|
@ -399,8 +399,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++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -102,7 +102,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 <= SHRT_MAX) && (y2 <= SHRT_MAX) &&
|
if ( (x2 <= SHRT_MAX) && (y2 <= SHRT_MAX) &&
|
||||||
(RECT_IN_REGION(pDrawable->pScreen, cclip, &box) == rgnIN) ) {
|
(RegionContainsRect(cclip, &box) == rgnIN) ) {
|
||||||
#ifdef FB_ACCESS_WRAPPER
|
#ifdef FB_ACCESS_WRAPPER
|
||||||
if (!wrapped) {
|
if (!wrapped) {
|
||||||
fbPrepareAccess (pDrawable);
|
fbPrepareAccess (pDrawable);
|
||||||
|
|
|
@ -670,7 +670,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;
|
||||||
|
@ -807,7 +807,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;
|
||||||
|
|
|
@ -185,7 +185,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++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,7 +44,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;
|
||||||
|
@ -71,7 +71,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,
|
||||||
|
@ -80,7 +80,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()
|
||||||
|
|
|
@ -41,7 +41,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;
|
||||||
|
@ -66,7 +66,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,
|
||||||
|
@ -75,7 +75,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)
|
||||||
|
|
|
@ -213,7 +213,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
|
||||||
|
|
|
@ -39,7 +39,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
|
||||||
|
@ -56,7 +56,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
|
||||||
|
|
|
@ -134,8 +134,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++)
|
||||||
{
|
{
|
||||||
|
@ -224,8 +224,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++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -117,7 +117,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;
|
||||||
|
@ -154,7 +154,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;
|
||||||
|
|
|
@ -75,7 +75,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;
|
||||||
|
@ -93,7 +93,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;
|
||||||
}
|
}
|
||||||
|
@ -147,7 +147,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;
|
||||||
|
@ -175,24 +175,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);
|
||||||
|
@ -200,9 +200,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);
|
||||||
|
@ -232,21 +232,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;
|
||||||
miCopyRegion (&pPixmap->drawable, &pPixmap->drawable,
|
miCopyRegion (&pPixmap->drawable, &pPixmap->drawable,
|
||||||
0,
|
0,
|
||||||
|
@ -259,12 +259,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
|
||||||
|
|
|
@ -77,8 +77,8 @@ fbWalkCompositeRegion (CARD8 op,
|
||||||
xMask, yMask, xDst, yDst, width, height))
|
xMask, yMask, xDst, yDst, width, height))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
n = REGION_NUM_RECTS (®ion);
|
n = RegionNumRects (®ion);
|
||||||
pbox = REGION_RECTS (®ion);
|
pbox = RegionRects (®ion);
|
||||||
while (n--)
|
while (n--)
|
||||||
{
|
{
|
||||||
h = pbox->y2 - pbox->y1;
|
h = pbox->y2 - pbox->y1;
|
||||||
|
@ -138,7 +138,7 @@ fbWalkCompositeRegion (CARD8 op,
|
||||||
}
|
}
|
||||||
pbox++;
|
pbox++;
|
||||||
}
|
}
|
||||||
REGION_UNINIT (pDst->pDrawable->pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -116,7 +116,7 @@ if (((rx1) < (rx2)) && ((ry1) < (ry2)) && \
|
||||||
if ((reg)->data->numRects == (reg)->data->size) \
|
if ((reg)->data->numRects == (reg)->data->size) \
|
||||||
{ \
|
{ \
|
||||||
RegionRectAlloc(reg, 1); \
|
RegionRectAlloc(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); \
|
||||||
|
@ -153,10 +153,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;
|
||||||
|
|
||||||
fbPrepareAccess(&pPix->drawable);
|
fbPrepareAccess(&pPix->drawable);
|
||||||
|
@ -304,8 +304,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)
|
||||||
{
|
{
|
||||||
free(pReg->data);
|
free(pReg->data);
|
||||||
|
|
|
@ -154,7 +154,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);
|
||||||
|
|
|
@ -190,8 +190,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++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -624,8 +624,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);
|
||||||
|
|
||||||
|
|
|
@ -60,8 +60,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)
|
||||||
|
|
|
@ -128,15 +128,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
|
||||||
|
|
||||||
|
@ -144,7 +144,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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,8 +211,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);
|
||||||
|
|
||||||
#ifndef FB_ACCESS_WRAPPER
|
#ifndef FB_ACCESS_WRAPPER
|
||||||
int try_mmx = 0;
|
int try_mmx = 0;
|
||||||
|
|
4
fix-patch-whitespace
Executable file
4
fix-patch-whitespace
Executable file
|
@ -0,0 +1,4 @@
|
||||||
|
#!/bin/sh
|
||||||
|
git diff --check |
|
||||||
|
sed -n 's!^\([^:]*\):\([^:]*\):.*!sed -i "\2 s/[ \t]*$//; \2 s/ *\t/\t/g" \1!p' |
|
||||||
|
sh
|
38
fix-region
Executable file
38
fix-region
Executable file
|
@ -0,0 +1,38 @@
|
||||||
|
#!/bin/sh
|
||||||
|
sed -i \
|
||||||
|
-e 's/REGION_NIL\b/RegionNil/g' \
|
||||||
|
-e 's/REGION_NAR\b/RegionNar/g' \
|
||||||
|
-e 's/REGION_NUM_RECTS\b/RegionNumRects/g' \
|
||||||
|
-e 's/REGION_SIZE\b/RegionSize/g' \
|
||||||
|
-e 's/REGION_RECTS\b/RegionRects/g' \
|
||||||
|
-e 's/REGION_BOXPTR\b/RegionBoxptr/g' \
|
||||||
|
-e 's/REGION_BOX\b/RegionBox/g' \
|
||||||
|
-e 's/REGION_TOP\b/RegionTop/g' \
|
||||||
|
-e 's/REGION_END\b/RegionEnd/g' \
|
||||||
|
-e 's/REGION_SZOF\b/RegionSizeof/g' \
|
||||||
|
-e 's/REGION_CREATE *([^,]*, */RegionCreate(/g' \
|
||||||
|
-e 's/REGION_COPY *([^,]*, */RegionCopy(/g' \
|
||||||
|
-e 's/REGION_DESTROY *([^,]*, */RegionDestroy(/g' \
|
||||||
|
-e 's/REGION_INTERSECT *([^,]*, */RegionIntersect(/g' \
|
||||||
|
-e 's/REGION_UNION *([^,]*, */RegionUnion(/g' \
|
||||||
|
-e 's/REGION_SUBTRACT *([^,]*, */RegionSubtract(/g' \
|
||||||
|
-e 's/REGION_INVERSE *([^,]*, */RegionInverse(/g' \
|
||||||
|
-e 's/REGION_TRANSLATE *([^,]*, */RegionTranslate(/g' \
|
||||||
|
-e 's/RECT_IN_REGION *([^,]*, */RegionContainsRect(/g' \
|
||||||
|
-e 's/POINT_IN_REGION *([^,]*, */RegionContainsPoint(/g' \
|
||||||
|
-e 's/REGION_EQUAL *([^,]*, */RegionEqual(/g' \
|
||||||
|
-e 's/REGION_APPEND *([^,]*, */RegionAppend(/g' \
|
||||||
|
-e 's/REGION_VALIDATE *([^,]*, */RegionValidate(/g' \
|
||||||
|
-e 's/BITMAP_TO_REGION\b/BitmapToRegion/g' \
|
||||||
|
-e 's/RECTS_TO_REGION *([^,]*, */RegionFromRects(/g' \
|
||||||
|
-e 's/REGION_BREAK *([^,]*, */RegionBreak(/g' \
|
||||||
|
-e 's/REGION_INIT *([^,]*, */RegionInit(/g' \
|
||||||
|
-e 's/REGION_UNINIT *([^,]*, */RegionUninit(/g' \
|
||||||
|
-e 's/REGION_RESET *([^,]*, */RegionReset(/g' \
|
||||||
|
-e 's/REGION_NOTEMPTY *([^,]*, */RegionNotEmpty(/g' \
|
||||||
|
-e 's/REGION_BROKEN *([^,]*, */RegionBroken(/g' \
|
||||||
|
-e 's/REGION_EMPTY *([^,]*, */RegionEmpty(/g' \
|
||||||
|
-e 's/REGION_EXTENTS *([^,]*, */RegionExtents(/g' \
|
||||||
|
-e 's/REGION_NULL *([^,]*, */RegionNull(/g' \
|
||||||
|
-e 's/REGION_NULL$/RegionNull/g' \
|
||||||
|
"$@"
|
12
glx/glxdri.c
12
glx/glxdri.c
|
@ -468,7 +468,7 @@ nooverride:
|
||||||
pRegion = NULL;
|
pRegion = NULL;
|
||||||
} else {
|
} else {
|
||||||
pRegion = DamageRegion(driDraw->pDamage);
|
pRegion = DamageRegion(driDraw->pDamage);
|
||||||
if (REGION_NIL(pRegion))
|
if (RegionNil(pRegion))
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -531,8 +531,8 @@ nooverride:
|
||||||
int i, numRects;
|
int i, numRects;
|
||||||
BoxPtr p;
|
BoxPtr p;
|
||||||
|
|
||||||
numRects = REGION_NUM_RECTS (pRegion);
|
numRects = RegionNumRects (pRegion);
|
||||||
p = REGION_RECTS (pRegion);
|
p = RegionRects (pRegion);
|
||||||
|
|
||||||
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, 0) );
|
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_PIXELS, 0) );
|
||||||
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, 0) );
|
CALL_PixelStorei( GET_DISPATCH(), (GL_UNPACK_SKIP_ROWS, 0) );
|
||||||
|
@ -832,12 +832,12 @@ static void __glXReportDamage(__DRIdrawable *driDraw,
|
||||||
|
|
||||||
__glXenterServer(GL_FALSE);
|
__glXenterServer(GL_FALSE);
|
||||||
|
|
||||||
REGION_INIT(pDraw->pScreen, ®ion, (BoxPtr) rects, num_rects);
|
RegionInit(®ion, (BoxPtr) rects, num_rects);
|
||||||
REGION_TRANSLATE(pScreen, ®ion, pDraw->x, pDraw->y);
|
RegionTranslate(®ion, pDraw->x, pDraw->y);
|
||||||
DamageRegionAppend(pDraw, ®ion);
|
DamageRegionAppend(pDraw, ®ion);
|
||||||
/* This is wrong, this needs a seperate function. */
|
/* This is wrong, this needs a seperate function. */
|
||||||
DamageRegionProcessPending(pDraw);
|
DamageRegionProcessPending(pDraw);
|
||||||
REGION_UNINIT(pDraw->pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
|
|
||||||
__glXleaveServer(GL_FALSE);
|
__glXleaveServer(GL_FALSE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,7 +122,7 @@ __glXDRIdrawableCopySubBuffer(__GLXdrawable *drawable,
|
||||||
box.y1 = private->height - y - h;
|
box.y1 = private->height - y - h;
|
||||||
box.x2 = x + w;
|
box.x2 = x + w;
|
||||||
box.y2 = private->height - y;
|
box.y2 = private->height - y;
|
||||||
REGION_INIT(drawable->pDraw->pScreen, ®ion, &box, 0);
|
RegionInit(®ion, &box, 0);
|
||||||
|
|
||||||
DRI2CopyRegion(drawable->pDraw, ®ion,
|
DRI2CopyRegion(drawable->pDraw, ®ion,
|
||||||
DRI2BufferFrontLeft, DRI2BufferBackLeft);
|
DRI2BufferFrontLeft, DRI2BufferBackLeft);
|
||||||
|
@ -139,7 +139,7 @@ __glXDRIdrawableWaitX(__GLXdrawable *drawable)
|
||||||
box.y1 = 0;
|
box.y1 = 0;
|
||||||
box.x2 = private->width;
|
box.x2 = private->width;
|
||||||
box.y2 = private->height;
|
box.y2 = private->height;
|
||||||
REGION_INIT(drawable->pDraw->pScreen, ®ion, &box, 0);
|
RegionInit(®ion, &box, 0);
|
||||||
|
|
||||||
DRI2CopyRegion(drawable->pDraw, ®ion,
|
DRI2CopyRegion(drawable->pDraw, ®ion,
|
||||||
DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft);
|
DRI2BufferFakeFrontLeft, DRI2BufferFrontLeft);
|
||||||
|
@ -156,7 +156,7 @@ __glXDRIdrawableWaitGL(__GLXdrawable *drawable)
|
||||||
box.y1 = 0;
|
box.y1 = 0;
|
||||||
box.x2 = private->width;
|
box.x2 = private->width;
|
||||||
box.y2 = private->height;
|
box.y2 = private->height;
|
||||||
REGION_INIT(drawable->pDraw->pScreen, ®ion, &box, 0);
|
RegionInit(®ion, &box, 0);
|
||||||
|
|
||||||
DRI2CopyRegion(drawable->pDraw, ®ion,
|
DRI2CopyRegion(drawable->pDraw, ®ion,
|
||||||
DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft);
|
DRI2BufferFrontLeft, DRI2BufferFakeFrontLeft);
|
||||||
|
|
|
@ -350,7 +350,7 @@ void dmxUpdateScreenResources(ScreenPtr pScreen, int x, int y, int w, int h)
|
||||||
* clipList to be broken since it will be recalculated in
|
* clipList to be broken since it will be recalculated in
|
||||||
* ValidateTree()
|
* ValidateTree()
|
||||||
*/
|
*/
|
||||||
REGION_BREAK(pScreen, &pRoot->clipList);
|
RegionBreak(&pRoot->clipList);
|
||||||
} else {
|
} else {
|
||||||
/* Otherwise, we just set it directly since there are no
|
/* Otherwise, we just set it directly since there are no
|
||||||
* windows visible on this screen
|
* windows visible on this screen
|
||||||
|
@ -994,7 +994,7 @@ static void dmxForceExposures(int idx)
|
||||||
* clipList to be broken since it will be recalculated in
|
* clipList to be broken since it will be recalculated in
|
||||||
* ValidateTree()
|
* ValidateTree()
|
||||||
*/
|
*/
|
||||||
REGION_BREAK(pScreen, &pRoot->clipList);
|
RegionBreak(&pRoot->clipList);
|
||||||
pScreen->ValidateTree(pRoot, NULL, VTBroken);
|
pScreen->ValidateTree(pRoot, NULL, VTBroken);
|
||||||
pScreen->HandleExposures(pRoot);
|
pScreen->HandleExposures(pRoot);
|
||||||
if (pScreen->PostValidateTree)
|
if (pScreen->PostValidateTree)
|
||||||
|
|
|
@ -363,9 +363,9 @@ void dmxChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects)
|
||||||
|
|
||||||
case CT_REGION:
|
case CT_REGION:
|
||||||
if (dmxScreen->beDisplay) {
|
if (dmxScreen->beDisplay) {
|
||||||
nRects = REGION_NUM_RECTS((RegionPtr)pGC->clientClip);
|
nRects = RegionNumRects((RegionPtr)pGC->clientClip);
|
||||||
pRects = malloc(nRects * sizeof(*pRects));
|
pRects = malloc(nRects * sizeof(*pRects));
|
||||||
pBox = REGION_RECTS((RegionPtr)pGC->clientClip);
|
pBox = RegionRects((RegionPtr)pGC->clientClip);
|
||||||
|
|
||||||
for (i = 0; i < nRects; i++) {
|
for (i = 0; i < nRects; i++) {
|
||||||
pRects[i].x = pBox[i].x1;
|
pRects[i].x = pBox[i].x1;
|
||||||
|
|
|
@ -127,16 +127,16 @@ void dmxPutImage(DrawablePtr pDrawable, GCPtr pGC,
|
||||||
box.y1 = y;
|
box.y1 = y;
|
||||||
box.x2 = x + w;
|
box.x2 = x + w;
|
||||||
box.y2 = y + h;
|
box.y2 = y + h;
|
||||||
pSubImages = REGION_CREATE(pGC->pScreen, &box, 1);
|
pSubImages = RegionCreate(&box, 1);
|
||||||
|
|
||||||
pClip = REGION_CREATE(pGC->pScreen, NullBox, 1);
|
pClip = RegionCreate(NullBox, 1);
|
||||||
REGION_COPY(pGC->pScreen, pClip, pGC->pCompositeClip);
|
RegionCopy(pClip, pGC->pCompositeClip);
|
||||||
REGION_TRANSLATE(pGC->pScreen, pClip,
|
RegionTranslate(pClip,
|
||||||
-pDrawable->x, -pDrawable->y);
|
-pDrawable->x, -pDrawable->y);
|
||||||
REGION_INTERSECT(pGC->pScreen, pSubImages, pSubImages, pClip);
|
RegionIntersect(pSubImages, pSubImages, pClip);
|
||||||
|
|
||||||
nBox = REGION_NUM_RECTS(pSubImages);
|
nBox = RegionNumRects(pSubImages);
|
||||||
pBox = REGION_RECTS(pSubImages);
|
pBox = RegionRects(pSubImages);
|
||||||
|
|
||||||
while (nBox--) {
|
while (nBox--) {
|
||||||
XPutImage(dmxScreen->beDisplay, draw, pGCPriv->gc, img,
|
XPutImage(dmxScreen->beDisplay, draw, pGCPriv->gc, img,
|
||||||
|
@ -148,8 +148,8 @@ void dmxPutImage(DrawablePtr pDrawable, GCPtr pGC,
|
||||||
pBox->y2 - pBox->y1);
|
pBox->y2 - pBox->y1);
|
||||||
pBox++;
|
pBox++;
|
||||||
}
|
}
|
||||||
REGION_DESTROY(pGC->pScreen, pClip);
|
RegionDestroy(pClip);
|
||||||
REGION_DESTROY(pGC->pScreen, pSubImages);
|
RegionDestroy(pSubImages);
|
||||||
} else {
|
} else {
|
||||||
XPutImage(dmxScreen->beDisplay, draw, pGCPriv->gc,
|
XPutImage(dmxScreen->beDisplay, draw, pGCPriv->gc,
|
||||||
img, 0, 0, x, y, w, h);
|
img, 0, 0, x, y, w, h);
|
||||||
|
|
|
@ -871,8 +871,8 @@ int dmxChangePictureClip(PicturePtr pPicture, int clipType,
|
||||||
pPictPriv->pict, 0, 0, None);
|
pPictPriv->pict, 0, 0, None);
|
||||||
} else if (pPicture->clientClip) {
|
} else if (pPicture->clientClip) {
|
||||||
RegionPtr pClip = pPicture->clientClip;
|
RegionPtr pClip = pPicture->clientClip;
|
||||||
BoxPtr pBox = REGION_RECTS(pClip);
|
BoxPtr pBox = RegionRects(pClip);
|
||||||
int nBox = REGION_NUM_RECTS(pClip);
|
int nBox = RegionNumRects(pClip);
|
||||||
XRectangle *pRects;
|
XRectangle *pRects;
|
||||||
XRectangle *pRect;
|
XRectangle *pRect;
|
||||||
int nRects;
|
int nRects;
|
||||||
|
|
|
@ -201,7 +201,7 @@ RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap)
|
||||||
Bool overlap;
|
Bool overlap;
|
||||||
|
|
||||||
if (!dmxScreen->beDisplay) {
|
if (!dmxScreen->beDisplay) {
|
||||||
pReg = REGION_CREATE(pScreen, NullBox, 1);
|
pReg = RegionCreate(NullBox, 1);
|
||||||
return pReg;
|
return pReg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,8 +209,8 @@ RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap)
|
||||||
pPixmap->drawable.width, pPixmap->drawable.height,
|
pPixmap->drawable.width, pPixmap->drawable.height,
|
||||||
1, XYPixmap);
|
1, XYPixmap);
|
||||||
|
|
||||||
pReg = REGION_CREATE(pScreen, NullBox, 1);
|
pReg = RegionCreate(NullBox, 1);
|
||||||
pTmpReg = REGION_CREATE(pScreen, NullBox, 1);
|
pTmpReg = RegionCreate(NullBox, 1);
|
||||||
if(!pReg || !pTmpReg) {
|
if(!pReg || !pTmpReg) {
|
||||||
XDestroyImage(ximage);
|
XDestroyImage(ximage);
|
||||||
return NullRegion;
|
return NullRegion;
|
||||||
|
@ -229,8 +229,8 @@ RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap)
|
||||||
} else if (currentPixel == 0L) {
|
} else if (currentPixel == 0L) {
|
||||||
/* right edge */
|
/* right edge */
|
||||||
Box.x2 = x;
|
Box.x2 = x;
|
||||||
REGION_RESET(pScreen, pTmpReg, &Box);
|
RegionReset(pTmpReg, &Box);
|
||||||
REGION_APPEND(pScreen, pReg, pTmpReg);
|
RegionAppend(pReg, pTmpReg);
|
||||||
}
|
}
|
||||||
previousPixel = currentPixel;
|
previousPixel = currentPixel;
|
||||||
}
|
}
|
||||||
|
@ -238,15 +238,15 @@ RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap)
|
||||||
if (previousPixel != 0L) {
|
if (previousPixel != 0L) {
|
||||||
/* right edge because of the end of pixmap */
|
/* right edge because of the end of pixmap */
|
||||||
Box.x2 = pPixmap->drawable.width;
|
Box.x2 = pPixmap->drawable.width;
|
||||||
REGION_RESET(pScreen, pTmpReg, &Box);
|
RegionReset(pTmpReg, &Box);
|
||||||
REGION_APPEND(pScreen, pReg, pTmpReg);
|
RegionAppend(pReg, pTmpReg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_DESTROY(pScreen, pTmpReg);
|
RegionDestroy(pTmpReg);
|
||||||
XDestroyImage(ximage);
|
XDestroyImage(ximage);
|
||||||
|
|
||||||
REGION_VALIDATE(pScreen, pReg, &overlap);
|
RegionValidate(pReg, &overlap);
|
||||||
|
|
||||||
dmxSync(dmxScreen, FALSE);
|
dmxSync(dmxScreen, FALSE);
|
||||||
return(pReg);
|
return(pReg);
|
||||||
|
|
|
@ -47,8 +47,8 @@
|
||||||
void dmxShadowUpdateProc(ScreenPtr pScreen, shadowBufPtr pBuf)
|
void dmxShadowUpdateProc(ScreenPtr pScreen, shadowBufPtr pBuf)
|
||||||
{
|
{
|
||||||
RegionPtr damage = &pBuf->damage;
|
RegionPtr damage = &pBuf->damage;
|
||||||
int nbox = REGION_NUM_RECTS(damage);
|
int nbox = RegionNumRects(damage);
|
||||||
BoxPtr pbox = REGION_RECTS(damage);
|
BoxPtr pbox = RegionRects(damage);
|
||||||
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
|
DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum];
|
||||||
|
|
||||||
if (!dmxScreen->beDisplay)
|
if (!dmxScreen->beDisplay)
|
||||||
|
|
|
@ -940,8 +940,8 @@ static void dmxDoSetShape(WindowPtr pWindow)
|
||||||
|
|
||||||
/* First, set the bounding shape */
|
/* First, set the bounding shape */
|
||||||
if (wBoundingShape(pWindow)) {
|
if (wBoundingShape(pWindow)) {
|
||||||
pBox = REGION_RECTS(wBoundingShape(pWindow));
|
pBox = RegionRects(wBoundingShape(pWindow));
|
||||||
nRect = nBox = REGION_NUM_RECTS(wBoundingShape(pWindow));
|
nRect = nBox = RegionNumRects(wBoundingShape(pWindow));
|
||||||
pRectFirst = pRect = malloc(nRect * sizeof(*pRect));
|
pRectFirst = pRect = malloc(nRect * sizeof(*pRect));
|
||||||
while (nBox--) {
|
while (nBox--) {
|
||||||
pRect->x = pBox->x1;
|
pRect->x = pBox->x1;
|
||||||
|
@ -963,8 +963,8 @@ static void dmxDoSetShape(WindowPtr pWindow)
|
||||||
|
|
||||||
/* Next, set the clip shape */
|
/* Next, set the clip shape */
|
||||||
if (wClipShape(pWindow)) {
|
if (wClipShape(pWindow)) {
|
||||||
pBox = REGION_RECTS(wClipShape(pWindow));
|
pBox = RegionRects(wClipShape(pWindow));
|
||||||
nRect = nBox = REGION_NUM_RECTS(wClipShape(pWindow));
|
nRect = nBox = RegionNumRects(wClipShape(pWindow));
|
||||||
pRectFirst = pRect = malloc(nRect * sizeof(*pRect));
|
pRectFirst = pRect = malloc(nRect * sizeof(*pRect));
|
||||||
while (nBox--) {
|
while (nBox--) {
|
||||||
pRect->x = pBox->x1;
|
pRect->x = pBox->x1;
|
||||||
|
|
|
@ -226,7 +226,7 @@ static void dmxConsoleDrawWindows(pointer private)
|
||||||
pChild->drawable.height,
|
pChild->drawable.height,
|
||||||
pChild->visibility,
|
pChild->visibility,
|
||||||
pChild->overrideRedirect,
|
pChild->overrideRedirect,
|
||||||
REGION_NUM_RECTS(&pChild->clipList));
|
RegionNumRects(&pChild->clipList));
|
||||||
#endif
|
#endif
|
||||||
rect.x = scalex(priv, pChild->drawable.x + pScreen->x);
|
rect.x = scalex(priv, pChild->drawable.x + pScreen->x);
|
||||||
rect.y = scaley(priv, pChild->drawable.y + pScreen->y);
|
rect.y = scaley(priv, pChild->drawable.y + pScreen->y);
|
||||||
|
|
|
@ -343,13 +343,13 @@ ephyrInternalDamageRedisplay (ScreenPtr pScreen)
|
||||||
|
|
||||||
pRegion = DamageRegion (scrpriv->pDamage);
|
pRegion = DamageRegion (scrpriv->pDamage);
|
||||||
|
|
||||||
if (REGION_NOTEMPTY (pScreen, pRegion))
|
if (RegionNotEmpty(pRegion))
|
||||||
{
|
{
|
||||||
int nbox;
|
int nbox;
|
||||||
BoxPtr pbox;
|
BoxPtr pbox;
|
||||||
|
|
||||||
nbox = REGION_NUM_RECTS (pRegion);
|
nbox = RegionNumRects (pRegion);
|
||||||
pbox = REGION_RECTS (pRegion);
|
pbox = RegionRects (pRegion);
|
||||||
|
|
||||||
while (nbox--)
|
while (nbox--)
|
||||||
{
|
{
|
||||||
|
@ -897,10 +897,10 @@ ephyrExposePairedWindow (int a_remote)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
screen = pair->local->drawable.pScreen;
|
screen = pair->local->drawable.pScreen;
|
||||||
REGION_NULL (screen, ®);
|
RegionNull(®);
|
||||||
REGION_COPY (screen, ®, &pair->local->clipList);
|
RegionCopy(®, &pair->local->clipList);
|
||||||
screen->WindowExposures (pair->local, ®, NullRegion);
|
screen->WindowExposures (pair->local, ®, NullRegion);
|
||||||
REGION_UNINIT (screen, ®);
|
RegionUninit(®);
|
||||||
}
|
}
|
||||||
#endif /* XF86DRI */
|
#endif /* XF86DRI */
|
||||||
|
|
||||||
|
|
|
@ -418,11 +418,11 @@ ephyrDRIClipNotify (WindowPtr a_win,
|
||||||
EPHYR_LOG_ERROR ("failed to get window pair\n") ;
|
EPHYR_LOG_ERROR ("failed to get window pair\n") ;
|
||||||
goto out ;
|
goto out ;
|
||||||
}
|
}
|
||||||
rects = calloc(REGION_NUM_RECTS (&a_win->clipList),
|
rects = calloc(RegionNumRects (&a_win->clipList),
|
||||||
sizeof (EphyrRect)) ;
|
sizeof (EphyrRect)) ;
|
||||||
for (i=0; i < REGION_NUM_RECTS (&a_win->clipList); i++) {
|
for (i=0; i < RegionNumRects (&a_win->clipList); i++) {
|
||||||
memmove (&rects[i],
|
memmove (&rects[i],
|
||||||
®ION_RECTS (&a_win->clipList)[i],
|
&RegionRects (&a_win->clipList)[i],
|
||||||
sizeof (EphyrRect)) ;
|
sizeof (EphyrRect)) ;
|
||||||
rects[i].x1 -= a_win->drawable.x;
|
rects[i].x1 -= a_win->drawable.x;
|
||||||
rects[i].x2 -= a_win->drawable.x;
|
rects[i].x2 -= a_win->drawable.x;
|
||||||
|
@ -436,7 +436,7 @@ ephyrDRIClipNotify (WindowPtr a_win,
|
||||||
is_ok = hostx_set_window_bounding_rectangles
|
is_ok = hostx_set_window_bounding_rectangles
|
||||||
(pair->remote,
|
(pair->remote,
|
||||||
rects,
|
rects,
|
||||||
REGION_NUM_RECTS (&a_win->clipList)) ;
|
RegionNumRects (&a_win->clipList)) ;
|
||||||
is_ok = TRUE ;
|
is_ok = TRUE ;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
@ -1168,12 +1168,12 @@ ProcXF86DRIGetDrawableInfo (register ClientPtr client)
|
||||||
return BadMatch ;
|
return BadMatch ;
|
||||||
}
|
}
|
||||||
EPHYR_LOG ("clip list of xephyr gl drawable:\n") ;
|
EPHYR_LOG ("clip list of xephyr gl drawable:\n") ;
|
||||||
for (i=0; i < REGION_NUM_RECTS (&window->clipList); i++) {
|
for (i=0; i < RegionNumRects (&window->clipList); i++) {
|
||||||
EPHYR_LOG ("x1:%d, y1:%d, x2:%d, y2:%d\n",
|
EPHYR_LOG ("x1:%d, y1:%d, x2:%d, y2:%d\n",
|
||||||
REGION_RECTS (&window->clipList)[i].x1,
|
RegionRects (&window->clipList)[i].x1,
|
||||||
REGION_RECTS (&window->clipList)[i].y1,
|
RegionRects (&window->clipList)[i].y1,
|
||||||
REGION_RECTS (&window->clipList)[i].x2,
|
RegionRects (&window->clipList)[i].x2,
|
||||||
REGION_RECTS (&window->clipList)[i].y2) ;
|
RegionRects (&window->clipList)[i].y2) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ephyrDRIGetDrawableInfo (stuff->screen,
|
if (!ephyrDRIGetDrawableInfo (stuff->screen,
|
||||||
|
|
|
@ -946,8 +946,8 @@ ephyrPutImage (KdScreenInfo *a_info,
|
||||||
a_drw_x, a_drw_y, a_drw_w, a_drw_h,
|
a_drw_x, a_drw_y, a_drw_w, a_drw_h,
|
||||||
a_src_x, a_src_y, a_src_w, a_src_h,
|
a_src_x, a_src_y, a_src_w, a_src_h,
|
||||||
a_width, a_height, a_buf,
|
a_width, a_height, a_buf,
|
||||||
(EphyrHostBox*)REGION_RECTS (a_clipping_region),
|
(EphyrHostBox*)RegionRects (a_clipping_region),
|
||||||
REGION_NUM_RECTS (a_clipping_region))) {
|
RegionNumRects (a_clipping_region))) {
|
||||||
EPHYR_LOG_ERROR ("EphyrHostXVPutImage() failed\n") ;
|
EPHYR_LOG_ERROR ("EphyrHostXVPutImage() failed\n") ;
|
||||||
goto out ;
|
goto out ;
|
||||||
}
|
}
|
||||||
|
@ -1025,8 +1025,8 @@ ephyrReputImage (KdScreenInfo *a_info,
|
||||||
port_priv->src_w, port_priv->src_h,
|
port_priv->src_w, port_priv->src_h,
|
||||||
port_priv->image_width, port_priv->image_height,
|
port_priv->image_width, port_priv->image_height,
|
||||||
port_priv->image_buf,
|
port_priv->image_buf,
|
||||||
(EphyrHostBox*)REGION_RECTS (a_clipping_region),
|
(EphyrHostBox*)RegionRects (a_clipping_region),
|
||||||
REGION_NUM_RECTS (a_clipping_region))) {
|
RegionNumRects (a_clipping_region))) {
|
||||||
EPHYR_LOG_ERROR ("ephyrHostXVPutImage() failed\n") ;
|
EPHYR_LOG_ERROR ("ephyrHostXVPutImage() failed\n") ;
|
||||||
goto out ;
|
goto out ;
|
||||||
}
|
}
|
||||||
|
@ -1064,7 +1064,7 @@ ephyrPutVideo (KdScreenInfo *a_info,
|
||||||
dst_box.y2 = a_drw_y + a_drw_h;
|
dst_box.y2 = a_drw_y + a_drw_h;
|
||||||
|
|
||||||
if (!DoSimpleClip (&dst_box,
|
if (!DoSimpleClip (&dst_box,
|
||||||
REGION_EXTENTS (pScreen->pScreen, a_clipping_region),
|
RegionExtents(a_clipping_region),
|
||||||
&clipped_area)) {
|
&clipped_area)) {
|
||||||
EPHYR_LOG_ERROR ("failed to simple clip\n") ;
|
EPHYR_LOG_ERROR ("failed to simple clip\n") ;
|
||||||
goto out ;
|
goto out ;
|
||||||
|
@ -1115,7 +1115,7 @@ ephyrGetVideo (KdScreenInfo *a_info,
|
||||||
dst_box.y2 = a_drw_y + a_drw_h;
|
dst_box.y2 = a_drw_y + a_drw_h;
|
||||||
|
|
||||||
if (!DoSimpleClip (&dst_box,
|
if (!DoSimpleClip (&dst_box,
|
||||||
REGION_EXTENTS (pScreen->pScreen, a_clipping_region),
|
RegionExtents(a_clipping_region),
|
||||||
&clipped_area)) {
|
&clipped_area)) {
|
||||||
EPHYR_LOG_ERROR ("failed to simple clip\n") ;
|
EPHYR_LOG_ERROR ("failed to simple clip\n") ;
|
||||||
goto out ;
|
goto out ;
|
||||||
|
@ -1166,7 +1166,7 @@ ephyrPutStill (KdScreenInfo *a_info,
|
||||||
dst_box.y2 = a_drw_y + a_drw_h;
|
dst_box.y2 = a_drw_y + a_drw_h;
|
||||||
|
|
||||||
if (!DoSimpleClip (&dst_box,
|
if (!DoSimpleClip (&dst_box,
|
||||||
REGION_EXTENTS (pScreen->pScreen, a_clipping_region),
|
RegionExtents(a_clipping_region),
|
||||||
&clipped_area)) {
|
&clipped_area)) {
|
||||||
EPHYR_LOG_ERROR ("failed to simple clip\n") ;
|
EPHYR_LOG_ERROR ("failed to simple clip\n") ;
|
||||||
goto out ;
|
goto out ;
|
||||||
|
@ -1217,7 +1217,7 @@ ephyrGetStill (KdScreenInfo *a_info,
|
||||||
dst_box.y2 = a_drw_y + a_drw_h;
|
dst_box.y2 = a_drw_y + a_drw_h;
|
||||||
|
|
||||||
if (!DoSimpleClip (&dst_box,
|
if (!DoSimpleClip (&dst_box,
|
||||||
REGION_EXTENTS (pScreen->pScreen, a_clipping_region),
|
RegionExtents(a_clipping_region),
|
||||||
&clipped_area)) {
|
&clipped_area)) {
|
||||||
EPHYR_LOG_ERROR ("failed to simple clip\n") ;
|
EPHYR_LOG_ERROR ("failed to simple clip\n") ;
|
||||||
goto out ;
|
goto out ;
|
||||||
|
|
|
@ -121,8 +121,8 @@ KdSetRootClip (ScreenPtr pScreen, BOOL enable)
|
||||||
{
|
{
|
||||||
RegionPtr borderVisible;
|
RegionPtr borderVisible;
|
||||||
|
|
||||||
borderVisible = REGION_CREATE(pScreen, NullBox, 1);
|
borderVisible = RegionCreate(NullBox, 1);
|
||||||
REGION_SUBTRACT(pScreen, borderVisible,
|
RegionSubtract(borderVisible,
|
||||||
&pWin->borderClip, &pWin->winSize);
|
&pWin->borderClip, &pWin->winSize);
|
||||||
pWin->valdata->before.borderVisible = borderVisible;
|
pWin->valdata->before.borderVisible = borderVisible;
|
||||||
}
|
}
|
||||||
|
@ -138,15 +138,15 @@ KdSetRootClip (ScreenPtr pScreen, BOOL enable)
|
||||||
box.y2 = pScreen->height;
|
box.y2 = pScreen->height;
|
||||||
pWin->drawable.width = pScreen->width;
|
pWin->drawable.width = pScreen->width;
|
||||||
pWin->drawable.height = pScreen->height;
|
pWin->drawable.height = pScreen->height;
|
||||||
REGION_INIT (pScreen, &pWin->winSize, &box, 1);
|
RegionInit(&pWin->winSize, &box, 1);
|
||||||
REGION_INIT (pScreen, &pWin->borderSize, &box, 1);
|
RegionInit(&pWin->borderSize, &box, 1);
|
||||||
REGION_RESET(pScreen, &pWin->borderClip, &box);
|
RegionReset(&pWin->borderClip, &box);
|
||||||
REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
|
RegionBreak(&pWin->clipList);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
REGION_EMPTY(pScreen, &pWin->borderClip);
|
RegionEmpty(&pWin->borderClip);
|
||||||
REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
|
RegionBreak(&pWin->clipList);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
|
ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
|
||||||
|
@ -836,8 +836,8 @@ KdCreateWindow (WindowPtr pWin)
|
||||||
|
|
||||||
if (!pScreenPriv->enabled)
|
if (!pScreenPriv->enabled)
|
||||||
{
|
{
|
||||||
REGION_EMPTY (pWin->drawable.pScreen, &pWin->borderClip);
|
RegionEmpty(&pWin->borderClip);
|
||||||
REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
|
RegionBreak(&pWin->clipList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -268,9 +268,9 @@ KdXVFreeAdaptor(XvAdaptorPtr pAdaptor)
|
||||||
pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
|
pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
|
||||||
if(pPriv) {
|
if(pPriv) {
|
||||||
if(pPriv->clientClip)
|
if(pPriv->clientClip)
|
||||||
REGION_DESTROY(pAdaptor->pScreen, pPriv->clientClip);
|
RegionDestroy(pPriv->clientClip);
|
||||||
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
||||||
REGION_DESTROY(pAdaptor->pScreen, pPriv->pCompositeClip);
|
RegionDestroy(pPriv->pCompositeClip);
|
||||||
free(pPriv);
|
free(pPriv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -607,18 +607,18 @@ KdXVUpdateCompositeClip(XvPortRecPrivatePtr portPriv)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pCompositeClip = REGION_CREATE(pWin->pScreen, NullBox, 1);
|
pCompositeClip = RegionCreate(NullBox, 1);
|
||||||
REGION_COPY(pWin->pScreen, pCompositeClip, portPriv->clientClip);
|
RegionCopy(pCompositeClip, portPriv->clientClip);
|
||||||
REGION_TRANSLATE(pWin->pScreen, pCompositeClip,
|
RegionTranslate(pCompositeClip,
|
||||||
portPriv->pDraw->x + portPriv->clipOrg.x,
|
portPriv->pDraw->x + portPriv->clipOrg.x,
|
||||||
portPriv->pDraw->y + portPriv->clipOrg.y);
|
portPriv->pDraw->y + portPriv->clipOrg.y);
|
||||||
REGION_INTERSECT(pWin->pScreen, pCompositeClip, pregWin, pCompositeClip);
|
RegionIntersect(pCompositeClip, pregWin, pCompositeClip);
|
||||||
|
|
||||||
portPriv->pCompositeClip = pCompositeClip;
|
portPriv->pCompositeClip = pCompositeClip;
|
||||||
portPriv->FreeCompositeClip = TRUE;
|
portPriv->FreeCompositeClip = TRUE;
|
||||||
|
|
||||||
if(freeCompClip) {
|
if(freeCompClip) {
|
||||||
REGION_DESTROY(pWin->pScreen, pregWin);
|
RegionDestroy(pregWin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -633,17 +633,17 @@ KdXVCopyClip(
|
||||||
/* copy the new clip if it exists */
|
/* copy the new clip if it exists */
|
||||||
if((pGC->clientClipType == CT_REGION) && pGC->clientClip) {
|
if((pGC->clientClipType == CT_REGION) && pGC->clientClip) {
|
||||||
if(!portPriv->clientClip)
|
if(!portPriv->clientClip)
|
||||||
portPriv->clientClip = REGION_CREATE(pGC->pScreen, NullBox, 1);
|
portPriv->clientClip = RegionCreate(NullBox, 1);
|
||||||
/* Note: this is in window coordinates */
|
/* Note: this is in window coordinates */
|
||||||
REGION_COPY(pGC->pScreen, portPriv->clientClip, pGC->clientClip);
|
RegionCopy(portPriv->clientClip, pGC->clientClip);
|
||||||
} else if(portPriv->clientClip) { /* free the old clientClip */
|
} else if(portPriv->clientClip) { /* free the old clientClip */
|
||||||
REGION_DESTROY(pGC->pScreen, portPriv->clientClip);
|
RegionDestroy(portPriv->clientClip);
|
||||||
portPriv->clientClip = NULL;
|
portPriv->clientClip = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get rid of the old clip list */
|
/* get rid of the old clip list */
|
||||||
if(portPriv->pCompositeClip && portPriv->FreeCompositeClip) {
|
if(portPriv->pCompositeClip && portPriv->FreeCompositeClip) {
|
||||||
REGION_DESTROY(pWin->pScreen, portPriv->pCompositeClip);
|
RegionDestroy(portPriv->pCompositeClip);
|
||||||
}
|
}
|
||||||
|
|
||||||
portPriv->clipOrg = pGC->clipOrg;
|
portPriv->clipOrg = pGC->clipOrg;
|
||||||
|
@ -670,18 +670,18 @@ KdXVRegetVideo(XvPortRecPrivatePtr portPriv)
|
||||||
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
||||||
|
|
||||||
/* clip to the window composite clip */
|
/* clip to the window composite clip */
|
||||||
REGION_INIT(portPriv->pDraw->pScreen, &WinRegion, &WinBox, 1);
|
RegionInit(&WinRegion, &WinBox, 1);
|
||||||
REGION_INIT(portPriv->pDraw->pScreen, &ClipRegion, NullBox, 1);
|
RegionInit(&ClipRegion, NullBox, 1);
|
||||||
REGION_INTERSECT(portPriv->pDraw->pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
||||||
|
|
||||||
/* that's all if it's totally obscured */
|
/* that's all if it's totally obscured */
|
||||||
if(!REGION_NOTEMPTY(portPriv->pDraw->pScreen, &ClipRegion)) {
|
if(!RegionNotEmpty(&ClipRegion)) {
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
goto CLIP_VIDEO_BAILOUT;
|
goto CLIP_VIDEO_BAILOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
||||||
REGION_SUBTRACT(portPriv->pDraw->pScreen, &ClipRegion, &WinRegion, &ClipRegion);
|
RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (*portPriv->AdaptorRec->GetVideo)(portPriv->screen, portPriv->pDraw,
|
ret = (*portPriv->AdaptorRec->GetVideo)(portPriv->screen, portPriv->pDraw,
|
||||||
|
@ -706,8 +706,8 @@ CLIP_VIDEO_BAILOUT:
|
||||||
if(!portPriv->FreeCompositeClip)
|
if(!portPriv->FreeCompositeClip)
|
||||||
portPriv->pCompositeClip = NULL;
|
portPriv->pCompositeClip = NULL;
|
||||||
|
|
||||||
REGION_UNINIT(portPriv->pDraw->pScreen, &WinRegion);
|
RegionUninit(&WinRegion);
|
||||||
REGION_UNINIT(portPriv->pDraw->pScreen, &ClipRegion);
|
RegionUninit(&ClipRegion);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -734,9 +734,9 @@ KdXVReputVideo(XvPortRecPrivatePtr portPriv)
|
||||||
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
||||||
|
|
||||||
/* clip to the window composite clip */
|
/* clip to the window composite clip */
|
||||||
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
RegionInit(&WinRegion, &WinBox, 1);
|
||||||
REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
|
RegionInit(&ClipRegion, NullBox, 1);
|
||||||
REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
||||||
|
|
||||||
/* clip and translate to the viewport */
|
/* clip and translate to the viewport */
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
||||||
|
@ -748,21 +748,21 @@ KdXVReputVideo(XvPortRecPrivatePtr portPriv)
|
||||||
VPBox.x2 = screen->width;
|
VPBox.x2 = screen->width;
|
||||||
VPBox.y2 = screen->height;
|
VPBox.y2 = screen->height;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
|
RegionInit(&VPReg, &VPBox, 1);
|
||||||
REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
|
RegionIntersect(&ClipRegion, &ClipRegion, &VPReg);
|
||||||
REGION_UNINIT(pScreen, &VPReg);
|
RegionUninit(&VPReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* that's all if it's totally obscured */
|
/* that's all if it's totally obscured */
|
||||||
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
|
if(!RegionNotEmpty(&ClipRegion)) {
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
goto CLIP_VIDEO_BAILOUT;
|
goto CLIP_VIDEO_BAILOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* bailout if we have to clip but the hardware doesn't support it */
|
/* bailout if we have to clip but the hardware doesn't support it */
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
||||||
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
|
BoxPtr clipBox = RegionRects(&ClipRegion);
|
||||||
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
|
if( (RegionNumRects(&ClipRegion) != 1) ||
|
||||||
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
||||||
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
||||||
{
|
{
|
||||||
|
@ -772,7 +772,7 @@ KdXVReputVideo(XvPortRecPrivatePtr portPriv)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
||||||
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
|
RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (*portPriv->AdaptorRec->PutVideo)(portPriv->screen, portPriv->pDraw,
|
ret = (*portPriv->AdaptorRec->PutVideo)(portPriv->screen, portPriv->pDraw,
|
||||||
|
@ -796,8 +796,8 @@ CLIP_VIDEO_BAILOUT:
|
||||||
if(!portPriv->FreeCompositeClip)
|
if(!portPriv->FreeCompositeClip)
|
||||||
portPriv->pCompositeClip = NULL;
|
portPriv->pCompositeClip = NULL;
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &WinRegion);
|
RegionUninit(&WinRegion);
|
||||||
REGION_UNINIT(pScreen, &ClipRegion);
|
RegionUninit(&ClipRegion);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -823,9 +823,9 @@ KdXVReputImage(XvPortRecPrivatePtr portPriv)
|
||||||
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
||||||
|
|
||||||
/* clip to the window composite clip */
|
/* clip to the window composite clip */
|
||||||
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
RegionInit(&WinRegion, &WinBox, 1);
|
||||||
REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
|
RegionInit(&ClipRegion, NullBox, 1);
|
||||||
REGION_INTERSECT(Screen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
||||||
|
|
||||||
/* clip and translate to the viewport */
|
/* clip and translate to the viewport */
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
||||||
|
@ -837,21 +837,21 @@ KdXVReputImage(XvPortRecPrivatePtr portPriv)
|
||||||
VPBox.x2 = screen->width;
|
VPBox.x2 = screen->width;
|
||||||
VPBox.y2 = screen->height;
|
VPBox.y2 = screen->height;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
|
RegionInit(&VPReg, &VPBox, 1);
|
||||||
REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
|
RegionIntersect(&ClipRegion, &ClipRegion, &VPReg);
|
||||||
REGION_UNINIT(pScreen, &VPReg);
|
RegionUninit(&VPReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* that's all if it's totally obscured */
|
/* that's all if it's totally obscured */
|
||||||
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
|
if(!RegionNotEmpty(&ClipRegion)) {
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
goto CLIP_VIDEO_BAILOUT;
|
goto CLIP_VIDEO_BAILOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* bailout if we have to clip but the hardware doesn't support it */
|
/* bailout if we have to clip but the hardware doesn't support it */
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
||||||
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
|
BoxPtr clipBox = RegionRects(&ClipRegion);
|
||||||
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
|
if( (RegionNumRects(&ClipRegion) != 1) ||
|
||||||
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
||||||
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
||||||
{
|
{
|
||||||
|
@ -861,7 +861,7 @@ KdXVReputImage(XvPortRecPrivatePtr portPriv)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
||||||
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
|
RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (*portPriv->AdaptorRec->ReputImage)(portPriv->screen, portPriv->pDraw,
|
ret = (*portPriv->AdaptorRec->ReputImage)(portPriv->screen, portPriv->pDraw,
|
||||||
|
@ -882,8 +882,8 @@ CLIP_VIDEO_BAILOUT:
|
||||||
if(!portPriv->FreeCompositeClip)
|
if(!portPriv->FreeCompositeClip)
|
||||||
portPriv->pCompositeClip = NULL;
|
portPriv->pCompositeClip = NULL;
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &WinRegion);
|
RegionUninit(&WinRegion);
|
||||||
REGION_UNINIT(pScreen, &ClipRegion);
|
RegionUninit(&ClipRegion);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1021,7 +1021,7 @@ KdXVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
|
||||||
XvPortRecPrivatePtr pPriv;
|
XvPortRecPrivatePtr pPriv;
|
||||||
Bool AreasExposed;
|
Bool AreasExposed;
|
||||||
|
|
||||||
AreasExposed = (WinPriv && reg1 && REGION_NOTEMPTY(pScreen, reg1));
|
AreasExposed = (WinPriv && reg1 && RegionNotEmpty(reg1));
|
||||||
|
|
||||||
pScreen->WindowExposures = ScreenPriv->WindowExposures;
|
pScreen->WindowExposures = ScreenPriv->WindowExposures;
|
||||||
(*pScreen->WindowExposures)(pWin, reg1, reg2);
|
(*pScreen->WindowExposures)(pWin, reg1, reg2);
|
||||||
|
@ -1089,7 +1089,7 @@ KdXVClipNotify(WindowPtr pWin, int dx, int dy)
|
||||||
pPriv = WinPriv->PortRec;
|
pPriv = WinPriv->PortRec;
|
||||||
|
|
||||||
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
||||||
REGION_DESTROY(pScreen, pPriv->pCompositeClip);
|
RegionDestroy(pPriv->pCompositeClip);
|
||||||
|
|
||||||
pPriv->pCompositeClip = NULL;
|
pPriv->pCompositeClip = NULL;
|
||||||
|
|
||||||
|
@ -1220,7 +1220,7 @@ KdXVDisable(ScreenPtr pScreen)
|
||||||
pPriv->isOn = XV_OFF;
|
pPriv->isOn = XV_OFF;
|
||||||
|
|
||||||
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
||||||
REGION_DESTROY(pScreen, pPriv->pCompositeClip);
|
RegionDestroy(pPriv->pCompositeClip);
|
||||||
|
|
||||||
pPriv->pCompositeClip = NULL;
|
pPriv->pCompositeClip = NULL;
|
||||||
|
|
||||||
|
@ -1330,9 +1330,9 @@ KdXVPutStill(
|
||||||
WinBox.x2 = WinBox.x1 + drw_w;
|
WinBox.x2 = WinBox.x1 + drw_w;
|
||||||
WinBox.y2 = WinBox.y1 + drw_h;
|
WinBox.y2 = WinBox.y1 + drw_h;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
RegionInit(&WinRegion, &WinBox, 1);
|
||||||
REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
|
RegionInit(&ClipRegion, NullBox, 1);
|
||||||
REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
|
RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip);
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
||||||
RegionRec VPReg;
|
RegionRec VPReg;
|
||||||
|
@ -1343,23 +1343,23 @@ KdXVPutStill(
|
||||||
VPBox.x2 = screen->width;
|
VPBox.x2 = screen->width;
|
||||||
VPBox.y2 = screen->height;
|
VPBox.y2 = screen->height;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
|
RegionInit(&VPReg, &VPBox, 1);
|
||||||
REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
|
RegionIntersect(&ClipRegion, &ClipRegion, &VPReg);
|
||||||
REGION_UNINIT(pScreen, &VPReg);
|
RegionUninit(&VPReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->pDraw) {
|
if(portPriv->pDraw) {
|
||||||
KdXVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
|
KdXVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
|
if(!RegionNotEmpty(&ClipRegion)) {
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
goto PUT_STILL_BAILOUT;
|
goto PUT_STILL_BAILOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
||||||
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
|
BoxPtr clipBox = RegionRects(&ClipRegion);
|
||||||
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
|
if( (RegionNumRects(&ClipRegion) != 1) ||
|
||||||
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
||||||
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
||||||
{
|
{
|
||||||
|
@ -1369,7 +1369,7 @@ KdXVPutStill(
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
||||||
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
|
RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (*portPriv->AdaptorRec->PutStill)(portPriv->screen, pDraw,
|
ret = (*portPriv->AdaptorRec->PutStill)(portPriv->screen, pDraw,
|
||||||
|
@ -1398,8 +1398,8 @@ PUT_STILL_BAILOUT:
|
||||||
portPriv->isOn = XV_PENDING;
|
portPriv->isOn = XV_PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &WinRegion);
|
RegionUninit(&WinRegion);
|
||||||
REGION_UNINIT(pScreen, &ClipRegion);
|
RegionUninit(&ClipRegion);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1483,21 +1483,21 @@ KdXVGetStill(
|
||||||
WinBox.x2 = WinBox.x1 + drw_w;
|
WinBox.x2 = WinBox.x1 + drw_w;
|
||||||
WinBox.y2 = WinBox.y1 + drw_h;
|
WinBox.y2 = WinBox.y1 + drw_h;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
RegionInit(&WinRegion, &WinBox, 1);
|
||||||
REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
|
RegionInit(&ClipRegion, NullBox, 1);
|
||||||
REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
|
RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip);
|
||||||
|
|
||||||
if(portPriv->pDraw) {
|
if(portPriv->pDraw) {
|
||||||
KdXVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
|
KdXVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
|
if(!RegionNotEmpty(&ClipRegion)) {
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
goto GET_STILL_BAILOUT;
|
goto GET_STILL_BAILOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
||||||
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
|
RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (*portPriv->AdaptorRec->GetStill)(portPriv->screen, pDraw,
|
ret = (*portPriv->AdaptorRec->GetStill)(portPriv->screen, pDraw,
|
||||||
|
@ -1513,8 +1513,8 @@ GET_STILL_BAILOUT:
|
||||||
portPriv->isOn = XV_PENDING;
|
portPriv->isOn = XV_PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &WinRegion);
|
RegionUninit(&WinRegion);
|
||||||
REGION_UNINIT(pScreen, &ClipRegion);
|
RegionUninit(&ClipRegion);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1630,9 +1630,9 @@ KdXVPutImage(
|
||||||
WinBox.x2 = WinBox.x1 + drw_w;
|
WinBox.x2 = WinBox.x1 + drw_w;
|
||||||
WinBox.y2 = WinBox.y1 + drw_h;
|
WinBox.y2 = WinBox.y1 + drw_h;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
RegionInit(&WinRegion, &WinBox, 1);
|
||||||
REGION_INIT(pScreen, &ClipRegion, NullBox, 1);
|
RegionInit(&ClipRegion, NullBox, 1);
|
||||||
REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
|
RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip);
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
||||||
RegionRec VPReg;
|
RegionRec VPReg;
|
||||||
|
@ -1643,23 +1643,23 @@ KdXVPutImage(
|
||||||
VPBox.x2 = pScreen->width;
|
VPBox.x2 = pScreen->width;
|
||||||
VPBox.y2 = pScreen->height;
|
VPBox.y2 = pScreen->height;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
|
RegionInit(&VPReg, &VPBox, 1);
|
||||||
REGION_INTERSECT(Screen, &ClipRegion, &ClipRegion, &VPReg);
|
RegionIntersect(&ClipRegion, &ClipRegion, &VPReg);
|
||||||
REGION_UNINIT(pScreen, &VPReg);
|
RegionUninit(&VPReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->pDraw) {
|
if(portPriv->pDraw) {
|
||||||
KdXVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
|
KdXVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
|
if(!RegionNotEmpty(&ClipRegion)) {
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
goto PUT_IMAGE_BAILOUT;
|
goto PUT_IMAGE_BAILOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
||||||
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
|
BoxPtr clipBox = RegionRects(&ClipRegion);
|
||||||
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
|
if( (RegionNumRects(&ClipRegion) != 1) ||
|
||||||
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
||||||
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
||||||
{
|
{
|
||||||
|
@ -1669,7 +1669,7 @@ KdXVPutImage(
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
||||||
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
|
RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (*portPriv->AdaptorRec->PutImage)(portPriv->screen, pDraw,
|
ret = (*portPriv->AdaptorRec->PutImage)(portPriv->screen, pDraw,
|
||||||
|
@ -1698,8 +1698,8 @@ PUT_IMAGE_BAILOUT:
|
||||||
portPriv->isOn = XV_PENDING;
|
portPriv->isOn = XV_PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &WinRegion);
|
RegionUninit(&WinRegion);
|
||||||
REGION_UNINIT(pScreen, &ClipRegion);
|
RegionUninit(&ClipRegion);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1869,8 +1869,8 @@ KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg)
|
||||||
GCPtr pGC;
|
GCPtr pGC;
|
||||||
ChangeGCVal val[2];
|
ChangeGCVal val[2];
|
||||||
xRectangle *rects, *r;
|
xRectangle *rects, *r;
|
||||||
BoxPtr pBox = REGION_RECTS (pRgn);
|
BoxPtr pBox = RegionRects (pRgn);
|
||||||
int nBox = REGION_NUM_RECTS (pRgn);
|
int nBox = RegionNumRects (pRgn);
|
||||||
|
|
||||||
rects = malloc(nBox * sizeof (xRectangle));
|
rects = malloc(nBox * sizeof (xRectangle));
|
||||||
if (!rects)
|
if (!rects)
|
||||||
|
@ -1897,7 +1897,7 @@ KXVPaintRegion (DrawablePtr pDraw, RegionPtr pRgn, Pixel fg)
|
||||||
ValidateGC (pDraw, pGC);
|
ValidateGC (pDraw, pGC);
|
||||||
|
|
||||||
(*pGC->ops->PolyFillRect) (pDraw, pGC,
|
(*pGC->ops->PolyFillRect) (pDraw, pGC,
|
||||||
REGION_NUM_RECTS (pRgn), rects);
|
RegionNumRects (pRgn), rects);
|
||||||
|
|
||||||
FreeScratchGC (pGC);
|
FreeScratchGC (pGC);
|
||||||
bail1:
|
bail1:
|
||||||
|
|
|
@ -1085,8 +1085,8 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable)
|
||||||
{
|
{
|
||||||
RegionPtr borderVisible;
|
RegionPtr borderVisible;
|
||||||
|
|
||||||
borderVisible = REGION_CREATE(pScreen, NullBox, 1);
|
borderVisible = RegionCreate(NullBox, 1);
|
||||||
REGION_SUBTRACT(pScreen, borderVisible,
|
RegionSubtract(borderVisible,
|
||||||
&pWin->borderClip, &pWin->winSize);
|
&pWin->borderClip, &pWin->winSize);
|
||||||
pWin->valdata->before.borderVisible = borderVisible;
|
pWin->valdata->before.borderVisible = borderVisible;
|
||||||
}
|
}
|
||||||
|
@ -1105,18 +1105,18 @@ xf86SetRootClip (ScreenPtr pScreen, Bool enable)
|
||||||
box.y1 = 0;
|
box.y1 = 0;
|
||||||
box.x2 = pScreen->width;
|
box.x2 = pScreen->width;
|
||||||
box.y2 = pScreen->height;
|
box.y2 = pScreen->height;
|
||||||
REGION_INIT (pScreen, &pWin->winSize, &box, 1);
|
RegionInit(&pWin->winSize, &box, 1);
|
||||||
REGION_INIT (pScreen, &pWin->borderSize, &box, 1);
|
RegionInit(&pWin->borderSize, &box, 1);
|
||||||
if (WasViewable)
|
if (WasViewable)
|
||||||
REGION_RESET(pScreen, &pWin->borderClip, &box);
|
RegionReset(&pWin->borderClip, &box);
|
||||||
pWin->drawable.width = pScreen->width;
|
pWin->drawable.width = pScreen->width;
|
||||||
pWin->drawable.height = pScreen->height;
|
pWin->drawable.height = pScreen->height;
|
||||||
REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
|
RegionBreak(&pWin->clipList);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
REGION_EMPTY(pScreen, &pWin->borderClip);
|
RegionEmpty(&pWin->borderClip);
|
||||||
REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
|
RegionBreak(&pWin->clipList);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
|
ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
|
||||||
|
|
|
@ -363,8 +363,8 @@ AllocateArea(
|
||||||
|
|
||||||
if(granularity <= 1) granularity = 0;
|
if(granularity <= 1) granularity = 0;
|
||||||
|
|
||||||
boxp = REGION_RECTS(offman->FreeBoxes);
|
boxp = RegionRects(offman->FreeBoxes);
|
||||||
num = REGION_NUM_RECTS(offman->FreeBoxes);
|
num = RegionNumRects(offman->FreeBoxes);
|
||||||
|
|
||||||
/* look through the free boxes */
|
/* look through the free boxes */
|
||||||
for(i = 0; i < num; i++, boxp++) {
|
for(i = 0; i < num; i++, boxp++) {
|
||||||
|
@ -407,9 +407,9 @@ AllocateArea(
|
||||||
|
|
||||||
/* bye, bye */
|
/* bye, bye */
|
||||||
(*link->area.RemoveAreaCallback)(&link->area);
|
(*link->area.RemoveAreaCallback)(&link->area);
|
||||||
REGION_INIT(pScreen, &NewReg, &(link->area.box), 1);
|
RegionInit(&NewReg, &(link->area.box), 1);
|
||||||
REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &NewReg);
|
RegionUnion(offman->FreeBoxes, offman->FreeBoxes, &NewReg);
|
||||||
REGION_UNINIT(pScreen, &NewReg);
|
RegionUninit(&NewReg);
|
||||||
|
|
||||||
area = &(link->area);
|
area = &(link->area);
|
||||||
break;
|
break;
|
||||||
|
@ -427,9 +427,9 @@ AllocateArea(
|
||||||
area->RemoveAreaCallback = removeCB;
|
area->RemoveAreaCallback = removeCB;
|
||||||
area->devPrivate.ptr = privData;
|
area->devPrivate.ptr = privData;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &NewReg, &(area->box), 1);
|
RegionInit(&NewReg, &(area->box), 1);
|
||||||
REGION_SUBTRACT(pScreen, offman->FreeBoxes, offman->FreeBoxes, &NewReg);
|
RegionSubtract(offman->FreeBoxes, offman->FreeBoxes, &NewReg);
|
||||||
REGION_UNINIT(pScreen, &NewReg);
|
RegionUninit(&NewReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
return area;
|
return area;
|
||||||
|
@ -477,9 +477,9 @@ localFreeOffscreenArea(FBAreaPtr area)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* put the area back into the pool */
|
/* put the area back into the pool */
|
||||||
REGION_INIT(pScreen, &FreedRegion, &(pLink->area.box), 1);
|
RegionInit(&FreedRegion, &(pLink->area.box), 1);
|
||||||
REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &FreedRegion);
|
RegionUnion(offman->FreeBoxes, offman->FreeBoxes, &FreedRegion);
|
||||||
REGION_UNINIT(pScreen, &FreedRegion);
|
RegionUninit(&FreedRegion);
|
||||||
|
|
||||||
if(pLinkPrev)
|
if(pLinkPrev)
|
||||||
pLinkPrev->next = pLink->next;
|
pLinkPrev->next = pLink->next;
|
||||||
|
@ -536,12 +536,12 @@ localResizeOffscreenArea(
|
||||||
(resize->box.x2 == OrigArea.x2))
|
(resize->box.x2 == OrigArea.x2))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &FreedReg, &OrigArea, 1);
|
RegionInit(&FreedReg, &OrigArea, 1);
|
||||||
REGION_INIT(pScreen, &NewReg, &(resize->box), 1);
|
RegionInit(&NewReg, &(resize->box), 1);
|
||||||
REGION_SUBTRACT(pScreen, &FreedReg, &FreedReg, &NewReg);
|
RegionSubtract(&FreedReg, &FreedReg, &NewReg);
|
||||||
REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &FreedReg);
|
RegionUnion(offman->FreeBoxes, offman->FreeBoxes, &FreedReg);
|
||||||
REGION_UNINIT(pScreen, &FreedReg);
|
RegionUninit(&FreedReg);
|
||||||
REGION_UNINIT(pScreen, &NewReg);
|
RegionUninit(&NewReg);
|
||||||
|
|
||||||
SendCallFreeBoxCallbacks(offman);
|
SendCallFreeBoxCallbacks(offman);
|
||||||
|
|
||||||
|
@ -551,8 +551,8 @@ localResizeOffscreenArea(
|
||||||
|
|
||||||
/* otherwise we remove the old region */
|
/* otherwise we remove the old region */
|
||||||
|
|
||||||
REGION_INIT(pScreen, &FreedReg, &OrigArea, 1);
|
RegionInit(&FreedReg, &OrigArea, 1);
|
||||||
REGION_UNION(pScreen, offman->FreeBoxes, offman->FreeBoxes, &FreedReg);
|
RegionUnion(offman->FreeBoxes, offman->FreeBoxes, &FreedReg);
|
||||||
|
|
||||||
/* remove the old link */
|
/* remove the old link */
|
||||||
if(pLinkPrev)
|
if(pLinkPrev)
|
||||||
|
@ -589,8 +589,8 @@ localResizeOffscreenArea(
|
||||||
offman->NumUsedAreas--;
|
offman->NumUsedAreas--;
|
||||||
} else {
|
} else {
|
||||||
/* reinstate the old region */
|
/* reinstate the old region */
|
||||||
REGION_SUBTRACT(pScreen, offman->FreeBoxes, offman->FreeBoxes, &FreedReg);
|
RegionSubtract(offman->FreeBoxes, offman->FreeBoxes, &FreedReg);
|
||||||
REGION_UNINIT(pScreen, &FreedReg);
|
RegionUninit(&FreedReg);
|
||||||
|
|
||||||
pLink->next = offman->UsedAreas;
|
pLink->next = offman->UsedAreas;
|
||||||
offman->UsedAreas = pLink;
|
offman->UsedAreas = pLink;
|
||||||
|
@ -598,7 +598,7 @@ localResizeOffscreenArea(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &FreedReg);
|
RegionUninit(&FreedReg);
|
||||||
|
|
||||||
SendCallFreeBoxCallbacks(offman);
|
SendCallFreeBoxCallbacks(offman);
|
||||||
|
|
||||||
|
@ -636,47 +636,47 @@ localQueryLargestOffscreenArea(
|
||||||
if(offman->NumUsedAreas) {
|
if(offman->NumUsedAreas) {
|
||||||
FBLinkPtr pLink;
|
FBLinkPtr pLink;
|
||||||
RegionRec tmpRegion;
|
RegionRec tmpRegion;
|
||||||
newRegion = REGION_CREATE(pScreen, NULL, 1);
|
newRegion = RegionCreate(NULL, 1);
|
||||||
REGION_COPY(pScreen, newRegion, offman->InitialBoxes);
|
RegionCopy(newRegion, offman->InitialBoxes);
|
||||||
pLink = offman->UsedAreas;
|
pLink = offman->UsedAreas;
|
||||||
|
|
||||||
while(pLink) {
|
while(pLink) {
|
||||||
if(!pLink->area.RemoveAreaCallback) {
|
if(!pLink->area.RemoveAreaCallback) {
|
||||||
REGION_INIT(pScreen, &tmpRegion, &(pLink->area.box), 1);
|
RegionInit(&tmpRegion, &(pLink->area.box), 1);
|
||||||
REGION_SUBTRACT(pScreen, newRegion, newRegion, &tmpRegion);
|
RegionSubtract(newRegion, newRegion, &tmpRegion);
|
||||||
REGION_UNINIT(pScreen, &tmpRegion);
|
RegionUninit(&tmpRegion);
|
||||||
}
|
}
|
||||||
pLink = pLink->next;
|
pLink = pLink->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
nbox = REGION_NUM_RECTS(newRegion);
|
nbox = RegionNumRects(newRegion);
|
||||||
pbox = REGION_RECTS(newRegion);
|
pbox = RegionRects(newRegion);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1:
|
case 1:
|
||||||
if(offman->NumUsedAreas) {
|
if(offman->NumUsedAreas) {
|
||||||
FBLinkPtr pLink;
|
FBLinkPtr pLink;
|
||||||
RegionRec tmpRegion;
|
RegionRec tmpRegion;
|
||||||
newRegion = REGION_CREATE(pScreen, NULL, 1);
|
newRegion = RegionCreate(NULL, 1);
|
||||||
REGION_COPY(pScreen, newRegion, offman->FreeBoxes);
|
RegionCopy(newRegion, offman->FreeBoxes);
|
||||||
pLink = offman->UsedAreas;
|
pLink = offman->UsedAreas;
|
||||||
|
|
||||||
while(pLink) {
|
while(pLink) {
|
||||||
if(pLink->area.RemoveAreaCallback) {
|
if(pLink->area.RemoveAreaCallback) {
|
||||||
REGION_INIT(pScreen, &tmpRegion, &(pLink->area.box), 1);
|
RegionInit(&tmpRegion, &(pLink->area.box), 1);
|
||||||
REGION_APPEND(pScreen, newRegion, &tmpRegion);
|
RegionAppend(newRegion, &tmpRegion);
|
||||||
REGION_UNINIT(pScreen, &tmpRegion);
|
RegionUninit(&tmpRegion);
|
||||||
}
|
}
|
||||||
pLink = pLink->next;
|
pLink = pLink->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
nbox = REGION_NUM_RECTS(newRegion);
|
nbox = RegionNumRects(newRegion);
|
||||||
pbox = REGION_RECTS(newRegion);
|
pbox = RegionRects(newRegion);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
nbox = REGION_NUM_RECTS(offman->FreeBoxes);
|
nbox = RegionNumRects(offman->FreeBoxes);
|
||||||
pbox = REGION_RECTS(offman->FreeBoxes);
|
pbox = RegionRects(offman->FreeBoxes);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -719,7 +719,7 @@ localQueryLargestOffscreenArea(
|
||||||
}
|
}
|
||||||
|
|
||||||
if(newRegion)
|
if(newRegion)
|
||||||
REGION_DESTROY(pScreen, newRegion);
|
RegionDestroy(newRegion);
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -741,9 +741,9 @@ localPurgeUnlockedOffscreenAreas(ScreenPtr pScreen)
|
||||||
if(pLink->area.RemoveAreaCallback) {
|
if(pLink->area.RemoveAreaCallback) {
|
||||||
(*pLink->area.RemoveAreaCallback)(&pLink->area);
|
(*pLink->area.RemoveAreaCallback)(&pLink->area);
|
||||||
|
|
||||||
REGION_INIT(pScreen, &FreedRegion, &(pLink->area.box), 1);
|
RegionInit(&FreedRegion, &(pLink->area.box), 1);
|
||||||
REGION_APPEND(pScreen, offman->FreeBoxes, &FreedRegion);
|
RegionAppend(offman->FreeBoxes, &FreedRegion);
|
||||||
REGION_UNINIT(pScreen, &FreedRegion);
|
RegionUninit(&FreedRegion);
|
||||||
|
|
||||||
if(pPrev)
|
if(pPrev)
|
||||||
pPrev->next = pLink->next;
|
pPrev->next = pLink->next;
|
||||||
|
@ -761,7 +761,7 @@ localPurgeUnlockedOffscreenAreas(ScreenPtr pScreen)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(anyUsed) {
|
if(anyUsed) {
|
||||||
REGION_VALIDATE(pScreen, offman->FreeBoxes, &anyUsed);
|
RegionValidate(offman->FreeBoxes, &anyUsed);
|
||||||
SendCallFreeBoxCallbacks(offman);
|
SendCallFreeBoxCallbacks(offman);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -924,7 +924,7 @@ localAllocateOffscreenLinear(
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* No linear available, so try and pinch some from the XY areas */
|
/* No linear available, so try and pinch some from the XY areas */
|
||||||
extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
|
extents = RegionExtents(offman->InitialBoxes);
|
||||||
pitch = extents->x2 - extents->x1;
|
pitch = extents->x2 - extents->x1;
|
||||||
|
|
||||||
if (gran > 1) {
|
if (gran > 1) {
|
||||||
|
@ -1055,7 +1055,7 @@ localResizeOffscreenLinear(FBLinearPtr resize, int length)
|
||||||
BoxPtr extents;
|
BoxPtr extents;
|
||||||
int pitch, w, h;
|
int pitch, w, h;
|
||||||
|
|
||||||
extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
|
extents = RegionExtents(offman->InitialBoxes);
|
||||||
pitch = extents->x2 - extents->x1;
|
pitch = extents->x2 - extents->x1;
|
||||||
|
|
||||||
if(length < pitch) { /* special case */
|
if(length < pitch) { /* special case */
|
||||||
|
@ -1121,7 +1121,7 @@ localQueryLargestOffscreenLinear(
|
||||||
|
|
||||||
offman = (FBManagerPtr)dixLookupPrivate(&pScreen->devPrivates,
|
offman = (FBManagerPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||||
xf86FBScreenKey);
|
xf86FBScreenKey);
|
||||||
extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
|
extents = RegionExtents(offman->InitialBoxes);
|
||||||
if((extents->x2 - extents->x1) == w)
|
if((extents->x2 - extents->x1) == w)
|
||||||
*size = w * h;
|
*size = w * h;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -1171,8 +1171,8 @@ xf86FBCloseScreen (int i, ScreenPtr pScreen)
|
||||||
free(tmp2);
|
free(tmp2);
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_DESTROY(pScreen, offman->InitialBoxes);
|
RegionDestroy(offman->InitialBoxes);
|
||||||
REGION_DESTROY(pScreen, offman->FreeBoxes);
|
RegionDestroy(offman->FreeBoxes);
|
||||||
|
|
||||||
free(offman->FreeBoxesUpdateCallback);
|
free(offman->FreeBoxesUpdateCallback);
|
||||||
free(offman->devPrivates);
|
free(offman->devPrivates);
|
||||||
|
@ -1206,15 +1206,15 @@ xf86InitFBManager(
|
||||||
if (FullBox->y2 < FullBox->y1) return FALSE;
|
if (FullBox->y2 < FullBox->y1) return FALSE;
|
||||||
if (FullBox->x2 < FullBox->x1) return FALSE;
|
if (FullBox->x2 < FullBox->x1) return FALSE;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &ScreenRegion, &ScreenBox, 1);
|
RegionInit(&ScreenRegion, &ScreenBox, 1);
|
||||||
REGION_INIT(pScreen, &FullRegion, FullBox, 1);
|
RegionInit(&FullRegion, FullBox, 1);
|
||||||
|
|
||||||
REGION_SUBTRACT(pScreen, &FullRegion, &FullRegion, &ScreenRegion);
|
RegionSubtract(&FullRegion, &FullRegion, &ScreenRegion);
|
||||||
|
|
||||||
ret = xf86InitFBManagerRegion(pScreen, &FullRegion);
|
ret = xf86InitFBManagerRegion(pScreen, &FullRegion);
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &ScreenRegion);
|
RegionUninit(&ScreenRegion);
|
||||||
REGION_UNINIT(pScreen, &FullRegion);
|
RegionUninit(&FullRegion);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1249,17 +1249,17 @@ xf86InitFBManagerArea(
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Factor out virtual resolution */
|
/* Factor out virtual resolution */
|
||||||
pRegion = RECTS_TO_REGION(pScreen, nRect, Rect, 0);
|
pRegion = RegionFromRects(nRect, Rect, 0);
|
||||||
if (pRegion) {
|
if (pRegion) {
|
||||||
if (!REGION_NAR(pRegion)) {
|
if (!RegionNar(pRegion)) {
|
||||||
Rect[2].x = Rect[2].y = 0;
|
Rect[2].x = Rect[2].y = 0;
|
||||||
Rect[2].width = pScrn->virtualX;
|
Rect[2].width = pScrn->virtualX;
|
||||||
Rect[2].height = pScrn->virtualY;
|
Rect[2].height = pScrn->virtualY;
|
||||||
|
|
||||||
pScreenRegion = RECTS_TO_REGION(pScreen, 1, &Rect[2], 0);
|
pScreenRegion = RegionFromRects(1, &Rect[2], 0);
|
||||||
if (pScreenRegion) {
|
if (pScreenRegion) {
|
||||||
if (!REGION_NAR(pScreenRegion)) {
|
if (!RegionNar(pScreenRegion)) {
|
||||||
REGION_SUBTRACT(pScreen, pRegion, pRegion, pScreenRegion);
|
RegionSubtract(pRegion, pRegion, pScreenRegion);
|
||||||
|
|
||||||
ret = xf86InitFBManagerRegion(pScreen, pRegion);
|
ret = xf86InitFBManagerRegion(pScreen, pRegion);
|
||||||
|
|
||||||
|
@ -1301,11 +1301,11 @@ xf86InitFBManagerArea(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_DESTROY(pScreen, pScreenRegion);
|
RegionDestroy(pScreenRegion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_DESTROY(pScreen, pRegion);
|
RegionDestroy(pRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -1318,7 +1318,7 @@ xf86InitFBManagerRegion(
|
||||||
){
|
){
|
||||||
FBManagerPtr offman;
|
FBManagerPtr offman;
|
||||||
|
|
||||||
if(REGION_NIL(FullRegion))
|
if(RegionNil(FullRegion))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
if(!xf86RegisterOffscreenManager(pScreen, &xf86FBManFuncs))
|
if(!xf86RegisterOffscreenManager(pScreen, &xf86FBManFuncs))
|
||||||
|
@ -1332,11 +1332,11 @@ xf86InitFBManagerRegion(
|
||||||
offman->CloseScreen = pScreen->CloseScreen;
|
offman->CloseScreen = pScreen->CloseScreen;
|
||||||
pScreen->CloseScreen = xf86FBCloseScreen;
|
pScreen->CloseScreen = xf86FBCloseScreen;
|
||||||
|
|
||||||
offman->InitialBoxes = REGION_CREATE(pScreen, NULL, 1);
|
offman->InitialBoxes = RegionCreate(NULL, 1);
|
||||||
offman->FreeBoxes = REGION_CREATE(pScreen, NULL, 1);
|
offman->FreeBoxes = RegionCreate(NULL, 1);
|
||||||
|
|
||||||
REGION_COPY(pScreen, offman->InitialBoxes, FullRegion);
|
RegionCopy(offman->InitialBoxes, FullRegion);
|
||||||
REGION_COPY(pScreen, offman->FreeBoxes, FullRegion);
|
RegionCopy(offman->FreeBoxes, FullRegion);
|
||||||
|
|
||||||
offman->pScreen = pScreen;
|
offman->pScreen = pScreen;
|
||||||
offman->UsedAreas = NULL;
|
offman->UsedAreas = NULL;
|
||||||
|
@ -1415,7 +1415,7 @@ xf86AllocateLinearOffscreenArea (
|
||||||
|
|
||||||
offman = (FBManagerPtr)dixLookupPrivate(&pScreen->devPrivates,
|
offman = (FBManagerPtr)dixLookupPrivate(&pScreen->devPrivates,
|
||||||
xf86FBScreenKey);
|
xf86FBScreenKey);
|
||||||
extents = REGION_EXTENTS(pScreen, offman->InitialBoxes);
|
extents = RegionExtents(offman->InitialBoxes);
|
||||||
w = extents->x2 - extents->x1;
|
w = extents->x2 - extents->x1;
|
||||||
|
|
||||||
if (gran > 1) {
|
if (gran > 1) {
|
||||||
|
|
|
@ -322,9 +322,9 @@ xf86XVFreeAdaptor(XvAdaptorPtr pAdaptor)
|
||||||
pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
|
pPriv = (XvPortRecPrivatePtr)pPort->devPriv.ptr;
|
||||||
if(pPriv) {
|
if(pPriv) {
|
||||||
if(pPriv->clientClip)
|
if(pPriv->clientClip)
|
||||||
REGION_DESTROY(pAdaptor->pScreen, pPriv->clientClip);
|
RegionDestroy(pPriv->clientClip);
|
||||||
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
||||||
REGION_DESTROY(pAdaptor->pScreen, pPriv->pCompositeClip);
|
RegionDestroy(pPriv->pCompositeClip);
|
||||||
free(pPriv);
|
free(pPriv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -658,18 +658,18 @@ xf86XVUpdateCompositeClip(XvPortRecPrivatePtr portPriv)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pCompositeClip = REGION_CREATE(pScreen, NullBox, 1);
|
pCompositeClip = RegionCreate(NullBox, 1);
|
||||||
REGION_COPY(pScreen, pCompositeClip, portPriv->clientClip);
|
RegionCopy(pCompositeClip, portPriv->clientClip);
|
||||||
REGION_TRANSLATE(pScreen, pCompositeClip,
|
RegionTranslate(pCompositeClip,
|
||||||
portPriv->pDraw->x + portPriv->clipOrg.x,
|
portPriv->pDraw->x + portPriv->clipOrg.x,
|
||||||
portPriv->pDraw->y + portPriv->clipOrg.y);
|
portPriv->pDraw->y + portPriv->clipOrg.y);
|
||||||
REGION_INTERSECT(pScreen, pCompositeClip, pregWin, pCompositeClip);
|
RegionIntersect(pCompositeClip, pregWin, pCompositeClip);
|
||||||
|
|
||||||
portPriv->pCompositeClip = pCompositeClip;
|
portPriv->pCompositeClip = pCompositeClip;
|
||||||
portPriv->FreeCompositeClip = TRUE;
|
portPriv->FreeCompositeClip = TRUE;
|
||||||
|
|
||||||
if(freeCompClip) {
|
if(freeCompClip) {
|
||||||
REGION_DESTROY(pScreen, pregWin);
|
RegionDestroy(pregWin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -684,17 +684,17 @@ xf86XVCopyClip(
|
||||||
/* copy the new clip if it exists */
|
/* copy the new clip if it exists */
|
||||||
if((pGC->clientClipType == CT_REGION) && pGC->clientClip) {
|
if((pGC->clientClipType == CT_REGION) && pGC->clientClip) {
|
||||||
if(!portPriv->clientClip)
|
if(!portPriv->clientClip)
|
||||||
portPriv->clientClip = REGION_CREATE(pScreen, NullBox, 1);
|
portPriv->clientClip = RegionCreate(NullBox, 1);
|
||||||
/* Note: this is in window coordinates */
|
/* Note: this is in window coordinates */
|
||||||
REGION_COPY(pScreen, portPriv->clientClip, pGC->clientClip);
|
RegionCopy(portPriv->clientClip, pGC->clientClip);
|
||||||
} else if(portPriv->clientClip) { /* free the old clientClip */
|
} else if(portPriv->clientClip) { /* free the old clientClip */
|
||||||
REGION_DESTROY(pScreen, portPriv->clientClip);
|
RegionDestroy(portPriv->clientClip);
|
||||||
portPriv->clientClip = NULL;
|
portPriv->clientClip = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get rid of the old clip list */
|
/* get rid of the old clip list */
|
||||||
if(portPriv->pCompositeClip && portPriv->FreeCompositeClip) {
|
if(portPriv->pCompositeClip && portPriv->FreeCompositeClip) {
|
||||||
REGION_DESTROY(pScreen, portPriv->pCompositeClip);
|
RegionDestroy(portPriv->pCompositeClip);
|
||||||
}
|
}
|
||||||
|
|
||||||
portPriv->clipOrg = pGC->clipOrg;
|
portPriv->clipOrg = pGC->clipOrg;
|
||||||
|
@ -723,18 +723,18 @@ xf86XVRegetVideo(XvPortRecPrivatePtr portPriv)
|
||||||
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
||||||
|
|
||||||
/* clip to the window composite clip */
|
/* clip to the window composite clip */
|
||||||
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
RegionInit(&WinRegion, &WinBox, 1);
|
||||||
REGION_NULL(pScreen, &ClipRegion);
|
RegionNull(&ClipRegion);
|
||||||
REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
||||||
|
|
||||||
/* that's all if it's totally obscured */
|
/* that's all if it's totally obscured */
|
||||||
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
|
if(!RegionNotEmpty(&ClipRegion)) {
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
goto CLIP_VIDEO_BAILOUT;
|
goto CLIP_VIDEO_BAILOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
||||||
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
|
RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (*portPriv->AdaptorRec->GetVideo)(portPriv->pScrn,
|
ret = (*portPriv->AdaptorRec->GetVideo)(portPriv->pScrn,
|
||||||
|
@ -760,8 +760,8 @@ CLIP_VIDEO_BAILOUT:
|
||||||
if(!portPriv->FreeCompositeClip)
|
if(!portPriv->FreeCompositeClip)
|
||||||
portPriv->pCompositeClip = NULL;
|
portPriv->pCompositeClip = NULL;
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &WinRegion);
|
RegionUninit(&WinRegion);
|
||||||
REGION_UNINIT(pScreen, &ClipRegion);
|
RegionUninit(&ClipRegion);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -788,9 +788,9 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv)
|
||||||
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
||||||
|
|
||||||
/* clip to the window composite clip */
|
/* clip to the window composite clip */
|
||||||
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
RegionInit(&WinRegion, &WinBox, 1);
|
||||||
REGION_NULL(pScreen, &ClipRegion);
|
RegionNull(&ClipRegion);
|
||||||
REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
||||||
|
|
||||||
/* clip and translate to the viewport */
|
/* clip and translate to the viewport */
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
||||||
|
@ -802,21 +802,21 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv)
|
||||||
VPBox.x2 = portPriv->pScrn->frameX1 + 1;
|
VPBox.x2 = portPriv->pScrn->frameX1 + 1;
|
||||||
VPBox.y2 = portPriv->pScrn->frameY1 + 1;
|
VPBox.y2 = portPriv->pScrn->frameY1 + 1;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
|
RegionInit(&VPReg, &VPBox, 1);
|
||||||
REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
|
RegionIntersect(&ClipRegion, &ClipRegion, &VPReg);
|
||||||
REGION_UNINIT(pScreen, &VPReg);
|
RegionUninit(&VPReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* that's all if it's totally obscured */
|
/* that's all if it's totally obscured */
|
||||||
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
|
if(!RegionNotEmpty(&ClipRegion)) {
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
goto CLIP_VIDEO_BAILOUT;
|
goto CLIP_VIDEO_BAILOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* bailout if we have to clip but the hardware doesn't support it */
|
/* bailout if we have to clip but the hardware doesn't support it */
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
||||||
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
|
BoxPtr clipBox = RegionRects(&ClipRegion);
|
||||||
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
|
if( (RegionNumRects(&ClipRegion) != 1) ||
|
||||||
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
||||||
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
||||||
{
|
{
|
||||||
|
@ -826,7 +826,7 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
||||||
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
|
RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (*portPriv->AdaptorRec->PutVideo)(portPriv->pScrn,
|
ret = (*portPriv->AdaptorRec->PutVideo)(portPriv->pScrn,
|
||||||
|
@ -851,8 +851,8 @@ CLIP_VIDEO_BAILOUT:
|
||||||
if(!portPriv->FreeCompositeClip)
|
if(!portPriv->FreeCompositeClip)
|
||||||
portPriv->pCompositeClip = NULL;
|
portPriv->pCompositeClip = NULL;
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &WinRegion);
|
RegionUninit(&WinRegion);
|
||||||
REGION_UNINIT(pScreen, &ClipRegion);
|
RegionUninit(&ClipRegion);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -878,9 +878,9 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv)
|
||||||
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
WinBox.y2 = WinBox.y1 + portPriv->drw_h;
|
||||||
|
|
||||||
/* clip to the window composite clip */
|
/* clip to the window composite clip */
|
||||||
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
RegionInit(&WinRegion, &WinBox, 1);
|
||||||
REGION_NULL(pScreen, &ClipRegion);
|
RegionNull(&ClipRegion);
|
||||||
REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip);
|
||||||
|
|
||||||
/* clip and translate to the viewport */
|
/* clip and translate to the viewport */
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
||||||
|
@ -892,21 +892,21 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv)
|
||||||
VPBox.x2 = portPriv->pScrn->frameX1 + 1;
|
VPBox.x2 = portPriv->pScrn->frameX1 + 1;
|
||||||
VPBox.y2 = portPriv->pScrn->frameY1 + 1;
|
VPBox.y2 = portPriv->pScrn->frameY1 + 1;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
|
RegionInit(&VPReg, &VPBox, 1);
|
||||||
REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
|
RegionIntersect(&ClipRegion, &ClipRegion, &VPReg);
|
||||||
REGION_UNINIT(pScreen, &VPReg);
|
RegionUninit(&VPReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* that's all if it's totally obscured */
|
/* that's all if it's totally obscured */
|
||||||
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
|
if(!RegionNotEmpty(&ClipRegion)) {
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
goto CLIP_VIDEO_BAILOUT;
|
goto CLIP_VIDEO_BAILOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* bailout if we have to clip but the hardware doesn't support it */
|
/* bailout if we have to clip but the hardware doesn't support it */
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
||||||
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
|
BoxPtr clipBox = RegionRects(&ClipRegion);
|
||||||
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
|
if( (RegionNumRects(&ClipRegion) != 1) ||
|
||||||
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
||||||
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
||||||
{
|
{
|
||||||
|
@ -916,7 +916,7 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
||||||
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
|
RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (*portPriv->AdaptorRec->ReputImage)(portPriv->pScrn,
|
ret = (*portPriv->AdaptorRec->ReputImage)(portPriv->pScrn,
|
||||||
|
@ -938,8 +938,8 @@ CLIP_VIDEO_BAILOUT:
|
||||||
if(!portPriv->FreeCompositeClip)
|
if(!portPriv->FreeCompositeClip)
|
||||||
portPriv->pCompositeClip = NULL;
|
portPriv->pCompositeClip = NULL;
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &WinRegion);
|
RegionUninit(&WinRegion);
|
||||||
REGION_UNINIT(pScreen, &ClipRegion);
|
RegionUninit(&ClipRegion);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1060,7 +1060,7 @@ xf86XVWindowExposures(WindowPtr pWin, RegionPtr reg1, RegionPtr reg2)
|
||||||
XvPortRecPrivatePtr pPriv;
|
XvPortRecPrivatePtr pPriv;
|
||||||
Bool AreasExposed;
|
Bool AreasExposed;
|
||||||
|
|
||||||
AreasExposed = (WinPriv && reg1 && REGION_NOTEMPTY(pScreen, reg1));
|
AreasExposed = (WinPriv && reg1 && RegionNotEmpty(reg1));
|
||||||
|
|
||||||
pScreen->WindowExposures = ScreenPriv->WindowExposures;
|
pScreen->WindowExposures = ScreenPriv->WindowExposures;
|
||||||
(*pScreen->WindowExposures)(pWin, reg1, reg2);
|
(*pScreen->WindowExposures)(pWin, reg1, reg2);
|
||||||
|
@ -1131,7 +1131,7 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy)
|
||||||
if(!pPriv) goto next;
|
if(!pPriv) goto next;
|
||||||
|
|
||||||
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
||||||
REGION_DESTROY(pScreen, pPriv->pCompositeClip);
|
RegionDestroy(pPriv->pCompositeClip);
|
||||||
|
|
||||||
pPriv->pCompositeClip = NULL;
|
pPriv->pCompositeClip = NULL;
|
||||||
|
|
||||||
|
@ -1268,7 +1268,7 @@ xf86XVLeaveVT(int index, int flags)
|
||||||
pPriv->isOn = XV_OFF;
|
pPriv->isOn = XV_OFF;
|
||||||
|
|
||||||
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
||||||
REGION_DESTROY(pScreen, pPriv->pCompositeClip);
|
RegionDestroy(pPriv->pCompositeClip);
|
||||||
|
|
||||||
pPriv->pCompositeClip = NULL;
|
pPriv->pCompositeClip = NULL;
|
||||||
|
|
||||||
|
@ -1309,7 +1309,7 @@ xf86XVAdjustFrame(int index, int x, int y, int flags)
|
||||||
if(!pPriv->type && (pPriv->isOn != XV_OFF)) { /* overlaid still/image */
|
if(!pPriv->type && (pPriv->isOn != XV_OFF)) { /* overlaid still/image */
|
||||||
|
|
||||||
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
if(pPriv->pCompositeClip && pPriv->FreeCompositeClip)
|
||||||
REGION_DESTROY(pScreen, pPriv->pCompositeClip);
|
RegionDestroy(pPriv->pCompositeClip);
|
||||||
|
|
||||||
pPriv->pCompositeClip = NULL;
|
pPriv->pCompositeClip = NULL;
|
||||||
|
|
||||||
|
@ -1432,9 +1432,9 @@ xf86XVPutStill(
|
||||||
WinBox.x2 = WinBox.x1 + drw_w;
|
WinBox.x2 = WinBox.x1 + drw_w;
|
||||||
WinBox.y2 = WinBox.y1 + drw_h;
|
WinBox.y2 = WinBox.y1 + drw_h;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
RegionInit(&WinRegion, &WinBox, 1);
|
||||||
REGION_NULL(pScreen, &ClipRegion);
|
RegionNull(&ClipRegion);
|
||||||
REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
|
RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip);
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
||||||
RegionRec VPReg;
|
RegionRec VPReg;
|
||||||
|
@ -1445,23 +1445,23 @@ xf86XVPutStill(
|
||||||
VPBox.x2 = portPriv->pScrn->frameX1 + 1;
|
VPBox.x2 = portPriv->pScrn->frameX1 + 1;
|
||||||
VPBox.y2 = portPriv->pScrn->frameY1 + 1;
|
VPBox.y2 = portPriv->pScrn->frameY1 + 1;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
|
RegionInit(&VPReg, &VPBox, 1);
|
||||||
REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
|
RegionIntersect(&ClipRegion, &ClipRegion, &VPReg);
|
||||||
REGION_UNINIT(pScreen, &VPReg);
|
RegionUninit(&VPReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->pDraw) {
|
if(portPriv->pDraw) {
|
||||||
xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
|
xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
|
if(!RegionNotEmpty(&ClipRegion)) {
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
goto PUT_STILL_BAILOUT;
|
goto PUT_STILL_BAILOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
||||||
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
|
BoxPtr clipBox = RegionRects(&ClipRegion);
|
||||||
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
|
if( (RegionNumRects(&ClipRegion) != 1) ||
|
||||||
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
||||||
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
||||||
{
|
{
|
||||||
|
@ -1471,7 +1471,7 @@ xf86XVPutStill(
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
||||||
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
|
RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (*portPriv->AdaptorRec->PutStill)(portPriv->pScrn,
|
ret = (*portPriv->AdaptorRec->PutStill)(portPriv->pScrn,
|
||||||
|
@ -1500,8 +1500,8 @@ PUT_STILL_BAILOUT:
|
||||||
portPriv->isOn = XV_PENDING;
|
portPriv->isOn = XV_PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &WinRegion);
|
RegionUninit(&WinRegion);
|
||||||
REGION_UNINIT(pScreen, &ClipRegion);
|
RegionUninit(&ClipRegion);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1584,21 +1584,21 @@ xf86XVGetStill(
|
||||||
WinBox.x2 = WinBox.x1 + drw_w;
|
WinBox.x2 = WinBox.x1 + drw_w;
|
||||||
WinBox.y2 = WinBox.y1 + drw_h;
|
WinBox.y2 = WinBox.y1 + drw_h;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
RegionInit(&WinRegion, &WinBox, 1);
|
||||||
REGION_NULL(pScreen, &ClipRegion);
|
RegionNull(&ClipRegion);
|
||||||
REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
|
RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip);
|
||||||
|
|
||||||
if(portPriv->pDraw) {
|
if(portPriv->pDraw) {
|
||||||
xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
|
xf86XVRemovePortFromWindow((WindowPtr)(portPriv->pDraw), portPriv);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
|
if(!RegionNotEmpty(&ClipRegion)) {
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
goto GET_STILL_BAILOUT;
|
goto GET_STILL_BAILOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
||||||
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
|
RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (*portPriv->AdaptorRec->GetStill)(portPriv->pScrn,
|
ret = (*portPriv->AdaptorRec->GetStill)(portPriv->pScrn,
|
||||||
|
@ -1615,8 +1615,8 @@ GET_STILL_BAILOUT:
|
||||||
portPriv->isOn = XV_PENDING;
|
portPriv->isOn = XV_PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &WinRegion);
|
RegionUninit(&WinRegion);
|
||||||
REGION_UNINIT(pScreen, &ClipRegion);
|
RegionUninit(&ClipRegion);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1732,9 +1732,9 @@ xf86XVPutImage(
|
||||||
WinBox.x2 = WinBox.x1 + drw_w;
|
WinBox.x2 = WinBox.x1 + drw_w;
|
||||||
WinBox.y2 = WinBox.y1 + drw_h;
|
WinBox.y2 = WinBox.y1 + drw_h;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &WinRegion, &WinBox, 1);
|
RegionInit(&WinRegion, &WinBox, 1);
|
||||||
REGION_NULL(pScreen, &ClipRegion);
|
RegionNull(&ClipRegion);
|
||||||
REGION_INTERSECT(pScreen, &ClipRegion, &WinRegion, pGC->pCompositeClip);
|
RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip);
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
|
||||||
RegionRec VPReg;
|
RegionRec VPReg;
|
||||||
|
@ -1745,9 +1745,9 @@ xf86XVPutImage(
|
||||||
VPBox.x2 = portPriv->pScrn->frameX1 + 1;
|
VPBox.x2 = portPriv->pScrn->frameX1 + 1;
|
||||||
VPBox.y2 = portPriv->pScrn->frameY1 + 1;
|
VPBox.y2 = portPriv->pScrn->frameY1 + 1;
|
||||||
|
|
||||||
REGION_INIT(pScreen, &VPReg, &VPBox, 1);
|
RegionInit(&VPReg, &VPBox, 1);
|
||||||
REGION_INTERSECT(pScreen, &ClipRegion, &ClipRegion, &VPReg);
|
RegionIntersect(&ClipRegion, &ClipRegion, &VPReg);
|
||||||
REGION_UNINIT(pScreen, &VPReg);
|
RegionUninit(&VPReg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If we are changing windows, unregister our port in the old window */
|
/* If we are changing windows, unregister our port in the old window */
|
||||||
|
@ -1758,14 +1758,14 @@ xf86XVPutImage(
|
||||||
ret = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
|
ret = xf86XVEnlistPortInWindow((WindowPtr)pDraw, portPriv);
|
||||||
if(ret != Success) goto PUT_IMAGE_BAILOUT;
|
if(ret != Success) goto PUT_IMAGE_BAILOUT;
|
||||||
|
|
||||||
if(!REGION_NOTEMPTY(pScreen, &ClipRegion)) {
|
if(!RegionNotEmpty(&ClipRegion)) {
|
||||||
clippedAway = TRUE;
|
clippedAway = TRUE;
|
||||||
goto PUT_IMAGE_BAILOUT;
|
goto PUT_IMAGE_BAILOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
if(portPriv->AdaptorRec->flags & VIDEO_NO_CLIPPING) {
|
||||||
BoxPtr clipBox = REGION_RECTS(&ClipRegion);
|
BoxPtr clipBox = RegionRects(&ClipRegion);
|
||||||
if( (REGION_NUM_RECTS(&ClipRegion) != 1) ||
|
if( (RegionNumRects(&ClipRegion) != 1) ||
|
||||||
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
(clipBox->x1 != WinBox.x1) || (clipBox->x2 != WinBox.x2) ||
|
||||||
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
(clipBox->y1 != WinBox.y1) || (clipBox->y2 != WinBox.y2))
|
||||||
{
|
{
|
||||||
|
@ -1775,7 +1775,7 @@ xf86XVPutImage(
|
||||||
}
|
}
|
||||||
|
|
||||||
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
if(portPriv->AdaptorRec->flags & VIDEO_INVERT_CLIPLIST) {
|
||||||
REGION_SUBTRACT(pScreen, &ClipRegion, &WinRegion, &ClipRegion);
|
RegionSubtract(&ClipRegion, &WinRegion, &ClipRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = (*portPriv->AdaptorRec->PutImage)(portPriv->pScrn,
|
ret = (*portPriv->AdaptorRec->PutImage)(portPriv->pScrn,
|
||||||
|
@ -1803,8 +1803,8 @@ PUT_IMAGE_BAILOUT:
|
||||||
portPriv->isOn = XV_PENDING;
|
portPriv->isOn = XV_PENDING;
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &WinRegion);
|
RegionUninit(&WinRegion);
|
||||||
REGION_UNINIT(pScreen, &ClipRegion);
|
RegionUninit(&ClipRegion);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -1834,8 +1834,8 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
|
||||||
WindowPtr pWin = (WindowPtr)pDraw;
|
WindowPtr pWin = (WindowPtr)pDraw;
|
||||||
XF86XVWindowPtr pPriv = GET_XF86XV_WINDOW(pWin);
|
XF86XVWindowPtr pPriv = GET_XF86XV_WINDOW(pWin);
|
||||||
GCPtr pGC = NULL;
|
GCPtr pGC = NULL;
|
||||||
BoxPtr pbox = REGION_RECTS(clipboxes);
|
BoxPtr pbox = RegionRects(clipboxes);
|
||||||
int i, nbox = REGION_NUM_RECTS(clipboxes);
|
int i, nbox = RegionNumRects(clipboxes);
|
||||||
xRectangle *rects;
|
xRectangle *rects;
|
||||||
|
|
||||||
if(!xf86Screens[pScreen->myNum]->vtSema) return;
|
if(!xf86Screens[pScreen->myNum]->vtSema) return;
|
||||||
|
@ -1860,7 +1860,7 @@ xf86XVFillKeyHelperDrawable (DrawablePtr pDraw, CARD32 key, RegionPtr clipboxes)
|
||||||
ValidateGC(pDraw, pGC);
|
ValidateGC(pDraw, pGC);
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_TRANSLATE(pDraw->pScreen, clipboxes, -pDraw->x, -pDraw->y);
|
RegionTranslate(clipboxes, -pDraw->x, -pDraw->y);
|
||||||
|
|
||||||
rects = malloc(nbox * sizeof(xRectangle));
|
rects = malloc(nbox * sizeof(xRectangle));
|
||||||
|
|
||||||
|
@ -1883,8 +1883,8 @@ xf86XVFillKeyHelper (ScreenPtr pScreen, CARD32 key, RegionPtr clipboxes)
|
||||||
{
|
{
|
||||||
DrawablePtr root = &pScreen->root->drawable;
|
DrawablePtr root = &pScreen->root->drawable;
|
||||||
ChangeGCVal pval[2];
|
ChangeGCVal pval[2];
|
||||||
BoxPtr pbox = REGION_RECTS(clipboxes);
|
BoxPtr pbox = RegionRects(clipboxes);
|
||||||
int i, nbox = REGION_NUM_RECTS(clipboxes);
|
int i, nbox = RegionNumRects(clipboxes);
|
||||||
xRectangle *rects;
|
xRectangle *rects;
|
||||||
GCPtr gc;
|
GCPtr gc;
|
||||||
|
|
||||||
|
@ -1936,7 +1936,7 @@ xf86XVClipVideoHelper(
|
||||||
){
|
){
|
||||||
double xsw, xdw, ysw, ydw;
|
double xsw, xdw, ysw, ydw;
|
||||||
INT32 delta;
|
INT32 delta;
|
||||||
BoxPtr extents = REGION_EXTENTS(DummyScreen, reg);
|
BoxPtr extents = RegionExtents(reg);
|
||||||
int diff;
|
int diff;
|
||||||
|
|
||||||
xsw = (*xb - *xa) << 16;
|
xsw = (*xb - *xa) << 16;
|
||||||
|
@ -1998,9 +1998,9 @@ xf86XVClipVideoHelper(
|
||||||
(dst->y1 > extents->y1) || (dst->y2 < extents->y2))
|
(dst->y1 > extents->y1) || (dst->y2 < extents->y2))
|
||||||
{
|
{
|
||||||
RegionRec clipReg;
|
RegionRec clipReg;
|
||||||
REGION_INIT(DummyScreen, &clipReg, dst, 1);
|
RegionInit(&clipReg, dst, 1);
|
||||||
REGION_INTERSECT(DummyScreen, reg, reg, &clipReg);
|
RegionIntersect(reg, reg, &clipReg);
|
||||||
REGION_UNINIT(DummyScreen, &clipReg);
|
RegionUninit(&clipReg);
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1157,7 +1157,7 @@ DRIDCNTreeTraversal(WindowPtr pWin, pointer data)
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||||
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
|
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
|
||||||
|
|
||||||
if (REGION_NUM_RECTS(&pWin->clipList) > 0) {
|
if (RegionNumRects(&pWin->clipList) > 0) {
|
||||||
WindowPtr *pDRIWindows = (WindowPtr*)data;
|
WindowPtr *pDRIWindows = (WindowPtr*)data;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
|
@ -1269,7 +1269,7 @@ DRICreateDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable,
|
||||||
pDRIDrawablePriv->pScreen = pScreen;
|
pDRIDrawablePriv->pScreen = pScreen;
|
||||||
pDRIDrawablePriv->refCount = 1;
|
pDRIDrawablePriv->refCount = 1;
|
||||||
pDRIDrawablePriv->drawableIndex = -1;
|
pDRIDrawablePriv->drawableIndex = -1;
|
||||||
pDRIDrawablePriv->nrects = REGION_NUM_RECTS(&pWin->clipList);
|
pDRIDrawablePriv->nrects = RegionNumRects(&pWin->clipList);
|
||||||
|
|
||||||
/* save private off of preallocated index */
|
/* save private off of preallocated index */
|
||||||
dixSetPrivate(&pWin->devPrivates, DRIWindowPrivKey,
|
dixSetPrivate(&pWin->devPrivates, DRIWindowPrivKey,
|
||||||
|
@ -1288,8 +1288,8 @@ DRICreateDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable,
|
||||||
drmUpdateDrawableInfo(pDRIPriv->drmFD,
|
drmUpdateDrawableInfo(pDRIPriv->drmFD,
|
||||||
pDRIDrawablePriv->hwDrawable,
|
pDRIDrawablePriv->hwDrawable,
|
||||||
DRM_DRAWABLE_CLIPRECTS,
|
DRM_DRAWABLE_CLIPRECTS,
|
||||||
REGION_NUM_RECTS(&pWin->clipList),
|
RegionNumRects(&pWin->clipList),
|
||||||
REGION_RECTS(&pWin->clipList));
|
RegionRects(&pWin->clipList));
|
||||||
*hHWDrawable = pDRIDrawablePriv->hwDrawable;
|
*hHWDrawable = pDRIDrawablePriv->hwDrawable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1502,8 +1502,8 @@ DRIGetDrawableInfo(ScreenPtr pScreen,
|
||||||
#endif
|
#endif
|
||||||
*W = (int)(pWin->drawable.width);
|
*W = (int)(pWin->drawable.width);
|
||||||
*H = (int)(pWin->drawable.height);
|
*H = (int)(pWin->drawable.height);
|
||||||
*numClipRects = REGION_NUM_RECTS(&pWin->clipList);
|
*numClipRects = RegionNumRects(&pWin->clipList);
|
||||||
*pClipRects = (drm_clip_rect_t *)REGION_RECTS(&pWin->clipList);
|
*pClipRects = (drm_clip_rect_t *)RegionRects(&pWin->clipList);
|
||||||
|
|
||||||
if (!*numClipRects && pDRIPriv->fullscreen) {
|
if (!*numClipRects && pDRIPriv->fullscreen) {
|
||||||
/* use fake full-screen clip rect */
|
/* use fake full-screen clip rect */
|
||||||
|
@ -1883,10 +1883,10 @@ DRITreeTraversal(WindowPtr pWin, pointer data)
|
||||||
ScreenPtr pScreen = pWin->drawable.pScreen;
|
ScreenPtr pScreen = pWin->drawable.pScreen;
|
||||||
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
|
DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
|
||||||
|
|
||||||
if(REGION_NUM_RECTS(&(pWin->clipList)) > 0) {
|
if(RegionNumRects(&(pWin->clipList)) > 0) {
|
||||||
RegionPtr reg = (RegionPtr)data;
|
RegionPtr reg = (RegionPtr)data;
|
||||||
|
|
||||||
REGION_UNION(pScreen, reg, reg, &(pWin->clipList));
|
RegionUnion(reg, reg, &(pWin->clipList));
|
||||||
pDRIPriv->nrWalked++;
|
pDRIPriv->nrWalked++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1932,21 +1932,21 @@ DRICopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
|
||||||
if(pDRIPriv->nrWindowsVisible > 0) {
|
if(pDRIPriv->nrWindowsVisible > 0) {
|
||||||
RegionRec reg;
|
RegionRec reg;
|
||||||
|
|
||||||
REGION_NULL(pScreen, ®);
|
RegionNull(®);
|
||||||
pDRIPriv->nrWalked = 0;
|
pDRIPriv->nrWalked = 0;
|
||||||
TraverseTree(pWin, DRITreeTraversal, (pointer)(®));
|
TraverseTree(pWin, DRITreeTraversal, (pointer)(®));
|
||||||
|
|
||||||
if(REGION_NOTEMPTY(pScreen, ®)) {
|
if(RegionNotEmpty(®)) {
|
||||||
REGION_TRANSLATE(pScreen, ®, ptOldOrg.x - pWin->drawable.x,
|
RegionTranslate(®, ptOldOrg.x - pWin->drawable.x,
|
||||||
ptOldOrg.y - pWin->drawable.y);
|
ptOldOrg.y - pWin->drawable.y);
|
||||||
REGION_INTERSECT(pScreen, ®, ®, prgnSrc);
|
RegionIntersect(®, ®, prgnSrc);
|
||||||
|
|
||||||
/* The MoveBuffers interface is not ideal */
|
/* The MoveBuffers interface is not ideal */
|
||||||
(*pDRIPriv->pDriverInfo->MoveBuffers)(pWin, ptOldOrg, ®,
|
(*pDRIPriv->pDriverInfo->MoveBuffers)(pWin, ptOldOrg, ®,
|
||||||
pDRIPriv->pDriverInfo->ddxDrawableTableEntry);
|
pDRIPriv->pDriverInfo->ddxDrawableTableEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, ®);
|
RegionUninit(®);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* call lower wrapped functions */
|
/* call lower wrapped functions */
|
||||||
|
@ -2122,7 +2122,7 @@ DRIClipNotify(WindowPtr pWin, int dx, int dy)
|
||||||
if(!pDRIPriv) return;
|
if(!pDRIPriv) return;
|
||||||
|
|
||||||
if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
|
if ((pDRIDrawablePriv = DRI_DRAWABLE_PRIV_FROM_WINDOW(pWin))) {
|
||||||
int nrects = REGION_NUM_RECTS(&pWin->clipList);
|
int nrects = RegionNumRects(&pWin->clipList);
|
||||||
|
|
||||||
if(!pDRIPriv->windowsTouched) {
|
if(!pDRIPriv->windowsTouched) {
|
||||||
DRILockTree(pScreen);
|
DRILockTree(pScreen);
|
||||||
|
@ -2143,7 +2143,7 @@ DRIClipNotify(WindowPtr pWin, int dx, int dy)
|
||||||
|
|
||||||
drmUpdateDrawableInfo(pDRIPriv->drmFD, pDRIDrawablePriv->hwDrawable,
|
drmUpdateDrawableInfo(pDRIPriv->drmFD, pDRIDrawablePriv->hwDrawable,
|
||||||
DRM_DRAWABLE_CLIPRECTS,
|
DRM_DRAWABLE_CLIPRECTS,
|
||||||
nrects, REGION_RECTS(&pWin->clipList));
|
nrects, RegionRects(&pWin->clipList));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* call lower wrapped functions */
|
/* call lower wrapped functions */
|
||||||
|
@ -2368,9 +2368,9 @@ DRIMoveBuffersHelper(
|
||||||
BoxRec tmpBox;
|
BoxRec tmpBox;
|
||||||
int y, nbox;
|
int y, nbox;
|
||||||
|
|
||||||
extents = REGION_EXTENTS(pScreen, reg);
|
extents = RegionExtents(reg);
|
||||||
nbox = REGION_NUM_RECTS(reg);
|
nbox = RegionNumRects(reg);
|
||||||
pbox = REGION_RECTS(reg);
|
pbox = RegionRects(reg);
|
||||||
|
|
||||||
if((dy > 0) && (dy < (extents->y2 - extents->y1))) {
|
if((dy > 0) && (dy < (extents->y2 - extents->y1))) {
|
||||||
*ydir = -1;
|
*ydir = -1;
|
||||||
|
|
|
@ -461,7 +461,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
|
||||||
box.y1 = 0;
|
box.y1 = 0;
|
||||||
box.x2 = pPriv->width;
|
box.x2 = pPriv->width;
|
||||||
box.y2 = pPriv->height;
|
box.y2 = pPriv->height;
|
||||||
REGION_INIT(pDraw->pScreen, ®ion, &box, 0);
|
RegionInit(®ion, &box, 0);
|
||||||
|
|
||||||
DRI2CopyRegion(pDraw, ®ion, DRI2BufferFakeFrontLeft,
|
DRI2CopyRegion(pDraw, ®ion, DRI2BufferFakeFrontLeft,
|
||||||
DRI2BufferFrontLeft);
|
DRI2BufferFrontLeft);
|
||||||
|
@ -614,7 +614,7 @@ DRI2CanFlip(DrawablePtr pDraw)
|
||||||
pWinPixmap = pScreen->GetWindowPixmap(pWin);
|
pWinPixmap = pScreen->GetWindowPixmap(pWin);
|
||||||
if (pRootPixmap != pWinPixmap)
|
if (pRootPixmap != pWinPixmap)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if (!REGION_EQUAL(pScreen, &pWin->clipList, &pRoot->winSize))
|
if (!RegionEqual(&pWin->clipList, &pRoot->winSize))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -710,7 +710,7 @@ DRI2SwapComplete(ClientPtr client, DrawablePtr pDraw, int frame,
|
||||||
box.y1 = 0;
|
box.y1 = 0;
|
||||||
box.x2 = pDraw->width;
|
box.x2 = pDraw->width;
|
||||||
box.y2 = pDraw->height;
|
box.y2 = pDraw->height;
|
||||||
REGION_INIT(pScreen, ®ion, &box, 0);
|
RegionInit(®ion, &box, 0);
|
||||||
DRI2CopyRegion(pDraw, ®ion, DRI2BufferFakeFrontLeft,
|
DRI2CopyRegion(pDraw, ®ion, DRI2BufferFakeFrontLeft,
|
||||||
DRI2BufferFrontLeft);
|
DRI2BufferFrontLeft);
|
||||||
|
|
||||||
|
@ -782,7 +782,7 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
|
||||||
box.y1 = 0;
|
box.y1 = 0;
|
||||||
box.x2 = pDraw->width;
|
box.x2 = pDraw->width;
|
||||||
box.y2 = pDraw->height;
|
box.y2 = pDraw->height;
|
||||||
REGION_INIT(pScreen, ®ion, &box, 0);
|
RegionInit(®ion, &box, 0);
|
||||||
|
|
||||||
pPriv->swapsPending++;
|
pPriv->swapsPending++;
|
||||||
|
|
||||||
|
|
|
@ -3155,9 +3155,9 @@ xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn,
|
||||||
&crtc_box);
|
&crtc_box);
|
||||||
|
|
||||||
if (crtc) {
|
if (crtc) {
|
||||||
REGION_INIT (pScreen, &crtc_region_local, &crtc_box, 1);
|
RegionInit(&crtc_region_local, &crtc_box, 1);
|
||||||
crtc_region = &crtc_region_local;
|
crtc_region = &crtc_region_local;
|
||||||
REGION_INTERSECT (pScreen, crtc_region, crtc_region, reg);
|
RegionIntersect(crtc_region, crtc_region, reg);
|
||||||
}
|
}
|
||||||
*crtc_ret = crtc;
|
*crtc_ret = crtc;
|
||||||
}
|
}
|
||||||
|
@ -3166,7 +3166,7 @@ xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn,
|
||||||
crtc_region, width, height);
|
crtc_region, width, height);
|
||||||
|
|
||||||
if (crtc_region != reg)
|
if (crtc_region != reg)
|
||||||
REGION_UNINIT (pScreen, &crtc_region_local);
|
RegionUninit(&crtc_region_local);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,8 +81,8 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region)
|
||||||
PictFormatPtr format = compWindowFormat (screen->root);
|
PictFormatPtr format = compWindowFormat (screen->root);
|
||||||
int error;
|
int error;
|
||||||
PicturePtr src, dst;
|
PicturePtr src, dst;
|
||||||
int n = REGION_NUM_RECTS(region);
|
int n = RegionNumRects(region);
|
||||||
BoxPtr b = REGION_RECTS(region);
|
BoxPtr b = RegionRects(region);
|
||||||
XID include_inferiors = IncludeInferiors;
|
XID include_inferiors = IncludeInferiors;
|
||||||
|
|
||||||
src = CreatePicture (None,
|
src = CreatePicture (None,
|
||||||
|
@ -167,10 +167,10 @@ xf86CrtcDamageShadow (xf86CrtcPtr crtc)
|
||||||
if (damage_box.y1 < 0) damage_box.y1 = 0;
|
if (damage_box.y1 < 0) damage_box.y1 = 0;
|
||||||
if (damage_box.x2 > pScreen->width) damage_box.x2 = pScreen->width;
|
if (damage_box.x2 > pScreen->width) damage_box.x2 = pScreen->width;
|
||||||
if (damage_box.y2 > pScreen->height) damage_box.y2 = pScreen->height;
|
if (damage_box.y2 > pScreen->height) damage_box.y2 = pScreen->height;
|
||||||
REGION_INIT (pScreen, &damage_region, &damage_box, 1);
|
RegionInit(&damage_region, &damage_box, 1);
|
||||||
DamageRegionAppend (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
|
DamageRegionAppend (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
|
||||||
&damage_region);
|
&damage_region);
|
||||||
REGION_UNINIT (pScreen, &damage_region);
|
RegionUninit(&damage_region);
|
||||||
crtc->shadowClear = TRUE;
|
crtc->shadowClear = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ xf86RotateRedisplay(ScreenPtr pScreen)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
xf86RotatePrepare (pScreen);
|
xf86RotatePrepare (pScreen);
|
||||||
region = DamageRegion(damage);
|
region = DamageRegion(damage);
|
||||||
if (REGION_NOTEMPTY(pScreen, region))
|
if (RegionNotEmpty(region))
|
||||||
{
|
{
|
||||||
int c;
|
int c;
|
||||||
SourceValidateProcPtr SourceValidate;
|
SourceValidateProcPtr SourceValidate;
|
||||||
|
@ -240,14 +240,14 @@ xf86RotateRedisplay(ScreenPtr pScreen)
|
||||||
RegionRec crtc_damage;
|
RegionRec crtc_damage;
|
||||||
|
|
||||||
/* compute portion of damage that overlaps crtc */
|
/* compute portion of damage that overlaps crtc */
|
||||||
REGION_INIT(pScreen, &crtc_damage, &crtc->bounds, 1);
|
RegionInit(&crtc_damage, &crtc->bounds, 1);
|
||||||
REGION_INTERSECT (pScreen, &crtc_damage, &crtc_damage, region);
|
RegionIntersect(&crtc_damage, &crtc_damage, region);
|
||||||
|
|
||||||
/* update damaged region */
|
/* update damaged region */
|
||||||
if (REGION_NOTEMPTY(pScreen, &crtc_damage))
|
if (RegionNotEmpty(&crtc_damage))
|
||||||
xf86RotateCrtcRedisplay (crtc, &crtc_damage);
|
xf86RotateCrtcRedisplay (crtc, &crtc_damage);
|
||||||
|
|
||||||
REGION_UNINIT (pScreen, &crtc_damage);
|
RegionUninit(&crtc_damage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pScreen->SourceValidate = SourceValidate;
|
pScreen->SourceValidate = SourceValidate;
|
||||||
|
|
|
@ -272,18 +272,18 @@ ShadowCopyWindow(
|
||||||
RegionRec rgnDst;
|
RegionRec rgnDst;
|
||||||
|
|
||||||
if (pPriv->vtSema) {
|
if (pPriv->vtSema) {
|
||||||
REGION_NULL(pWin->drawable.pScreen, &rgnDst);
|
RegionNull(&rgnDst);
|
||||||
REGION_COPY(pWin->drawable.pScreen, &rgnDst, prgn);
|
RegionCopy(&rgnDst, prgn);
|
||||||
|
|
||||||
REGION_TRANSLATE(pWin->drawable.pScreen, &rgnDst,
|
RegionTranslate(&rgnDst,
|
||||||
pWin->drawable.x - ptOldOrg.x,
|
pWin->drawable.x - ptOldOrg.x,
|
||||||
pWin->drawable.y - ptOldOrg.y);
|
pWin->drawable.y - ptOldOrg.y);
|
||||||
REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, &rgnDst);
|
RegionIntersect(&rgnDst, &pWin->borderClip, &rgnDst);
|
||||||
if ((num = REGION_NUM_RECTS(&rgnDst))) {
|
if ((num = RegionNumRects(&rgnDst))) {
|
||||||
if(pPriv->preRefresh)
|
if(pPriv->preRefresh)
|
||||||
(*pPriv->preRefresh)(pPriv->pScrn, num, REGION_RECTS(&rgnDst));
|
(*pPriv->preRefresh)(pPriv->pScrn, num, RegionRects(&rgnDst));
|
||||||
} else {
|
} else {
|
||||||
REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
|
RegionUninit(&rgnDst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -293,8 +293,8 @@ ShadowCopyWindow(
|
||||||
|
|
||||||
if (num) {
|
if (num) {
|
||||||
if (pPriv->postRefresh)
|
if (pPriv->postRefresh)
|
||||||
(*pPriv->postRefresh)(pPriv->pScrn, num, REGION_RECTS(&rgnDst));
|
(*pPriv->postRefresh)(pPriv->pScrn, num, RegionRects(&rgnDst));
|
||||||
REGION_UNINIT(pWin->drawable.pScreen, &rgnDst);
|
RegionUninit(&rgnDst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1353,37 +1353,37 @@ ShadowFontToBox(BoxPtr BB, DrawablePtr pDrawable, GCPtr pGC, int x, int y,
|
||||||
}
|
}
|
||||||
right += pFont->info.maxbounds.rightSideBearing;
|
right += pFont->info.maxbounds.rightSideBearing;
|
||||||
BB->x1 =
|
BB->x1 =
|
||||||
max(pDrawable->x + x - left, (REGION_EXTENTS(pGC->pScreen,
|
max(pDrawable->x + x - left, (RegionExtents(
|
||||||
&((WindowPtr) pDrawable)->winSize))->x1);
|
&((WindowPtr) pDrawable)->winSize))->x1);
|
||||||
BB->y1 =
|
BB->y1 =
|
||||||
max(pDrawable->y + y - ascent,
|
max(pDrawable->y + y - ascent,
|
||||||
(REGION_EXTENTS(pGC->pScreen,
|
(RegionExtents(
|
||||||
&((WindowPtr) pDrawable)->winSize))->y1);
|
&((WindowPtr) pDrawable)->winSize))->y1);
|
||||||
BB->x2 =
|
BB->x2 =
|
||||||
min(pDrawable->x + x + right,
|
min(pDrawable->x + x + right,
|
||||||
(REGION_EXTENTS(pGC->pScreen,
|
(RegionExtents(
|
||||||
&((WindowPtr) pDrawable)->winSize))->x2);
|
&((WindowPtr) pDrawable)->winSize))->x2);
|
||||||
BB->y2 =
|
BB->y2 =
|
||||||
min(pDrawable->y + y + descent,
|
min(pDrawable->y + y + descent,
|
||||||
(REGION_EXTENTS(pGC->pScreen,
|
(RegionExtents(
|
||||||
&((WindowPtr) pDrawable)->winSize))->y2);
|
&((WindowPtr) pDrawable)->winSize))->y2);
|
||||||
} else {
|
} else {
|
||||||
ShadowTextExtent(pFont, count, chars, wide ? (FONTLASTROW(pFont) == 0)
|
ShadowTextExtent(pFont, count, chars, wide ? (FONTLASTROW(pFont) == 0)
|
||||||
? Linear16Bit : TwoD16Bit : Linear8Bit, BB);
|
? Linear16Bit : TwoD16Bit : Linear8Bit, BB);
|
||||||
BB->x1 =
|
BB->x1 =
|
||||||
max(pDrawable->x + x + BB->x1, (REGION_EXTENTS(pGC->pScreen,
|
max(pDrawable->x + x + BB->x1, (RegionExtents(
|
||||||
&((WindowPtr) pDrawable)->winSize))->x1);
|
&((WindowPtr) pDrawable)->winSize))->x1);
|
||||||
BB->y1 =
|
BB->y1 =
|
||||||
max(pDrawable->y + y + BB->y1,
|
max(pDrawable->y + y + BB->y1,
|
||||||
(REGION_EXTENTS(pGC->pScreen,
|
(RegionExtents(
|
||||||
&((WindowPtr) pDrawable)->winSize))->y1);
|
&((WindowPtr) pDrawable)->winSize))->y1);
|
||||||
BB->x2 =
|
BB->x2 =
|
||||||
min(pDrawable->x + x + BB->x2,
|
min(pDrawable->x + x + BB->x2,
|
||||||
(REGION_EXTENTS(pGC->pScreen,
|
(RegionExtents(
|
||||||
&((WindowPtr) pDrawable)->winSize))->x2);
|
&((WindowPtr) pDrawable)->winSize))->x2);
|
||||||
BB->y2 =
|
BB->y2 =
|
||||||
min(pDrawable->y + y + BB->y2,
|
min(pDrawable->y + y + BB->y2,
|
||||||
(REGION_EXTENTS(pGC->pScreen,
|
(RegionExtents(
|
||||||
&((WindowPtr) pDrawable)->winSize))->y2);
|
&((WindowPtr) pDrawable)->winSize))->y2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,8 +118,8 @@ XAABitBlt(
|
||||||
fastExpose = 0;
|
fastExpose = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
|
RegionInit(&rgnDst, &fastBox, 1);
|
||||||
REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst, prgnSrcClip);
|
RegionIntersect(&rgnDst, &rgnDst, prgnSrcClip);
|
||||||
}
|
}
|
||||||
|
|
||||||
dstx += pDstDrawable->x;
|
dstx += pDstDrawable->x;
|
||||||
|
@ -128,9 +128,9 @@ XAABitBlt(
|
||||||
if (pDstDrawable->type == DRAWABLE_WINDOW) {
|
if (pDstDrawable->type == DRAWABLE_WINDOW) {
|
||||||
if (!((WindowPtr)pDstDrawable)->realized) {
|
if (!((WindowPtr)pDstDrawable)->realized) {
|
||||||
if (!fastClip)
|
if (!fastClip)
|
||||||
REGION_UNINIT(pGC->pScreen, &rgnDst);
|
RegionUninit(&rgnDst);
|
||||||
if (freeSrcClip)
|
if (freeSrcClip)
|
||||||
REGION_DESTROY(pGC->pScreen, prgnSrcClip);
|
RegionDestroy(prgnSrcClip);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -153,8 +153,8 @@ XAABitBlt(
|
||||||
blown region and call intersect */
|
blown region and call intersect */
|
||||||
|
|
||||||
cclip = pGC->pCompositeClip;
|
cclip = pGC->pCompositeClip;
|
||||||
if (REGION_NUM_RECTS(cclip) == 1) {
|
if (RegionNumRects(cclip) == 1) {
|
||||||
BoxPtr pBox = REGION_RECTS(cclip);
|
BoxPtr pBox = RegionRects(cclip);
|
||||||
|
|
||||||
if (fastBox.x1 < pBox->x1) fastBox.x1 = pBox->x1;
|
if (fastBox.x1 < pBox->x1) fastBox.x1 = pBox->x1;
|
||||||
if (fastBox.x2 > pBox->x2) fastBox.x2 = pBox->x2;
|
if (fastBox.x2 > pBox->x2) fastBox.x2 = pBox->x2;
|
||||||
|
@ -163,37 +163,37 @@ XAABitBlt(
|
||||||
|
|
||||||
/* Check to see if the region is empty */
|
/* Check to see if the region is empty */
|
||||||
if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) {
|
if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) {
|
||||||
REGION_NULL(pGC->pScreen, &rgnDst);
|
RegionNull(&rgnDst);
|
||||||
} else {
|
} else {
|
||||||
REGION_INIT(pGC->pScreen, &rgnDst, &fastBox, 1);
|
RegionInit(&rgnDst, &fastBox, 1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* We must turn off fastClip now, since we must create
|
/* We must turn off fastClip now, since we must create
|
||||||
a full blown region. It is intersected with the
|
a full blown region. It is intersected with the
|
||||||
composite clip below. */
|
composite clip below. */
|
||||||
fastClip = 0;
|
fastClip = 0;
|
||||||
REGION_INIT(pGC->pScreen, &rgnDst, &fastBox,1);
|
RegionInit(&rgnDst, &fastBox,1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
REGION_TRANSLATE(pGC->pScreen, &rgnDst, -dx, -dy);
|
RegionTranslate(&rgnDst, -dx, -dy);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!fastClip) {
|
if (!fastClip) {
|
||||||
REGION_INTERSECT(pGC->pScreen, &rgnDst, &rgnDst,
|
RegionIntersect(&rgnDst, &rgnDst,
|
||||||
pGC->pCompositeClip);
|
pGC->pCompositeClip);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do bit blitting */
|
/* Do bit blitting */
|
||||||
numRects = REGION_NUM_RECTS(&rgnDst);
|
numRects = RegionNumRects(&rgnDst);
|
||||||
if (numRects && width && height) {
|
if (numRects && width && height) {
|
||||||
if(!(pptSrc = (DDXPointPtr)malloc(numRects *
|
if(!(pptSrc = (DDXPointPtr)malloc(numRects *
|
||||||
sizeof(DDXPointRec)))) {
|
sizeof(DDXPointRec)))) {
|
||||||
REGION_UNINIT(pGC->pScreen, &rgnDst);
|
RegionUninit(&rgnDst);
|
||||||
if (freeSrcClip)
|
if (freeSrcClip)
|
||||||
REGION_DESTROY(pGC->pScreen, prgnSrcClip);
|
RegionDestroy(prgnSrcClip);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
pbox = REGION_RECTS(&rgnDst);
|
pbox = RegionRects(&rgnDst);
|
||||||
ppt = pptSrc;
|
ppt = pptSrc;
|
||||||
for (i = numRects; --i >= 0; pbox++, ppt++) {
|
for (i = numRects; --i >= 0; pbox++, ppt++) {
|
||||||
ppt->x = pbox->x1 + dx;
|
ppt->x = pbox->x1 + dx;
|
||||||
|
@ -214,8 +214,8 @@ XAABitBlt(
|
||||||
(int)origSource.height,
|
(int)origSource.height,
|
||||||
origDest.x, origDest.y, bitPlane);
|
origDest.x, origDest.y, bitPlane);
|
||||||
}
|
}
|
||||||
REGION_UNINIT(pGC->pScreen, &rgnDst);
|
RegionUninit(&rgnDst);
|
||||||
if (freeSrcClip)
|
if (freeSrcClip)
|
||||||
REGION_DESTROY(pGC->pScreen, prgnSrcClip);
|
RegionDestroy(prgnSrcClip);
|
||||||
return prgnExposed;
|
return prgnExposed;
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,8 +95,8 @@ XAADoBitBlt(
|
||||||
((pSrc->type == DRAWABLE_WINDOW) &&
|
((pSrc->type == DRAWABLE_WINDOW) &&
|
||||||
(pDst->type == DRAWABLE_WINDOW)));
|
(pDst->type == DRAWABLE_WINDOW)));
|
||||||
|
|
||||||
pbox = REGION_RECTS(prgnDst);
|
pbox = RegionRects(prgnDst);
|
||||||
nbox = REGION_NUM_RECTS(prgnDst);
|
nbox = RegionNumRects(prgnDst);
|
||||||
|
|
||||||
pboxNew1 = NULL;
|
pboxNew1 = NULL;
|
||||||
pptNew1 = NULL;
|
pptNew1 = NULL;
|
||||||
|
@ -204,8 +204,8 @@ XAADoImageWrite(
|
||||||
int srcwidth;
|
int srcwidth;
|
||||||
unsigned char* psrcBase; /* start of image */
|
unsigned char* psrcBase; /* start of image */
|
||||||
unsigned char* srcPntr; /* index into the image */
|
unsigned char* srcPntr; /* index into the image */
|
||||||
BoxPtr pbox = REGION_RECTS(prgnDst);
|
BoxPtr pbox = RegionRects(prgnDst);
|
||||||
int nbox = REGION_NUM_RECTS(prgnDst);
|
int nbox = RegionNumRects(prgnDst);
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
||||||
int Bpp = pSrc->bitsPerPixel >> 3;
|
int Bpp = pSrc->bitsPerPixel >> 3;
|
||||||
|
|
||||||
|
@ -233,8 +233,8 @@ XAADoImageRead(
|
||||||
int dstwidth;
|
int dstwidth;
|
||||||
unsigned char* pdstBase; /* start of image */
|
unsigned char* pdstBase; /* start of image */
|
||||||
unsigned char* dstPntr; /* index into the image */
|
unsigned char* dstPntr; /* index into the image */
|
||||||
BoxPtr pbox = REGION_RECTS(prgnDst);
|
BoxPtr pbox = RegionRects(prgnDst);
|
||||||
int nbox = REGION_NUM_RECTS(prgnDst);
|
int nbox = RegionNumRects(prgnDst);
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
||||||
int Bpp = pSrc->bitsPerPixel >> 3; /* wouldn't get here unless both
|
int Bpp = pSrc->bitsPerPixel >> 3; /* wouldn't get here unless both
|
||||||
src and dst have same bpp */
|
src and dst have same bpp */
|
||||||
|
|
|
@ -76,8 +76,8 @@ XAACopyPlane1toNColorExpand(
|
||||||
DDXPointPtr pptSrc )
|
DDXPointPtr pptSrc )
|
||||||
{
|
{
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
||||||
BoxPtr pbox = REGION_RECTS(rgnDst);
|
BoxPtr pbox = RegionRects(rgnDst);
|
||||||
int numrects = REGION_NUM_RECTS(rgnDst);
|
int numrects = RegionNumRects(rgnDst);
|
||||||
unsigned char *src = ((PixmapPtr)pSrc)->devPrivate.ptr;
|
unsigned char *src = ((PixmapPtr)pSrc)->devPrivate.ptr;
|
||||||
int srcwidth = ((PixmapPtr)pSrc)->devKind;
|
int srcwidth = ((PixmapPtr)pSrc)->devKind;
|
||||||
|
|
||||||
|
@ -101,8 +101,8 @@ XAACopyPlaneNtoNColorExpand(
|
||||||
DDXPointPtr pptSrc
|
DDXPointPtr pptSrc
|
||||||
){
|
){
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
||||||
BoxPtr pbox = REGION_RECTS(rgnDst);
|
BoxPtr pbox = RegionRects(rgnDst);
|
||||||
int numrects = REGION_NUM_RECTS(rgnDst);
|
int numrects = RegionNumRects(rgnDst);
|
||||||
unsigned char *src = ((PixmapPtr)pSrc)->devPrivate.ptr;
|
unsigned char *src = ((PixmapPtr)pSrc)->devPrivate.ptr;
|
||||||
unsigned char *data, *srcPtr, *dataPtr;
|
unsigned char *data, *srcPtr, *dataPtr;
|
||||||
int srcwidth = ((PixmapPtr)pSrc)->devKind;
|
int srcwidth = ((PixmapPtr)pSrc)->devKind;
|
||||||
|
@ -168,14 +168,14 @@ XAAPushPixelsSolidColorExpansion(
|
||||||
int xOrg, int yOrg )
|
int xOrg, int yOrg )
|
||||||
{
|
{
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
||||||
int MaxBoxes = REGION_NUM_RECTS(pGC->pCompositeClip);
|
int MaxBoxes = RegionNumRects(pGC->pCompositeClip);
|
||||||
BoxPtr pbox, pClipBoxes;
|
BoxPtr pbox, pClipBoxes;
|
||||||
int nboxes, srcx, srcy;
|
int nboxes, srcx, srcy;
|
||||||
xRectangle TheRect;
|
xRectangle TheRect;
|
||||||
unsigned char *src = pBitMap->devPrivate.ptr;
|
unsigned char *src = pBitMap->devPrivate.ptr;
|
||||||
int srcwidth = pBitMap->devKind;
|
int srcwidth = pBitMap->devKind;
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pGC->pCompositeClip))
|
if(!RegionNumRects(pGC->pCompositeClip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TheRect.x = xOrg;
|
TheRect.x = xOrg;
|
||||||
|
|
|
@ -49,18 +49,18 @@ XAACopyWindow(
|
||||||
|
|
||||||
pwinRoot = pScreen->root;
|
pwinRoot = pScreen->root;
|
||||||
|
|
||||||
REGION_NULL(pScreen, &rgnDst);
|
RegionNull(&rgnDst);
|
||||||
|
|
||||||
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(pScreen, prgnSrc, -dx, -dy);
|
RegionTranslate(prgnSrc, -dx, -dy);
|
||||||
REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
|
RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc);
|
||||||
|
|
||||||
pbox = REGION_RECTS(&rgnDst);
|
pbox = RegionRects(&rgnDst);
|
||||||
nbox = REGION_NUM_RECTS(&rgnDst);
|
nbox = RegionNumRects(&rgnDst);
|
||||||
if(!nbox ||
|
if(!nbox ||
|
||||||
!(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) {
|
!(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) {
|
||||||
REGION_UNINIT(pScreen, &rgnDst);
|
RegionUninit(&rgnDst);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ppt = pptSrc;
|
ppt = pptSrc;
|
||||||
|
@ -78,5 +78,5 @@ XAACopyWindow(
|
||||||
&(infoRec->ScratchGC), &rgnDst, pptSrc);
|
&(infoRec->ScratchGC), &rgnDst, pptSrc);
|
||||||
|
|
||||||
free(pptSrc);
|
free(pptSrc);
|
||||||
REGION_UNINIT(pScreen, &rgnDst);
|
RegionUninit(&rgnDst);
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,8 +37,8 @@ XAAPolyLinesDashed(
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
||||||
XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&pGC->devPrivates,
|
XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&pGC->devPrivates,
|
||||||
XAAGetGCKey());
|
XAAGetGCKey());
|
||||||
BoxPtr pboxInit = REGION_RECTS(pGC->pCompositeClip);
|
BoxPtr pboxInit = RegionRects(pGC->pCompositeClip);
|
||||||
int nboxInit = REGION_NUM_RECTS(pGC->pCompositeClip);
|
int nboxInit = RegionNumRects(pGC->pCompositeClip);
|
||||||
unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
|
unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
|
||||||
int xorg = pDrawable->x;
|
int xorg = pDrawable->x;
|
||||||
int yorg = pDrawable->y;
|
int yorg = pDrawable->y;
|
||||||
|
|
|
@ -171,7 +171,7 @@ XAAPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
|
||||||
|
|
||||||
cclip = pGC->pCompositeClip;
|
cclip = pGC->pCompositeClip;
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(cclip))
|
if(!RegionNumRects(cclip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (arc = parcs, i = narcs; --i >= 0; arc++)
|
for (arc = parcs, i = narcs; --i >= 0; arc++)
|
||||||
|
@ -198,7 +198,7 @@ XAAPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc *parcs)
|
||||||
y2 = box.y1 + (int)arc->height + 1;
|
y2 = box.y1 + (int)arc->height + 1;
|
||||||
box.y2 = y2;
|
box.y2 = y2;
|
||||||
if ( (x2 <= SHRT_MAX) && (y2 <= SHRT_MAX) &&
|
if ( (x2 <= SHRT_MAX) && (y2 <= SHRT_MAX) &&
|
||||||
(RECT_IN_REGION(pDraw->pScreen, cclip, &box) == rgnIN) )
|
(RegionContainsRect(cclip, &box) == rgnIN) )
|
||||||
{
|
{
|
||||||
if ((arc->angle2 >= FULLCIRCLE) ||
|
if ((arc->angle2 >= FULLCIRCLE) ||
|
||||||
(arc->angle2 <= -FULLCIRCLE))
|
(arc->angle2 <= -FULLCIRCLE))
|
||||||
|
|
|
@ -213,7 +213,7 @@ XAAFillPolygonSolid(
|
||||||
int c, y, maxy, h, yoffset;
|
int c, y, maxy, h, yoffset;
|
||||||
DDXPointPtr topPoint;
|
DDXPointPtr topPoint;
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pGC->pCompositeClip))
|
if(!RegionNumRects(pGC->pCompositeClip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (mode == CoordModePrevious) {
|
if (mode == CoordModePrevious) {
|
||||||
|
@ -226,7 +226,7 @@ XAAFillPolygonSolid(
|
||||||
mode = CoordModeOrigin;
|
mode = CoordModeOrigin;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1) {
|
if (RegionNumRects(pGC->pCompositeClip) != 1) {
|
||||||
miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
|
miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -676,7 +676,7 @@ XAAFillPolygonStippled(
|
||||||
RectFuncPtr RectFunc = NULL;
|
RectFuncPtr RectFunc = NULL;
|
||||||
TrapFuncPtr TrapFunc = NULL;
|
TrapFuncPtr TrapFunc = NULL;
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pGC->pCompositeClip))
|
if(!RegionNumRects(pGC->pCompositeClip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (mode == CoordModePrevious) {
|
if (mode == CoordModePrevious) {
|
||||||
|
@ -689,7 +689,7 @@ XAAFillPolygonStippled(
|
||||||
mode = CoordModeOrigin;
|
mode = CoordModeOrigin;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1) {
|
if (RegionNumRects(pGC->pCompositeClip) != 1) {
|
||||||
miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
|
miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -836,7 +836,7 @@ XAAFillPolygonTiled(
|
||||||
RectFuncPtr RectFunc = NULL;
|
RectFuncPtr RectFunc = NULL;
|
||||||
TrapFuncPtr TrapFunc = NULL;
|
TrapFuncPtr TrapFunc = NULL;
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pGC->pCompositeClip))
|
if(!RegionNumRects(pGC->pCompositeClip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (mode == CoordModePrevious) {
|
if (mode == CoordModePrevious) {
|
||||||
|
@ -849,7 +849,7 @@ XAAFillPolygonTiled(
|
||||||
mode = CoordModeOrigin;
|
mode = CoordModeOrigin;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (REGION_NUM_RECTS(pGC->pCompositeClip) != 1) {
|
if (RegionNumRects(pGC->pCompositeClip) != 1) {
|
||||||
miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
|
miFillPolygon (pDraw, pGC, shape, mode, count, ptsIn);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ XAAPolyFillRect(
|
||||||
if((nrectFill <= 0) || !pGC->planemask)
|
if((nrectFill <= 0) || !pGC->planemask)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pGC->pCompositeClip))
|
if(!RegionNumRects(pGC->pCompositeClip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch(pGC->fillStyle) {
|
switch(pGC->fillStyle) {
|
||||||
|
@ -944,8 +944,8 @@ XAAClipAndRenderRects(
|
||||||
pboxClippedBase = (BoxPtr)infoRec->PreAllocMem;
|
pboxClippedBase = (BoxPtr)infoRec->PreAllocMem;
|
||||||
pboxClipped = pboxClippedBase;
|
pboxClipped = pboxClippedBase;
|
||||||
|
|
||||||
if (REGION_NUM_RECTS(pGC->pCompositeClip) == 1) {
|
if (RegionNumRects(pGC->pCompositeClip) == 1) {
|
||||||
pextent = REGION_RECTS(pGC->pCompositeClip);
|
pextent = RegionRects(pGC->pCompositeClip);
|
||||||
while (nrectFill--) {
|
while (nrectFill--) {
|
||||||
pboxClipped->x1 = max(pextent->x1, prect->x);
|
pboxClipped->x1 = max(pextent->x1, prect->x);
|
||||||
pboxClipped->y1 = max(pextent->y1, prect->y);
|
pboxClipped->y1 = max(pextent->y1, prect->y);
|
||||||
|
@ -967,7 +967,7 @@ XAAClipAndRenderRects(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pextent = REGION_EXTENTS(pGC->pScreen, pGC->pCompositeClip);
|
pextent = RegionExtents(pGC->pCompositeClip);
|
||||||
while (nrectFill--) {
|
while (nrectFill--) {
|
||||||
int n;
|
int n;
|
||||||
BoxRec box, *pbox;
|
BoxRec box, *pbox;
|
||||||
|
@ -986,8 +986,8 @@ XAAClipAndRenderRects(
|
||||||
if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
|
if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
n = REGION_NUM_RECTS (pGC->pCompositeClip);
|
n = RegionNumRects (pGC->pCompositeClip);
|
||||||
pbox = REGION_RECTS(pGC->pCompositeClip);
|
pbox = RegionRects(pGC->pCompositeClip);
|
||||||
|
|
||||||
/* 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()
|
||||||
|
@ -1030,8 +1030,8 @@ XAAGetRectClipBoxes(
|
||||||
xRectangle *prect = prectInit;
|
xRectangle *prect = prectInit;
|
||||||
RegionPtr prgnClip = pGC->pCompositeClip;
|
RegionPtr prgnClip = pGC->pCompositeClip;
|
||||||
|
|
||||||
if (REGION_NUM_RECTS(prgnClip) == 1) {
|
if (RegionNumRects(prgnClip) == 1) {
|
||||||
pextent = REGION_RECTS(prgnClip);
|
pextent = RegionRects(prgnClip);
|
||||||
while (nrectFill--) {
|
while (nrectFill--) {
|
||||||
pboxClipped->x1 = max(pextent->x1, prect->x);
|
pboxClipped->x1 = max(pextent->x1, prect->x);
|
||||||
pboxClipped->y1 = max(pextent->y1, prect->y);
|
pboxClipped->y1 = max(pextent->y1, prect->y);
|
||||||
|
@ -1049,7 +1049,7 @@ XAAGetRectClipBoxes(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pextent = REGION_EXTENTS(pGC->pScreen, prgnClip);
|
pextent = RegionExtents(prgnClip);
|
||||||
while (nrectFill--) {
|
while (nrectFill--) {
|
||||||
int n;
|
int n;
|
||||||
BoxRec box, *pbox;
|
BoxRec box, *pbox;
|
||||||
|
@ -1068,8 +1068,8 @@ XAAGetRectClipBoxes(
|
||||||
if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
|
if ((box.x1 >= box.x2) || (box.y1 >= box.y2))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
n = REGION_NUM_RECTS (prgnClip);
|
n = RegionNumRects (prgnClip);
|
||||||
pbox = REGION_RECTS(prgnClip);
|
pbox = RegionRects(prgnClip);
|
||||||
|
|
||||||
/* 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()
|
||||||
|
|
|
@ -406,7 +406,7 @@ XAAPutImage(
|
||||||
Bool depthBug = FALSE;
|
Bool depthBug = FALSE;
|
||||||
if(!w || !h) return;
|
if(!w || !h) return;
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pGC->pCompositeClip))
|
if(!RegionNumRects(pGC->pCompositeClip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
depthBug = XAA_DEPTH_BUG(pGC);
|
depthBug = XAA_DEPTH_BUG(pGC);
|
||||||
|
@ -431,7 +431,7 @@ XAAPutImage(
|
||||||
!(infoRec->WriteBitmapFlags & NO_PLANEMASK) &&
|
!(infoRec->WriteBitmapFlags & NO_PLANEMASK) &&
|
||||||
!(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY))){
|
!(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY))){
|
||||||
|
|
||||||
int MaxBoxes = REGION_NUM_RECTS(pGC->pCompositeClip);
|
int MaxBoxes = RegionNumRects(pGC->pCompositeClip);
|
||||||
BoxPtr pbox, pClipBoxes;
|
BoxPtr pbox, pClipBoxes;
|
||||||
int nboxes, srcx, srcy, srcwidth;
|
int nboxes, srcx, srcy, srcwidth;
|
||||||
xRectangle TheRect;
|
xRectangle TheRect;
|
||||||
|
|
|
@ -35,8 +35,8 @@ XAAPolyLines(
|
||||||
#endif
|
#endif
|
||||||
){
|
){
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
||||||
BoxPtr pboxInit = REGION_RECTS(pGC->pCompositeClip);
|
BoxPtr pboxInit = RegionRects(pGC->pCompositeClip);
|
||||||
int nboxInit = REGION_NUM_RECTS(pGC->pCompositeClip);
|
int nboxInit = RegionNumRects(pGC->pCompositeClip);
|
||||||
unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
|
unsigned int bias = miGetZeroLineBias(pDrawable->pScreen);
|
||||||
int xorg = pDrawable->x;
|
int xorg = pDrawable->x;
|
||||||
int yorg = pDrawable->y;
|
int yorg = pDrawable->y;
|
||||||
|
|
|
@ -128,7 +128,7 @@ XAAImageText8NonTEColorExpansion(
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
||||||
unsigned long n;
|
unsigned long n;
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pGC->pCompositeClip))
|
if(!RegionNumRects(pGC->pCompositeClip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
(*pGC->font->get_glyphs)(pGC->font, (unsigned long)count,
|
(*pGC->font->get_glyphs)(pGC->font, (unsigned long)count,
|
||||||
|
@ -153,7 +153,7 @@ XAAImageText16NonTEColorExpansion(
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
||||||
unsigned long n;
|
unsigned long n;
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pGC->pCompositeClip))
|
if(!RegionNumRects(pGC->pCompositeClip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
(*pGC->font->get_glyphs)(
|
(*pGC->font->get_glyphs)(
|
||||||
|
@ -188,7 +188,7 @@ XAAImageGlyphBltNonTEColorExpansion(
|
||||||
){
|
){
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pGC->pCompositeClip))
|
if(!RegionNumRects(pGC->pCompositeClip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ImageGlyphBltNonTEColorExpansion(
|
ImageGlyphBltNonTEColorExpansion(
|
||||||
|
@ -208,7 +208,7 @@ XAAPolyGlyphBltNonTEColorExpansion(
|
||||||
){
|
){
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pGC->pCompositeClip))
|
if(!RegionNumRects(pGC->pCompositeClip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
PolyGlyphBltNonTEColorExpansion(
|
PolyGlyphBltNonTEColorExpansion(
|
||||||
|
@ -368,8 +368,8 @@ ImageGlyphBltNonTEColorExpansion(
|
||||||
int skippix, skipglyph, width, n, i;
|
int skippix, skipglyph, width, n, i;
|
||||||
int Left, Right, Top, Bottom;
|
int Left, Right, Top, Bottom;
|
||||||
int LeftEdge, RightEdge, ytop, ybot;
|
int LeftEdge, RightEdge, ytop, ybot;
|
||||||
int nbox = REGION_NUM_RECTS(cclip);
|
int nbox = RegionNumRects(cclip);
|
||||||
BoxPtr pbox = REGION_RECTS(cclip);
|
BoxPtr pbox = RegionRects(cclip);
|
||||||
Bool AlreadySetup = FALSE;
|
Bool AlreadySetup = FALSE;
|
||||||
|
|
||||||
width = CollectCharacterInfo(infoRec->GlyphInfo, nglyph, ppci, font);
|
width = CollectCharacterInfo(infoRec->GlyphInfo, nglyph, ppci, font);
|
||||||
|
@ -405,8 +405,8 @@ ImageGlyphBltNonTEColorExpansion(
|
||||||
nbox--; pbox++;
|
nbox--; pbox++;
|
||||||
}
|
}
|
||||||
|
|
||||||
nbox = REGION_NUM_RECTS(cclip);
|
nbox = RegionNumRects(cclip);
|
||||||
pbox = REGION_RECTS(cclip);
|
pbox = RegionRects(cclip);
|
||||||
|
|
||||||
if(infoRec->WriteBitmap && (nglyph > 1) &&
|
if(infoRec->WriteBitmap && (nglyph > 1) &&
|
||||||
((FONTMAXBOUNDS(font, rightSideBearing) -
|
((FONTMAXBOUNDS(font, rightSideBearing) -
|
||||||
|
@ -477,8 +477,8 @@ PolyGlyphBltNonTEColorExpansion(
|
||||||
int skippix, skipglyph, width, n, i;
|
int skippix, skipglyph, width, n, i;
|
||||||
int Left, Right, Top, Bottom;
|
int Left, Right, Top, Bottom;
|
||||||
int LeftEdge, RightEdge;
|
int LeftEdge, RightEdge;
|
||||||
int nbox = REGION_NUM_RECTS(cclip);
|
int nbox = RegionNumRects(cclip);
|
||||||
BoxPtr pbox = REGION_RECTS(cclip);
|
BoxPtr pbox = RegionRects(cclip);
|
||||||
|
|
||||||
width = CollectCharacterInfo(infoRec->GlyphInfo, nglyph, ppci, font);
|
width = CollectCharacterInfo(infoRec->GlyphInfo, nglyph, ppci, font);
|
||||||
|
|
||||||
|
|
|
@ -59,18 +59,18 @@ XAACopyWindow8_32(
|
||||||
if(doUnderlay)
|
if(doUnderlay)
|
||||||
freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip);
|
freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip);
|
||||||
|
|
||||||
REGION_NULL(pScreen, &rgnDst);
|
RegionNull(&rgnDst);
|
||||||
|
|
||||||
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(pScreen, prgnSrc, -dx, -dy);
|
RegionTranslate(prgnSrc, -dx, -dy);
|
||||||
REGION_INTERSECT(pScreen, &rgnDst, borderClip, prgnSrc);
|
RegionIntersect(&rgnDst, borderClip, prgnSrc);
|
||||||
|
|
||||||
pbox = REGION_RECTS(&rgnDst);
|
pbox = RegionRects(&rgnDst);
|
||||||
nbox = REGION_NUM_RECTS(&rgnDst);
|
nbox = RegionNumRects(&rgnDst);
|
||||||
if(!nbox ||
|
if(!nbox ||
|
||||||
!(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) {
|
!(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) {
|
||||||
REGION_UNINIT(pScreen, &rgnDst);
|
RegionUninit(&rgnDst);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ppt = pptSrc;
|
ppt = pptSrc;
|
||||||
|
@ -88,9 +88,9 @@ XAACopyWindow8_32(
|
||||||
&(infoRec->ScratchGC), &rgnDst, pptSrc);
|
&(infoRec->ScratchGC), &rgnDst, pptSrc);
|
||||||
|
|
||||||
free(pptSrc);
|
free(pptSrc);
|
||||||
REGION_UNINIT(pScreen, &rgnDst);
|
RegionUninit(&rgnDst);
|
||||||
if(freeReg)
|
if(freeReg)
|
||||||
REGION_DESTROY(pScreen, borderClip);
|
RegionDestroy(borderClip);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -341,18 +341,18 @@ XAAOverCopyWindow(
|
||||||
infoRec->ScratchGC.alu = GXcopy;
|
infoRec->ScratchGC.alu = GXcopy;
|
||||||
infoRec->ScratchGC.planemask = ~0;
|
infoRec->ScratchGC.planemask = ~0;
|
||||||
|
|
||||||
REGION_NULL(pScreen, &rgnDst);
|
RegionNull(&rgnDst);
|
||||||
|
|
||||||
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(pScreen, prgnSrc, -dx, -dy);
|
RegionTranslate(prgnSrc, -dx, -dy);
|
||||||
REGION_INTERSECT(pScreen, &rgnDst, &pWin->borderClip, prgnSrc);
|
RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc);
|
||||||
|
|
||||||
nbox = REGION_NUM_RECTS(&rgnDst);
|
nbox = RegionNumRects(&rgnDst);
|
||||||
if(nbox &&
|
if(nbox &&
|
||||||
(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) {
|
(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))) {
|
||||||
|
|
||||||
pbox = REGION_RECTS(&rgnDst);
|
pbox = RegionRects(&rgnDst);
|
||||||
for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
|
for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
|
||||||
ppt->x = pbox->x1 + dx;
|
ppt->x = pbox->x1 + dx;
|
||||||
ppt->y = pbox->y1 + dy;
|
ppt->y = pbox->y1 + dy;
|
||||||
|
@ -371,18 +371,18 @@ XAAOverCopyWindow(
|
||||||
free(pptSrc);
|
free(pptSrc);
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, &rgnDst);
|
RegionUninit(&rgnDst);
|
||||||
|
|
||||||
if(pWin->drawable.depth == 8) {
|
if(pWin->drawable.depth == 8) {
|
||||||
REGION_NULL(pScreen, &rgnDst);
|
RegionNull(&rgnDst);
|
||||||
miSegregateChildren(pWin, &rgnDst, pScrn->depth);
|
miSegregateChildren(pWin, &rgnDst, pScrn->depth);
|
||||||
if(REGION_NOTEMPTY(pScreen, &rgnDst)) {
|
if(RegionNotEmpty(&rgnDst)) {
|
||||||
REGION_INTERSECT(pScreen, &rgnDst, &rgnDst, prgnSrc);
|
RegionIntersect(&rgnDst, &rgnDst, prgnSrc);
|
||||||
nbox = REGION_NUM_RECTS(&rgnDst);
|
nbox = RegionNumRects(&rgnDst);
|
||||||
if(nbox &&
|
if(nbox &&
|
||||||
(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))){
|
(pptSrc = (DDXPointPtr )malloc(nbox * sizeof(DDXPointRec)))){
|
||||||
|
|
||||||
pbox = REGION_RECTS(&rgnDst);
|
pbox = RegionRects(&rgnDst);
|
||||||
for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
|
for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) {
|
||||||
ppt->x = pbox->x1 + dx;
|
ppt->x = pbox->x1 + dx;
|
||||||
ppt->y = pbox->y1 + dy;
|
ppt->y = pbox->y1 + dy;
|
||||||
|
@ -394,7 +394,7 @@ XAAOverCopyWindow(
|
||||||
free(pptSrc);
|
free(pptSrc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
REGION_UNINIT(pScreen, &rgnDst);
|
RegionUninit(&rgnDst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -409,13 +409,13 @@ XAAOverWindowExposures(
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
|
||||||
|
|
||||||
if((pWin->drawable.bitsPerPixel != 8) && infoRec->pScrn->vtSema) {
|
if((pWin->drawable.bitsPerPixel != 8) && infoRec->pScrn->vtSema) {
|
||||||
if(REGION_NUM_RECTS(pReg) && infoRec->FillSolidRects) {
|
if(RegionNumRects(pReg) && infoRec->FillSolidRects) {
|
||||||
XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen);
|
XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen);
|
||||||
|
|
||||||
SWITCH_DEPTH(8);
|
SWITCH_DEPTH(8);
|
||||||
(*infoRec->FillSolidRects)(infoRec->pScrn,
|
(*infoRec->FillSolidRects)(infoRec->pScrn,
|
||||||
infoRec->pScrn->colorKey, GXcopy, ~0,
|
infoRec->pScrn->colorKey, GXcopy, ~0,
|
||||||
REGION_NUM_RECTS(pReg), REGION_RECTS(pReg));
|
RegionNumRects(pReg), RegionRects(pReg));
|
||||||
miWindowExposures(pWin, pReg, pOtherReg);
|
miWindowExposures(pWin, pReg, pOtherReg);
|
||||||
return;
|
return;
|
||||||
} else if(infoRec->NeedToSync) {
|
} else if(infoRec->NeedToSync) {
|
||||||
|
|
|
@ -639,8 +639,8 @@ XAAInitPixmapCache(
|
||||||
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
||||||
XAAInfoRecPtr infoRec = (XAAInfoRecPtr)data;
|
XAAInfoRecPtr infoRec = (XAAInfoRecPtr)data;
|
||||||
XAAPixmapCachePrivatePtr pCachePriv;
|
XAAPixmapCachePrivatePtr pCachePriv;
|
||||||
BoxPtr pBox = REGION_RECTS(areas);
|
BoxPtr pBox = RegionRects(areas);
|
||||||
int nBox = REGION_NUM_RECTS(areas);
|
int nBox = RegionNumRects(areas);
|
||||||
int Num512, Num256, Num128, NumPartial, NumColor, NumMono;
|
int Num512, Num256, Num128, NumPartial, NumColor, NumMono;
|
||||||
int Target512, Target256;
|
int Target512, Target256;
|
||||||
CacheLinkPtr List512, List256, List128, ListPartial, ListColor, ListMono;
|
CacheLinkPtr List512, List256, List128, ListPartial, ListColor, ListMono;
|
||||||
|
|
|
@ -215,7 +215,7 @@ XAADoComposite (
|
||||||
BoxPtr pbox;
|
BoxPtr pbox;
|
||||||
int nbox, w, h;
|
int nbox, w, h;
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pDst->pCompositeClip))
|
if(!RegionNumRects(pDst->pCompositeClip))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if(!infoRec->pScrn->vtSema || !DRAWABLE_IS_ON_CARD(pDst->pDrawable))
|
if(!infoRec->pScrn->vtSema || !DRAWABLE_IS_ON_CARD(pDst->pDrawable))
|
||||||
|
@ -273,8 +273,8 @@ XAADoComposite (
|
||||||
width, height))
|
width, height))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
nbox = REGION_NUM_RECTS(®ion);
|
nbox = RegionNumRects(®ion);
|
||||||
pbox = REGION_RECTS(®ion);
|
pbox = RegionRects(®ion);
|
||||||
|
|
||||||
if(!nbox)
|
if(!nbox)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -298,7 +298,7 @@ XAADoComposite (
|
||||||
}
|
}
|
||||||
|
|
||||||
/* WriteBitmap sets the Sync flag */
|
/* WriteBitmap sets the Sync flag */
|
||||||
REGION_UNINIT(pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -340,11 +340,11 @@ XAADoComposite (
|
||||||
width, height))
|
width, height))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
nbox = REGION_NUM_RECTS(®ion);
|
nbox = RegionNumRects(®ion);
|
||||||
pbox = REGION_RECTS(®ion);
|
pbox = RegionRects(®ion);
|
||||||
|
|
||||||
if(!nbox) {
|
if(!nbox) {
|
||||||
REGION_UNINIT(pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -355,7 +355,7 @@ XAADoComposite (
|
||||||
((PixmapPtr)(pMask->pDrawable))->devKind,
|
((PixmapPtr)(pMask->pDrawable))->devKind,
|
||||||
w, h, flags))
|
w, h, flags))
|
||||||
{
|
{
|
||||||
REGION_UNINIT(pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -371,7 +371,7 @@ XAADoComposite (
|
||||||
}
|
}
|
||||||
|
|
||||||
SET_SYNC_FLAG(infoRec);
|
SET_SYNC_FLAG(infoRec);
|
||||||
REGION_UNINIT(pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -409,11 +409,11 @@ XAADoComposite (
|
||||||
width, height))
|
width, height))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
nbox = REGION_NUM_RECTS(®ion);
|
nbox = RegionNumRects(®ion);
|
||||||
pbox = REGION_RECTS(®ion);
|
pbox = RegionRects(®ion);
|
||||||
|
|
||||||
if(!nbox) {
|
if(!nbox) {
|
||||||
REGION_UNINIT(pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -423,7 +423,7 @@ XAADoComposite (
|
||||||
((PixmapPtr)(pSrc->pDrawable))->devKind,
|
((PixmapPtr)(pSrc->pDrawable))->devKind,
|
||||||
w, h, flags))
|
w, h, flags))
|
||||||
{
|
{
|
||||||
REGION_UNINIT(pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,7 +440,7 @@ XAADoComposite (
|
||||||
}
|
}
|
||||||
|
|
||||||
SET_SYNC_FLAG(infoRec);
|
SET_SYNC_FLAG(infoRec);
|
||||||
REGION_UNINIT(pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -476,16 +476,16 @@ XAACompositeSrcCopy (PicturePtr pSrc,
|
||||||
width, height))
|
width, height))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
nbox = REGION_NUM_RECTS(®ion);
|
nbox = RegionNumRects(®ion);
|
||||||
pbox = REGION_RECTS(®ion);
|
pbox = RegionRects(®ion);
|
||||||
|
|
||||||
if(!nbox) {
|
if(!nbox) {
|
||||||
REGION_UNINIT(pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
pptSrc = malloc(sizeof(DDXPointRec) * nbox);
|
pptSrc = malloc(sizeof(DDXPointRec) * nbox);
|
||||||
if (!pptSrc) {
|
if (!pptSrc) {
|
||||||
REGION_UNINIT(pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
xoff = xSrc - xDst;
|
xoff = xSrc - xDst;
|
||||||
|
@ -502,7 +502,7 @@ XAACompositeSrcCopy (PicturePtr pSrc,
|
||||||
pptSrc);
|
pptSrc);
|
||||||
|
|
||||||
free(pptSrc);
|
free(pptSrc);
|
||||||
REGION_UNINIT(pScreen, ®ion);
|
RegionUninit(®ion);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -588,7 +588,7 @@ XAADoGlyphs (CARD8 op,
|
||||||
ScreenPtr pScreen = pDst->pDrawable->pScreen;
|
ScreenPtr pScreen = pDst->pDrawable->pScreen;
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen);
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pDst->pCompositeClip))
|
if(!RegionNumRects(pDst->pCompositeClip))
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if(!infoRec->pScrn->vtSema ||
|
if(!infoRec->pScrn->vtSema ||
|
||||||
|
|
|
@ -46,8 +46,8 @@ XAAPolyRectangleThinSolid(
|
||||||
int clipYMax; /* lower right corner of clip rect */
|
int clipYMax; /* lower right corner of clip rect */
|
||||||
int width, height; /* width and height of rect */
|
int width, height; /* width and height of rect */
|
||||||
|
|
||||||
nClipRects = REGION_NUM_RECTS(pGC->pCompositeClip);
|
nClipRects = RegionNumRects(pGC->pCompositeClip);
|
||||||
pClipRects = REGION_RECTS(pGC->pCompositeClip);
|
pClipRects = RegionRects(pGC->pCompositeClip);
|
||||||
|
|
||||||
if(!nClipRects) return;
|
if(!nClipRects) return;
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ XAAFillSpans(
|
||||||
if((nInit <= 0) || !pGC->planemask)
|
if((nInit <= 0) || !pGC->planemask)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pGC->pCompositeClip))
|
if(!RegionNumRects(pGC->pCompositeClip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
switch(pGC->fillStyle) {
|
switch(pGC->fillStyle) {
|
||||||
|
@ -117,7 +117,7 @@ XAAFillSpans(
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if((nInit < 10) || (REGION_NUM_RECTS(pGC->pCompositeClip) != 1))
|
if((nInit < 10) || (RegionNumRects(pGC->pCompositeClip) != 1))
|
||||||
fastClip = FALSE;
|
fastClip = FALSE;
|
||||||
|
|
||||||
if(fastClip) {
|
if(fastClip) {
|
||||||
|
@ -797,10 +797,10 @@ XAAClipAndRenderSpans(
|
||||||
pptNew = pptBase;
|
pptNew = pptBase;
|
||||||
pwidthNew = pwidthBase;
|
pwidthNew = pwidthBase;
|
||||||
|
|
||||||
numRects = REGION_NUM_RECTS(pGC->pCompositeClip);
|
numRects = RegionNumRects(pGC->pCompositeClip);
|
||||||
|
|
||||||
if(numRects == 1) {
|
if(numRects == 1) {
|
||||||
BoxPtr pextent = REGION_RECTS(pGC->pCompositeClip);
|
BoxPtr pextent = RegionRects(pGC->pCompositeClip);
|
||||||
|
|
||||||
while(nspans--) {
|
while(nspans--) {
|
||||||
if ((pextent->y1 <= ppt->y) && (ppt->y < pextent->y2)) {
|
if ((pextent->y1 <= ppt->y) && (ppt->y < pextent->y2)) {
|
||||||
|
@ -830,7 +830,7 @@ XAAClipAndRenderSpans(
|
||||||
|
|
||||||
while(nspans--) {
|
while(nspans--) {
|
||||||
nbox = numRects;
|
nbox = numRects;
|
||||||
pbox = REGION_RECTS(pGC->pCompositeClip);
|
pbox = RegionRects(pGC->pCompositeClip);
|
||||||
|
|
||||||
/* find the first band */
|
/* find the first band */
|
||||||
while(nbox && (pbox->y2 <= ppt->y)) {
|
while(nbox && (pbox->y2 <= ppt->y)) {
|
||||||
|
|
|
@ -110,7 +110,7 @@ XAAImageText8TEColorExpansion(
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
||||||
unsigned long n;
|
unsigned long n;
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pGC->pCompositeClip))
|
if(!RegionNumRects(pGC->pCompositeClip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
(*pGC->font->get_glyphs)(pGC->font, (unsigned long)count,
|
(*pGC->font->get_glyphs)(pGC->font, (unsigned long)count,
|
||||||
|
@ -134,7 +134,7 @@ XAAImageText16TEColorExpansion(
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
||||||
unsigned long n;
|
unsigned long n;
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pGC->pCompositeClip))
|
if(!RegionNumRects(pGC->pCompositeClip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
(*pGC->font->get_glyphs)(
|
(*pGC->font->get_glyphs)(
|
||||||
|
@ -169,7 +169,7 @@ XAAImageGlyphBltTEColorExpansion(
|
||||||
{
|
{
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pGC->pCompositeClip))
|
if(!RegionNumRects(pGC->pCompositeClip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
XAAGlyphBltTEColorExpansion(
|
XAAGlyphBltTEColorExpansion(
|
||||||
|
@ -189,7 +189,7 @@ XAAPolyGlyphBltTEColorExpansion(
|
||||||
{
|
{
|
||||||
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC);
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pGC->pCompositeClip))
|
if(!RegionNumRects(pGC->pCompositeClip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
XAAGlyphBltTEColorExpansion(
|
XAAGlyphBltTEColorExpansion(
|
||||||
|
@ -229,8 +229,8 @@ XAAGlyphBltTEColorExpansion(
|
||||||
int skippix, skipglyphs;
|
int skippix, skipglyphs;
|
||||||
int Left, Right, Top, Bottom;
|
int Left, Right, Top, Bottom;
|
||||||
int LeftEdge, RightEdge, ytop, ybot;
|
int LeftEdge, RightEdge, ytop, ybot;
|
||||||
int nbox = REGION_NUM_RECTS(cclip);
|
int nbox = RegionNumRects(cclip);
|
||||||
BoxPtr pbox = REGION_RECTS(cclip);
|
BoxPtr pbox = RegionRects(cclip);
|
||||||
unsigned int **glyphs = NULL;
|
unsigned int **glyphs = NULL;
|
||||||
int glyphWidth = FONTMAXBOUNDS(font, characterWidth);
|
int glyphWidth = FONTMAXBOUNDS(font, characterWidth);
|
||||||
|
|
||||||
|
|
|
@ -804,10 +804,10 @@ XAAPolylinesWideSolid (
|
||||||
int yorg = pDrawable->y;
|
int yorg = pDrawable->y;
|
||||||
Bool hardClip = FALSE;
|
Bool hardClip = FALSE;
|
||||||
|
|
||||||
if(!REGION_NUM_RECTS(pGC->pCompositeClip))
|
if(!RegionNumRects(pGC->pCompositeClip))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(REGION_NUM_RECTS(pGC->pCompositeClip) != 1) {
|
if(RegionNumRects(pGC->pCompositeClip) != 1) {
|
||||||
miWideLine(pDrawable, pGC, mode, npt, pPts);
|
miWideLine(pDrawable, pGC, mode, npt, pPts);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
#define XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC)\
|
#define XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC)\
|
||||||
XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&(pGC)->devPrivates, XAAGetGCKey()); \
|
XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&(pGC)->devPrivates, XAAGetGCKey()); \
|
||||||
GCFuncs *oldFuncs = pGC->funcs;\
|
GCFuncs *oldFuncs = pGC->funcs;\
|
||||||
if(!REGION_NUM_RECTS(pGC->pCompositeClip)) return; \
|
if(!RegionNumRects(pGC->pCompositeClip)) return; \
|
||||||
pGC->funcs = pGCPriv->wrapFuncs;\
|
pGC->funcs = pGCPriv->wrapFuncs;\
|
||||||
pGC->ops = pGCPriv->wrapOps
|
pGC->ops = pGCPriv->wrapOps
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ xnestCollectExposures(void)
|
||||||
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, &Rgn, &Box, 1);
|
RegionInit(&Rgn, &Box, 1);
|
||||||
|
|
||||||
miSendExposures(pWin, &Rgn, Box.x2, Box.y2);
|
miSendExposures(pWin, &Rgn, Box.x2, Box.y2);
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,10 +210,10 @@ xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CT_REGION:
|
case CT_REGION:
|
||||||
nRects = REGION_NUM_RECTS((RegionPtr)pValue);
|
nRects = RegionNumRects((RegionPtr)pValue);
|
||||||
size = nRects * sizeof(*pRects);
|
size = nRects * sizeof(*pRects);
|
||||||
pRects = (XRectangle *) malloc(size);
|
pRects = (XRectangle *) malloc(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;
|
||||||
|
@ -277,7 +277,7 @@ xnestChangeClip(GCPtr pGC, int type, pointer pValue, int nRects)
|
||||||
* other parts of server can only deal with CT_NONE,
|
* other parts of server can only deal with CT_NONE,
|
||||||
* CT_PIXMAP and CT_REGION client clips.
|
* CT_PIXMAP and CT_REGION client clips.
|
||||||
*/
|
*/
|
||||||
pGC->clientClip = (pointer) RECTS_TO_REGION(pGC->pScreen, nRects,
|
pGC->clientClip = (pointer) RegionFromRects(nRects,
|
||||||
(xRectangle *)pValue, type);
|
(xRectangle *)pValue, type);
|
||||||
free(pValue);
|
free(pValue);
|
||||||
pValue = pGC->clientClip;
|
pValue = pGC->clientClip;
|
||||||
|
@ -313,7 +313,7 @@ xnestDestroyClipHelper(GCPtr pGC)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CT_REGION:
|
case CT_REGION:
|
||||||
REGION_DESTROY(pGC->pScreen, pGC->clientClip);
|
RegionDestroy(pGC->clientClip);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -331,8 +331,8 @@ xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CT_REGION:
|
case CT_REGION:
|
||||||
pRgn = REGION_CREATE(pGCDst->pScreen, NULL, 1);
|
pRgn = RegionCreate(NULL, 1);
|
||||||
REGION_COPY(pGCDst->pScreen, pRgn, pGCSrc->clientClip);
|
RegionCopy(pRgn, pGCSrc->clientClip);
|
||||||
xnestChangeClip(pGCDst, CT_REGION, pRgn, 0);
|
xnestChangeClip(pGCDst, CT_REGION, pRgn, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -131,8 +131,8 @@ xnestBitBlitHelper(GCPtr pGC)
|
||||||
BoxRec Box;
|
BoxRec Box;
|
||||||
Bool pending, overlap;
|
Bool pending, overlap;
|
||||||
|
|
||||||
pReg = REGION_CREATE(pGC->pScreen, NULL, 1);
|
pReg = RegionCreate(NULL, 1);
|
||||||
pTmpReg = REGION_CREATE(pGC->pScreen, NULL, 1);
|
pTmpReg = RegionCreate(NULL, 1);
|
||||||
if(!pReg || !pTmpReg) return NullRegion;
|
if(!pReg || !pTmpReg) return NullRegion;
|
||||||
|
|
||||||
pending = True;
|
pending = True;
|
||||||
|
@ -149,15 +149,15 @@ xnestBitBlitHelper(GCPtr pGC)
|
||||||
Box.y1 = event.xgraphicsexpose.y;
|
Box.y1 = event.xgraphicsexpose.y;
|
||||||
Box.x2 = event.xgraphicsexpose.x + event.xgraphicsexpose.width;
|
Box.x2 = event.xgraphicsexpose.x + event.xgraphicsexpose.width;
|
||||||
Box.y2 = event.xgraphicsexpose.y + event.xgraphicsexpose.height;
|
Box.y2 = event.xgraphicsexpose.y + event.xgraphicsexpose.height;
|
||||||
REGION_RESET(pGC->pScreen, pTmpReg, &Box);
|
RegionReset(pTmpReg, &Box);
|
||||||
REGION_APPEND(pGC->pScreen, pReg, pTmpReg);
|
RegionAppend(pReg, pTmpReg);
|
||||||
pending = event.xgraphicsexpose.count;
|
pending = event.xgraphicsexpose.count;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_DESTROY(pGC->pScreen, pTmpReg);
|
RegionDestroy(pTmpReg);
|
||||||
REGION_VALIDATE(pGC->pScreen, pReg, &overlap);
|
RegionValidate(pReg, &overlap);
|
||||||
return(pReg);
|
return(pReg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,8 +97,8 @@ xnestPixmapToRegion(PixmapPtr pPixmap)
|
||||||
pPixmap->drawable.width, pPixmap->drawable.height,
|
pPixmap->drawable.width, pPixmap->drawable.height,
|
||||||
1, XYPixmap);
|
1, XYPixmap);
|
||||||
|
|
||||||
pReg = REGION_CREATE(pPixmap->drawable.pScreen, NULL, 1);
|
pReg = RegionCreate(NULL, 1);
|
||||||
pTmpReg = REGION_CREATE(pPixmap->drawable.pScreen, NULL, 1);
|
pTmpReg = RegionCreate(NULL, 1);
|
||||||
if(!pReg || !pTmpReg) {
|
if(!pReg || !pTmpReg) {
|
||||||
XDestroyImage(ximage);
|
XDestroyImage(ximage);
|
||||||
return NullRegion;
|
return NullRegion;
|
||||||
|
@ -118,8 +118,8 @@ xnestPixmapToRegion(PixmapPtr pPixmap)
|
||||||
else if (currentPixel == 0L) {
|
else if (currentPixel == 0L) {
|
||||||
/* right edge */
|
/* right edge */
|
||||||
Box.x2 = x;
|
Box.x2 = x;
|
||||||
REGION_RESET(pPixmap->drawable.pScreen, pTmpReg, &Box);
|
RegionReset(pTmpReg, &Box);
|
||||||
REGION_APPEND(pPixmap->drawable.pScreen, pReg, pTmpReg);
|
RegionAppend(pReg, pTmpReg);
|
||||||
}
|
}
|
||||||
previousPixel = currentPixel;
|
previousPixel = currentPixel;
|
||||||
}
|
}
|
||||||
|
@ -127,15 +127,15 @@ xnestPixmapToRegion(PixmapPtr pPixmap)
|
||||||
if (previousPixel != 0L) {
|
if (previousPixel != 0L) {
|
||||||
/* right edge because of the end of pixmap */
|
/* right edge because of the end of pixmap */
|
||||||
Box.x2 = pPixmap->drawable.width;
|
Box.x2 = pPixmap->drawable.width;
|
||||||
REGION_RESET(pPixmap->drawable.pScreen, pTmpReg, &Box);
|
RegionReset(pTmpReg, &Box);
|
||||||
REGION_APPEND(pPixmap->drawable.pScreen, pReg, pTmpReg);
|
RegionAppend(pReg, pTmpReg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_DESTROY(pPixmap->drawable.pScreen, pTmpReg);
|
RegionDestroy(pTmpReg);
|
||||||
XDestroyImage(ximage);
|
XDestroyImage(ximage);
|
||||||
|
|
||||||
REGION_VALIDATE(pPixmap->drawable.pScreen, pReg, &overlap);
|
RegionValidate(pReg, &overlap);
|
||||||
|
|
||||||
return(pReg);
|
return(pReg);
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,9 +135,9 @@ xnestCreateWindow(WindowPtr pWin)
|
||||||
if (pWin->nextSib)
|
if (pWin->nextSib)
|
||||||
xnestWindowPriv(pWin->nextSib)->sibling_above = xnestWindow(pWin);
|
xnestWindowPriv(pWin->nextSib)->sibling_above = xnestWindow(pWin);
|
||||||
xnestWindowPriv(pWin)->bounding_shape =
|
xnestWindowPriv(pWin)->bounding_shape =
|
||||||
REGION_CREATE(pWin->drawable.pScreen, NULL, 1);
|
RegionCreate(NULL, 1);
|
||||||
xnestWindowPriv(pWin)->clip_shape =
|
xnestWindowPriv(pWin)->clip_shape =
|
||||||
REGION_CREATE(pWin->drawable.pScreen, NULL, 1);
|
RegionCreate(NULL, 1);
|
||||||
|
|
||||||
if (!pWin->parent) /* only the root window will have the right colormap */
|
if (!pWin->parent) /* only the root window will have the right colormap */
|
||||||
xnestSetInstalledColormapWindows(pWin->drawable.pScreen);
|
xnestSetInstalledColormapWindows(pWin->drawable.pScreen);
|
||||||
|
@ -151,9 +151,9 @@ xnestDestroyWindow(WindowPtr pWin)
|
||||||
if (pWin->nextSib)
|
if (pWin->nextSib)
|
||||||
xnestWindowPriv(pWin->nextSib)->sibling_above =
|
xnestWindowPriv(pWin->nextSib)->sibling_above =
|
||||||
xnestWindowPriv(pWin)->sibling_above;
|
xnestWindowPriv(pWin)->sibling_above;
|
||||||
REGION_DESTROY(pWin->drawable.pScreen,
|
RegionDestroy(
|
||||||
xnestWindowPriv(pWin)->bounding_shape);
|
xnestWindowPriv(pWin)->bounding_shape);
|
||||||
REGION_DESTROY(pWin->drawable.pScreen,
|
RegionDestroy(
|
||||||
xnestWindowPriv(pWin)->clip_shape);
|
xnestWindowPriv(pWin)->clip_shape);
|
||||||
XDestroyWindow(xnestDisplay, xnestWindow(pWin));
|
XDestroyWindow(xnestDisplay, xnestWindow(pWin));
|
||||||
xnestWindowPriv(pWin)->window = None;
|
xnestWindowPriv(pWin)->window = None;
|
||||||
|
@ -415,7 +415,7 @@ xnestWindowExposures(WindowPtr pWin, RegionPtr pRgn, RegionPtr other_exposed)
|
||||||
|
|
||||||
event.xexpose.type = ProcessedExpose;
|
event.xexpose.type = ProcessedExpose;
|
||||||
|
|
||||||
if (RECT_IN_REGION(pWin->drawable.pScreen, pRgn, &Box) != rgnIN)
|
if (RegionContainsRect(pRgn, &Box) != rgnIN)
|
||||||
XPutBackEvent(xnestDisplay, &event);
|
XPutBackEvent(xnestDisplay, &event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -439,11 +439,11 @@ xnestRegionEqual(RegionPtr pReg1, RegionPtr pReg2)
|
||||||
|
|
||||||
if (pReg1 == NullRegion || pReg2 == NullRegion) return False;
|
if (pReg1 == NullRegion || pReg2 == NullRegion) return False;
|
||||||
|
|
||||||
pBox1 = REGION_RECTS(pReg1);
|
pBox1 = RegionRects(pReg1);
|
||||||
n1 = REGION_NUM_RECTS(pReg1);
|
n1 = RegionNumRects(pReg1);
|
||||||
|
|
||||||
pBox2 = REGION_RECTS(pReg2);
|
pBox2 = RegionRects(pReg2);
|
||||||
n2 = REGION_NUM_RECTS(pReg2);
|
n2 = RegionNumRects(pReg2);
|
||||||
|
|
||||||
if (n1 != n2) return False;
|
if (n1 != n2) return False;
|
||||||
|
|
||||||
|
@ -466,13 +466,13 @@ xnestShapeWindow(WindowPtr pWin)
|
||||||
wBoundingShape(pWin))) {
|
wBoundingShape(pWin))) {
|
||||||
|
|
||||||
if (wBoundingShape(pWin)) {
|
if (wBoundingShape(pWin)) {
|
||||||
REGION_COPY(pWin->drawable.pScreen,
|
RegionCopy(
|
||||||
xnestWindowPriv(pWin)->bounding_shape, wBoundingShape(pWin));
|
xnestWindowPriv(pWin)->bounding_shape, wBoundingShape(pWin));
|
||||||
|
|
||||||
reg = XCreateRegion();
|
reg = XCreateRegion();
|
||||||
pBox = REGION_RECTS(xnestWindowPriv(pWin)->bounding_shape);
|
pBox = RegionRects(xnestWindowPriv(pWin)->bounding_shape);
|
||||||
for (i = 0;
|
for (i = 0;
|
||||||
i < REGION_NUM_RECTS(xnestWindowPriv(pWin)->bounding_shape);
|
i < RegionNumRects(xnestWindowPriv(pWin)->bounding_shape);
|
||||||
i++) {
|
i++) {
|
||||||
rect.x = pBox[i].x1;
|
rect.x = pBox[i].x1;
|
||||||
rect.y = pBox[i].y1;
|
rect.y = pBox[i].y1;
|
||||||
|
@ -485,7 +485,7 @@ xnestShapeWindow(WindowPtr pWin)
|
||||||
XDestroyRegion(reg);
|
XDestroyRegion(reg);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
REGION_EMPTY(pWin->drawable.pScreen,
|
RegionEmpty(
|
||||||
xnestWindowPriv(pWin)->bounding_shape);
|
xnestWindowPriv(pWin)->bounding_shape);
|
||||||
|
|
||||||
XShapeCombineMask(xnestDisplay, xnestWindow(pWin),
|
XShapeCombineMask(xnestDisplay, xnestWindow(pWin),
|
||||||
|
@ -497,13 +497,13 @@ xnestShapeWindow(WindowPtr pWin)
|
||||||
wClipShape(pWin))) {
|
wClipShape(pWin))) {
|
||||||
|
|
||||||
if (wClipShape(pWin)) {
|
if (wClipShape(pWin)) {
|
||||||
REGION_COPY(pWin->drawable.pScreen,
|
RegionCopy(
|
||||||
xnestWindowPriv(pWin)->clip_shape, wClipShape(pWin));
|
xnestWindowPriv(pWin)->clip_shape, wClipShape(pWin));
|
||||||
|
|
||||||
reg = XCreateRegion();
|
reg = XCreateRegion();
|
||||||
pBox = REGION_RECTS(xnestWindowPriv(pWin)->clip_shape);
|
pBox = RegionRects(xnestWindowPriv(pWin)->clip_shape);
|
||||||
for (i = 0;
|
for (i = 0;
|
||||||
i < REGION_NUM_RECTS(xnestWindowPriv(pWin)->clip_shape);
|
i < RegionNumRects(xnestWindowPriv(pWin)->clip_shape);
|
||||||
i++) {
|
i++) {
|
||||||
rect.x = pBox[i].x1;
|
rect.x = pBox[i].x1;
|
||||||
rect.y = pBox[i].y1;
|
rect.y = pBox[i].y1;
|
||||||
|
@ -516,7 +516,7 @@ xnestShapeWindow(WindowPtr pWin)
|
||||||
XDestroyRegion(reg);
|
XDestroyRegion(reg);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
REGION_EMPTY(pWin->drawable.pScreen,
|
RegionEmpty(
|
||||||
xnestWindowPriv(pWin)->clip_shape);
|
xnestWindowPriv(pWin)->clip_shape);
|
||||||
|
|
||||||
XShapeCombineMask(xnestDisplay, xnestWindow(pWin),
|
XShapeCombineMask(xnestDisplay, xnestWindow(pWin),
|
||||||
|
|
|
@ -817,8 +817,8 @@ xf86SetRootClip (ScreenPtr pScreen, int enable)
|
||||||
{
|
{
|
||||||
RegionPtr borderVisible;
|
RegionPtr borderVisible;
|
||||||
|
|
||||||
borderVisible = REGION_CREATE(pScreen, NullBox, 1);
|
borderVisible = RegionCreate(NullBox, 1);
|
||||||
REGION_SUBTRACT(pScreen, borderVisible,
|
RegionSubtract(borderVisible,
|
||||||
&pWin->borderClip, &pWin->winSize);
|
&pWin->borderClip, &pWin->winSize);
|
||||||
pWin->valdata->before.borderVisible = borderVisible;
|
pWin->valdata->before.borderVisible = borderVisible;
|
||||||
}
|
}
|
||||||
|
@ -837,13 +837,13 @@ xf86SetRootClip (ScreenPtr pScreen, int enable)
|
||||||
box.y1 = 0;
|
box.y1 = 0;
|
||||||
box.x2 = pScreen->width;
|
box.x2 = pScreen->width;
|
||||||
box.y2 = pScreen->height;
|
box.y2 = pScreen->height;
|
||||||
REGION_RESET(pScreen, &pWin->borderClip, &box);
|
RegionReset(&pWin->borderClip, &box);
|
||||||
REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
|
RegionBreak(&pWin->clipList);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
REGION_EMPTY(pScreen, &pWin->borderClip);
|
RegionEmpty(&pWin->borderClip);
|
||||||
REGION_BREAK (pWin->drawable.pScreen, &pWin->clipList);
|
RegionBreak(&pWin->clipList);
|
||||||
}
|
}
|
||||||
|
|
||||||
ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
|
ResizeChildrenWinSize (pWin, 0, 0, 0, 0);
|
||||||
|
@ -852,8 +852,8 @@ xf86SetRootClip (ScreenPtr pScreen, int enable)
|
||||||
{
|
{
|
||||||
if (pWin->backStorage)
|
if (pWin->backStorage)
|
||||||
{
|
{
|
||||||
pOldClip = REGION_CREATE(pScreen, NullBox, 1);
|
pOldClip = RegionCreate(NullBox, 1);
|
||||||
REGION_COPY(pScreen, pOldClip, &pWin->clipList);
|
RegionCopy(pOldClip, &pWin->clipList);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pWin->firstChild)
|
if (pWin->firstChild)
|
||||||
|
@ -882,7 +882,7 @@ xf86SetRootClip (ScreenPtr pScreen, int enable)
|
||||||
(pWin, 0, 0, pOldClip,
|
(pWin, 0, 0, pOldClip,
|
||||||
pWin->drawable.x, pWin->drawable.y);
|
pWin->drawable.x, pWin->drawable.y);
|
||||||
if (WasViewable)
|
if (WasViewable)
|
||||||
REGION_DESTROY(pScreen, pOldClip);
|
RegionDestroy(pOldClip);
|
||||||
if (bsExposed)
|
if (bsExposed)
|
||||||
{
|
{
|
||||||
RegionPtr valExposed = NullRegion;
|
RegionPtr valExposed = NullRegion;
|
||||||
|
@ -891,8 +891,8 @@ xf86SetRootClip (ScreenPtr pScreen, int enable)
|
||||||
valExposed = &pWin->valdata->after.exposed;
|
valExposed = &pWin->valdata->after.exposed;
|
||||||
(*pScreen->WindowExposures) (pWin, valExposed, bsExposed);
|
(*pScreen->WindowExposures) (pWin, valExposed, bsExposed);
|
||||||
if (valExposed)
|
if (valExposed)
|
||||||
REGION_EMPTY(pScreen, valExposed);
|
RegionEmpty(valExposed);
|
||||||
REGION_DESTROY(pScreen, bsExposed);
|
RegionDestroy(bsExposed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (WasViewable)
|
if (WasViewable)
|
||||||
|
|
|
@ -347,8 +347,8 @@ DRIUpdateSurface(DRIDrawablePrivPtr pDRIDrawablePriv, DrawablePtr pDraw)
|
||||||
wc.height = pWin->drawable.height + 2 * pWin->borderWidth;
|
wc.height = pWin->drawable.height + 2 * pWin->borderWidth;
|
||||||
wc.bit_gravity = XP_GRAVITY_NONE;
|
wc.bit_gravity = XP_GRAVITY_NONE;
|
||||||
|
|
||||||
wc.shape_nrects = REGION_NUM_RECTS(&pWin->clipList);
|
wc.shape_nrects = RegionNumRects(&pWin->clipList);
|
||||||
wc.shape_rects = REGION_RECTS(&pWin->clipList);
|
wc.shape_rects = RegionRects(&pWin->clipList);
|
||||||
wc.shape_tx = - (pTopWin->drawable.x - pTopWin->borderWidth);
|
wc.shape_tx = - (pTopWin->drawable.x - pTopWin->borderWidth);
|
||||||
wc.shape_ty = - (pTopWin->drawable.y - pTopWin->borderWidth);
|
wc.shape_ty = - (pTopWin->drawable.y - pTopWin->borderWidth);
|
||||||
|
|
||||||
|
|
|
@ -163,8 +163,8 @@ xprCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
|
||||||
|
|
||||||
if (pShape != NULL)
|
if (pShape != NULL)
|
||||||
{
|
{
|
||||||
wc.shape_nrects = REGION_NUM_RECTS(pShape);
|
wc.shape_nrects = RegionNumRects(pShape);
|
||||||
wc.shape_rects = REGION_RECTS(pShape);
|
wc.shape_rects = RegionRects(pShape);
|
||||||
wc.shape_tx = wc.shape_ty = 0;
|
wc.shape_tx = wc.shape_ty = 0;
|
||||||
mask |= XP_SHAPE;
|
mask |= XP_SHAPE;
|
||||||
}
|
}
|
||||||
|
@ -306,8 +306,8 @@ xprReshapeFrame(RootlessFrameID wid, RegionPtr pShape)
|
||||||
|
|
||||||
if (pShape != NULL)
|
if (pShape != NULL)
|
||||||
{
|
{
|
||||||
wc.shape_nrects = REGION_NUM_RECTS(pShape);
|
wc.shape_nrects = RegionNumRects(pShape);
|
||||||
wc.shape_rects = REGION_RECTS(pShape);
|
wc.shape_rects = RegionRects(pShape);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -80,8 +80,8 @@ winFillSpansNativeGDI (DrawablePtr pDrawable,
|
||||||
int fullX1, fullX2, fullY1;
|
int fullX1, fullX2, fullY1;
|
||||||
HRGN hrgn = NULL, combined = NULL;
|
HRGN hrgn = NULL, combined = NULL;
|
||||||
|
|
||||||
nbox = REGION_NUM_RECTS (pClip);
|
nbox = RegionNumRects (pClip);
|
||||||
pbox = REGION_RECTS (pClip);
|
pbox = RegionRects (pClip);
|
||||||
|
|
||||||
if (!nbox) return;
|
if (!nbox) return;
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ winFillSpansNativeGDI (DrawablePtr pDrawable,
|
||||||
pbox++;
|
pbox++;
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
|
|
|
@ -210,7 +210,7 @@ winDestroyGCNativeGDI (GCPtr pGC)
|
||||||
winScreenPriv(pGC->pScreen);
|
winScreenPriv(pGC->pScreen);
|
||||||
|
|
||||||
if (pGC->freeCompClip)
|
if (pGC->freeCompClip)
|
||||||
REGION_DESTROY (pGC->pScreen, pGC->pCompositeClip);
|
RegionDestroy(pGC->pCompositeClip);
|
||||||
|
|
||||||
/* Free the memory DC */
|
/* Free the memory DC */
|
||||||
if (pGCPriv->hdcMem != NULL)
|
if (pGCPriv->hdcMem != NULL)
|
||||||
|
|
|
@ -117,15 +117,15 @@ winReshapeMultiWindow (WindowPtr pWin)
|
||||||
if (!wBoundingShape (pWin))
|
if (!wBoundingShape (pWin))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
REGION_NULL(pWin->drawable.pScreen, &rrNewShape);
|
RegionNull(&rrNewShape);
|
||||||
REGION_COPY(pWin->drawable.pScreen, &rrNewShape, wBoundingShape(pWin));
|
RegionCopy(&rrNewShape, wBoundingShape(pWin));
|
||||||
REGION_TRANSLATE(pWin->drawable.pScreen,
|
RegionTranslate(
|
||||||
&rrNewShape,
|
&rrNewShape,
|
||||||
pWin->borderWidth,
|
pWin->borderWidth,
|
||||||
pWin->borderWidth);
|
pWin->borderWidth);
|
||||||
|
|
||||||
nRects = REGION_NUM_RECTS(&rrNewShape);
|
nRects = RegionNumRects(&rrNewShape);
|
||||||
pShape = REGION_RECTS(&rrNewShape);
|
pShape = RegionRects(&rrNewShape);
|
||||||
|
|
||||||
/* Don't do anything if there are no rectangles in the region */
|
/* Don't do anything if there are no rectangles in the region */
|
||||||
if (nRects > 0)
|
if (nRects > 0)
|
||||||
|
@ -205,7 +205,7 @@ winReshapeMultiWindow (WindowPtr pWin)
|
||||||
pWinPriv->hRgn = hRgn;
|
pWinPriv->hRgn = hRgn;
|
||||||
}
|
}
|
||||||
|
|
||||||
REGION_UNINIT(pWin->drawable.pScreen, &rrNewShape);
|
RegionUninit(&rrNewShape);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,8 +54,8 @@ winSetSpansNativeGDI (DrawablePtr pDrawable,
|
||||||
int nbox;
|
int nbox;
|
||||||
BoxPtr pbox;
|
BoxPtr pbox;
|
||||||
|
|
||||||
nbox = REGION_NUM_RECTS (pGC->pCompositeClip);
|
nbox = RegionNumRects (pGC->pCompositeClip);
|
||||||
pbox = REGION_RECTS (pGC->pCompositeClip);
|
pbox = RegionRects (pGC->pCompositeClip);
|
||||||
|
|
||||||
if (!nbox) return;
|
if (!nbox) return;
|
||||||
|
|
||||||
|
|
|
@ -525,8 +525,8 @@ winShadowUpdateDD (ScreenPtr pScreen,
|
||||||
HRESULT ddrval = DD_OK;
|
HRESULT ddrval = DD_OK;
|
||||||
RECT rcDest, rcSrc;
|
RECT rcDest, rcSrc;
|
||||||
POINT ptOrigin;
|
POINT ptOrigin;
|
||||||
DWORD dwBox = REGION_NUM_RECTS (damage);
|
DWORD dwBox = RegionNumRects (damage);
|
||||||
BoxPtr pBox = REGION_RECTS (damage);
|
BoxPtr pBox = RegionRects (damage);
|
||||||
HRGN hrgnTemp = NULL, hrgnCombined = NULL;
|
HRGN hrgnTemp = NULL, hrgnCombined = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -588,7 +588,7 @@ winShadowUpdateDD (ScreenPtr pScreen,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BoxPtr pBoxExtents = REGION_EXTENTS (pScreen, damage);
|
BoxPtr pBoxExtents = RegionExtents(damage);
|
||||||
|
|
||||||
/* Compute a GDI region from the damaged region */
|
/* Compute a GDI region from the damaged region */
|
||||||
hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
|
hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
|
||||||
|
|
|
@ -601,8 +601,8 @@ winShadowUpdateDDNL (ScreenPtr pScreen,
|
||||||
HRESULT ddrval = DD_OK;
|
HRESULT ddrval = DD_OK;
|
||||||
RECT rcDest, rcSrc;
|
RECT rcDest, rcSrc;
|
||||||
POINT ptOrigin;
|
POINT ptOrigin;
|
||||||
DWORD dwBox = REGION_NUM_RECTS (damage);
|
DWORD dwBox = RegionNumRects (damage);
|
||||||
BoxPtr pBox = REGION_RECTS (damage);
|
BoxPtr pBox = RegionRects (damage);
|
||||||
HRGN hrgnTemp = NULL, hrgnCombined = NULL;
|
HRGN hrgnTemp = NULL, hrgnCombined = NULL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -677,7 +677,7 @@ winShadowUpdateDDNL (ScreenPtr pScreen,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
BoxPtr pBoxExtents = REGION_EXTENTS (pScreen, damage);
|
BoxPtr pBoxExtents = RegionExtents(damage);
|
||||||
|
|
||||||
/* Compute a GDI region from the damaged region */
|
/* Compute a GDI region from the damaged region */
|
||||||
hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
|
hrgnCombined = CreateRectRgn (pBox->x1, pBox->y1, pBox->x2, pBox->y2);
|
||||||
|
|
|
@ -499,8 +499,8 @@ winShadowUpdateGDI (ScreenPtr pScreen,
|
||||||
winScreenPriv(pScreen);
|
winScreenPriv(pScreen);
|
||||||
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
|
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
|
||||||
RegionPtr damage = shadowDamage(pBuf);
|
RegionPtr damage = shadowDamage(pBuf);
|
||||||
DWORD dwBox = REGION_NUM_RECTS (damage);
|
DWORD dwBox = RegionNumRects (damage);
|
||||||
BoxPtr pBox = REGION_RECTS (damage);
|
BoxPtr pBox = RegionRects (damage);
|
||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
HRGN hrgnTemp = NULL, hrgnCombined = NULL;
|
HRGN hrgnTemp = NULL, hrgnCombined = NULL;
|
||||||
#ifdef XWIN_UPDATESTATS
|
#ifdef XWIN_UPDATESTATS
|
||||||
|
@ -508,7 +508,7 @@ winShadowUpdateGDI (ScreenPtr pScreen,
|
||||||
static DWORD s_dwTotalUpdates = 0;
|
static DWORD s_dwTotalUpdates = 0;
|
||||||
static DWORD s_dwTotalBoxes = 0;
|
static DWORD s_dwTotalBoxes = 0;
|
||||||
#endif
|
#endif
|
||||||
BoxPtr pBoxExtents = REGION_EXTENTS (pScreen, damage);
|
BoxPtr pBoxExtents = RegionExtents(damage);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Return immediately if the app is not active
|
* Return immediately if the app is not active
|
||||||
|
|
|
@ -185,7 +185,7 @@ winSetupImageVideo (ScreenPtr pScreen)
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/* gotta uninit this someplace */
|
/* gotta uninit this someplace */
|
||||||
REGION_NULL(pScreen, &pPriv->clip);
|
RegionNull(&pPriv->clip);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user