Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5573)

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2158423002: Wheel scroll latching enabled behind flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unit_tests_fixed Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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() {

Powered by Google App Engine
This is Rietveld 408576698