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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 1097183004: Clean up unnecessary conditionals in WebViewImpl (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 640748994f2cc102c31d19601cf721b0828302e2..101cb34ea9d74a4341c2bfeffbbd1bf929426ee3 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -4159,6 +4159,12 @@ void WebViewImpl::setRootGraphicsLayer(GraphicsLayer* layer)
m_rootLayer = pinchViewport.rootGraphicsLayer()->platformLayer();
m_rootTransformLayer = pinchViewport.rootGraphicsLayer();
updateRootLayerTransform();
+ m_layerTreeView->setRootLayer(*m_rootLayer);
+ // We register viewport layers here since there may not be a layer
+ // tree view prior to this point.
+ page()->frameHost().pinchViewport().registerLayersWithTreeView(m_layerTreeView);
+ if (m_pageOverlays)
+ m_pageOverlays->update();
} else {
m_rootGraphicsLayer = nullptr;
m_rootLayer = nullptr;
@@ -4167,20 +4173,8 @@ void WebViewImpl::setRootGraphicsLayer(GraphicsLayer* layer)
// commits until Blink generates invalidations so we don't
// attempt to paint too early in the next page load.
m_layerTreeView->setDeferCommits(true);
- }
-
- if (m_layerTreeView) {
- if (m_rootLayer) {
- m_layerTreeView->setRootLayer(*m_rootLayer);
- // We register viewport layers here since there may not be a layer
- // tree view prior to this point.
- page()->frameHost().pinchViewport().registerLayersWithTreeView(m_layerTreeView);
- if (m_pageOverlays)
- m_pageOverlays->update();
- } else {
- m_layerTreeView->clearRootLayer();
- page()->frameHost().pinchViewport().clearLayersForTreeView(m_layerTreeView);
- }
+ m_layerTreeView->clearRootLayer();
+ page()->frameHost().pinchViewport().clearLayersForTreeView(m_layerTreeView);
}
suppressInvalidations(false);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698