Chromium Code Reviews| Index: cc/trees/layer_tree_host_impl.cc |
| diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc |
| index 2449788df4e23896abf10b90806008792ad85054..a245975db1f20bbe738e63786e40bde546ffed5c 100644 |
| --- a/cc/trees/layer_tree_host_impl.cc |
| +++ b/cc/trees/layer_tree_host_impl.cc |
| @@ -2396,6 +2396,14 @@ LayerImpl* LayerTreeHostImpl::FindScrollLayerForDeviceViewportPoint( |
| if (potentially_scrolling_layer_impl == OuterViewportScrollLayer()) |
| potentially_scrolling_layer_impl = InnerViewportScrollLayer(); |
| + // Animated wheel scrolls need to scroll the outer viewport layer, and do not |
| + // go through Viewport::ScrollBy which would normally handle the distribution. |
| + // NOTE: This will need refactoring if we want smooth scrolling on Android. |
| + if (type == ANIMATED_WHEEL && |
| + potentially_scrolling_layer_impl == InnerViewportScrollLayer()) { |
| + potentially_scrolling_layer_impl = OuterViewportScrollLayer(); |
|
ymalik
2015/10/19 22:36:54
Instead of adding a new ScrollInputType, I wonder
|
| + } |
| + |
| return potentially_scrolling_layer_impl; |
| } |
| @@ -2419,7 +2427,7 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBeginImpl( |
| top_controls_manager_->ScrollBegin(); |
| active_tree_->SetCurrentlyScrollingLayer(scrolling_layer_impl); |
| - wheel_scrolling_ = (type == WHEEL); |
| + wheel_scrolling_ = (type == WHEEL || type == ANIMATED_WHEEL); |
| client_->RenewTreePriority(); |
| UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", false); |
| return SCROLL_STARTED; |
| @@ -2480,13 +2488,13 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollAnimated( |
| // ScrollAnimated is only used for wheel scrolls. We use the same bubbling |
| // behavior as ScrollBy to determine which layer to animate, but we do not |
| // do the Android-specific things in ScrollBy like showing top controls. |
| - InputHandler::ScrollStatus scroll_status = ScrollBegin(viewport_point, WHEEL); |
| + InputHandler::ScrollStatus scroll_status = |
| + ScrollBegin(viewport_point, ANIMATED_WHEEL); |
| if (scroll_status == SCROLL_STARTED) { |
| gfx::Vector2dF pending_delta = scroll_delta; |
| for (LayerImpl* layer_impl = CurrentlyScrollingLayer(); layer_impl; |
| layer_impl = NextLayerInScrollOrder(layer_impl)) { |
| - // The inner viewport layer represents the viewport. |
| - if (!layer_impl->scrollable() || layer_impl == OuterViewportScrollLayer()) |
| + if (!layer_impl->scrollable()) |
| continue; |
| gfx::ScrollOffset current_offset = layer_impl->CurrentScrollOffset(); |