Bug 1287066 - Restore Layer::SetVisibleRegion behavior to fix invalidation bug. r=mstange
authorBenoit Girard <b56girard@gmail.com>
Thu, 21 Jul 2016 12:32:53 -0400
changeset 306180 67186c2d647ed2807eacc51cc834ca7932d38fba
parent 306179 cd5af43f84b11096643c2418d3af263cf92c7bdd
child 306181 cfb99ceaac776f343540d912f97d49994ca7bed7
push id79800
push usercbook@mozilla.com
push dateFri, 22 Jul 2016 10:17:37 +0000
treeherdermozilla-inbound@30745bed2567 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1287066
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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();
     }
   }
 
   /**