diff options
Diffstat (limited to 'src/vmware.c')
-rw-r--r-- | src/vmware.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/src/vmware.c b/src/vmware.c index c2b72e8..cff4715 100644 --- a/src/vmware.c +++ b/src/vmware.c @@ -1447,6 +1447,59 @@ VMWAREAddDisplayMode(ScrnInfoPtr pScrn, } +/* + *----------------------------------------------------------------------------- + * + * vmwareIsRegionEqual -- + * + * This function implements REGION_EQUAL because older versions of + * regionstr.h don't define it. + * It is a slightly modified version of miRegionEqual from $Xorg: miregion.c + * + * Results: + * TRUE if regions are equal; FALSE otherwise + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +vmwareIsRegionEqual(const RegionPtr reg1, + const RegionPtr reg2) +{ + int i, num; + BoxPtr rects1, rects2; + + if ((reg1->extents.x1 != reg2->extents.x1) || + (reg1->extents.x2 != reg2->extents.x2) || + (reg1->extents.y1 != reg2->extents.y1) || + (reg1->extents.y2 != reg2->extents.y2)) { + return FALSE; + } + + num = REGION_NUM_RECTS(reg1); + if (num != REGION_NUM_RECTS(reg2)) { + return FALSE; + } + + rects1 = REGION_RECTS(reg1); + rects2 = REGION_RECTS(reg2); + + for (i = 0; i < num; i++) { + if ((rects1[i].x1 != rects2[i].x1) || + (rects1[i].x2 != rects2[i].x2) || + (rects1[i].y1 != rects2[i].y1) || + (rects1[i].y2 != rects2[i].y2)) { + return FALSE; + } + } + + return TRUE; +} + + #if VMWARE_DRIVER_FUNC static Bool VMWareDriverFunc(ScrnInfoPtr pScrn, |