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

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: features deleted from blink features. 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..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() {

Powered by Google App Engine
This is Rietveld 408576698