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