Bug 1287066 - Restore Layer::SetVisibleRegion behavior to fix invalidation bug. r=mstange, a=gchang
authorBenoit Girard <b56girard@gmail.com>
Thu, 21 Jul 2016 12:32:53 -0400
changeset 325509 517663b29d7ffc2ce91f90dc7beaac4fa35e52e5
parent 325508 7431edf0d97c7d93be05bd7d6b0c91474925861d
child 325510 2a0c3fd014516cd8718395e25a8cecd1fa29e0cb
push id9825
push usercbook@mozilla.com
push dateMon, 25 Jul 2016 09:05:51 +0000
treeherdermozilla-aurora@517663b29d7f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange, gchang
bugs1287066
milestone49.0a2
Bug 1287066 - Restore Layer::SetVisibleRegion behavior to fix invalidation bug. r=mstange, a=gchang 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();
     }
   }
 
   /**