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

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

Issue 2040543002: Take MT jank into account when animating the scroll offset on CC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add test + apply suggested improvement Created 4 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_unittest_animation.cc ('k') | 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 5cbb1cc9dc151d1cac73a8bb8cf4fb39632a7061..8ee7816f1938a83a3d9a4855f14f605e8ab749e7 100644
--- a/ui/events/blink/input_handler_proxy.cc
+++ b/ui/events/blink/input_handler_proxy.cc
@@ -503,7 +503,6 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::ScrollByMouseWheel(
RecordMainThreadScrollingReasons(
blink::WebGestureDeviceTouchpad,
cc::MainThreadScrollingReason::kPageBasedScrolling);
-
} else {
DCHECK(!ShouldAnimate(wheel_event.hasPreciseScrollingDeltas));
cc::ScrollStateData scroll_state_begin_data;
@@ -621,7 +620,7 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollBegin(
InputHandlerProxy::EventDisposition
InputHandlerProxy::HandleGestureScrollUpdate(
- const WebGestureEvent& gesture_event) {
+ const WebGestureEvent& gesture_event) {
#ifndef NDEBUG
DCHECK(expect_scroll_update_end_);
#endif
@@ -636,7 +635,12 @@ InputHandlerProxy::HandleGestureScrollUpdate(
if (ShouldAnimate(gesture_event.data.scrollUpdate.deltaUnits !=
blink::WebGestureEvent::ScrollUnits::Pixels)) {
DCHECK(!scroll_state.is_in_inertial_phase());
- switch (input_handler_->ScrollAnimated(scroll_point, scroll_delta).thread) {
+ base::TimeTicks event_time =
+ base::TimeTicks() +
+ base::TimeDelta::FromSecondsD(gesture_event.timeStampSeconds);
+ base::TimeDelta delay = base::TimeTicks::Now() - event_time;
+ switch (input_handler_->ScrollAnimated(scroll_point, scroll_delta, delay)
+ .thread) {
case cc::InputHandler::SCROLL_ON_IMPL_THREAD:
return DID_HANDLE;
case cc::InputHandler::SCROLL_IGNORED:
« no previous file with comments | « cc/trees/layer_tree_host_unittest_animation.cc ('k') | ui/events/blink/input_handler_proxy_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698