| 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 1974eb1dcc8fc394ae5a201b8d53a867833d1892..07df1f05cad1238b13a78a3cabbb1327980f0a4d 100644
|
| --- a/cc/trees/layer_tree_host_impl.cc
|
| +++ b/cc/trees/layer_tree_host_impl.cc
|
| @@ -2690,6 +2690,8 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBeginImpl(
|
| client_->RenewTreePriority();
|
| RecordCompositorSlowScrollMetric(type, CC_THREAD);
|
|
|
| + UpdateScrollSourceInfo(wheel_scrolling_);
|
| +
|
| return scroll_status;
|
| }
|
|
|
| @@ -3486,6 +3488,10 @@ std::unique_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() {
|
| active_tree_->elastic_overscroll()->PullDeltaForMainThread();
|
| scroll_info->swap_promises.swap(swap_promises_for_main_thread_scroll_update_);
|
|
|
| + // Record and reset scroll_source_info_;
|
| + scroll_info->scroll_source_info = scroll_source_info_;
|
| + scroll_source_info_ = ScrollSourceInfo::NONE;
|
| +
|
| return scroll_info;
|
| }
|
|
|
| @@ -4188,4 +4194,26 @@ void LayerTreeHostImpl::SetContextVisibility(bool is_visible) {
|
| }
|
| }
|
|
|
| +void LayerTreeHostImpl::UpdateScrollSourceInfo(bool is_wheel_scroll) {
|
| + switch (scroll_source_info_) {
|
| + case ScrollSourceInfo::NONE:
|
| + scroll_source_info_ = is_wheel_scroll
|
| + ? ScrollSourceInfo::SCROLLED_BY_WHEEL
|
| + : ScrollSourceInfo::SCROLLED_BY_TOUCH;
|
| + break;
|
| + case ScrollSourceInfo::SCROLLED_BY_TOUCH:
|
| + scroll_source_info_ = is_wheel_scroll
|
| + ? ScrollSourceInfo::SCROLLED_BY_TOUCH_AND_WHEEL
|
| + : ScrollSourceInfo::SCROLLED_BY_TOUCH;
|
| + break;
|
| + case ScrollSourceInfo::SCROLLED_BY_WHEEL:
|
| + scroll_source_info_ = is_wheel_scroll
|
| + ? ScrollSourceInfo::SCROLLED_BY_WHEEL
|
| + : ScrollSourceInfo::SCROLLED_BY_TOUCH_AND_WHEEL;
|
| + break;
|
| + case ScrollSourceInfo::SCROLLED_BY_TOUCH_AND_WHEEL:
|
| + break;
|
| + }
|
| +}
|
| +
|
| } // namespace cc
|
|
|