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..409f440e8c33a759957bf36654326e08dd5a7629 100644 |
--- a/cc/trees/layer_tree_host_impl.cc |
+++ b/cc/trees/layer_tree_host_impl.cc |
@@ -2684,8 +2684,13 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin( |
ScrollStatus scroll_status; |
scroll_status.main_thread_scrolling_reasons = |
MainThreadScrollingReason::kNotScrollingOnMain; |
+ |
TRACE_EVENT0("cc", "LayerTreeHostImpl::ScrollBegin"); |
+ // In Mac a scroll begin with inertial_phase = true happens to handle a fling. |
tdresser
2016/07/22 15:43:15
In Mac -> On Mac
|
+ if (scroll_state->is_in_inertial_phase()) |
+ return FlingScrollBegin(); |
+ |
ClearCurrentlyScrollingLayer(); |
gfx::Point viewport_point(scroll_state->position_x(), |
@@ -3238,7 +3243,13 @@ void LayerTreeHostImpl::ScrollEnd(ScrollState* scroll_state) { |
DistributeScrollDelta(scroll_state); |
top_controls_manager_->ScrollEnd(); |
- ClearCurrentlyScrollingLayer(); |
+ |
+ if (scroll_state->is_in_inertial_phase()) { |
+ // 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. |
tdresser
2016/07/22 15:43:15
This comment is a bit confusing, since it's talkin
|
+ ClearCurrentlyScrollingLayer(); |
+ } |
} |
InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() { |