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

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

Issue 2128363002: Moved viewport layer registration into WebViewImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rootScrollerPinchedIn2
Patch Set: Moved visual viewport layer registration into WebViewImpl Created 4 years, 5 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 3e92e32a2f867341300bb60c550f5729a13a1c55..7f3a4031a82f7aebd0e1dc708f2b441de2b26aa3 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -4182,6 +4182,36 @@ bool WebViewImpl::tabsToLinks() const
return m_tabsToLinks;
}
+void WebViewImpl::registerViewportLayersWithCompositor()
+{
+ DCHECK(m_layerTreeView);
+ DCHECK(!page()->deprecatedLocalMainFrame()->contentLayoutItem().isNull());
+
+ PaintLayerCompositor* compositor =
+ page()->deprecatedLocalMainFrame()->contentLayoutItem().compositor();
+
+ DCHECK(compositor);
+
+ // Get the outer viewport scroll layer.
+ WebLayer* scrollLayer =
+ compositor->scrollLayer()
+ ? compositor->scrollLayer()->platformLayer()
+ : nullptr;
+
+ VisualViewport& visualViewport = page()->frameHost().visualViewport();
+
+ // TODO(bokan): This was moved here from when registerViewportLayers was a
+ // part of VisualViewport and maybe doesn't belong here. See comment inside
+ // the mehtod.
+ visualViewport.setScrollLayerOnScrollbars(scrollLayer);
+
+ m_layerTreeView->registerViewportLayers(
+ visualViewport.overscrollElasticityLayer()->platformLayer(),
+ visualViewport.pageScaleLayer()->platformLayer(),
+ visualViewport.scrollLayer()->platformLayer(),
+ scrollLayer);
+}
+
void WebViewImpl::setRootGraphicsLayer(GraphicsLayer* layer)
{
if (!m_layerTreeView)
@@ -4201,7 +4231,7 @@ void WebViewImpl::setRootGraphicsLayer(GraphicsLayer* layer)
m_layerTreeView->setRootLayer(*m_rootLayer);
// We register viewport layers here since there may not be a layer
// tree view prior to this point.
- visualViewport.registerLayersWithTreeView(m_layerTreeView);
+ registerViewportLayersWithCompositor();
updatePageOverlays();
// TODO(enne): Work around page visibility changes not being
// propagated to the WebView in some circumstances. This needs to
@@ -4217,7 +4247,7 @@ void WebViewImpl::setRootGraphicsLayer(GraphicsLayer* layer)
// attempt to paint too early in the next page load.
m_layerTreeView->setDeferCommits(true);
m_layerTreeView->clearRootLayer();
- visualViewport.clearLayersForTreeView(m_layerTreeView);
+ m_layerTreeView->clearViewportLayers();
}
}
« 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