summaryrefslogtreecommitdiffstats
path: root/xorg/server
diff options
context:
space:
mode:
authorJay Sorg <jay.sorg@gmail.com>2014-02-03 19:53:43 -0800
committerJay Sorg <jay.sorg@gmail.com>2014-02-03 19:53:43 -0800
commit334cfc4b46dfabd4f7b7d77c53e07562da86bd23 (patch)
treecc3e8d48df0a92284da825120f86c73b09fdff87 /xorg/server
parentdbd16f3e9bdc5db7e288d61d44c90677cc0abe8c (diff)
downloadxrdp-proprietary-334cfc4b46dfabd4f7b7d77c53e07562da86bd23.tar.gz
xrdp-proprietary-334cfc4b46dfabd4f7b7d77c53e07562da86bd23.zip
xorg: added rdpRegionPixelCount
Diffstat (limited to 'xorg/server')
-rw-r--r--xorg/server/module/rdpReg.c19
-rw-r--r--xorg/server/module/rdpReg.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/xorg/server/module/rdpReg.c b/xorg/server/module/rdpReg.c
index 20600f66..8ff7d79d 100644
--- a/xorg/server/module/rdpReg.c
+++ b/xorg/server/module/rdpReg.c
@@ -244,3 +244,22 @@ rdpRegionUnionRect(RegionPtr pReg, BoxPtr prect)
rdpRegionUnion(pReg, pReg, &reg);
rdpRegionUninit(&reg);
}
+
+/*****************************************************************************/
+int
+rdpRegionPixelCount(RegionPtr pReg)
+{
+ int index;
+ int count;
+ int rv;
+ BoxRec box;
+
+ rv = 0;
+ count = REGION_NUM_RECTS(pReg);
+ for (index = 0; index < count; index++)
+ {
+ box = REGION_RECTS(pReg)[index];
+ rv += (box.x2 - box.x1) * (box.y2 - box.y1);
+ }
+ return rv;
+}
diff --git a/xorg/server/module/rdpReg.h b/xorg/server/module/rdpReg.h
index 38c4188a..a5cd73bf 100644
--- a/xorg/server/module/rdpReg.h
+++ b/xorg/server/module/rdpReg.h
@@ -58,5 +58,7 @@ Bool
rdpRegionBreak(RegionPtr pReg);
void
rdpRegionUnionRect(RegionPtr pReg, BoxPtr prect);
+int
+rdpRegionPixelCount(RegionPtr pReg);
#endif