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

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

Issue 2841263002: [VSync Queue] Flush input in CommitComplete() (Closed)
Patch Set: Test Patch: VsyncAlignedInput Enabled Created 3 years, 7 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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 !IsGestureScrollOrFlingOrPinch(event_with_callback->event().GetType())) { 318 !IsGestureScrollOrFlingOrPinch(event_with_callback->event().GetType())) {
319 DispatchSingleInputEvent(std::move(event_with_callback), 319 DispatchSingleInputEvent(std::move(event_with_callback),
320 tick_clock_->NowTicks()); 320 tick_clock_->NowTicks());
321 return; 321 return;
322 } 322 }
323 323
324 if (has_ongoing_compositor_scroll_fling_pinch_) { 324 if (has_ongoing_compositor_scroll_fling_pinch_) {
325 bool needs_animate_input = compositor_event_queue_->empty(); 325 bool needs_animate_input = compositor_event_queue_->empty();
326 compositor_event_queue_->Queue(std::move(event_with_callback), 326 compositor_event_queue_->Queue(std::move(event_with_callback),
327 tick_clock_->NowTicks()); 327 tick_clock_->NowTicks());
328
329 if (input_handler_->GetInputHandlerState() ==
330 cc::InputHandler::InputHandlerState::IDLE) {
331 // Dispatch immediately to avoid checkerboard in high latency mode.
332 DispatchQueuedInputEvents();
333 return;
334 }
335
328 if (needs_animate_input) 336 if (needs_animate_input)
329 input_handler_->SetNeedsAnimateInput(); 337 input_handler_->SetNeedsAnimateInput();
330 return; 338 return;
331 } 339 }
332 340
333 // We have to dispatch the event to know whether the gesture sequence will be 341 // We have to dispatch the event to know whether the gesture sequence will be
334 // handled by the compositor or not. 342 // handled by the compositor or not.
335 DispatchSingleInputEvent(std::move(event_with_callback), 343 DispatchSingleInputEvent(std::move(event_with_callback),
336 tick_clock_->NowTicks()); 344 tick_clock_->NowTicks());
337 } 345 }
(...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after
1645 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, 1653 scroll_elasticity_controller_->GetWeakPtr(), gesture_event,
1646 scroll_result)); 1654 scroll_result));
1647 } 1655 }
1648 1656
1649 void InputHandlerProxy::SetTickClockForTesting( 1657 void InputHandlerProxy::SetTickClockForTesting(
1650 std::unique_ptr<base::TickClock> tick_clock) { 1658 std::unique_ptr<base::TickClock> tick_clock) {
1651 tick_clock_ = std::move(tick_clock); 1659 tick_clock_ = std::move(tick_clock);
1652 } 1660 }
1653 1661
1654 } // namespace ui 1662 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698