diff options
author | Keith Packard <keithp@keithp.com> | 2010-05-21 15:05:48 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-06-05 18:59:00 -0700 |
commit | 2dc138922b7588515d5f2447e4b9dcdc0bef15e0 (patch) | |
tree | 004ca1d730f94a78150c30b3fbc0c87af31f2895 /miext/damage/damage.c | |
parent | d17e726e89ef644310de77b960b715c2d11088da (diff) |
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>
Diffstat (limited to 'miext/damage/damage.c')
-rw-r--r-- | miext/damage/damage.c | 124 |
1 files changed, 62 insertions, 62 deletions
diff --git a/miext/damage/damage.c b/miext/damage/damage.c index 551cb721e..935b1c048 100644 --- a/miext/damage/damage.c +++ b/miext/damage/damage.c @@ -129,40 +129,40 @@ damageReportDamage (DamagePtr pDamage, RegionPtr pDamageRegion) switch (pDamage->damageLevel) { case DamageReportRawRegion: - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, + RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); (*pDamage->damageReport) (pDamage, pDamageRegion, pDamage->closure); break; case DamageReportDeltaRegion: - REGION_NULL (pScreen, &tmpRegion); - REGION_SUBTRACT (pScreen, &tmpRegion, pDamageRegion, &pDamage->damage); - if (REGION_NOTEMPTY (pScreen, &tmpRegion)) { - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, + RegionNull(&tmpRegion); + RegionSubtract(&tmpRegion, pDamageRegion, &pDamage->damage); + if (RegionNotEmpty(&tmpRegion)) { + RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); (*pDamage->damageReport) (pDamage, &tmpRegion, pDamage->closure); } - REGION_UNINIT(pScreen, &tmpRegion); + RegionUninit(&tmpRegion); break; case DamageReportBoundingBox: - tmpBox = *REGION_EXTENTS (pScreen, &pDamage->damage); - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, + tmpBox = *RegionExtents(&pDamage->damage); + RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); - if (!BOX_SAME (&tmpBox, REGION_EXTENTS (pScreen, &pDamage->damage))) { + if (!BOX_SAME (&tmpBox, RegionExtents(&pDamage->damage))) { (*pDamage->damageReport) (pDamage, &pDamage->damage, pDamage->closure); } break; case DamageReportNonEmpty: - was_empty = !REGION_NOTEMPTY(pScreen, &pDamage->damage); - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, + was_empty = !RegionNotEmpty(&pDamage->damage); + RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); - if (was_empty && REGION_NOTEMPTY(pScreen, &pDamage->damage)) { + if (was_empty && RegionNotEmpty(&pDamage->damage)) { (*pDamage->damageReport) (pDamage, &pDamage->damage, pDamage->closure); } break; case DamageReportNone: - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, + RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); break; } @@ -175,30 +175,30 @@ damageReportDamagePostRendering (DamagePtr pDamage, RegionPtr pOldDamage, Region RegionRec tmpRegion, newDamage; Bool was_empty; - REGION_UNION(pScreem, &newDamage, pOldDamage, pDamageRegion); + RegionUnion(&newDamage, pOldDamage, pDamageRegion); switch (pDamage->damageLevel) { case DamageReportRawRegion: (*pDamage->damageReportPostRendering) (pDamage, pDamageRegion, pDamage->closure); break; case DamageReportDeltaRegion: - REGION_NULL (pScreen, &tmpRegion); - REGION_SUBTRACT (pScreen, &tmpRegion, pDamageRegion, pOldDamage); - if (REGION_NOTEMPTY (pScreen, &tmpRegion)) { + RegionNull(&tmpRegion); + RegionSubtract(&tmpRegion, pDamageRegion, pOldDamage); + if (RegionNotEmpty(&tmpRegion)) { (*pDamage->damageReportPostRendering) (pDamage, &tmpRegion, pDamage->closure); } - REGION_UNINIT(pScreen, &tmpRegion); + RegionUninit(&tmpRegion); break; case DamageReportBoundingBox: - tmpBox = *REGION_EXTENTS (pScreen, pOldDamage); - if (!BOX_SAME (&tmpBox, REGION_EXTENTS (pScreen, &newDamage))) { + tmpBox = *RegionExtents(pOldDamage); + if (!BOX_SAME (&tmpBox, RegionExtents(&newDamage))) { (*pDamage->damageReportPostRendering) (pDamage, &newDamage, pDamage->closure); } break; case DamageReportNonEmpty: - was_empty = !REGION_NOTEMPTY(pScreen, pOldDamage); - if (was_empty && REGION_NOTEMPTY(pScreen, &newDamage)) { + was_empty = !RegionNotEmpty(pOldDamage); + if (was_empty && RegionNotEmpty(&newDamage)) { (*pDamage->damageReportPostRendering) (pDamage, &newDamage, pDamage->closure); } @@ -207,7 +207,7 @@ damageReportDamagePostRendering (DamagePtr pDamage, RegionPtr pOldDamage, Region break; } - REGION_UNINIT(pScreen, &newDamage); + RegionUninit(&newDamage); } #if DAMAGE_DEBUG_ENABLE @@ -233,7 +233,7 @@ damageRegionAppend (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, #endif /* short circuit for empty regions */ - if (!REGION_NOTEMPTY(pScreen, pRegion)) + if (!RegionNotEmpty(pRegion)) return; #ifdef COMPOSITE @@ -248,7 +248,7 @@ damageRegionAppend (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, screen_y = ((PixmapPtr) pDrawable)->screen_y - pDrawable->y; } if (screen_x || screen_y) - REGION_TRANSLATE (pScreen, pRegion, screen_x, screen_y); + RegionTranslate(pRegion, screen_x, screen_y); #endif if (pDrawable->type == DRAWABLE_WINDOW && @@ -256,22 +256,22 @@ damageRegionAppend (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, { if (subWindowMode == ClipByChildren) { - REGION_INTERSECT(pScreen, pRegion, pRegion, + RegionIntersect(pRegion, pRegion, &((WindowPtr)(pDrawable))->clipList); } else if (subWindowMode == IncludeInferiors) { RegionPtr pTempRegion = NotClippedByChildren((WindowPtr)(pDrawable)); - REGION_INTERSECT(pScreen, pRegion, pRegion, pTempRegion); - REGION_DESTROY(pScreen, pTempRegion); + RegionIntersect(pRegion, pRegion, pTempRegion); + RegionDestroy(pTempRegion); } /* If subWindowMode is set to an invalid value, don't perform * any drawable-based clipping. */ } - REGION_NULL (pScreen, &clippedRec); + RegionNull(&clippedRec); for (; pDamage; pDamage = pNext) { pNext = pDamage->pNext; @@ -316,7 +316,7 @@ damageRegionAppend (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, { pDamageRegion = &clippedRec; if (pDamage->pDrawable->type == DRAWABLE_WINDOW) { - REGION_INTERSECT (pScreen, pDamageRegion, pRegion, + RegionIntersect(pDamageRegion, pRegion, &((WindowPtr)(pDamage->pDrawable))->borderClip); } else { BoxRec box; @@ -324,14 +324,14 @@ damageRegionAppend (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, box.y1 = draw_y; box.x2 = draw_x + pDamage->pDrawable->width; box.y2 = draw_y + pDamage->pDrawable->height; - REGION_INIT(pScreen, &pixClip, &box, 1); - REGION_INTERSECT (pScreen, pDamageRegion, pRegion, &pixClip); - REGION_UNINIT(pScreen, &pixClip); + RegionInit(&pixClip, &box, 1); + RegionIntersect(pDamageRegion, pRegion, &pixClip); + RegionUninit(&pixClip); } /* * Short circuit empty results */ - if (!REGION_NOTEMPTY(pScreen, pDamageRegion)) + if (!RegionNotEmpty(pDamageRegion)) continue; } @@ -346,23 +346,23 @@ damageRegionAppend (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, * Move region to target coordinate space */ if (draw_x || draw_y) - REGION_TRANSLATE (pScreen, pDamageRegion, -draw_x, -draw_y); + RegionTranslate(pDamageRegion, -draw_x, -draw_y); /* Store damage region if needed after submission. */ if (pDamage->reportAfter || pDamage->damageMarker) - REGION_UNION(pScreen, &pDamage->pendingDamage, + RegionUnion(&pDamage->pendingDamage, &pDamage->pendingDamage, pDamageRegion); /* Duplicate current damage if needed. */ if (pDamage->damageMarker) - REGION_COPY(pScreen, &pDamage->backupDamage, &pDamage->damage); + RegionCopy(&pDamage->backupDamage, &pDamage->damage); /* Report damage now, if desired. */ if (!pDamage->reportAfter) { if (pDamage->damageReport) damageReportDamage (pDamage, pDamageRegion); else - REGION_UNION(pScreen, &pDamage->damage, + RegionUnion(&pDamage->damage, &pDamage->damage, pDamageRegion); } @@ -370,14 +370,14 @@ damageRegionAppend (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, * translate original region back */ if (pDamageRegion == pRegion && (draw_x || draw_y)) - REGION_TRANSLATE (pScreen, pDamageRegion, draw_x, draw_y); + RegionTranslate(pDamageRegion, draw_x, draw_y); } #ifdef COMPOSITE if (screen_x || screen_y) - REGION_TRANSLATE (pScreen, pRegion, -screen_x, -screen_y); + RegionTranslate(pRegion, -screen_x, -screen_y); #endif - REGION_UNINIT (pScreen, &clippedRec); + RegionUninit(&clippedRec); } static void @@ -395,14 +395,14 @@ damageRegionProcessPending (DrawablePtr pDrawable) if (pDamage->damageReport) damageReportDamage (pDamage, &pDamage->pendingDamage); else - REGION_UNION(pScreen, &pDamage->damage, &pDamage->damage, + RegionUnion(&pDamage->damage, &pDamage->damage, &pDamage->pendingDamage); } if (pDamage->reportAfter || pDamage->damageMarker) - REGION_EMPTY (pScreen, &pDamage->pendingDamage); + RegionEmpty(&pDamage->pendingDamage); if (pDamage->damageMarker) - REGION_EMPTY (pScreen, &pDamage->backupDamage); + RegionEmpty(&pDamage->backupDamage); } } @@ -418,13 +418,13 @@ damageDamageBox (DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode) { RegionRec region; - REGION_INIT (pDrawable->pScreen, ®ion, pBox, 1); + RegionInit(®ion, pBox, 1); #if DAMAGE_DEBUG_ENABLE _damageRegionAppend (pDrawable, ®ion, TRUE, subWindowMode, where); #else damageRegionAppend (pDrawable, ®ion, TRUE, subWindowMode); #endif - REGION_UNINIT (pDrawable->pScreen, ®ion); + RegionUninit(®ion); } static void damageValidateGC(GCPtr, unsigned long, DrawablePtr); @@ -593,7 +593,7 @@ damageDestroyClip(GCPtr pGC) #define checkGCDamage(d,g) (getDrawableDamage(d) && \ (!g->pCompositeClip ||\ - REGION_NOTEMPTY(d->pScreen, \ + RegionNotEmpty(\ g->pCompositeClip))) #define TRIM_PICTURE_BOX(box, pDst) { \ @@ -605,7 +605,7 @@ damageDestroyClip(GCPtr pGC) } #define checkPictureDamage(p) (getDrawableDamage(p->pDrawable) && \ - REGION_NOTEMPTY(pScreen, p->pCompositeClip)) + RegionNotEmpty(p->pCompositeClip)) static void damageComposite (CARD8 op, @@ -1763,9 +1763,9 @@ damageCopyWindow(WindowPtr pWindow, * The region comes in source relative, but the damage occurs * at the destination location. Translate back and forth. */ - REGION_TRANSLATE (pScreen, prgnSrc, dx, dy); + RegionTranslate(prgnSrc, dx, dy); damageRegionAppend (&pWindow->drawable, prgnSrc, FALSE, -1); - REGION_TRANSLATE (pScreen, prgnSrc, -dx, -dy); + RegionTranslate(prgnSrc, -dx, -dy); } unwrap (pScrPriv, pScreen, CopyWindow); (*pScreen->CopyWindow) (pWindow, ptOldOrg, prgnSrc); @@ -1931,8 +1931,8 @@ DamageCreate (DamageReportFunc damageReport, return 0; pDamage->pNext = 0; pDamage->pNextWin = 0; - REGION_NULL(pScreen, &pDamage->damage); - REGION_NULL(pScreen, &pDamage->pendingDamage); + RegionNull(&pDamage->damage); + RegionNull(&pDamage->pendingDamage); pDamage->damageLevel = damageLevel; pDamage->isInternal = isInternal; @@ -2052,8 +2052,8 @@ DamageDestroy (DamagePtr pDamage) (*pScrPriv->funcs.Destroy) (pDamage); dixFreePrivates(pDamage->devPrivates); pDamage->devPrivates = NULL; - REGION_UNINIT (pScreen, &pDamage->damage); - REGION_UNINIT (pScreen, &pDamage->pendingDamage); + RegionUninit(&pDamage->damage); + RegionUninit(&pDamage->pendingDamage); free(pDamage); } @@ -2065,7 +2065,7 @@ DamageSubtract (DamagePtr pDamage, RegionRec pixmapClip; DrawablePtr pDrawable = pDamage->pDrawable; - REGION_SUBTRACT (pDrawable->pScreen, &pDamage->damage, &pDamage->damage, pRegion); + RegionSubtract(&pDamage->damage, &pDamage->damage, pRegion); if (pDrawable) { if (pDrawable->type == DRAWABLE_WINDOW) @@ -2078,22 +2078,22 @@ DamageSubtract (DamagePtr pDamage, box.y1 = pDrawable->y; box.x2 = pDrawable->x + pDrawable->width; box.y2 = pDrawable->y + pDrawable->height; - REGION_INIT (pDrawable->pScreen, &pixmapClip, &box, 1); + RegionInit(&pixmapClip, &box, 1); pClip = &pixmapClip; } - REGION_TRANSLATE (pDrawable->pScreen, &pDamage->damage, pDrawable->x, pDrawable->y); - REGION_INTERSECT (pDrawable->pScreen, &pDamage->damage, &pDamage->damage, pClip); - REGION_TRANSLATE (pDrawable->pScreen, &pDamage->damage, -pDrawable->x, -pDrawable->y); + RegionTranslate(&pDamage->damage, pDrawable->x, pDrawable->y); + RegionIntersect(&pDamage->damage, &pDamage->damage, pClip); + RegionTranslate(&pDamage->damage, -pDrawable->x, -pDrawable->y); if (pDrawable->type != DRAWABLE_WINDOW) - REGION_UNINIT(pDrawable->pScreen, &pixmapClip); + RegionUninit(&pixmapClip); } - return REGION_NOTEMPTY (pDrawable->pScreen, &pDamage->damage); + return RegionNotEmpty(&pDamage->damage); } void DamageEmpty (DamagePtr pDamage) { - REGION_EMPTY (pDamage->pDrawable->pScreen, &pDamage->damage); + RegionEmpty(&pDamage->damage); } RegionPtr |