summaryrefslogtreecommitdiff
path: root/dix/region.c
diff options
context:
space:
mode:
Diffstat (limited to 'dix/region.c')
-rw-r--r--dix/region.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/dix/region.c b/dix/region.c
index 737d2a861..15f3d01a5 100644
--- a/dix/region.c
+++ b/dix/region.c
@@ -255,6 +255,21 @@ RegionDestroy(RegionPtr pReg)
free(pReg);
}
+RegionPtr
+RegionDuplicate(RegionPtr pOld)
+{
+ RegionPtr pNew;
+
+ pNew = RegionCreate(&pOld->extents, 0);
+ if (!pNew)
+ return NULL;
+ if (!RegionCopy(pNew, pOld)) {
+ RegionDestroy(pNew);
+ return NULL;
+ }
+ return pNew;
+}
+
void
RegionPrint(RegionPtr rgn)
{