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 e6db70e6cbf14ee4bb5643da1ca6ed8efd3569dc..2a9e01ff2c265eb162282cc9bd68659b134eae0f 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -2684,8 +2684,12 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin( |
ScrollStatus scroll_status; |
scroll_status.main_thread_scrolling_reasons = |
MainThreadScrollingReason::kNotScrollingOnMain; |
+ |
TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBegin"); |
+ if (scroll_state->is_in_inertial_phase()) |
+ return FlingScrollBegin(); |
ericrk
2016/07/19 20:21:51
To make sure I'm understanding this:
Is the idea
sahel
2016/07/19 22:47:03
Yes, because in mac flings are handled as scrolls.
|
+ |
ClearCurrentlyScrollingLayer(); |
gfx::Point viewport_point(scroll_state->position_x(), |
@@ -3238,7 +3242,13 @@ void LayerTreeHostImpl::ScrollEnd(ScrollState* scroll_state) { |
DistributeScrollDelta(scroll_state); |
top_controls_manager_->ScrollEnd(); |
- ClearCurrentlyScrollingLayer(); |
+ |
+ if (scroll_state->is_in_inertial_phase()) { |
ericrk
2016/07/19 20:21:51
I though that is_in_inertial_phase indicated that
sahel
2016/07/19 22:47:03
in ScrollEnd, is_in_inertial_phase is true iff the
ericrk
2016/07/20 17:44:35
Ok, this makes sense, thanks for explaining.
|
+ // There might be a fling after the scroll end. In those cases, |
+ // don't clear the currently scrolling layer to avoid a new hit test for the |
+ // fling. |
+ ClearCurrentlyScrollingLayer(); |
+ } |
} |
InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() { |