[PATCH 2/2] Make RegionInit() and RegionCreate() take just a box and no size

Søren Sandmann sandmann at cs.au.dk
Wed Mar 30 08:34:10 PDT 2011


From: Søren Sandmann Pedersen <ssp at redhat.com>

The interface to these function was was very confusing since it gave
the impression that they initialized the region from a list of boxes,
which they didn't.

This patch changes the interface to take just one box and fixes all
the callers accordingly.

There were a couple of callers (XFixesRegionCopy() and
SetPictureClipRegion()) that actually used the size field for its
intended purpose, which was to preallocate boxes when the passed box
was NULL, but in both cases, the optimization was rather dubious since
all it accomplished was moving the malloc() call to RegionCopy()
instead.

Also change the REGION_INIT() macro to simply ignore the size
argument. This is always correct since it was only used for
preallocation.

Signed-off-by: Soren Sandmann <ssp at redhat.com>
---
 Xext/panoramiX.c              |    6 +++---
 Xext/shape.c                  |    8 ++++----
 Xext/xace.c                   |    2 +-
 dix/region.c                  |    6 +++---
 dix/window.c                  |   18 +++++++++---------
 exa/exa.c                     |    2 +-
 exa/exa_accel.c               |    4 ++--
 exa/exa_classic.c             |    4 ++--
 exa/exa_migration_classic.c   |    2 +-
 exa/exa_render.c              |    2 +-
 exa/exa_unaccel.c             |    4 ++--
 fb/fboverlay.c                |    2 +-
 fb/fbpixmap.c                 |    2 +-
 hw/dmx/dmxgcops.c             |    4 ++--
 hw/dmx/dmxpixmap.c            |    6 +++---
 hw/kdrive/src/kxv.c           |   36 ++++++++++++++++++------------------
 hw/xfree86/common/xf86fbman.c |   30 +++++++++++++++---------------
 hw/xfree86/common/xf86xv.c    |   30 +++++++++++++++---------------
 hw/xfree86/dri2/dri2.c        |    6 +++---
 hw/xfree86/modes/xf86Crtc.c   |    2 +-
 hw/xfree86/modes/xf86Rotate.c |    4 ++--
 hw/xfree86/xaa/xaaBitBlt.c    |    6 +++---
 hw/xnest/Events.c             |    2 +-
 hw/xnest/GC.c                 |    2 +-
 hw/xnest/GCOps.c              |    4 ++--
 hw/xnest/Pixmap.c             |    4 ++--
 hw/xnest/Window.c             |    4 ++--
 include/regionstr.h           |   26 ++++++--------------------
 mi/mibitblt.c                 |    8 ++++----
 mi/micopy.c                   |    2 +-
 mi/miexpose.c                 |   10 +++++-----
 mi/migc.c                     |    6 +++---
 mi/mioverlay.c                |   40 ++++++++++++++++++++--------------------
 mi/miwindow.c                 |   18 +++++++++---------
 miext/cw/cw.c                 |    4 ++--
 miext/damage/damage.c         |    6 +++---
 render/mipict.c               |    4 ++--
 render/picture.c              |    7 ++-----
 xfixes/region.c               |    5 ++---
 39 files changed, 160 insertions(+), 178 deletions(-)

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index 00afe94..ff40dda 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -404,7 +404,7 @@ static void XineramaInitData(ScreenPtr pScreen)
 	TheBox.y1 = pScreen->y;
 	TheBox.y2 = TheBox.y1 + pScreen->height;
 
-	RegionInit(&ScreenRegion, &TheBox, 1);
+	RegionInit(&ScreenRegion, &TheBox);
 	RegionUnion(&PanoramiXScreenRegion, &PanoramiXScreenRegion,
 		     &ScreenRegion);
 	RegionUninit(&ScreenRegion);
@@ -1174,7 +1174,7 @@ XineramaGetImageData(
     SrcBox.x2 = SrcBox.x1 + width;
     SrcBox.y2 = SrcBox.y1 + height;
     
-    RegionInit(&SrcRegion, &SrcBox, 1);
+    RegionInit(&SrcRegion, &SrcBox);
     RegionNull(&GrabRegion);
 
     depth = (format == XYPixmap) ? 1 : pDraw->depth;
@@ -1190,7 +1190,7 @@ XineramaGetImageData(
 	TheBox.y1 = pScreen->y;
 	TheBox.y2 = TheBox.y1 + pScreen->height;
 
-	RegionInit(&ScreenRegion, &TheBox, 1);
+	RegionInit(&ScreenRegion, &TheBox);
 	inOut = RegionContainsRect(&ScreenRegion, &SrcBox);
 	if(inOut == rgnPART)
 	    RegionIntersect(&GrabRegion, &SrcRegion, &ScreenRegion);
diff --git a/Xext/shape.c b/Xext/shape.c
index 115fc07..96f32fc 100644
--- a/Xext/shape.c
+++ b/Xext/shape.c
@@ -171,7 +171,7 @@ RegionOperate (
 	break;
     case ShapeInvert:
 	if (!*destRgnp)
-	    *destRgnp = RegionCreate((BoxPtr) 0, 0);
+	    *destRgnp = RegionCreate((BoxPtr) 0);
 	else
 	    RegionSubtract(*destRgnp, srcRgn, *destRgnp);
 	break;
@@ -195,7 +195,7 @@ CreateBoundingShape (WindowPtr pWin)
     extents.y1 = -wBorderWidth (pWin);
     extents.x2 = pWin->drawable.width + wBorderWidth (pWin);
     extents.y2 = pWin->drawable.height + wBorderWidth (pWin);
-    return RegionCreate(&extents, 1);
+    return RegionCreate(&extents);
 }
 
 RegionPtr
@@ -207,7 +207,7 @@ CreateClipShape (WindowPtr pWin)
     extents.y1 = 0;
     extents.x2 = pWin->drawable.width;
     extents.y2 = pWin->drawable.height;
-    return RegionCreate(&extents, 1);
+    return RegionCreate(&extents);
 }
 
 static int
@@ -504,7 +504,7 @@ ProcShapeCombine (ClientPtr client)
     }
 
     if (srcRgn) {
-        tmp = RegionCreate((BoxPtr) 0, 0);
+        tmp = RegionCreate((BoxPtr) 0);
         RegionCopy(tmp, srcRgn);
         srcRgn = tmp;
     } else
diff --git a/Xext/xace.c b/Xext/xace.c
index c757cad..822d5d1 100644
--- a/Xext/xace.c
+++ b/Xext/xace.c
@@ -232,7 +232,7 @@ XaceCensorImage(
     imageBox.y1 = y;
     imageBox.x2 = x + w;
     imageBox.y2 = y + h;
-    RegionInit(&imageRegion, &imageBox, 1);
+    RegionInit(&imageRegion, &imageBox);
     RegionNull(&censorRegion);
 
     /* censorRegion = imageRegion - visibleRegion */
diff --git a/dix/region.c b/dix/region.c
index 6820c1e..614581b 100644
--- a/dix/region.c
+++ b/dix/region.c
@@ -235,7 +235,7 @@ InitRegions (void)
  *****************************************************************/
 
 RegionPtr
-RegionCreate(BoxPtr rect, int size)
+RegionCreate(BoxPtr rect)
 {
     RegionPtr pReg;
    
@@ -243,7 +243,7 @@ RegionCreate(BoxPtr rect, int size)
     if (!pReg)
 	return &RegionBrokenRegion;
 
-    RegionInit (pReg, rect, size);
+    RegionInit (pReg, rect);
     
     return pReg;
 }
@@ -1355,7 +1355,7 @@ RegionFromRects(int nrects, xRectangle *prect, int ctype)
     int        		i;
     int			x1, y1, x2, y2;
 
-    pRgn = RegionCreate(NullBox, 0);
+    pRgn = RegionCreate(NullBox);
     if (RegionNar (pRgn))
 	return pRgn;
     if (!nrects)
diff --git a/dix/window.c b/dix/window.c
index cd28d05..b2bdba2 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -418,10 +418,10 @@ CreateRootWindow(ScreenPtr pScreen)
     box.y1 = 0;
     box.x2 = pScreen->width;
     box.y2 = pScreen->height;
-    RegionInit(&pWin->clipList, &box, 1);
-    RegionInit(&pWin->winSize, &box, 1);
-    RegionInit(&pWin->borderSize, &box, 1);
-    RegionInit(&pWin->borderClip, &box, 1);
+    RegionInit(&pWin->clipList, &box);
+    RegionInit(&pWin->winSize, &box);
+    RegionInit(&pWin->borderSize, &box);
+    RegionInit(&pWin->borderClip, &box);
 
     pWin->drawable.class = InputOutput;
     pWin->optional->visual = pScreen->rootVisual;
@@ -1857,7 +1857,7 @@ MakeBoundingRegion (
     WindowPtr	pWin,
     BoxPtr	pBox)
 {
-    RegionPtr	pRgn = RegionCreate(pBox, 1);
+    RegionPtr	pRgn = RegionCreate(pBox);
     if (wBoundingShape (pWin)) {
 	RegionTranslate(pRgn, -pWin->origin.x, -pWin->origin.y);
 	RegionIntersect(pRgn, pRgn, wBoundingShape (pWin));
@@ -3034,7 +3034,7 @@ PointInWindowIsVisible(WindowPtr pWin, int x, int y)
 RegionPtr
 NotClippedByChildren(WindowPtr pWin)
 {
-    RegionPtr pReg = RegionCreate(NullBox, 1);
+    RegionPtr pReg = RegionCreate(NullBox);
     if (pWin->parent ||
 	screenIsSaved != SCREEN_SAVER_ON ||
 	!HasSaverWindow (pWin->drawable.pScreen))
@@ -3721,7 +3721,7 @@ SetRootClip(ScreenPtr pScreen, Bool enable)
 	    {
 		RegionPtr	borderVisible;
 
-		borderVisible = RegionCreate(NullBox, 1);
+		borderVisible = RegionCreate(NullBox);
 		RegionSubtract(borderVisible,
 				&pWin->borderClip, &pWin->winSize);
 		pWin->valdata->before.borderVisible = borderVisible;
@@ -3741,8 +3741,8 @@ SetRootClip(ScreenPtr pScreen, Bool enable)
 	box.y1 = 0;
 	box.x2 = pScreen->width;
 	box.y2 = pScreen->height;
-	RegionInit(&pWin->winSize, &box, 1);
-	RegionInit(&pWin->borderSize, &box, 1);
+	RegionInit(&pWin->winSize, &box);
+	RegionInit(&pWin->borderSize, &box);
 	if (WasViewable)
 	    RegionReset(&pWin->borderClip, &box);
 	pWin->drawable.width = pScreen->width;
diff --git a/exa/exa.c b/exa/exa.c
index a4e294a..78cf7fb 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -158,7 +158,7 @@ exaPixmapDirty (PixmapPtr pPix, int x1, int y1, int x2, int y2)
     if (box.x1 >= box.x2 || box.y1 >= box.y2)
 	return;
 
-    RegionInit(&region, &box, 1);
+    RegionInit(&region, &box);
     DamageDamageRegion(&pPix->drawable, &region);
     RegionUninit(&region);
 }
diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index b4c0f83..dfd4579 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -422,7 +422,7 @@ exaHWCopyNtoN (DrawablePtr    pSrcDrawable,
 	if (!pGC || !exaGCReadsDestination(pDstDrawable, pGC->planemask,
 					   pGC->fillStyle, pGC->alu,
 					   pGC->clientClipType)) {
-	    dstregion = RegionCreate(NullBox, 0);
+	    dstregion = RegionCreate(NullBox);
 	    RegionCopy(dstregion, srcregion);
 	    RegionTranslate(dstregion, dst_off_x - dx - src_off_x,
 			     dst_off_y - dy - src_off_y);
@@ -966,7 +966,7 @@ exaCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
     dy = ptOldOrg.y - pWin->drawable.y;
     RegionTranslate(prgnSrc, -dx, -dy);
 
-    RegionInit(&rgnDst, NullBox, 0);
+    RegionInit(&rgnDst, NullBox);
 
     RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc);
 #ifdef COMPOSITE
diff --git a/exa/exa_classic.c b/exa/exa_classic.c
index 169ce3a..7328247 100644
--- a/exa/exa_classic.c
+++ b/exa/exa_classic.c
@@ -131,8 +131,8 @@ exaCreatePixmap_classic(ScreenPtr pScreen, int w, int h, int depth,
     box.y1 = 0;
     box.x2 = w;
     box.y2 = h;
-    RegionInit(&pExaPixmap->validSys, &box, 0);
-    RegionInit(&pExaPixmap->validFB, &box, 0);
+    RegionInit(&pExaPixmap->validSys, &box);
+    RegionInit(&pExaPixmap->validFB, &box);
 
     exaSetAccelBlock(pExaScr, pExaPixmap,
                      w, h, bpp);
diff --git a/exa/exa_migration_classic.c b/exa/exa_migration_classic.c
index 6c49fb7..a8ce687 100644
--- a/exa/exa_migration_classic.c
+++ b/exa/exa_migration_classic.c
@@ -180,7 +180,7 @@ exaCopyDirty(ExaMigrationPtr migrate, RegionPtr pValidDst, RegionPtr pValidSrc,
 		box.x2 = max(pValidExt->x2, pDamageExt->x2);
 		box.y2 = max(pValidExt->y2, pDamageExt->y2);
 
-		RegionInit(&closure, &box, 0);
+		RegionInit(&closure, &box);
 		RegionIntersect(&CopyReg, &CopyReg, &closure);
 	    } else
 		RegionIntersect(&CopyReg, &CopyReg, pending_damage);
diff --git a/exa/exa_render.c b/exa/exa_render.c
index 6f2af8a..795ba62 100644
--- a/exa/exa_render.c
+++ b/exa/exa_render.c
@@ -575,7 +575,7 @@ exaCompositeRects(CARD8	              op,
 	 * (see use of DamagePendingRegion in exaCopyDirty)
 	 */
 
-	RegionInit(&region, &box, 1);
+	RegionInit(&region, &box);
     
 	DamageRegionAppend(pDst->pDrawable, &region);
 
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index fe0680d..bf34759 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -188,7 +188,7 @@ ExaFallbackPrepareReg(DrawablePtr pDrawable,
 	box.x2 = box.x1 + width;
 	box.y2 = box.y1 + height;
 
-	RegionInit(&reg, &box, 1);
+	RegionInit(&reg, &box);
 	pExaScr->prepare_access_reg(pPixmap, index, &reg);
 	RegionUninit(&reg);
     } else
@@ -459,7 +459,7 @@ ExaSrcValidate(DrawablePtr pDrawable,
     dst = (pExaScr->srcPix == pPix) ? &pExaScr->srcReg :
 	&pExaScr->maskReg;
 
-    RegionInit(&reg, &box, 1);
+    RegionInit(&reg, &box);
     RegionUnion(dst, dst, &reg);
     RegionUninit(&reg);
 
diff --git a/fb/fboverlay.c b/fb/fboverlay.c
index 7fca89c..f42976d 100644
--- a/fb/fboverlay.c
+++ b/fb/fboverlay.c
@@ -146,7 +146,7 @@ fbOverlayCreateScreenResources(ScreenPtr pScreen)
 					    pbits))
 	    return FALSE;
 	pScrPriv->layer[i].u.run.pixmap = pPixmap;
-	RegionInit(&pScrPriv->layer[i].u.run.region, &box, 0);
+	RegionInit(&pScrPriv->layer[i].u.run.region, &box);
     }
     pScreen->devPrivate = pScrPriv->layer[0].u.run.pixmap;
     return TRUE;
diff --git a/fb/fbpixmap.c b/fb/fbpixmap.c
index 41b12ce..6d6260f 100644
--- a/fb/fbpixmap.c
+++ b/fb/fbpixmap.c
@@ -153,7 +153,7 @@ fbPixmapToRegion(PixmapPtr pPix)
     FbBits		*pwLine;
     int			nWidth;
     
-    pReg = RegionCreate(NULL, 1);
+    pReg = RegionCreate(NULL);
     if(!pReg)
 	return NullRegion;
     FirstRect = RegionBoxptr(pReg);
diff --git a/hw/dmx/dmxgcops.c b/hw/dmx/dmxgcops.c
index 500e2cd..5c633f1 100644
--- a/hw/dmx/dmxgcops.c
+++ b/hw/dmx/dmxgcops.c
@@ -127,9 +127,9 @@ void dmxPutImage(DrawablePtr pDrawable, GCPtr pGC,
 	    box.y1 = y;
 	    box.x2 = x + w;
 	    box.y2 = y + h;
-	    pSubImages = RegionCreate(&box, 1);
+	    pSubImages = RegionCreate(&box);
 
-	    pClip = RegionCreate(NullBox, 1);
+	    pClip = RegionCreate(NullBox);
 	    RegionCopy(pClip, pGC->pCompositeClip);
 	    RegionTranslate(pClip,
 			     -pDrawable->x, -pDrawable->y);
diff --git a/hw/dmx/dmxpixmap.c b/hw/dmx/dmxpixmap.c
index 81b7115..83b487e 100644
--- a/hw/dmx/dmxpixmap.c
+++ b/hw/dmx/dmxpixmap.c
@@ -199,7 +199,7 @@ RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap)
     Bool           overlap;
   
     if (!dmxScreen->beDisplay) {
-	pReg = RegionCreate(NullBox, 1);
+	pReg = RegionCreate(NullBox);
 	return pReg;
     }
 
@@ -207,8 +207,8 @@ RegionPtr dmxBitmapToRegion(PixmapPtr pPixmap)
 		       pPixmap->drawable.width, pPixmap->drawable.height,
 		       1, XYPixmap);
 
-    pReg = RegionCreate(NullBox, 1);
-    pTmpReg = RegionCreate(NullBox, 1);
+    pReg = RegionCreate(NullBox);
+    pTmpReg = RegionCreate(NullBox);
     if(!pReg || !pTmpReg) {
 	XDestroyImage(ximage);
 	return NullRegion;
diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c
index 50dc235..e1144dc 100644
--- a/hw/kdrive/src/kxv.c
+++ b/hw/kdrive/src/kxv.c
@@ -606,7 +606,7 @@ KdXVUpdateCompositeClip(XvPortRecPrivatePtr portPriv)
 	return;
    }
 
-   pCompositeClip = RegionCreate(NullBox, 1);
+   pCompositeClip = RegionCreate(NullBox);
    RegionCopy(pCompositeClip, portPriv->clientClip);
    RegionTranslate(pCompositeClip,
 			portPriv->pDraw->x + portPriv->clipOrg.x,
@@ -632,7 +632,7 @@ KdXVCopyClip(
     /* copy the new clip if it exists */
     if((pGC->clientClipType == CT_REGION) && pGC->clientClip) {
 	if(!portPriv->clientClip)
-	    portPriv->clientClip = RegionCreate(NullBox, 1);
+	    portPriv->clientClip = RegionCreate(NullBox);
 	/* Note: this is in window coordinates */
 	RegionCopy(portPriv->clientClip, pGC->clientClip);
     } else if(portPriv->clientClip) { /* free the old clientClip */
@@ -669,8 +669,8 @@ KdXVRegetVideo(XvPortRecPrivatePtr portPriv)
   WinBox.y2 = WinBox.y1 + portPriv->drw_h;
 
   /* clip to the window composite clip */
-  RegionInit(&WinRegion, &WinBox, 1);
-  RegionInit(&ClipRegion, NullBox, 1);
+  RegionInit(&WinRegion, &WinBox);
+  RegionInit(&ClipRegion, NullBox);
   RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip);
 
   /* that's all if it's totally obscured */
@@ -733,8 +733,8 @@ KdXVReputVideo(XvPortRecPrivatePtr portPriv)
   WinBox.y2 = WinBox.y1 + portPriv->drw_h;
 
   /* clip to the window composite clip */
-  RegionInit(&WinRegion, &WinBox, 1);
-  RegionInit(&ClipRegion, NullBox, 1);
+  RegionInit(&WinRegion, &WinBox);
+  RegionInit(&ClipRegion, NullBox);
   RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip);
 
   /* clip and translate to the viewport */
@@ -747,7 +747,7 @@ KdXVReputVideo(XvPortRecPrivatePtr portPriv)
      VPBox.x2 = screen->width;
      VPBox.y2 = screen->height;
 
-     RegionInit(&VPReg, &VPBox, 1);
+     RegionInit(&VPReg, &VPBox);
      RegionIntersect(&ClipRegion, &ClipRegion, &VPReg);
      RegionUninit(&VPReg);
   }
@@ -822,8 +822,8 @@ KdXVReputImage(XvPortRecPrivatePtr portPriv)
   WinBox.y2 = WinBox.y1 + portPriv->drw_h;
 
   /* clip to the window composite clip */
-  RegionInit(&WinRegion, &WinBox, 1);
-  RegionInit(&ClipRegion, NullBox, 1);
+  RegionInit(&WinRegion, &WinBox);
+  RegionInit(&ClipRegion, NullBox);
   RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip);
 
   /* clip and translate to the viewport */
@@ -836,7 +836,7 @@ KdXVReputImage(XvPortRecPrivatePtr portPriv)
      VPBox.x2 = screen->width;
      VPBox.y2 = screen->height;
 
-     RegionInit(&VPReg, &VPBox, 1);
+     RegionInit(&VPReg, &VPBox);
      RegionIntersect(&ClipRegion, &ClipRegion, &VPReg);
      RegionUninit(&VPReg);
   }
@@ -1329,8 +1329,8 @@ KdXVPutStill(
   WinBox.x2 = WinBox.x1 + drw_w;
   WinBox.y2 = WinBox.y1 + drw_h;
 
-  RegionInit(&WinRegion, &WinBox, 1);
-  RegionInit(&ClipRegion, NullBox, 1);
+  RegionInit(&WinRegion, &WinBox);
+  RegionInit(&ClipRegion, NullBox);
   RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip);
 
   if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
@@ -1342,7 +1342,7 @@ KdXVPutStill(
      VPBox.x2 = screen->width;
      VPBox.y2 = screen->height;
 
-     RegionInit(&VPReg, &VPBox, 1);
+     RegionInit(&VPReg, &VPBox);
      RegionIntersect(&ClipRegion, &ClipRegion, &VPReg);
      RegionUninit(&VPReg);
   }
@@ -1482,8 +1482,8 @@ KdXVGetStill(
   WinBox.x2 = WinBox.x1 + drw_w;
   WinBox.y2 = WinBox.y1 + drw_h;
 
-  RegionInit(&WinRegion, &WinBox, 1);
-  RegionInit(&ClipRegion, NullBox, 1);
+  RegionInit(&WinRegion, &WinBox);
+  RegionInit(&ClipRegion, NullBox);
   RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip);
 
   if(portPriv->pDraw) {
@@ -1629,8 +1629,8 @@ KdXVPutImage(
   WinBox.x2 = WinBox.x1 + drw_w;
   WinBox.y2 = WinBox.y1 + drw_h;
 
-  RegionInit(&WinRegion, &WinBox, 1);
-  RegionInit(&ClipRegion, NullBox, 1);
+  RegionInit(&WinRegion, &WinBox);
+  RegionInit(&ClipRegion, NullBox);
   RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip);
 
   if(portPriv->AdaptorRec->flags & VIDEO_CLIP_TO_VIEWPORT) {
@@ -1642,7 +1642,7 @@ KdXVPutImage(
      VPBox.x2 = pScreen->width;
      VPBox.y2 = pScreen->height;
 
-     RegionInit(&VPReg, &VPBox, 1);
+     RegionInit(&VPReg, &VPBox);
      RegionIntersect(&ClipRegion, &ClipRegion, &VPReg);
      RegionUninit(&VPReg);
   }
diff --git a/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c
index e60e5c4..c5fdb6c 100644
--- a/hw/xfree86/common/xf86fbman.c
+++ b/hw/xfree86/common/xf86fbman.c
@@ -412,7 +412,7 @@ AllocateArea(
 
 	   /* bye, bye */
 	   (*link->area.RemoveAreaCallback)(&link->area);
-	   RegionInit(&NewReg, &(link->area.box), 1);
+	   RegionInit(&NewReg, &(link->area.box));
 	   RegionUnion(offman->FreeBoxes, offman->FreeBoxes, &NewReg);
 	   RegionUninit(&NewReg);
 
@@ -432,7 +432,7 @@ AllocateArea(
 	area->RemoveAreaCallback = removeCB;
 	area->devPrivate.ptr = privData;
 
-        RegionInit(&NewReg, &(area->box), 1);
+        RegionInit(&NewReg, &(area->box));
 	RegionSubtract(offman->FreeBoxes, offman->FreeBoxes, &NewReg);
 	RegionUninit(&NewReg);
    }
@@ -482,7 +482,7 @@ localFreeOffscreenArea(FBAreaPtr area)
    }
 
    /* put the area back into the pool */
-   RegionInit(&FreedRegion, &(pLink->area.box), 1);
+   RegionInit(&FreedRegion, &(pLink->area.box));
    RegionUnion(offman->FreeBoxes, offman->FreeBoxes, &FreedRegion);
    RegionUninit(&FreedRegion);
 
@@ -541,8 +541,8 @@ localResizeOffscreenArea(
 	   (resize->box.x2 == OrigArea.x2))
 		return TRUE;
 
-	RegionInit(&FreedReg, &OrigArea, 1);
-	RegionInit(&NewReg, &(resize->box), 1);
+	RegionInit(&FreedReg, &OrigArea);
+	RegionInit(&NewReg, &(resize->box));
 	RegionSubtract(&FreedReg, &FreedReg, &NewReg);
 	RegionUnion(offman->FreeBoxes, offman->FreeBoxes, &FreedReg);
 	RegionUninit(&FreedReg);
@@ -556,7 +556,7 @@ localResizeOffscreenArea(
 
    /* otherwise we remove the old region */
 
-   RegionInit(&FreedReg, &OrigArea, 1);
+   RegionInit(&FreedReg, &OrigArea);
    RegionUnion(offman->FreeBoxes, offman->FreeBoxes, &FreedReg);
   
    /* remove the old link */
@@ -641,13 +641,13 @@ localQueryLargestOffscreenArea(
 	if(offman->NumUsedAreas) {
 	    FBLinkPtr pLink;
 	    RegionRec tmpRegion;
-	    newRegion = RegionCreate(NULL, 1);
+	    newRegion = RegionCreate(NULL);
 	    RegionCopy(newRegion, offman->InitialBoxes);
 	    pLink = offman->UsedAreas;
 
 	    while(pLink) {
 		if(!pLink->area.RemoveAreaCallback) {
-		    RegionInit(&tmpRegion, &(pLink->area.box), 1);
+		    RegionInit(&tmpRegion, &(pLink->area.box));
 		    RegionSubtract(newRegion, newRegion, &tmpRegion);
 		    RegionUninit(&tmpRegion);
 		}
@@ -662,13 +662,13 @@ localQueryLargestOffscreenArea(
 	if(offman->NumUsedAreas) {
 	    FBLinkPtr pLink;
 	    RegionRec tmpRegion;
-	    newRegion = RegionCreate(NULL, 1);
+	    newRegion = RegionCreate(NULL);
 	    RegionCopy(newRegion, offman->FreeBoxes);
 	    pLink = offman->UsedAreas;
 
 	    while(pLink) {
 		if(pLink->area.RemoveAreaCallback) {
-		    RegionInit(&tmpRegion, &(pLink->area.box), 1);
+		    RegionInit(&tmpRegion, &(pLink->area.box));
 		    RegionAppend(newRegion, &tmpRegion);
 		    RegionUninit(&tmpRegion);
 		}
@@ -746,7 +746,7 @@ localPurgeUnlockedOffscreenAreas(ScreenPtr pScreen)
 	if(pLink->area.RemoveAreaCallback) {
 	    (*pLink->area.RemoveAreaCallback)(&pLink->area);
 
-	    RegionInit(&FreedRegion, &(pLink->area.box), 1);
+	    RegionInit(&FreedRegion, &(pLink->area.box));
 	    RegionAppend(offman->FreeBoxes, &FreedRegion);
 	    RegionUninit(&FreedRegion);
 
@@ -1211,8 +1211,8 @@ xf86InitFBManager(
    if (FullBox->y2 < FullBox->y1) return FALSE;
    if (FullBox->x2 < FullBox->x1) return FALSE;
 
-   RegionInit(&ScreenRegion, &ScreenBox, 1);
-   RegionInit(&FullRegion, FullBox, 1);
+   RegionInit(&ScreenRegion, &ScreenBox);
+   RegionInit(&FullRegion, FullBox);
 
    RegionSubtract(&FullRegion, &FullRegion, &ScreenRegion);
 
@@ -1340,8 +1340,8 @@ xf86InitFBManagerRegion(
    offman->CloseScreen = pScreen->CloseScreen;
    pScreen->CloseScreen = xf86FBCloseScreen;
 
-   offman->InitialBoxes = RegionCreate(NULL, 1);
-   offman->FreeBoxes = RegionCreate(NULL, 1);
+   offman->InitialBoxes = RegionCreate(NULL);
+   offman->FreeBoxes = RegionCreate(NULL);
 
    RegionCopy(offman->InitialBoxes, FullRegion);
    RegionCopy(offman->FreeBoxes, FullRegion);
diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c
index 53ebe8f..bb012d4 100644
--- a/hw/xfree86/common/xf86xv.c
+++ b/hw/xfree86/common/xf86xv.c
@@ -665,7 +665,7 @@ xf86XVUpdateCompositeClip(XvPortRecPrivatePtr portPriv)
 	return;
    }
 
-   pCompositeClip = RegionCreate(NullBox, 1);
+   pCompositeClip = RegionCreate(NullBox);
    RegionCopy(pCompositeClip, portPriv->clientClip);
    RegionTranslate(pCompositeClip,
 		   portPriv->pDraw->x, portPriv->pDraw->y);
@@ -690,7 +690,7 @@ xf86XVCopyClip(
     /* copy the new clip if it exists */
     if((pGC->clientClipType == CT_REGION) && pGC->clientClip) {
 	if(!portPriv->clientClip)
-	    portPriv->clientClip = RegionCreate(NullBox, 1);
+	    portPriv->clientClip = RegionCreate(NullBox);
 	/* Note: this is in window coordinates */
 	RegionCopy(portPriv->clientClip, pGC->clientClip);
 	RegionTranslate(portPriv->clientClip,
@@ -716,7 +716,7 @@ xf86XVCopyCompositeClip(XvPortRecPrivatePtr portPriv,
 			DrawablePtr pDraw)
 {
     if (!portPriv->clientClip)
-	portPriv->clientClip = RegionCreate(NullBox, 1);
+	portPriv->clientClip = RegionCreate(NullBox);
     /* Keep the original GC composite clip around for ReputImage */
     RegionCopy(portPriv->clientClip, pGC->pCompositeClip);
     RegionTranslate(portPriv->clientClip,
@@ -749,7 +749,7 @@ xf86XVRegetVideo(XvPortRecPrivatePtr portPriv)
   WinBox.y2 = WinBox.y1 + portPriv->drw_h;
 
   /* clip to the window composite clip */
-  RegionInit(&WinRegion, &WinBox, 1);
+  RegionInit(&WinRegion, &WinBox);
   RegionNull(&ClipRegion);
   RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip);
 
@@ -811,7 +811,7 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv)
   WinBox.y2 = WinBox.y1 + portPriv->drw_h;
 
   /* clip to the window composite clip */
-  RegionInit(&WinRegion, &WinBox, 1);
+  RegionInit(&WinRegion, &WinBox);
   RegionNull(&ClipRegion);
   RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip);
 
@@ -825,7 +825,7 @@ xf86XVReputVideo(XvPortRecPrivatePtr portPriv)
      VPBox.x2 = portPriv->pScrn->frameX1 + 1;
      VPBox.y2 = portPriv->pScrn->frameY1 + 1;
 
-     RegionInit(&VPReg, &VPBox, 1);
+     RegionInit(&VPReg, &VPBox);
      RegionIntersect(&ClipRegion, &ClipRegion, &VPReg);
      RegionUninit(&VPReg);
   }
@@ -904,7 +904,7 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv)
   WinBox.y2 = WinBox.y1 + portPriv->drw_h;
 
   /* clip to the window composite clip */
-  RegionInit(&WinRegion, &WinBox, 1);
+  RegionInit(&WinRegion, &WinBox);
   RegionNull(&ClipRegion);
   RegionIntersect(&ClipRegion, &WinRegion, portPriv->pCompositeClip);
 
@@ -918,7 +918,7 @@ xf86XVReputImage(XvPortRecPrivatePtr portPriv)
      VPBox.x2 = portPriv->pScrn->frameX1 + 1;
      VPBox.y2 = portPriv->pScrn->frameY1 + 1;
 
-     RegionInit(&VPReg, &VPBox, 1);
+     RegionInit(&VPReg, &VPBox);
      RegionIntersect(&ClipRegion, &ClipRegion, &VPReg);
      RegionUninit(&VPReg);
   }
@@ -1507,7 +1507,7 @@ xf86XVPutStill(
 
   xf86XVCopyCompositeClip(portPriv, pGC, pDraw);
 
-  RegionInit(&WinRegion, &WinBox, 1);
+  RegionInit(&WinRegion, &WinBox);
   RegionNull(&ClipRegion);
   RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip);
 
@@ -1520,7 +1520,7 @@ xf86XVPutStill(
      VPBox.x2 = portPriv->pScrn->frameX1 + 1;
      VPBox.y2 = portPriv->pScrn->frameY1 + 1;
 
-     RegionInit(&VPReg, &VPBox, 1);
+     RegionInit(&VPReg, &VPBox);
      RegionIntersect(&ClipRegion, &ClipRegion, &VPReg);
      RegionUninit(&VPReg);
   }
@@ -1662,7 +1662,7 @@ xf86XVGetStill(
   WinBox.x2 = WinBox.x1 + drw_w;
   WinBox.y2 = WinBox.y1 + drw_h;
 
-  RegionInit(&WinRegion, &WinBox, 1);
+  RegionInit(&WinRegion, &WinBox);
   RegionNull(&ClipRegion);
   RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip);
 
@@ -1809,7 +1809,7 @@ xf86XVPutImage(
   WinBox.x2 = WinBox.x1 + drw_w;
   WinBox.y2 = WinBox.y1 + drw_h;
 
-  RegionInit(&WinRegion, &WinBox, 1);
+  RegionInit(&WinRegion, &WinBox);
   RegionNull(&ClipRegion);
   RegionIntersect(&ClipRegion, &WinRegion, pGC->pCompositeClip);
 
@@ -1822,7 +1822,7 @@ xf86XVPutImage(
      VPBox.x2 = portPriv->pScrn->frameX1 + 1;
      VPBox.y2 = portPriv->pScrn->frameY1 + 1;
 
-     RegionInit(&VPReg, &VPBox, 1);
+     RegionInit(&VPReg, &VPBox);
      RegionIntersect(&ClipRegion, &ClipRegion, &VPReg);
      RegionUninit(&VPReg);
   }
@@ -1973,7 +1973,7 @@ xf86XVFillKeyHelperPort (DrawablePtr pDraw, pointer data, CARD32 key, RegionPtr
 	return;
 
     if (!portPriv->ckeyFilled)
-	portPriv->ckeyFilled = RegionCreate(NULL, 0);
+	portPriv->ckeyFilled = RegionCreate(NULL);
 
     if (!fillEverything) {
 	RegionNull(&reg);
@@ -2079,7 +2079,7 @@ xf86XVClipVideoHelper(
 	(dst->y1 > extents->y1) || (dst->y2 < extents->y2))
     {
 	RegionRec clipReg;
-	RegionInit(&clipReg, dst, 1);
+	RegionInit(&clipReg, dst);
 	RegionIntersect(reg, reg, &clipReg);
 	RegionUninit(&clipReg);
     }
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 9ca378f..7b2a631 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -484,7 +484,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height,
 	box.y1 = 0;
 	box.x2 = pPriv->width;
 	box.y2 = pPriv->height;
-	RegionInit(&region, &box, 0);
+	RegionInit(&region, &box);
 
 	DRI2CopyRegion(pDraw, &region, DRI2BufferFakeFrontLeft,
 		       DRI2BufferFrontLeft);
@@ -744,7 +744,7 @@ DRI2SwapComplete(ClientPtr client, DrawablePtr pDraw, int frame,
     box.y1 = 0;
     box.x2 = pDraw->width;
     box.y2 = pDraw->height;
-    RegionInit(&region, &box, 0);
+    RegionInit(&region, &box);
     DRI2CopyRegion(pDraw, &region, DRI2BufferFakeFrontLeft,
 		   DRI2BufferFrontLeft);
 
@@ -817,7 +817,7 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
 	box.y1 = 0;
 	box.x2 = pDraw->width;
 	box.y2 = pDraw->height;
-	RegionInit(&region, &box, 0);
+	RegionInit(&region, &box);
 
 	pPriv->swapsPending++;
 
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index c2814d4..26a179f 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -3162,7 +3162,7 @@ xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn,
 						  &crtc_box);
 
 	if (crtc) {
-	    RegionInit(&crtc_region_local, &crtc_box, 1);
+	    RegionInit(&crtc_region_local, &crtc_box);
 	    crtc_region = &crtc_region_local;
 	    RegionIntersect(crtc_region, crtc_region, reg);
 	}
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 57c3499..b8a204f 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -167,7 +167,7 @@ xf86CrtcDamageShadow (xf86CrtcPtr crtc)
     if (damage_box.y1 < 0) damage_box.y1 = 0;
     if (damage_box.x2 > pScreen->width) damage_box.x2 = pScreen->width;
     if (damage_box.y2 > pScreen->height) damage_box.y2 = pScreen->height;
-    RegionInit(&damage_region, &damage_box, 1);
+    RegionInit(&damage_region, &damage_box);
     DamageDamageRegion (&(*pScreen->GetScreenPixmap)(pScreen)->drawable,
 			&damage_region);
     RegionUninit(&damage_region);
@@ -240,7 +240,7 @@ xf86RotateRedisplay(ScreenPtr pScreen)
 		RegionRec   crtc_damage;
 
 		/* compute portion of damage that overlaps crtc */
-		RegionInit(&crtc_damage, &crtc->bounds, 1);
+		RegionInit(&crtc_damage, &crtc->bounds);
 		RegionIntersect(&crtc_damage, &crtc_damage, region);
 		
 		/* update damaged region */
diff --git a/hw/xfree86/xaa/xaaBitBlt.c b/hw/xfree86/xaa/xaaBitBlt.c
index 049dbfb..47054e5 100644
--- a/hw/xfree86/xaa/xaaBitBlt.c
+++ b/hw/xfree86/xaa/xaaBitBlt.c
@@ -118,7 +118,7 @@ XAABitBlt(
 	    fastExpose = 0;
 	}
     } else {
-	RegionInit(&rgnDst, &fastBox, 1);
+	RegionInit(&rgnDst, &fastBox);
 	RegionIntersect(&rgnDst, &rgnDst, prgnSrcClip);
     }
 
@@ -165,14 +165,14 @@ XAABitBlt(
 	    if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) {
 		RegionNull(&rgnDst);
 	    } else {
-		RegionInit(&rgnDst, &fastBox, 1);
+		RegionInit(&rgnDst, &fastBox);
 	    }
 	} else {
 	    /* We must turn off fastClip now, since we must create
 	       a full blown region.  It is intersected with the
 	       composite clip below. */
 	    fastClip = 0;
-	    RegionInit(&rgnDst, &fastBox,1);
+	    RegionInit(&rgnDst, &fastBox);
 	}
     } else {
         RegionTranslate(&rgnDst, -dx, -dy);
diff --git a/hw/xnest/Events.c b/hw/xnest/Events.c
index 5ff6d21..5070f1b 100644
--- a/hw/xnest/Events.c
+++ b/hw/xnest/Events.c
@@ -94,7 +94,7 @@ xnestCollectExposures(void)
       Box.x2 = Box.x1 + X.xexpose.width;
       Box.y2 = Box.y1 + X.xexpose.height;
       
-      RegionInit(&Rgn, &Box, 1);
+      RegionInit(&Rgn, &Box);
       
       miSendExposures(pWin, &Rgn, Box.x2, Box.y2);
     }
diff --git a/hw/xnest/GC.c b/hw/xnest/GC.c
index 7968b4f..f0367eb 100644
--- a/hw/xnest/GC.c
+++ b/hw/xnest/GC.c
@@ -325,7 +325,7 @@ xnestCopyClip(GCPtr pGCDst, GCPtr pGCSrc)
       break;
 
     case CT_REGION:
-      pRgn = RegionCreate(NULL, 1);
+      pRgn = RegionCreate(NULL);
       RegionCopy(pRgn, pGCSrc->clientClip);
       xnestChangeClip(pGCDst, CT_REGION, pRgn, 0);
       break;
diff --git a/hw/xnest/GCOps.c b/hw/xnest/GCOps.c
index 829b86b..91e1fb9 100644
--- a/hw/xnest/GCOps.c
+++ b/hw/xnest/GCOps.c
@@ -131,8 +131,8 @@ xnestBitBlitHelper(GCPtr pGC)
     BoxRec Box;
     Bool pending, overlap;
 
-    pReg = RegionCreate(NULL, 1);
-    pTmpReg = RegionCreate(NULL, 1);
+    pReg = RegionCreate(NULL);
+    pTmpReg = RegionCreate(NULL);
     if(!pReg || !pTmpReg) return NullRegion;
     
     pending = True;
diff --git a/hw/xnest/Pixmap.c b/hw/xnest/Pixmap.c
index 3a92ffd..6ea3731 100644
--- a/hw/xnest/Pixmap.c
+++ b/hw/xnest/Pixmap.c
@@ -93,8 +93,8 @@ xnestPixmapToRegion(PixmapPtr pPixmap)
 		     pPixmap->drawable.width, pPixmap->drawable.height,
 		     1, XYPixmap);
   
-  pReg = RegionCreate(NULL, 1);
-  pTmpReg = RegionCreate(NULL, 1);
+  pReg = RegionCreate(NULL);
+  pTmpReg = RegionCreate(NULL);
   if(!pReg || !pTmpReg) {
       XDestroyImage(ximage);
       return NullRegion;
diff --git a/hw/xnest/Window.c b/hw/xnest/Window.c
index 9ed69ed..b362df3 100644
--- a/hw/xnest/Window.c
+++ b/hw/xnest/Window.c
@@ -134,9 +134,9 @@ xnestCreateWindow(WindowPtr pWin)
   if (pWin->nextSib)
     xnestWindowPriv(pWin->nextSib)->sibling_above = xnestWindow(pWin);
   xnestWindowPriv(pWin)->bounding_shape = 
-    RegionCreate(NULL, 1);
+    RegionCreate(NULL);
   xnestWindowPriv(pWin)->clip_shape = 
-    RegionCreate(NULL, 1);
+    RegionCreate(NULL);
 
   if (!pWin->parent) /* only the root window will have the right colormap */
     xnestSetInstalledColormapWindows(pWin->drawable.pScreen);
diff --git a/include/regionstr.h b/include/regionstr.h
index 2448c25..fd52709 100644
--- a/include/regionstr.h
+++ b/include/regionstr.h
@@ -111,25 +111,12 @@ static inline size_t RegionSizeof(int n) {
     return (sizeof(RegDataRec) + ((n) * sizeof(BoxRec)));
 }
 
-static inline void RegionInit(RegionPtr _pReg, BoxPtr _rect, int _size)
+static inline void RegionInit(RegionPtr pReg, BoxPtr rect)
 {
-    if ((_rect) != NULL)
-    {
-        (_pReg)->extents = *(_rect);
-        (_pReg)->data = (RegDataPtr)NULL;
-    }
+    if (rect)
+	pixman_region_init_with_extents (pReg, rect);
     else
-    {
-        (_pReg)->extents = RegionEmptyBox;
-        if (((_size) > 1) && ((_pReg)->data =
-			      (RegDataPtr)malloc(RegionSizeof(_size))))
-        {
-            (_pReg)->data->size = (_size);
-            (_pReg)->data->numRects = 0;
-        }
-        else
-            (_pReg)->data = &RegionEmptyData;
-    }
+	pixman_region_init (pReg);
 }
 
 static inline void RegionInitBoxes(RegionPtr pReg, BoxPtr boxes, int nBoxes)
@@ -182,8 +169,7 @@ static inline void RegionNull(RegionPtr _pReg)
 extern _X_EXPORT void InitRegions(void);
 
 extern _X_EXPORT RegionPtr RegionCreate(
-    BoxPtr /*rect*/,
-    int /*size*/);
+    BoxPtr /* rect */);
 
 extern _X_EXPORT void RegionDestroy(
     RegionPtr /*pReg*/);
@@ -352,7 +338,7 @@ extern _X_EXPORT void RegionPrint(
 #define REGION_VALIDATE(pScreen, r, o)		RegionValidate(r, o)
 #define RECTS_TO_REGION(pScreen, n, r, c)	RegionFromRects(n, r, c)
 #define REGION_BREAK(pScreen, r)		RegionBreak(r)
-#define REGION_INIT(pScreen, r, b, s)		RegionInit(r, b, s)
+#define REGION_INIT(pScreen, r, b, s)		RegionInit(r, b)
 #define REGION_UNINIT(pScreen, r)		RegionUninit(r)
 #define REGION_RESET(pScreen, r, b)		RegionReset(r, b)
 #define REGION_NOTEMPTY(pScreen, r)		RegionNotEmpty(r)
diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index 49e17bd..e509f7a 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -116,7 +116,7 @@ miCopyArea(DrawablePtr  pSrcDrawable,
 	box.x2 = pSrcDrawable->x + (int) pSrcDrawable->width;
 	box.y2 = pSrcDrawable->y + (int) pSrcDrawable->height;
 
-	prgnSrcClip = RegionCreate(&box, 1);
+	prgnSrcClip = RegionCreate(&box);
 	realSrcClip = 1;
     }
     else
@@ -440,7 +440,7 @@ miOpqStipDrawable(DrawablePtr pDraw, GCPtr pGC, RegionPtr prgnSrc,
        to destroy what it's sent.  note that this means we don't
        have to free prgnSrcClip ourselves.
     */
-    prgnSrcClip = RegionCreate(NULL, 0);
+    prgnSrcClip = RegionCreate(NULL);
     RegionCopy(prgnSrcClip, prgnSrc);
     RegionTranslate(prgnSrcClip, srcx, 0);
     (*pGCT->funcs->ChangeClip)(pGCT, CT_REGION, prgnSrcClip, 0);
@@ -575,7 +575,7 @@ miCopyPlane( DrawablePtr pSrcDrawable,
 	box.x2 = box.x1;
     if (box.y1 > box.y2)
 	box.y2 = box.y1;
-    prgnSrc = RegionCreate(&box, 1);
+    prgnSrc = RegionCreate(&box);
 
     if (pSrcDrawable->type != DRAWABLE_PIXMAP) {
 	/* clip to visible drawable */
@@ -758,7 +758,7 @@ miPutImage( DrawablePtr pDraw, GCPtr pGC, int depth,
 	box.y1 = 0;
 	box.x2 = w;
 	box.y2 = h;
-	prgnSrc = RegionCreate(&box, 1);
+	prgnSrc = RegionCreate(&box);
 
         miOpqStipDrawable(pDraw, pGC, prgnSrc, (MiBits *) pImage,
 			  leftPad, w, h, x, y);
diff --git a/mi/micopy.c b/mi/micopy.c
index 652c620..41a3843 100644
--- a/mi/micopy.c
+++ b/mi/micopy.c
@@ -311,7 +311,7 @@ miDoCopy (DrawablePtr	pSrcDrawable,
 	box.y1 = box_y1;
 	box.x2 = box_x2;
 	box.y2 = box_y2;
-	RegionInit(&rgnDst, &box, 1);
+	RegionInit(&rgnDst, &box);
     }
     
     /* Clip against complex source if needed */
diff --git a/mi/miexpose.c b/mi/miexpose.c
index 94258b8..67c6588 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -202,7 +202,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
 	box.x2 = pSrcDrawable->width;
 	box.y2 = pSrcDrawable->height;
 	prgnSrcClip = &rgnSrcRec;
-	RegionInit(prgnSrcClip, &box, 1);
+	RegionInit(prgnSrcClip, &box);
 	pSrcWin = NULL;
     }
 
@@ -235,11 +235,11 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
 	box.x2 = pDstDrawable->width;
 	box.y2 = pDstDrawable->height;
 	prgnDstClip = &rgnDstRec;
-	RegionInit(prgnDstClip, &box, 1);
+	RegionInit(prgnDstClip, &box);
     }
 
     /* drawable-relative source region */
-    RegionInit(&rgnExposed, &srcBox, 1);
+    RegionInit(&rgnExposed, &srcBox);
 
     /* now get the hidden parts of the source box*/
     RegionSubtract(&rgnExposed, &rgnExposed, prgnSrcClip);
@@ -327,7 +327,7 @@ miHandleExposures(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable,
     if (pGC->graphicsExposures)
     {
 	/* don't look */
-	RegionPtr exposed = RegionCreate(NullBox, 0);
+	RegionPtr exposed = RegionCreate(NullBox);
 	*exposed = rgnExposed;
 	return exposed;
     }
@@ -488,7 +488,7 @@ miWindowExposures( WindowPtr pWin, RegionPtr prgn, RegionPtr other_exposed)
 	    box = *RegionExtents(exposures);
 	    if (exposures == prgn) {
 		exposures = &expRec;
-		RegionInit(exposures, &box, 1);
+		RegionInit(exposures, &box);
 		RegionReset(prgn, &box);
 	    } else {
 		RegionReset(exposures, &box);
diff --git a/mi/migc.c b/mi/migc.c
index 6d734e1..3d5848e 100644
--- a/mi/migc.c
+++ b/mi/migc.c
@@ -116,7 +116,7 @@ miCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
 				   pgcSrc->clientClip, 0);
 	break;
       case CT_REGION:
-	prgnNew = RegionCreate(NULL, 1);
+	prgnNew = RegionCreate(NULL);
 	RegionCopy(prgnNew, (RegionPtr) (pgcSrc->clientClip));
 	(*pgcDst->funcs->ChangeClip) (pgcDst, CT_REGION, (pointer) prgnNew, 0);
 	break;
@@ -194,7 +194,7 @@ miComputeCompositeClip( GCPtr pGC, DrawablePtr pDrawable)
 	    }
 	    else
 	    {
-		pGC->pCompositeClip = RegionCreate(NullBox, 0);
+		pGC->pCompositeClip = RegionCreate(NullBox);
 		RegionIntersect(pGC->pCompositeClip,
 				       pregWin, pGC->clientClip);
 	    }
@@ -222,7 +222,7 @@ miComputeCompositeClip( GCPtr pGC, DrawablePtr pDrawable)
 	else
 	{
 	    pGC->freeCompClip = TRUE;
-	    pGC->pCompositeClip = RegionCreate(&pixbounds, 1);
+	    pGC->pCompositeClip = RegionCreate(&pixbounds);
 	}
 
 	if (pGC->clientClipType == CT_REGION)
diff --git a/mi/mioverlay.c b/mi/mioverlay.c
index 766c5e7..e0c032c 100644
--- a/mi/mioverlay.c
+++ b/mi/mioverlay.c
@@ -213,8 +213,8 @@ miOverlayCreateWindow(WindowPtr pWin)
 		fullBox.y1 = 0;
 		fullBox.x2 = pScreen->width;
 		fullBox.y2 = pScreen->height;
-		RegionInit(&(pTree->borderClip), &fullBox, 1);
-		RegionInit(&(pTree->clipList), &fullBox, 1);
+		RegionInit(&(pTree->borderClip), &fullBox);
+		RegionInit(&(pTree->clipList), &fullBox);
 	    }
 	} else free(pTree);
     }
@@ -1030,7 +1030,7 @@ miOverlayWindowExposures(
 	    box = *RegionExtents(exposures);
 	    if (exposures == prgn) {
 		exposures = &expRec;
-		RegionInit(exposures, &box, 1);
+		RegionInit(exposures, &box);
 		RegionReset(prgn, &box);
 	    } else {
 		RegionReset(exposures, &box);
@@ -1152,10 +1152,10 @@ miOverlayResizeWindow(
 	/*
 	 * save the visible region of the window
 	 */
-	oldRegion = RegionCreate(NullBox, 1);
+	oldRegion = RegionCreate(NullBox);
 	RegionCopy(oldRegion, &pWin->winSize);
 	if(doUnderlay) {
-	    oldRegion2 = RegionCreate(NullBox, 1);
+	    oldRegion2 = RegionCreate(NullBox);
 	    RegionCopy(oldRegion2, &pWin->winSize);
 	}
 
@@ -1168,13 +1168,13 @@ miOverlayResizeWindow(
 	    g = pChild->winGravity;
 	    if (g != UnmapGravity) {
 		if (!gravitate[g])
-		    gravitate[g] = RegionCreate(NullBox, 1);
+		    gravitate[g] = RegionCreate(NullBox);
 		RegionUnion(gravitate[g],
 				   gravitate[g], &pChild->borderClip);
 		
 		if(doUnderlay) {
 		    if (!gravitate2[g])
-			gravitate2[g] = RegionCreate(NullBox, 0);
+			gravitate2[g] = RegionCreate(NullBox);
 		
 		    if((tChild = MIOVERLAY_GET_WINDOW_TREE(pChild))) {
 		        RegionUnion(gravitate2[g],
@@ -1191,10 +1191,10 @@ miOverlayResizeWindow(
 
 	oldWinClip = oldWinClip2 = NULL;
 	if (pWin->bitGravity != ForgetGravity) {
-	    oldWinClip = RegionCreate(NullBox, 1);
+	    oldWinClip = RegionCreate(NullBox);
 	    RegionCopy(oldWinClip, &pWin->clipList);
 	    if(pTree) {
-		oldWinClip2 = RegionCreate(NullBox, 1);
+		oldWinClip2 = RegionCreate(NullBox);
 		RegionCopy(oldWinClip2, &pTree->clipList);
 	    }
 	}
@@ -1211,9 +1211,9 @@ miOverlayResizeWindow(
 	if ((pWin->drawable.height != h || pWin->drawable.width != w) &&
 	    HasBorder (pWin))
 	{
-	    borderVisible = RegionCreate(NullBox, 1);
+	    borderVisible = RegionCreate(NullBox);
 	    if(pTree)
-		borderVisible2 = RegionCreate(NullBox, 1);
+		borderVisible2 = RegionCreate(NullBox);
 	    /* for tiled borders, we punt and draw the whole thing */
 	    if (pWin->borderIsPixel || !moved)
 	    {
@@ -1257,7 +1257,7 @@ miOverlayResizeWindow(
     pFirstChange = MoveWindowInStack(pWin, pSib);
 
     if (WasViewable) {
-	pRegion = RegionCreate(NullBox, 1);
+	pRegion = RegionCreate(NullBox);
 
 	(*pScreen->MarkOverlappedWindows)(pWin, pFirstChange, NULL);
 
@@ -1506,7 +1506,7 @@ miOverlaySetShape(WindowPtr pWin, int kind)
             if (HasBorder (pWin)) {
                 RegionPtr borderVisible;
 
-                borderVisible = RegionCreate(NullBox, 1);
+                borderVisible = RegionCreate(NullBox);
                 RegionSubtract(borderVisible,
                                         &pWin->borderClip, &pWin->winSize);
                 pWin->valdata->before.borderVisible = borderVisible;
@@ -1515,7 +1515,7 @@ miOverlaySetShape(WindowPtr pWin, int kind)
                     miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
                     RegionPtr borderVisible2;
 
-                    borderVisible2 = RegionCreate(NULL, 1);
+                    borderVisible2 = RegionCreate(NULL);
                     RegionSubtract(borderVisible2,
                                         &pTree->borderClip, &pWin->winSize);
                     pTree->valdata->borderVisible = borderVisible2;
@@ -1575,7 +1575,7 @@ miOverlayChangeBorderWidth(
 
 	    if (HadBorder) {
 		RegionPtr   borderVisible;
-		borderVisible = RegionCreate(NULL, 1);
+		borderVisible = RegionCreate(NULL);
 		RegionSubtract(borderVisible,
 				      &pWin->borderClip, &pWin->winSize);
 		pWin->valdata->before.borderVisible = borderVisible;
@@ -1583,7 +1583,7 @@ miOverlayChangeBorderWidth(
 		    miOverlayTreePtr pTree = MIOVERLAY_GET_WINDOW_TREE(pWin);
 		    RegionPtr borderVisible2;
 
-		    borderVisible2 = RegionCreate(NULL, 1);
+		    borderVisible2 = RegionCreate(NULL);
 		    RegionSubtract(borderVisible2,
 				      &pTree->borderClip, &pWin->winSize);
 		    pTree->valdata->borderVisible = borderVisible2;
@@ -1671,7 +1671,7 @@ miOverlayClearToBackground(
     box.x1 = x1; box.x2 = x2;
     box.y1 = y1; box.y2 = y2;
 
-    RegionInit(&reg, &box, 1);
+    RegionInit(&reg, &box);
 
     RegionIntersect(&reg, &reg, clipList);
     if (generateExposures)
@@ -1733,7 +1733,7 @@ miOverlayComputeCompositeClip(GCPtr pGC, WindowPtr pWin)
     }
 
     if (pGC->subWindowMode == IncludeInferiors) {
-	pregWin = RegionCreate(NullBox, 1);
+	pregWin = RegionCreate(NullBox);
 	freeTmpClip = TRUE;
 	if (pWin->parent || (screenIsSaved != SCREEN_SAVER_ON) ||
 		!HasSaverWindow (pGC->pScreen))
@@ -1764,7 +1764,7 @@ miOverlayComputeCompositeClip(GCPtr pGC, WindowPtr pWin)
 	    RegionIntersect(pregWin, pregWin, pGC->clientClip);
 	    pGC->pCompositeClip = pregWin;
 	} else {
-	    pGC->pCompositeClip = RegionCreate(NullBox, 0);
+	    pGC->pCompositeClip = RegionCreate(NullBox);
 	    RegionIntersect(pGC->pCompositeClip,
 				       pregWin, pGC->clientClip);
 	}
@@ -1787,7 +1787,7 @@ miOverlayCollectUnderlayRegions(
 	return FALSE;
     }
 
-    *region = RegionCreate(NullBox, 0);
+    *region = RegionCreate(NullBox);
     
     CollectUnderlayChildrenRegions(pWin, *region);
 
diff --git a/mi/miwindow.c b/mi/miwindow.c
index dc5d21a..58d6f51 100644
--- a/mi/miwindow.c
+++ b/mi/miwindow.c
@@ -109,7 +109,7 @@ miClearToBackground(WindowPtr pWin,
     box.y1 = y1;
     box.y2 = y2;
 
-    RegionInit(&reg, &box, 1);
+    RegionInit(&reg, &box);
 
     RegionIntersect(&reg, &reg, &pWin->clipList);
     if (generateExposures)
@@ -274,7 +274,7 @@ miMoveWindow(WindowPtr pWin, int x, int y, WindowPtr pNextSib, VTKind kind)
     oldpt.y = pWin->drawable.y;
     if (WasViewable)
     {
-	oldRegion = RegionCreate(NullBox, 1);
+	oldRegion = RegionCreate(NullBox);
 	RegionCopy(oldRegion, &pWin->borderClip);
 	anyMarked = (*pScreen->MarkOverlappedWindows)(pWin, pWin, &pLayerWin);
     }
@@ -403,7 +403,7 @@ miSlideAndSizeWindow(WindowPtr pWin,
 	/*
 	 * save the visible region of the window
 	 */
-	oldRegion = RegionCreate(NullBox, 1);
+	oldRegion = RegionCreate(NullBox);
 	RegionCopy(oldRegion, &pWin->winSize);
 
 	/*
@@ -417,7 +417,7 @@ miSlideAndSizeWindow(WindowPtr pWin,
 	    if (g != UnmapGravity)
 	    {
 		if (!gravitate[g])
-		    gravitate[g] = RegionCreate(NullBox, 1);
+		    gravitate[g] = RegionCreate(NullBox);
 		RegionUnion(gravitate[g],
 				   gravitate[g], &pChild->borderClip);
 	    }
@@ -433,7 +433,7 @@ miSlideAndSizeWindow(WindowPtr pWin,
 	oldWinClip = NULL;
 	if (pWin->bitGravity != ForgetGravity)
 	{
-	    oldWinClip = RegionCreate(NullBox, 1);
+	    oldWinClip = RegionCreate(NullBox);
 	    RegionCopy(oldWinClip, &pWin->clipList);
 	}
 	/*
@@ -449,7 +449,7 @@ miSlideAndSizeWindow(WindowPtr pWin,
 	if ((pWin->drawable.height != h || pWin->drawable.width != w) &&
 	    HasBorder (pWin))
 	{
-	    borderVisible = RegionCreate(NullBox, 1);
+	    borderVisible = RegionCreate(NullBox);
 	    /* for tiled borders, we punt and draw the whole thing */
 	    if (pWin->borderIsPixel || !moved)
 	    {
@@ -485,7 +485,7 @@ miSlideAndSizeWindow(WindowPtr pWin,
 
     if (WasViewable)
     {
-	pRegion = RegionCreate(NullBox, 1);
+	pRegion = RegionCreate(NullBox);
 
 	if (pLayerWin == pWin)
 	    anyMarked |= (*pScreen->MarkOverlappedWindows)(pWin, pFirstChange,
@@ -702,7 +702,7 @@ miSetShape(WindowPtr pWin, int kind)
                 {
                     RegionPtr borderVisible;
 
-                    borderVisible = RegionCreate(NullBox, 1);
+                    borderVisible = RegionCreate(NullBox);
                     RegionSubtract(borderVisible,
                                     &pWin->borderClip, &pWin->winSize);
                     pWin->valdata->before.borderVisible = borderVisible;
@@ -776,7 +776,7 @@ miChangeBorderWidth(WindowPtr pWin, unsigned int width)
 	    if (pWin->valdata && HadBorder)
 	    {
 		RegionPtr   borderVisible;
-		borderVisible = RegionCreate(NULL, 1);
+		borderVisible = RegionCreate(NULL);
 		RegionSubtract(borderVisible,
 				      &pWin->borderClip, &pWin->winSize);
 		pWin->valdata->before.borderVisible = borderVisible;
diff --git a/miext/cw/cw.c b/miext/cw/cw.c
index 3da3bc3..d37f5dc 100644
--- a/miext/cw/cw.c
+++ b/miext/cw/cw.c
@@ -188,7 +188,7 @@ cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable)
 	ChangeGCVal vals[2];
 	RegionPtr   pCompositeClip;
 
-	pCompositeClip = RegionCreate(NULL, 0);
+	pCompositeClip = RegionCreate(NULL);
 	RegionCopy(pCompositeClip, pGC->pCompositeClip);
 
 	/* Either the drawable has changed, or the clip list in the drawable has
@@ -418,7 +418,7 @@ cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
 	/*
 	 * Copy region to GC as clip, aligning as dest clip
 	 */
-	pClip = RegionCreate(NULL, 0);
+	pClip = RegionCreate(NULL);
 	RegionIntersect(pClip, &pWin->borderClip, prgnSrc);
 	RegionTranslate(pClip,
 			 -pBackingPixmap->screen_x,
diff --git a/miext/damage/damage.c b/miext/damage/damage.c
index 0fe1fb6..7897abb 100644
--- a/miext/damage/damage.c
+++ b/miext/damage/damage.c
@@ -324,7 +324,7 @@ 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;
-		RegionInit(&pixClip, &box, 1);
+		RegionInit(&pixClip, &box);
 		RegionIntersect(pDamageRegion, pRegion, &pixClip);
 		RegionUninit(&pixClip);
 	    }
@@ -418,7 +418,7 @@ damageDamageBox (DrawablePtr pDrawable, BoxPtr pBox, int subWindowMode)
 {
     RegionRec	region;
 
-    RegionInit(&region, pBox, 1);
+    RegionInit(&region, pBox);
 #if DAMAGE_DEBUG_ENABLE
     _damageRegionAppend (pDrawable, &region, TRUE, subWindowMode, where);
 #else
@@ -2039,7 +2039,7 @@ DamageSubtract (DamagePtr	    pDamage,
 	    box.y1 = pDrawable->y;
 	    box.x2 = pDrawable->x + pDrawable->width;
 	    box.y2 = pDrawable->y + pDrawable->height;
-	    RegionInit(&pixmapClip, &box, 1);
+	    RegionInit(&pixmapClip, &box);
 	    pClip = &pixmapClip;
 	}
 	RegionTranslate(&pDamage->damage, pDrawable->x, pDrawable->y);
diff --git a/render/mipict.c b/render/mipict.c
index 08b2fa7..9decd39 100644
--- a/render/mipict.c
+++ b/render/mipict.c
@@ -193,7 +193,7 @@ miValidatePicture (PicturePtr pPicture,
 		}
 		else
 		{
-		    pPicture->pCompositeClip = RegionCreate(NullBox, 0);
+		    pPicture->pCompositeClip = RegionCreate(NullBox);
 		    RegionIntersect(pPicture->pCompositeClip,
 				     pregWin, pPicture->clientClip);
 		}
@@ -221,7 +221,7 @@ miValidatePicture (PicturePtr pPicture,
 	    else
 	    {
 		pPicture->freeCompClip = TRUE;
-		pPicture->pCompositeClip = RegionCreate(&pixbounds, 1);
+		pPicture->pCompositeClip = RegionCreate(&pixbounds);
 	    }
 
 	    if (pPicture->clientClipType == CT_REGION)
diff --git a/render/picture.c b/render/picture.c
index 015d633..08d8847 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -1329,8 +1329,7 @@ SetPictureClipRegion (PicturePtr    pPicture,
     if (pRegion)
     {
         type = CT_REGION;
-        clientClip = RegionCreate(RegionExtents(pRegion),
-                                  RegionNumRects(pRegion));
+        clientClip = RegionCreate(RegionExtents(pRegion));
         if (!clientClip)
             return BadAlloc;
         if (!RegionCopy(clientClip, pRegion))
@@ -1458,9 +1457,7 @@ CopyPicture (PicturePtr	pSrc,
 		    RegionPtr clientClip;
 		    RegionPtr srcClientClip = (RegionPtr)pSrc->clientClip;
 
-		    clientClip = RegionCreate(
-			RegionExtents(srcClientClip),
-			RegionNumRects(srcClientClip));
+		    clientClip = RegionCreate (RegionExtents(srcClientClip));
 		    (*ps->ChangePictureClip)(pDst, CT_REGION, clientClip, 0);
 		}
 		break;
diff --git a/xfixes/region.c b/xfixes/region.c
index 81ead4d..6eaeb15 100644
--- a/xfixes/region.c
+++ b/xfixes/region.c
@@ -46,8 +46,7 @@ RegionResFree (pointer data, XID id)
 RegionPtr
 XFixesRegionCopy (RegionPtr pRegion)
 {
-    RegionPtr   pNew = RegionCreate(RegionExtents(pRegion),
-				      RegionNumRects(pRegion));
+    RegionPtr   pNew = RegionCreate(RegionExtents(pRegion));
     if (!pNew)
 	return 0;
     if (!RegionCopy(pNew, pRegion))
@@ -817,7 +816,7 @@ ProcXFixesExpandRegion (ClientPtr client)
 	for (i = 0; i < nBoxes; i++)
 	{
 	    RegionRec	r;
-	    RegionInit(&r, &pTmp[i], 0);
+	    RegionInit(&r, &pTmp[i]);
 	    RegionUnion(pDestination, pDestination, &r);
 	}
 	free(pTmp);
-- 
1.7.4



More information about the xorg-devel mailing list