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

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: Remove unused plumbing Created 4 years, 4 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: 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 1d4a119420bbfc7103437d70a83da022085c87af..d68605c139187a63e976e3bfc9301331915e39f8 100644
--- a/ui/events/blink/input_handler_proxy.cc
+++ b/ui/events/blink/input_handler_proxy.cc
@@ -493,7 +493,7 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::ScrollByMouseWheel(
} else if (ShouldAnimate(wheel_event.hasPreciseScrollingDeltas)) {
cc::InputHandler::ScrollStatus scroll_status =
input_handler_->ScrollAnimated(gfx::Point(wheel_event.x, wheel_event.y),
- scroll_delta);
+ scroll_delta, base::TimeDelta());
RecordMainThreadScrollingReasons(
blink::WebGestureDeviceTouchpad,
@@ -625,7 +625,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
@@ -639,7 +639,12 @@ InputHandlerProxy::HandleGestureScrollUpdate(
if (ShouldAnimate(gesture_event.data.scrollUpdate.deltaUnits !=
blink::WebGestureEvent::ScrollUnits::Pixels)) {
- switch (input_handler_->ScrollAnimated(scroll_point, scroll_delta).thread) {
+ base::TimeDelta delay =
+ (base::TimeTicks::Now() -
+ (base::TimeTicks() +
+ base::TimeDelta::FromSecondsD(gesture_event.timeStampSeconds)));
tdresser 2016/08/25 15:55:54 Math seems correct, though I might add a temporary
ymalik 2016/08/29 14:52:06 Good tip, looks much prettier!
+ 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:

Powered by Google App Engine
This is Rietveld 408576698