author | sotaro <sotaro.ikeda.g@gmail.com> |
Mon, 01 Oct 2018 10:12:22 +0900 | |
changeset 438928 | 94a87c720eee25ae57b47fba0b564de70c7b1741 |
parent 438927 | 06173200ede0eff3a9a9136968d99d9f7e29d1d1 |
child 438929 | 948d251c50ee0c25f30bb032a089a9e83434f756 |
push id | 108441 |
push user | sikeda@mozilla.com |
push date | Mon, 01 Oct 2018 01:12:59 +0000 |
treeherder | mozilla-inbound@94a87c720eee [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | mattwoodrow |
bugs | 1491798 |
milestone | 64.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
|
--- a/dom/ipc/TabChild.cpp +++ b/dom/ipc/TabChild.cpp @@ -3206,16 +3206,35 @@ TabChild::InvalidateLayers() MOZ_ASSERT(mPuppetWidget); RefPtr<LayerManager> lm = mPuppetWidget->GetLayerManager(); MOZ_ASSERT(lm); FrameLayerBuilder::InvalidateAllLayers(lm); } void +TabChild::SchedulePaint() +{ + nsCOMPtr<nsIDocShell> docShell = do_GetInterface(WebNavigation()); + if (!docShell) { + return; + } + + // We don't use TabChildBase::GetPresShell() here because that would create + // a content viewer if one doesn't exist yet. Creating a content viewer can + // cause JS to run, which we want to avoid. nsIDocShell::GetPresShell + // returns null if no content viewer exists yet. + if (nsCOMPtr<nsIPresShell> presShell = docShell->GetPresShell()) { + if (nsIFrame* root = presShell->GetRootFrame()) { + root->SchedulePaint(); + } + } +} + +void TabChild::ReinitRendering() { MOZ_ASSERT(mLayersId.IsValid()); // Before we establish a new PLayerTransaction, we must connect our layer tree // id, CompositorBridge, and the widget compositor all together again. // Normally this happens in TabParent before TabChild is given rendering // information.
--- a/dom/ipc/TabChild.h +++ b/dom/ipc/TabChild.h @@ -535,16 +535,17 @@ public: const TimeStamp& aCompositeStart, const TimeStamp& aCompositeEnd); void DidRequestComposite(const TimeStamp& aCompositeReqStart, const TimeStamp& aCompositeReqEnd); void ClearCachedResources(); void InvalidateLayers(); + void SchedulePaint(); void ReinitRendering(); void ReinitRenderingForDeviceReset(); static inline TabChild* GetFrom(nsIDOMWindow* aWindow) { nsCOMPtr<nsIWebNavigation> webNav = do_GetInterface(aWindow); nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(webNav); return GetFrom(docShell);
--- a/gfx/layers/wr/WebRenderLayerManager.cpp +++ b/gfx/layers/wr/WebRenderLayerManager.cpp @@ -556,16 +556,22 @@ WebRenderLayerManager::ClearCachedResour WrBridge()->EndClearCachedResources(); } void WebRenderLayerManager::WrUpdated() { mWebRenderCommandBuilder.ClearCachedResources(); DiscardLocalImages(); + + if (mWidget) { + if (dom::TabChild* tabChild = mWidget->GetOwningTabChild()) { + tabChild->SchedulePaint(); + } + } } dom::TabGroup* WebRenderLayerManager::GetTabGroup() { if (mWidget) { if (dom::TabChild* tabChild = mWidget->GetOwningTabChild()) { return tabChild->TabGroup();