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
--- 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