Bug 1229429 - Refresh plugin window state during composition if we detect a change of layer trees. Fixes issues with plugin window visibility during rapid tab switching. r?roc draft
authorJim Mathies <jmathies@mozilla.com>
Tue, 16 Feb 2016 09:30:55 -0600
changeset 331216 1f989bb9895cee0866503643ec0dead627495736
parent 330693 218d16a9ddcc3699be2a19bcab7d5f6b7f8e7515
child 514337 88090c7162e66e5f5f953ac5e39712012ec5f595
push id10937
push userjmathies@mozilla.com
push dateTue, 16 Feb 2016 15:34:19 +0000
reviewersroc
bugs1229429
milestone47.0a1
Bug 1229429 - Refresh plugin window state during composition if we detect a change of layer trees. Fixes issues with plugin window visibility during rapid tab switching. r?roc MozReview-Commit-ID: pVnTksTt2d
gfx/layers/ipc/CompositorParent.cpp
--- a/gfx/layers/ipc/CompositorParent.cpp
+++ b/gfx/layers/ipc/CompositorParent.cpp
@@ -2175,18 +2175,25 @@ CompositorParent::UpdatePluginWindowStat
   CompositorParent::LayerTreeState& lts = sIndirectLayerTrees[aId];
   if (!lts.mParent) {
     PLUGINS_LOG("[%" PRIu64 "] layer tree compositor parent pointer is null", aId);
     return false;
   }
 
   // Check if this layer tree has received any shadow layer updates
   if (!lts.mUpdatedPluginDataAvailable) {
-    PLUGINS_LOG("[%" PRIu64 "] no plugin data", aId);
-    return false;
+    if (mLastPluginUpdateLayerTreeId != aId) {
+      lts.mUpdatedPluginDataAvailable = true;
+      mPluginsLayerOffset = nsIntPoint(0,0);
+      mPluginsLayerVisibleRegion.SetEmpty();
+      PLUGINS_LOG("[%" PRIu64 "] new layer id, refreshing", aId);
+    } else {
+      PLUGINS_LOG("[%" PRIu64 "] no plugin data", aId);
+      return false;
+    }
   }
 
   // pluginMetricsChanged tracks whether we need to send plugin update
   // data to the main thread. If we do we'll have to block composition,
   // which we want to avoid if at all possible.
   bool pluginMetricsChanged = false;
 
   // Same layer tree checks