Bug 516740. Never simplify the visible region by increasing its area when we're subtracting opaque areas from the visible region. Instead, just don't subtract the opaque area if it would make the visible region too complex. r=bzbarsky

--HG--
extra : rebase_source : 388dd9229d6d1a50efd409f508aded95f1ec226a
This commit is contained in:
Robert O'Callahan 2009-09-20 00:12:48 +12:00
parent eaeee3bd5a
commit 110dce9d34

View File

@ -170,9 +170,12 @@ void
nsDisplayListBuilder::SubtractFromVisibleRegion(nsRegion* aVisibleRegion,
const nsRegion& aRegion)
{
aVisibleRegion->Sub(*aVisibleRegion, aRegion);
if (!GetAccurateVisibleRegions()) {
aVisibleRegion->SimplifyOutward(15);
nsRegion tmp;
tmp.Sub(*aVisibleRegion, aRegion);
// Don't let *aVisibleRegion get too complex, but don't let it fluff out
// to its bounds either, which can be very bad (see bug 516740).
if (GetAccurateVisibleRegions() || tmp.GetNumRects() <= 15) {
*aVisibleRegion = tmp;
}
}