Chromium Code Reviews| Index: Source/core/page/scrolling/ScrollingCoordinator.cpp |
| diff --git a/Source/core/page/scrolling/ScrollingCoordinator.cpp b/Source/core/page/scrolling/ScrollingCoordinator.cpp |
| index df6f35f0c01d18b7e523ee92fe79f9d159a03c20..216b23a8edf3dff5d9c5748c26545d6cbea315ca 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); |
| @@ -493,9 +497,44 @@ void ScrollingCoordinator::touchEventTargetRectsDidChange(const Document*) |
| setTouchEventTargetRects(touchEventTargetRects); |
| } |
| -void ScrollingCoordinator::willDestroyRenderLayer(RenderLayer* layer) |
| +void ScrollingCoordinator::updateScrollParentForLayer(RenderLayer* child, RenderLayer* parent) |
| { |
| - m_layersWithTouchRects.remove(layer); |
| + if (!child || !child->backing()) |
|
enne (OOO)
2013/08/22 20:54:30
Shouldn't these always be true?
|
| + 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", |
| + "childId", childWebLayer->id(), |
| + "ancestorId", scrollParentWebLayer ? scrollParentWebLayer->id() : -1); |
| + |
| + 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) |
| @@ -512,8 +551,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() |