mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-14 18:51:28 +00:00
Added SetNativeRegion() + fixed 2 small bugs
This commit is contained in:
parent
d281709765
commit
b808081b1b
@ -366,6 +366,21 @@ NS_IMETHODIMP nsRegionMac :: GetNativeRegion(void *&aRegion) const
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
nsresult nsRegionMac :: SetNativeRegion(void *aRegion)
|
||||
{
|
||||
if (aRegion)
|
||||
{
|
||||
mRegion = (RgnHandle)aRegion;
|
||||
SetRegionType();
|
||||
}
|
||||
else
|
||||
{
|
||||
Init();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
||||
NS_IMETHODIMP nsRegionMac :: GetRegionComplexity(nsRegionComplexity &aComplexity) const
|
||||
@ -382,7 +397,10 @@ void nsRegionMac :: SetRegionType()
|
||||
if (::EmptyRgn(mRegion) == PR_TRUE)
|
||||
mRegionType = eRegionComplexity_empty;
|
||||
else
|
||||
mRegionType = eRegionComplexity_rect;
|
||||
if ((*mRegion)->rgnSize == 10)
|
||||
mRegionType = eRegionComplexity_rect;
|
||||
else
|
||||
mRegionType = eRegionComplexity_complex;
|
||||
}
|
||||
|
||||
|
||||
@ -392,6 +410,7 @@ void nsRegionMac :: SetRegionType()
|
||||
void nsRegionMac :: SetRegionEmpty()
|
||||
{
|
||||
::SetEmptyRgn(mRegion);
|
||||
SetRegionType();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
NS_IMETHOD GetRects(nsRegionRectSet **aRects);
|
||||
NS_IMETHOD FreeRects(nsRegionRectSet *aRects);
|
||||
NS_IMETHOD GetNativeRegion(void *&aRegion) const;
|
||||
virtual nsresult SetNativeRegion(void *aRegion);
|
||||
NS_IMETHOD GetRegionComplexity(nsRegionComplexity &aComplexity) const;
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user