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

Side by Side Diff: ui/events/blink/input_handler_proxy.cc

Issue 2951973002: Reland of [VSync Queue] Plug touch ack to gesture events and flush vsync queue if necessary (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/blink/input_handler_proxy.h" 5 #include "ui/events/blink/input_handler_proxy.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 // Note: Other input can race ahead of gesture input as they don't have to go 317 // Note: Other input can race ahead of gesture input as they don't have to go
318 // through the queue, but we believe it's OK to do so. 318 // through the queue, but we believe it's OK to do so.
319 if (!compositor_event_queue_ || 319 if (!compositor_event_queue_ ||
320 !IsGestureScrollOrFlingOrPinch(event_with_callback->event().GetType())) { 320 !IsGestureScrollOrFlingOrPinch(event_with_callback->event().GetType())) {
321 DispatchSingleInputEvent(std::move(event_with_callback), 321 DispatchSingleInputEvent(std::move(event_with_callback),
322 tick_clock_->NowTicks()); 322 tick_clock_->NowTicks());
323 return; 323 return;
324 } 324 }
325 325
326 if (has_ongoing_compositor_scroll_fling_pinch_) { 326 if (has_ongoing_compositor_scroll_fling_pinch_) {
327 const auto& gesture_event = ToWebGestureEvent(event_with_callback->event());
328 if (gesture_event.source_device == blink::kWebGestureDeviceTouchscreen &&
329 gesture_event.is_source_touch_event_set_non_blocking) {
330 // Dispatch immediately to avoid regression in
331 // |smoothness.tough_scrolling_cases:first_gesture_scroll_update_latency|.
332 compositor_event_queue_->Queue(std::move(event_with_callback),
333 tick_clock_->NowTicks());
334 DispatchQueuedInputEvents();
335 return;
336 }
337
327 bool needs_animate_input = compositor_event_queue_->empty(); 338 bool needs_animate_input = compositor_event_queue_->empty();
328 compositor_event_queue_->Queue(std::move(event_with_callback), 339 compositor_event_queue_->Queue(std::move(event_with_callback),
329 tick_clock_->NowTicks()); 340 tick_clock_->NowTicks());
330 if (needs_animate_input) 341 if (needs_animate_input)
331 input_handler_->SetNeedsAnimateInput(); 342 input_handler_->SetNeedsAnimateInput();
332 return; 343 return;
333 } 344 }
334 345
335 // We have to dispatch the event to know whether the gesture sequence will be 346 // We have to dispatch the event to know whether the gesture sequence will be
336 // handled by the compositor or not. 347 // handled by the compositor or not.
(...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after
1675 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, 1686 scroll_elasticity_controller_->GetWeakPtr(), gesture_event,
1676 scroll_result)); 1687 scroll_result));
1677 } 1688 }
1678 1689
1679 void InputHandlerProxy::SetTickClockForTesting( 1690 void InputHandlerProxy::SetTickClockForTesting(
1680 std::unique_ptr<base::TickClock> tick_clock) { 1691 std::unique_ptr<base::TickClock> tick_clock) {
1681 tick_clock_ = std::move(tick_clock); 1692 tick_clock_ = std::move(tick_clock);
1682 } 1693 }
1683 1694
1684 } // namespace ui 1695 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/blink/blink_event_util.cc ('k') | ui/events/gesture_detection/filtered_gesture_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698