OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/gesture_detection/motion_event_buffer.h" | 5 #include "ui/events/gesture_detection/motion_event_buffer.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/trace_event/trace_event.h" |
8 #include "ui/events/gesture_detection/motion_event_generic.h" | 8 #include "ui/events/gesture_detection/motion_event_generic.h" |
9 | 9 |
10 namespace ui { | 10 namespace ui { |
11 namespace { | 11 namespace { |
12 | 12 |
13 // Latency added during resampling. A few milliseconds doesn't hurt much but | 13 // Latency added during resampling. A few milliseconds doesn't hurt much but |
14 // reduces the impact of mispredicted touch positions. | 14 // reduces the impact of mispredicted touch positions. |
15 const int kResampleLatencyMs = 5; | 15 const int kResampleLatencyMs = 5; |
16 | 16 |
17 // Minimum time difference between consecutive samples before attempting to | 17 // Minimum time difference between consecutive samples before attempting to |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 | 332 |
333 void MotionEventBuffer::FlushWithoutResampling(MotionEventVector events) { | 333 void MotionEventBuffer::FlushWithoutResampling(MotionEventVector events) { |
334 last_extrapolated_event_time_ = base::TimeTicks(); | 334 last_extrapolated_event_time_ = base::TimeTicks(); |
335 if (events.empty()) | 335 if (events.empty()) |
336 return; | 336 return; |
337 | 337 |
338 client_->ForwardMotionEvent(*ConsumeSamples(events.Pass())); | 338 client_->ForwardMotionEvent(*ConsumeSamples(events.Pass())); |
339 } | 339 } |
340 | 340 |
341 } // namespace ui | 341 } // namespace ui |
OLD | NEW |