From 110dce9d343b09dbf16632fad8232ff709f41f4c Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Sun, 20 Sep 2009 00:12:48 +1200 Subject: [PATCH] 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 --- layout/base/nsDisplayList.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/layout/base/nsDisplayList.cpp b/layout/base/nsDisplayList.cpp index bf0e493551eb..203f42fbde0e 100644 --- a/layout/base/nsDisplayList.cpp +++ b/layout/base/nsDisplayList.cpp @@ -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; } }