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

Unified Diff: ui/events/blink/input_handler_proxy.cc

Issue 1720023002: Wheel scrolling with smooth scrolling enabled would cause an extra animation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix failing test with adjusted scrollbegin/scroll end approach Created 4 years, 10 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 | « no previous file | ui/events/blink/input_handler_proxy_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/blink/input_handler_proxy.cc
diff --git a/ui/events/blink/input_handler_proxy.cc b/ui/events/blink/input_handler_proxy.cc
index 2a191b83601ca69228ac505a0d4600f71897bdea..187c9ac85a13cb26f002f2224f96bb42a7fcd13d 100644
--- a/ui/events/blink/input_handler_proxy.cc
+++ b/ui/events/blink/input_handler_proxy.cc
@@ -597,10 +597,18 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollBegin(
} else if (smooth_scroll_enabled_ &&
gesture_event.data.scrollBegin.deltaHintUnits ==
blink::WebGestureEvent::ScrollUnits::Pixels) {
- gfx::Vector2dF scroll_delta(-gesture_event.data.scrollBegin.deltaXHint,
- -gesture_event.data.scrollBegin.deltaYHint);
- scroll_status = input_handler_->ScrollAnimated(
- gfx::Point(gesture_event.x, gesture_event.y), scroll_delta);
+ // Generate a scroll begin/end combination to determine if
+ // this can actually be handled by the impl thread or not. But
+ // don't generate any scroll yet; GestureScrollUpdate will generate
+ // the scroll animation.
+ scroll_status = input_handler_->ScrollBegin(
+ &scroll_state, cc::InputHandler::ANIMATED_WHEEL);
+ if (scroll_status.thread == cc::InputHandler::SCROLL_ON_IMPL_THREAD) {
+ cc::ScrollStateData scroll_state_end_data;
+ scroll_state_end_data.is_ending = true;
+ cc::ScrollState scroll_state_end(scroll_state_end_data);
+ input_handler_->ScrollEnd(&scroll_state_end);
+ }
} else {
scroll_status =
input_handler_->ScrollBegin(&scroll_state, cc::InputHandler::GESTURE);
« no previous file with comments | « no previous file | ui/events/blink/input_handler_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698