diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-03-16 11:11:43 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-05-02 14:53:06 +0200 |
commit | 63f1fff8fe1e7f94ebc0a72df773c6f77531f7a4 (patch) | |
tree | 3d67994a85c5d8c3a929ab315fbcb617baa6423d /nx-X11/programs/Xserver/miext/damage | |
parent | 28ba877803d8383eac282b873b8e0bb50c8db46b (diff) | |
download | nx-libs-63f1fff8fe1e7f94ebc0a72df773c6f77531f7a4.tar.gz nx-libs-63f1fff8fe1e7f94ebc0a72df773c6f77531f7a4.tar.bz2 nx-libs-63f1fff8fe1e7f94ebc0a72df773c6f77531f7a4.zip |
Rename region macros to eliminate screen argument
This is a huge mechanical patch and a few small fixups required to finish
the job. They were reviewed separately, but because the server does not
build without both pieces, I've merged them together at this time.
The mechanical changes were performed by running the included
'fix-region' script over the whole nx-X11/programs/Xserver tree:
$ cd nx-X11/programs/Xserver && ( git ls-files | grep -v '^fix-' | xargs ./fix-region; )
And then, the white space errors in the resulting patch were fixed
using the provided fix-patch-whitespace script.
$ sh ./fix-patch-whitespace
Thanks to Jamey Sharp for the mighty fine sed-generating sed script.
v1: Keith Packard <keithp@keithp.com> (X.Org xserver commit: 2dc138922b7588515d5f2447e4b9dcdc0bef15e0)
v2: Mike Gabriel <mike.gabriel@das-netzwerkteam.de> (apply fix-region script to nx-libs)
Diffstat (limited to 'nx-X11/programs/Xserver/miext/damage')
-rwxr-xr-x | nx-X11/programs/Xserver/miext/damage/damage.c | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/nx-X11/programs/Xserver/miext/damage/damage.c b/nx-X11/programs/Xserver/miext/damage/damage.c index 0dd788ec3..60e2ae4b5 100755 --- a/nx-X11/programs/Xserver/miext/damage/damage.c +++ b/nx-X11/programs/Xserver/miext/damage/damage.c @@ -137,7 +137,7 @@ damageDamageRegion (DrawablePtr pDrawable, RegionPtr pRegion, Bool clip, #endif /* short circuit for empty regions */ - if (!REGION_NOTEMPTY(pScreen, pRegion)) + if (!RegionNotEmpty(pRegion)) return; #ifdef COMPOSITE @@ -152,7 +152,7 @@ damageDamageRegion (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 && @@ -160,22 +160,22 @@ damageDamageRegion (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; @@ -223,7 +223,7 @@ damageDamageRegion (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; @@ -231,14 +231,14 @@ damageDamageRegion (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; } @@ -253,39 +253,39 @@ damageDamageRegion (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); switch (pDamage->damageLevel) { case DamageReportRawRegion: (*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)) + RegionNull(&tmpRegion); + RegionSubtract(&tmpRegion, pDamageRegion, &pDamage->damage); + if (RegionNotEmpty(&tmpRegion)) { - REGION_UNION(pScreen, &pDamage->damage, + 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, + 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; } @@ -293,14 +293,14 @@ damageDamageRegion (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); } #if DAMAGE_DEBUG_ENABLE @@ -314,13 +314,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 _damageDamageRegion (pDrawable, ®ion, TRUE, subWindowMode, where); #else damageDamageRegion (pDrawable, ®ion, TRUE, subWindowMode); #endif - REGION_UNINIT (pDrawable->pScreen, ®ion); + RegionUninit(®ion); } static void damageValidateGC(GCPtr, unsigned long, DrawablePtr); @@ -489,7 +489,7 @@ damageDestroyClip(GCPtr pGC) #define checkGCDamage(d,g) (getDrawableDamage(d) && \ (!g->pCompositeClip ||\ - REGION_NOTEMPTY(d->pScreen, \ + RegionNotEmpty(\ g->pCompositeClip))) #ifdef RENDER @@ -503,7 +503,7 @@ damageDestroyClip(GCPtr pGC) } #define checkPictureDamage(p) (getDrawableDamage(p->pDrawable) && \ - REGION_NOTEMPTY(pScreen, p->pCompositeClip)) + RegionNotEmpty(p->pCompositeClip)) static void damageComposite (CARD8 op, @@ -1615,9 +1615,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); damageDamageRegion (&pWindow->drawable, prgnSrc, FALSE, -1); - REGION_TRANSLATE (pScreen, prgnSrc, -dx, -dy); + RegionTranslate(prgnSrc, -dx, -dy); } unwrap (pScrPriv, pScreen, CopyWindow); (*pScreen->CopyWindow) (pWindow, ptOldOrg, prgnSrc); @@ -1820,7 +1820,7 @@ DamageCreate (DamageReportFunc damageReport, return 0; pDamage->pNext = 0; pDamage->pNextWin = 0; - REGION_NULL(pScreen, &pDamage->damage); + RegionNull(&pDamage->damage); pDamage->damageLevel = damageLevel; pDamage->isInternal = isInternal; @@ -1909,7 +1909,7 @@ DamageDestroy (DamagePtr pDamage) { if (pDamage->damageDestroy) (*pDamage->damageDestroy) (pDamage, pDamage->closure); - REGION_UNINIT (pDamage->pDrawable->pScreen, &pDamage->damage); + RegionUninit(&pDamage->damage); xfree (pDamage); } @@ -1921,7 +1921,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) @@ -1934,22 +1934,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 |