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

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: Created 4 years, 6 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
« cc/input/input_handler.h ('K') | « ui/events/blink/input_handler_proxy.h ('k') | no next file » | 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 811554176974f8afdcfe2a08b02ea5c5bb685d9b..8405e216412d0fba134318ac2317a7b2e8af5a2e 100644
--- a/ui/events/blink/input_handler_proxy.cc
+++ b/ui/events/blink/input_handler_proxy.cc
@@ -276,12 +276,13 @@ InputHandlerProxy::HandleInputEventWithLatencyInfo(
std::unique_ptr<cc::SwapPromiseMonitor> latency_info_swap_promise_monitor =
input_handler_->CreateLatencyInfoSwapPromiseMonitor(latency_info);
- InputHandlerProxy::EventDisposition disposition = HandleInputEvent(event);
+ InputHandlerProxy::EventDisposition disposition =
+ HandleInputEvent(event, latency_info);
return disposition;
}
InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent(
- const WebInputEvent& event) {
+ const WebInputEvent& event, ui::LatencyInfo* latency_info) {
DCHECK(input_handler_);
if (FilterInputEventForFlingBoosting(event))
@@ -297,7 +298,7 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleInputEvent(
case WebInputEvent::GestureScrollUpdate:
return HandleGestureScrollUpdate(
- static_cast<const WebGestureEvent&>(event));
+ static_cast<const WebGestureEvent&>(event), latency_info);
case WebInputEvent::GestureScrollEnd:
return HandleGestureScrollEnd(static_cast<const WebGestureEvent&>(event));
@@ -647,7 +648,7 @@ InputHandlerProxy::EventDisposition InputHandlerProxy::HandleGestureScrollBegin(
InputHandlerProxy::EventDisposition
InputHandlerProxy::HandleGestureScrollUpdate(
- const WebGestureEvent& gesture_event) {
+ const WebGestureEvent& gesture_event, ui::LatencyInfo* latency_info) {
#ifndef NDEBUG
DCHECK(expect_scroll_update_end_);
#endif
@@ -662,8 +663,20 @@ InputHandlerProxy::HandleGestureScrollUpdate(
if (ShouldAnimate(gesture_event.data.scrollUpdate.deltaUnits !=
blink::WebGestureEvent::ScrollUnits::Pixels)) {
switch (input_handler_->ScrollAnimated(scroll_point, scroll_delta).thread) {
- case cc::InputHandler::SCROLL_ON_IMPL_THREAD:
+ case cc::InputHandler::SCROLL_ON_IMPL_THREAD: {
+ for (const auto& lc : latency_info->latency_components()) {
+ if (lc.first.first == ui::INPUT_EVENT_LATENCY_BEGIN_RWH_COMPONENT) {
+ LatencyInfo::LatencyComponent o_component;
+ if (latency_info->FindLatency(
+ ui::INPUT_EVENT_LATENCY_ORIGINAL_COMPONENT, 0, &o_component)) {
+ input_handler_->AdjustDuration(
+ lc.second.event_time - o_component.event_time);
skobes 2016/06/08 22:47:28 I don't really understand what this is doing, is i
+ }
+ break;
+ }
+ }
return DID_HANDLE;
+ }
case cc::InputHandler::SCROLL_IGNORED:
return DROP_EVENT;
default:
« cc/input/input_handler.h ('K') | « ui/events/blink/input_handler_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698