Bug 1258440 - Don't attempt to hide plugin windows when switching trees if the previous remote layer tree didn't contain plugin windows. Fixes a tpaint regression. r?mconley draft
authorJim Mathies <jmathies@mozilla.com>
Tue, 22 Mar 2016 17:30:14 -0500
changeset 343524 04b76cdec95256f66da3c2b05735de3352a0e7d0
parent 340999 341344bdec8f10bf50646cd6ef2355361435cbf6
child 516798 6e16df666e4d46d35d97dce1c030365e930fcacc
push id13652
push userjmathies@mozilla.com
push dateTue, 22 Mar 2016 22:30:22 +0000
reviewersmconley
bugs1258440
milestone48.0a1
Bug 1258440 - Don't attempt to hide plugin windows when switching trees if the previous remote layer tree didn't contain plugin windows. Fixes a tpaint regression. r?mconley MozReview-Commit-ID: 7UDO4RxBRVF
gfx/layers/ipc/CompositorParent.cpp
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -2394,16 +2394,21 @@ CompositorParent::UpdatePluginWindowStat
   // update the metrics to make sure they are visible again.
   if (mPluginWindowsHidden) {
     PLUGINS_LOG("[%" PRIu64 "] re-showing", aId);
     mPluginWindowsHidden = false;
     pluginMetricsChanged = true;
   }
 
   if (!lts.mPluginData.Length()) {
+    // Don't hide plugins if the previous remote layer tree didn't contain any.
+    if (!mCachedPluginData.Length()) {
+      PLUGINS_LOG("[%" PRIu64 "] nothing to hide", aId);
+      return false;
+    }
     // We will pass through here in cases where the previous shadow layer
     // tree contained visible plugins and the new tree does not. All we need
     // to do here is hide the plugins for the old tree, so don't waste time
     // calculating clipping.
     mPluginsLayerOffset = nsIntPoint(0,0);
     mPluginsLayerVisibleRegion.SetEmpty();
     uintptr_t parentWidget = (uintptr_t)lts.mParent->GetWidget();
     Unused << lts.mParent->SendHideAllPlugins(parentWidget);