Bug 1287066 - Restore Layer::SetVisibleRegion behavior to fix invalidation bug. r=mstange draft
authorBenoit Girard <b56girard@gmail.com>
Thu, 21 Jul 2016 12:32:53 -0400
changeset 390733 9b9f28a5b39a469ad7959ff053334f014acbc1e3
parent 390029 d224fc999cb6accb208af0a105f14433375e2e77
child 526055 e0a1aceb9e1c609774a7202d0d40008b4d869a23
push id23732
push userb56girard@gmail.com
push dateThu, 21 Jul 2016 16:33:07 +0000
reviewersmstange
bugs1287066
milestone50.0a1
Bug 1287066 - Restore Layer::SetVisibleRegion behavior to fix invalidation bug. r=mstange MozReview-Commit-ID: HcstO0EhiWz
gfx/layers/Layers.h
--- 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();
     }
   }
 
   /**