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/hw/nxagent/NXdamage.c | |
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/hw/nxagent/NXdamage.c')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/NXdamage.c | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c b/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c index d18840dad..278e0727c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdamage.c @@ -154,7 +154,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 @@ -169,7 +169,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 && @@ -177,22 +177,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; @@ -240,7 +240,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; @@ -248,14 +248,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; } @@ -270,39 +270,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; } @@ -310,14 +310,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 @@ -331,13 +331,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); @@ -506,7 +506,7 @@ damageDestroyClip(GCPtr pGC) #define checkGCDamage(d,g) (getDrawableDamage(d) && \ (!g->pCompositeClip ||\ - REGION_NOTEMPTY(d->pScreen, \ + RegionNotEmpty(\ g->pCompositeClip))) #ifdef RENDER @@ -520,7 +520,7 @@ damageDestroyClip(GCPtr pGC) } #define checkPictureDamage(p) (getDrawableDamage(p->pDrawable) && \ - REGION_NOTEMPTY(pScreen, p->pCompositeClip)) + RegionNotEmpty(p->pCompositeClip)) static void damageComposite (CARD8 op, @@ -1722,9 +1722,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); @@ -1927,7 +1927,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; @@ -2016,7 +2016,7 @@ DamageDestroy (DamagePtr pDamage) { if (pDamage->damageDestroy) (*pDamage->damageDestroy) (pDamage, pDamage->closure); - REGION_UNINIT (pDamage->pDrawable->pScreen, &pDamage->damage); + RegionUninit(&pDamage->damage); xfree (pDamage); } @@ -2028,7 +2028,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) @@ -2041,22 +2041,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 |