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

Unified Diff: Source/core/page/scrolling/ScrollingCoordinator.cpp

Issue 22419002: Set up clip and scroll parents on the blink side. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 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 | « Source/core/page/scrolling/ScrollingCoordinator.h ('k') | Source/core/platform/ScrollableArea.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/scrolling/ScrollingCoordinator.cpp
diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp
index 7a3005971a154c0687a97e6238578ab263d186e4..7002305d0d013ee7d556ea7a4067273d17515762 100644
--- a/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -288,6 +288,10 @@ void ScrollingCoordinator::scrollableAreaScrollbarLayerDidChange(ScrollableArea*
bool ScrollingCoordinator::scrollableAreaScrollLayerDidChange(ScrollableArea* scrollableArea)
{
+ TRACE_EVENT_INSTANT2("comp-scroll", "ScrollingCoordinator::scrollableAreaScrollLayerDidChange",
+ "width", scrollableArea->scrollableAreaBoundingBox().width(),
+ "height", scrollableArea->scrollableAreaBoundingBox().height());
+
GraphicsLayer* scrollLayer = scrollLayerForScrollableArea(scrollableArea);
if (scrollLayer) {
bool isMainFrame = isForMainFrame(scrollableArea);
@@ -405,6 +409,46 @@ void ScrollingCoordinator::touchEventTargetRectsDidChange(const Document*)
setTouchEventTargetRects(touchEventTargetRects);
}
+void ScrollingCoordinator::updateScrollParentForLayer(RenderLayer* child, RenderLayer* parent)
+{
+ if (!child || !child->backing())
+ return;
+
+ WebLayer* childWebLayer = scrollingWebLayerForGraphicsLayer(child->layerForScrollChild());
+ if (!childWebLayer)
+ return;
+
+ WebLayer* scrollParentWebLayer = 0;
+ if (parent && parent->backing())
+ scrollParentWebLayer = scrollingWebLayerForGraphicsLayer(parent->backing()->parentForSublayers());
+
+ TRACE_EVENT_INSTANT2("comp-scroll2", "ScrollingCoordinator::updateScrollParentForLayer",
enne (OOO) 2013/08/22 20:54:30 Would this trace event be better on the cc side wh
+ "childId", childWebLayer->id(),
+ "ancestorId", scrollParentWebLayer ? scrollParentWebLayer->id() : -1);
enne (OOO) 2013/08/22 20:54:30 Ids start at 1, so you could say 0.
+
+ childWebLayer->setScrollParent(scrollParentWebLayer);
+}
+
+void ScrollingCoordinator::updateClipParentForLayer(RenderLayer* child, RenderLayer* parent)
+{
+ if (!child || !child->backing())
+ return;
+
+ WebLayer* childWebLayer = scrollingWebLayerForGraphicsLayer(child->backing()->graphicsLayer());
+ if (!childWebLayer)
+ return;
+
+ WebLayer* clipParentWebLayer = 0;
+ if (parent && parent->backing())
+ clipParentWebLayer = scrollingWebLayerForGraphicsLayer(parent->backing()->parentForSublayers());
+
+ TRACE_EVENT_INSTANT2("comp-scroll", "ScrollingCoordinator::updateClipParentForLayer",
+ "childId", childWebLayer->id(),
+ "ancestorId", clipParentWebLayer ? clipParentWebLayer->id() : -1);
+
+ childWebLayer->setClipParent(clipParentWebLayer);
+}
+
void ScrollingCoordinator::setWheelEventHandlerCount(unsigned count)
{
if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(m_page->mainFrame()->view()))
@@ -419,8 +463,12 @@ void ScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView(FrameView
void ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons reasons)
{
- if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(m_page->mainFrame()->view()))
+ if (WebLayer* scrollLayer = scrollingWebLayerForScrollableArea(m_page->mainFrame()->view())) {
+ TRACE_EVENT_INSTANT2("impl-scroll", "ScrollingCoordinator::setShouldUpdateScrollLayerPositionOnMainThread",
+ "layerId", scrollLayer->id(),
+ "reasons", reasons);
scrollLayer->setShouldScrollOnMainThread(reasons);
+ }
}
void ScrollingCoordinator::pageDestroyed()
« no previous file with comments | « Source/core/page/scrolling/ScrollingCoordinator.h ('k') | Source/core/platform/ScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698