xorg: added rdpRegionPixelCount
This commit is contained in:
parent
dbd16f3e9b
commit
334cfc4b46
@ -244,3 +244,22 @@ rdpRegionUnionRect(RegionPtr pReg, BoxPtr prect)
|
|||||||
rdpRegionUnion(pReg, pReg, ®);
|
rdpRegionUnion(pReg, pReg, ®);
|
||||||
rdpRegionUninit(®);
|
rdpRegionUninit(®);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
@ -58,5 +58,7 @@ Bool
|
|||||||
rdpRegionBreak(RegionPtr pReg);
|
rdpRegionBreak(RegionPtr pReg);
|
||||||
void
|
void
|
||||||
rdpRegionUnionRect(RegionPtr pReg, BoxPtr prect);
|
rdpRegionUnionRect(RegionPtr pReg, BoxPtr prect);
|
||||||
|
int
|
||||||
|
rdpRegionPixelCount(RegionPtr pReg);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user