Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2736523002: Defer ChromeClient::attachRootGraphicsLayer until after compositing update. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
}
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698