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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 1306193006: Remove touch scroll chaining from compositor scrolling. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@disable_chaining_no_bubbling
Patch Set: Created 5 years, 3 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
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 fa3ba0e599df1d93f2bbd0fdf3c7ce6f33c2a9cd..0fc053cef803f722a5fdb944f62a904f332983ba 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -180,7 +180,6 @@ LayerTreeHostImpl::LayerTreeHostImpl(
tree_resources_for_gpu_rasterization_dirty_(false),
input_handler_client_(NULL),
did_lock_scrolling_layer_(false),
- should_bubble_scrolls_(false),
wheel_scrolling_(false),
scroll_affects_scroll_handler_(false),
scroll_layer_id_when_mouse_over_scrollbar_(0),
@@ -2396,7 +2395,6 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBeginImpl(
top_controls_manager_->ScrollBegin();
active_tree_->SetCurrentlyScrollingLayer(scrolling_layer_impl);
- should_bubble_scrolls_ = (type != NON_BUBBLING_GESTURE);
wheel_scrolling_ = (type == WHEEL);
client_->RenewTreePriority();
UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", false);
@@ -2439,6 +2437,10 @@ InputHandler::ScrollStatus LayerTreeHostImpl::ScrollBegin(
device_viewport_point, type, layer_impl, &scroll_on_main_thread,
&scroll_affects_scroll_handler_);
+ // The inner viewport layer represents the viewport during scrolling.
jdduke (slow) 2015/09/09 14:41:10 Should we instead move this adjustment into FindSc
tdresser 2015/09/10 13:56:51 Absolutely, thanks. Done.
+ if (scrolling_layer_impl == OuterViewportScrollLayer())
+ scrolling_layer_impl = InnerViewportScrollLayer();
+
if (scroll_on_main_thread) {
UMA_HISTOGRAM_BOOLEAN("TryScroll.SlowScroll", true);
return SCROLL_ON_MAIN_THREAD;
@@ -2643,12 +2645,8 @@ void LayerTreeHostImpl::ApplyScroll(LayerImpl* layer,
if (!scrolled)
return;
- // When scrolls are allowed to bubble, it's important that the original
- // scrolling layer be preserved. This ensures that, after a scroll
- // bubbles, the user can reverse scroll directions and immediately resume
- // scrolling the original layer that scrolled.
- if (!scroll_state->should_propagate())
- scroll_state->set_current_native_scrolling_layer(layer);
+
+ scroll_state->set_current_native_scrolling_layer(layer);
}
InputHandlerScrollResult LayerTreeHostImpl::ScrollBy(
@@ -2662,7 +2660,7 @@ InputHandlerScrollResult LayerTreeHostImpl::ScrollBy(
top_controls_manager_->ControlsTopOffset();
ScrollState scroll_state(
scroll_delta.x(), scroll_delta.y(), viewport_point.x(),
- viewport_point.y(), should_bubble_scrolls_ /* should_propagate */,
+ viewport_point.y(), false /* should_propagate */,
did_lock_scrolling_layer_ /* delta_consumed_for_scroll_sequence */,
!wheel_scrolling_ /* is_direct_manipulation */);
scroll_state.set_current_native_scrolling_layer(CurrentlyScrollingLayer());
@@ -2800,16 +2798,6 @@ InputHandler::ScrollStatus LayerTreeHostImpl::FlingScrollBegin() {
if (!CurrentlyScrollingLayer())
return SCROLL_IGNORED;
- bool currently_scrolling_viewport =
- CurrentlyScrollingLayer() == OuterViewportScrollLayer() ||
- CurrentlyScrollingLayer() == InnerViewportScrollLayer();
- if (!wheel_scrolling_ && !currently_scrolling_viewport) {
- // Allow the fling to lock to the first layer that moves after the initial
- // fling |ScrollBy()| event, unless we're already scrolling the viewport.
- did_lock_scrolling_layer_ = false;
- should_bubble_scrolls_ = false;
- }
-
return SCROLL_STARTED;
}
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698