Rename region macros to eliminate screen argument

This is a combination of a huge mechanical patch and a few small
fixups required to finish the job. They were reviewed separately, but
because the server does not build without both pieces, I've merged
them together at this time.

The mechanical changes were performed by running the included
'fix-region' script over the whole tree:

$ git ls-files | grep -v '^fix-' | xargs ./fix-region

And then, the white space errors in the resulting patch were fixed
using the provided fix-patch-whitespace script.

$ sh ./fix-patch-whitespace

Thanks to Jamey Sharp for the mighty fine sed-generating sed script.

The hand-done changes involve removing functions from dix/region.c
that duplicate inline functions in include/regionstr.h, along with
their declarations in regionstr.h, mi.h and mispans.h.

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

View File

@@ -47,7 +47,7 @@ void
miDestroyPicture (PicturePtr pPicture)
{
if (pPicture->freeCompClip)
REGION_DESTROY(pPicture->pDrawable->pScreen, pPicture->pCompositeClip);
RegionDestroy(pPicture->pCompositeClip);
}
void
@@ -64,7 +64,7 @@ miDestroyPictureClip (PicturePtr pPicture)
* we know we'll never have a list of rectangles, since ChangeClip
* immediately turns them into a region
*/
REGION_DESTROY(pPicture->pDrawable->pScreen, pPicture->clientClip);
RegionDestroy(pPicture->clientClip);
break;
}
pPicture->clientClip = NULL;
@@ -85,7 +85,7 @@ miChangePictureClip (PicturePtr pPicture,
switch (type) {
case CT_PIXMAP:
/* convert the pixmap to a region */
clientClip = (pointer) BITMAP_TO_REGION(pScreen, (PixmapPtr) value);
clientClip = (pointer) BitmapToRegion(pScreen, (PixmapPtr) value);
if (!clientClip)
return BadAlloc;
clientClipType = CT_REGION;
@@ -100,7 +100,7 @@ miChangePictureClip (PicturePtr pPicture,
clientClipType = CT_NONE;
break;
default:
clientClip = (pointer) RECTS_TO_REGION(pScreen, n,
clientClip = (pointer) RegionFromRects(n,
(xRectangle *) value,
type);
if (!clientClip)
@@ -160,7 +160,7 @@ miValidatePicture (PicturePtr pPicture,
if (pPicture->clientClipType == CT_NONE)
{
if (freeCompClip)
REGION_DESTROY(pScreen, pPicture->pCompositeClip);
RegionDestroy(pPicture->pCompositeClip);
pPicture->pCompositeClip = pregWin;
pPicture->freeCompClip = freeTmpClip;
}
@@ -175,30 +175,30 @@ miValidatePicture (PicturePtr pPicture,
* clip. if neither is real, create a new region.
*/
REGION_TRANSLATE(pScreen, pPicture->clientClip,
RegionTranslate(pPicture->clientClip,
pDrawable->x + pPicture->clipOrigin.x,
pDrawable->y + pPicture->clipOrigin.y);
if (freeCompClip)
{
REGION_INTERSECT(pScreen, pPicture->pCompositeClip,
RegionIntersect(pPicture->pCompositeClip,
pregWin, pPicture->clientClip);
if (freeTmpClip)
REGION_DESTROY(pScreen, pregWin);
RegionDestroy(pregWin);
}
else if (freeTmpClip)
{
REGION_INTERSECT(pScreen, pregWin, pregWin, pPicture->clientClip);
RegionIntersect(pregWin, pregWin, pPicture->clientClip);
pPicture->pCompositeClip = pregWin;
}
else
{
pPicture->pCompositeClip = REGION_CREATE(pScreen, NullBox, 0);
REGION_INTERSECT(pScreen, pPicture->pCompositeClip,
pPicture->pCompositeClip = RegionCreate(NullBox, 0);
RegionIntersect(pPicture->pCompositeClip,
pregWin, pPicture->clientClip);
}
pPicture->freeCompClip = TRUE;
REGION_TRANSLATE(pScreen, pPicture->clientClip,
RegionTranslate(pPicture->clientClip,
-(pDrawable->x + pPicture->clipOrigin.x),
-(pDrawable->y + pPicture->clipOrigin.y));
}
@@ -216,31 +216,31 @@ miValidatePicture (PicturePtr pPicture,
if (pPicture->freeCompClip)
{
REGION_RESET(pScreen, pPicture->pCompositeClip, &pixbounds);
RegionReset(pPicture->pCompositeClip, &pixbounds);
}
else
{
pPicture->freeCompClip = TRUE;
pPicture->pCompositeClip = REGION_CREATE(pScreen, &pixbounds, 1);
pPicture->pCompositeClip = RegionCreate(&pixbounds, 1);
}
if (pPicture->clientClipType == CT_REGION)
{
if(pDrawable->x || pDrawable->y) {
REGION_TRANSLATE(pScreen, pPicture->clientClip,
RegionTranslate(pPicture->clientClip,
pDrawable->x + pPicture->clipOrigin.x,
pDrawable->y + pPicture->clipOrigin.y);
REGION_INTERSECT(pScreen, pPicture->pCompositeClip,
RegionIntersect(pPicture->pCompositeClip,
pPicture->pCompositeClip, pPicture->clientClip);
REGION_TRANSLATE(pScreen, pPicture->clientClip,
RegionTranslate(pPicture->clientClip,
-(pDrawable->x + pPicture->clipOrigin.x),
-(pDrawable->y + pPicture->clipOrigin.y));
} else {
REGION_TRANSLATE(pScreen, pPicture->pCompositeClip,
RegionTranslate(pPicture->pCompositeClip,
-pPicture->clipOrigin.x, -pPicture->clipOrigin.y);
REGION_INTERSECT(pScreen, pPicture->pCompositeClip,
RegionIntersect(pPicture->pCompositeClip,
pPicture->pCompositeClip, pPicture->clientClip);
REGION_TRANSLATE(pScreen, pPicture->pCompositeClip,
RegionTranslate(pPicture->pCompositeClip,
pPicture->clipOrigin.x, pPicture->clipOrigin.y);
}
}
@@ -321,7 +321,7 @@ miClipPictureSrc (RegionPtr pRegion,
pPicture->clipOrigin.x + dx,
pPicture->clipOrigin.y + dy);
result = REGION_INTERSECT (pScreen, pRegion, pRegion, pPicture->clientClip);
result = RegionIntersect(pRegion, pRegion, pPicture->clientClip);
pixman_region_translate ( pPicture->clientClip,
- (pPicture->clipOrigin.x + dx),