aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/region.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix/region.c')
-rw-r--r--xorg-server/dix/region.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/xorg-server/dix/region.c b/xorg-server/dix/region.c
index 737d2a861..15f3d01a5 100644
--- a/xorg-server/dix/region.c
+++ b/xorg-server/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)
{