Bug 1287066 - Restore Layer::SetVisibleRegion behavior to fix invalidation bug. r=mstange
MozReview-Commit-ID: HcstO0EhiWz
--- a/gfx/layers/Layers.h
+++ b/gfx/layers/Layers.h
@@ -862,17 +862,19 @@ public:
* (This can be an overapproximation to the "true" visible region.)
*
* There is no general guarantee that drawing outside the bounds of the
* visible region will be ignored. So if a layer draws outside the bounds
* of its visible region, it needs to ensure that what it draws is valid.
*/
virtual void SetVisibleRegion(const LayerIntRegion& aRegion)
{
- if (!mVisibleRegion.IsEqual(aRegion)) {
+ // IsEmpty is required otherwise we get invalidation glitches.
+ // See bug 1288464 for investigating why.
+ if (!mVisibleRegion.IsEqual(aRegion) || aRegion.IsEmpty()) {
MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) VisibleRegion was %s is %s", this,
mVisibleRegion.ToString().get(), aRegion.ToString().get()));
mVisibleRegion = aRegion;
Mutated();
}
}
/**