Commit dfb18f8f authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

nxagent: simplify nxagentFreeRegion macro

Does not require two parameters. It could be replaced by RegionDestroy() entirely but we leave it to have a match to nxagentCreateRegion().
parent cc8d8f72
...@@ -941,7 +941,7 @@ nxagentSynchronizeRegionFree: ...@@ -941,7 +941,7 @@ nxagentSynchronizeRegionFree:
if (clipRegion != NullRegion) if (clipRegion != NullRegion)
{ {
nxagentFreeRegion(pDrawable, clipRegion); nxagentFreeRegion(clipRegion);
} }
SAFE_free(data); SAFE_free(data);
...@@ -996,7 +996,7 @@ void nxagentSynchronizeBox(DrawablePtr pDrawable, BoxPtr pBox, unsigned int brea ...@@ -996,7 +996,7 @@ void nxagentSynchronizeBox(DrawablePtr pDrawable, BoxPtr pBox, unsigned int brea
pRegion -> extents.x1, pRegion -> extents.y1, pRegion -> extents.x2, pRegion -> extents.y2); pRegion -> extents.x1, pRegion -> extents.y1, pRegion -> extents.x2, pRegion -> extents.y2);
#endif #endif
nxagentFreeRegion(pDrawable, pRegion); nxagentFreeRegion(pRegion);
return; return;
} }
...@@ -1009,7 +1009,7 @@ void nxagentSynchronizeBox(DrawablePtr pDrawable, BoxPtr pBox, unsigned int brea ...@@ -1009,7 +1009,7 @@ void nxagentSynchronizeBox(DrawablePtr pDrawable, BoxPtr pBox, unsigned int brea
nxagentSynchronizeRegion(pDrawable, pRegion, breakMask, NULL); nxagentSynchronizeRegion(pDrawable, pRegion, breakMask, NULL);
nxagentFreeRegion(pDrawable, pRegion); nxagentFreeRegion(pRegion);
} }
} }
...@@ -1520,7 +1520,7 @@ void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion) ...@@ -1520,7 +1520,7 @@ void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion)
RegionUnion(nxagentCorruptedRegion(pDrawable), RegionUnion(nxagentCorruptedRegion(pDrawable),
nxagentCorruptedRegion(pDrawable), pRegion); nxagentCorruptedRegion(pDrawable), pRegion);
nxagentFreeRegion(pDrawable, pRegion); nxagentFreeRegion(pRegion);
} }
else else
{ {
...@@ -2321,7 +2321,7 @@ void nxagentCorruptedRegionOnWindow(void *p0, XID x, void *p2) ...@@ -2321,7 +2321,7 @@ void nxagentCorruptedRegionOnWindow(void *p0, XID x, void *p2)
RegionIntersect(&visRegion, clipRegion, nxagentCorruptedRegion((DrawablePtr) pWin)); RegionIntersect(&visRegion, clipRegion, nxagentCorruptedRegion((DrawablePtr) pWin));
nxagentFreeRegion(pWin -> drawable.pScreen, clipRegion); nxagentFreeRegion(clipRegion);
if (RegionNil(&visRegion) == 1) if (RegionNil(&visRegion) == 1)
{ {
...@@ -2528,7 +2528,7 @@ nxagentCreateDrawableBitmapEnd: ...@@ -2528,7 +2528,7 @@ nxagentCreateDrawableBitmapEnd:
if (pClipRegion != NullRegion) if (pClipRegion != NullRegion)
{ {
nxagentFreeRegion(pDrawable, pClipRegion); nxagentFreeRegion(pClipRegion);
} }
if (pGC != NULL) if (pGC != NULL)
......
...@@ -162,8 +162,7 @@ extern int nxagentForceSynchronization; ...@@ -162,8 +162,7 @@ extern int nxagentForceSynchronization;
extern RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y, extern RegionPtr nxagentCreateRegion(DrawablePtr pDrawable, GCPtr pGC, int x, int y,
int width, int height); int width, int height);
#define nxagentFreeRegion(pDrawable, pRegion) \ #define nxagentFreeRegion(pRegion) RegionDestroy(pRegion);
RegionDestroy(pRegion);
extern void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion); extern void nxagentMarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion);
extern void nxagentUnmarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion); extern void nxagentUnmarkCorruptedRegion(DrawablePtr pDrawable, RegionPtr pRegion);
......
...@@ -313,7 +313,7 @@ FIXME: The popup could be synchronized with one single put image, ...@@ -313,7 +313,7 @@ FIXME: The popup could be synchronized with one single put image,
RegionUninit(&corruptedRegion); RegionUninit(&corruptedRegion);
nxagentFreeRegion(pSrcDrawable, pSrcRegion); nxagentFreeRegion(pSrcRegion);
if (nxagentDrawableStatus(pSrcDrawable) == Synchronized) if (nxagentDrawableStatus(pSrcDrawable) == Synchronized)
{ {
...@@ -511,7 +511,7 @@ FIXME: The popup could be synchronized with one single put image, ...@@ -511,7 +511,7 @@ FIXME: The popup could be synchronized with one single put image,
if (pClipRegionFree == True) if (pClipRegionFree == True)
{ {
nxagentFreeRegion(pSrcDrawable, pClipRegion); nxagentFreeRegion(pClipRegion);
} }
FreeScratchGC(targetGC); FreeScratchGC(targetGC);
...@@ -527,10 +527,10 @@ FIXME: The popup could be synchronized with one single put image, ...@@ -527,10 +527,10 @@ FIXME: The popup could be synchronized with one single put image,
* we deallocate it explicitly only if we don't change the clip. * we deallocate it explicitly only if we don't change the clip.
*/ */
nxagentFreeRegion(pSrcDrawable, pClipRegion); nxagentFreeRegion(pClipRegion);
} }
nxagentFreeRegion(pSrcDrawable, pCorruptedRegion); nxagentFreeRegion(pCorruptedRegion);
return 1; return 1;
} }
...@@ -562,7 +562,7 @@ FIXME: The popup could be synchronized with one single put image, ...@@ -562,7 +562,7 @@ FIXME: The popup could be synchronized with one single put image,
RegionUninit(&corruptedRegion); RegionUninit(&corruptedRegion);
nxagentFreeRegion(pSrcDrawable, pSrcRegion); nxagentFreeRegion(pSrcRegion);
} }
return 0; return 0;
...@@ -800,7 +800,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -800,7 +800,7 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
nxagentUnmarkCorruptedRegion(pDstDrawable, pDstRegion); nxagentUnmarkCorruptedRegion(pDstDrawable, pDstRegion);
nxagentFreeRegion(pDstDrawable, pDstRegion); nxagentFreeRegion(pDstRegion);
} }
} }
...@@ -981,7 +981,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -981,7 +981,7 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
nxagentMarkCorruptedRegion(pDstDrawable, pDstRegion); nxagentMarkCorruptedRegion(pDstDrawable, pDstRegion);
nxagentFreeRegion(pDstDrawable, pDstRegion); nxagentFreeRegion(pDstRegion);
skip = 1; skip = 1;
} }
...@@ -1009,12 +1009,12 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, ...@@ -1009,12 +1009,12 @@ RegionPtr nxagentCopyPlane(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
nxagentUnmarkCorruptedRegion(pDstDrawable, pDstRegion); nxagentUnmarkCorruptedRegion(pDstDrawable, pDstRegion);
nxagentFreeRegion(pDstDrawable, pDstRegion); nxagentFreeRegion(pDstRegion);
} }
RegionUninit(&corruptedRegion); RegionUninit(&corruptedRegion);
nxagentFreeRegion(pSrcDrawable, pSrcRegion); nxagentFreeRegion(pSrcRegion);
} }
} }
#ifdef TEST #ifdef TEST
......
...@@ -864,7 +864,7 @@ nxagentPutImageEnd: ...@@ -864,7 +864,7 @@ nxagentPutImageEnd:
if (pRegion != NullRegion) if (pRegion != NullRegion)
{ {
nxagentFreeRegion(pDrawable, pRegion); nxagentFreeRegion(pRegion);
} }
} }
...@@ -992,7 +992,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth, ...@@ -992,7 +992,7 @@ void nxagentRealizeImage(DrawablePtr pDrawable, GCPtr pGC, int depth,
if (clipRegion != NullRegion) if (clipRegion != NullRegion)
{ {
nxagentFreeRegion(pDrawable, clipRegion); nxagentFreeRegion(clipRegion);
} }
y += h; y += h;
......
...@@ -1157,7 +1157,7 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD ...@@ -1157,7 +1157,7 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD
nxagentMarkCorruptedRegion(pDst -> pDrawable, pDstRegion); nxagentMarkCorruptedRegion(pDst -> pDrawable, pDstRegion);
nxagentFreeRegion(pDst -> pDrawable, pDstRegion); nxagentFreeRegion(pDstRegion);
return; return;
} }
...@@ -1326,12 +1326,12 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst, ...@@ -1326,12 +1326,12 @@ void nxagentGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
(void *) pDst -> pDrawable); (void *) pDst -> pDrawable);
#endif #endif
nxagentFreeRegion(pDst -> pDrawable, pRegion); nxagentFreeRegion(pRegion);
return; return;
} }
nxagentFreeRegion(pDst -> pDrawable, pRegion); nxagentFreeRegion(pRegion);
} }
/* /*
...@@ -1817,7 +1817,7 @@ FIXME: Is this useful or just a waste of bandwidth? ...@@ -1817,7 +1817,7 @@ FIXME: Is this useful or just a waste of bandwidth?
nxagentMarkCorruptedRegion(pDst -> pDrawable, pDstRegion); nxagentMarkCorruptedRegion(pDst -> pDrawable, pDstRegion);
nxagentFreeRegion(pDst -> pDrawable, pDstRegion); nxagentFreeRegion(pDstRegion);
if (pDst -> pDrawable -> type == DRAWABLE_PIXMAP) if (pDst -> pDrawable -> type == DRAWABLE_PIXMAP)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment