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
commit 2dc138922b
130 changed files with 1817 additions and 1865 deletions

View file

@ -286,30 +286,30 @@ RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion)
drawing inside the clip, go to some lengths to avoid the general
case intersection. */
b1 = REGION_EXTENTS(pScreen, &pWindow->borderClip);
b2 = REGION_EXTENTS(pScreen, pRegion);
b1 = RegionExtents(&pWindow->borderClip);
b2 = RegionExtents(pRegion);
if (EXTENTCHECK(b1, b2)) {
/* Regions may overlap. */
if (REGION_NUM_RECTS(pRegion) == 1) {
if (RegionNumRects(pRegion) == 1) {
int in;
/* Damaged region only has a single rect, so we can
just compare that against the region */
in = RECT_IN_REGION(pScreen, &pWindow->borderClip,
REGION_RECTS (pRegion));
in = RegionContainsRect(&pWindow->borderClip,
RegionRects (pRegion));
if (in == rgnIN) {
/* clip totally contains pRegion */
#ifdef ROOTLESS_TRACK_DAMAGE
REGION_UNION(pScreen, &winRec->damage,
RegionUnion(&winRec->damage,
&winRec->damage, (pRegion));
#else
SCREENREC(pScreen)->imp->DamageRects(winRec->wid,
REGION_NUM_RECTS(pRegion),
REGION_RECTS(pRegion),
RegionNumRects(pRegion),
RegionRects(pRegion),
-winRec->x, -winRec->y);
#endif
@ -325,20 +325,20 @@ RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion)
/* clip overlaps pRegion, need to intersect */
REGION_NULL(pScreen, &clipped);
REGION_INTERSECT(pScreen, &clipped, &pWindow->borderClip, pRegion);
RegionNull(&clipped);
RegionIntersect(&clipped, &pWindow->borderClip, pRegion);
#ifdef ROOTLESS_TRACK_DAMAGE
REGION_UNION(pScreen, &winRec->damage,
RegionUnion(&winRec->damage,
&winRec->damage, (pRegion));
#else
SCREENREC(pScreen)->imp->DamageRects(winRec->wid,
REGION_NUM_RECTS(&clipped),
REGION_RECTS(&clipped),
RegionNumRects(&clipped),
RegionRects(&clipped),
-winRec->x, -winRec->y);
#endif
REGION_UNINIT(pScreen, &clipped);
RegionUninit(&clipped);
RootlessQueueRedisplay(pTop->drawable.pScreen);
}
@ -346,8 +346,8 @@ RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion)
out:
#ifdef ROOTLESSDEBUG
{
BoxRec *box = REGION_RECTS(pRegion), *end;
int numBox = REGION_NUM_RECTS(pRegion);
BoxRec *box = RegionRects(pRegion), *end;
int numBox = RegionNumRects(pRegion);
for (end = box+numBox; box < end; box++) {
RL_DEBUG_MSG("Damage rect: %i, %i, %i, %i\n",
@ -369,11 +369,11 @@ RootlessDamageBox(WindowPtr pWindow, BoxPtr pBox)
{
RegionRec region;
REGION_INIT(pWindow->drawable.pScreen, &region, pBox, 1);
RegionInit(&region, pBox, 1);
RootlessDamageRegion(pWindow, &region);
REGION_UNINIT(pWindow->drawable.pScreen, &region); /* no-op */
RegionUninit(&region); /* no-op */
}
@ -396,11 +396,11 @@ RootlessDamageRect(WindowPtr pWindow, int x, int y, int w, int h)
box.y1 = y;
box.y2 = y + h;
REGION_INIT(pWindow->drawable.pScreen, &region, &box, 1);
RegionInit(&region, &box, 1);
RootlessDamageRegion(pWindow, &region);
REGION_UNINIT(pWindow->drawable.pScreen, &region); /* no-op */
RegionUninit(&region); /* no-op */
}
@ -418,18 +418,18 @@ RootlessRedisplay(WindowPtr pWindow)
RootlessStopDrawing(pWindow, FALSE);
if (REGION_NOTEMPTY(pScreen, &winRec->damage)) {
if (RegionNotEmpty(&winRec->damage)) {
RL_DEBUG_MSG("Redisplay Win 0x%x, %i x %i @ (%i, %i)\n",
pWindow, winRec->width, winRec->height,
winRec->x, winRec->y);
// move region to window local coords
REGION_TRANSLATE(pScreen, &winRec->damage,
RegionTranslate(&winRec->damage,
-winRec->x, -winRec->y);
SCREENREC(pScreen)->imp->UpdateRegion(winRec->wid, &winRec->damage);
REGION_EMPTY(pScreen, &winRec->damage);
RegionEmpty(&winRec->damage);
}
#else /* !ROOTLESS_TRACK_DAMAGE */