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

Unified Diff: third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp

Issue 2113483002: Make RootScroller set the outer viewport scroll layer in the compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: RootScroller changes outer viewport scroll layer 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
Index: third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp
diff --git a/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp b/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp
index 9bac01d863e387845dede9541d8f7e159b76facb..4d4f495ffd56a3c3d95f108474546c299a0c0c61 100644
--- a/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/RootScrollerController.cpp
@@ -9,11 +9,14 @@
#include "core/frame/FrameHost.h"
#include "core/frame/FrameView.h"
#include "core/frame/TopControls.h"
+#include "core/frame/VisualViewport.h"
#include "core/layout/LayoutBox.h"
+#include "core/page/ChromeClient.h"
#include "core/page/Page.h"
#include "core/page/scrolling/OverscrollController.h"
#include "core/page/scrolling/ViewportScrollCallback.h"
#include "core/paint/PaintLayerScrollableArea.h"
+#include "platform/graphics/GraphicsLayer.h"
#include "platform/scroll/ScrollableArea.h"
namespace blink {
@@ -160,6 +163,34 @@ bool RootScrollerController::moveViewportApplyScroll(Element* target)
return true;
}
+void RootScrollerController::didUpdateCompositing()
+{
+ FrameHost& frameHost = *m_document->frameHost();
+
+ // Let the compositor-side counterpart know about this change.
+ if (m_document->isInMainFrame())
+ frameHost.chromeClient().registerViewportLayers();
+}
+
+GraphicsLayer* RootScrollerController::rootScrollerLayer()
+{
+ if (!m_effectiveRootScroller)
+ return nullptr;
+
+ ScrollableArea* area = scrollableAreaFor(*m_effectiveRootScroller);
+
+ if (!area)
+ return nullptr;
+
+ GraphicsLayer* graphicsLayer = area->layerForScrolling();
+
+ // TODO(bokan): We should assert graphicsLayer here and
+ // RootScrollerController should do whatever needs to happen to ensure
+ // the root scroller gets composited.
+
+ return graphicsLayer;
+}
+
Element* RootScrollerController::defaultEffectiveRootScroller()
{
DCHECK(m_document);
« no previous file with comments | « third_party/WebKit/Source/core/page/scrolling/RootScrollerController.h ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698