Chromium Code Reviews| Index: third_party/WebKit/Source/web/WebViewImpl.cpp |
| diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp |
| index a14899a44e8bbb407cce2a174f07682c7ebdcd15..8ada9cca4c3fd9c320c92f723a0ceb6f9275ebe8 100644 |
| --- a/third_party/WebKit/Source/web/WebViewImpl.cpp |
| +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp |
| @@ -361,6 +361,7 @@ WebViewImpl::WebViewImpl(WebViewClient* client, |
| m_suppressNextKeypressEvent(false), |
| m_imeAcceptEvents(true), |
| m_devToolsEmulator(nullptr), |
| + m_needsUpdatePageOverlays(false), |
| m_isTransparent(false), |
| m_tabsToLinks(false), |
| m_layerTreeView(nullptr), |
| @@ -1997,6 +1998,8 @@ void WebViewImpl::updateAllLifecyclePhases() { |
| PageWidgetDelegate::updateAllLifecyclePhases(*m_page, |
| *mainFrameImpl()->frame()); |
| + // This needs to run after the compositing update. |
| + updatePageOverlays(); |
|
bokan
2017/03/06 16:17:18
I think there's ways for compositing to be run wit
skobes
2017/03/06 22:44:23
Done, although doing this from WebViewImpl::layout
|
| if (InspectorOverlay* overlay = inspectorOverlay()) { |
| overlay->updateAllLifecyclePhases(); |
| // TODO(chrishtr): integrate paint into the overlay's lifecycle. |
| @@ -3682,7 +3685,7 @@ void WebViewImpl::layoutUpdated(WebLocalFrameImpl* webframe) { |
| if (view->needsLayout()) |
| view->layout(); |
| - updatePageOverlays(); |
| + m_needsUpdatePageOverlays = true; |
| m_fullscreenController->didUpdateLayout(); |
| m_client->didUpdateLayout(); |
| @@ -3727,7 +3730,7 @@ void WebViewImpl::setPageOverlayColor(WebColor color) { |
| m_pageColorOverlay = PageOverlay::create( |
| mainFrameImpl(), WTF::makeUnique<ColorOverlay>(color)); |
| - m_pageColorOverlay->update(); |
| + m_needsUpdatePageOverlays = true; |
| } |
| WebPageImportanceSignals* WebViewImpl::pageImportanceSignals() { |
| @@ -4139,12 +4142,15 @@ AnimationWorkletProxyClient* WebViewImpl::createAnimationWorkletProxyClient() { |
| } |
| void WebViewImpl::updatePageOverlays() { |
| - if (m_pageColorOverlay) |
| - m_pageColorOverlay->update(); |
| - if (InspectorOverlay* overlay = inspectorOverlay()) { |
| - PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); |
| - if (inspectorPageOverlay) |
| - inspectorPageOverlay->update(); |
| + if (m_needsUpdatePageOverlays) { |
| + if (m_pageColorOverlay) |
| + m_pageColorOverlay->update(); |
| + if (InspectorOverlay* overlay = inspectorOverlay()) { |
| + PageOverlay* inspectorPageOverlay = overlay->pageOverlay(); |
| + if (inspectorPageOverlay) |
| + inspectorPageOverlay->update(); |
| + } |
| + m_needsUpdatePageOverlays = false; |
| } |
| } |