OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef UI_EVENTS_OZONE_EVDEV_TOUCH_NOISE_FAR_APART_TAPS_TOUCH_NOISE_FILTER_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_TOUCH_NOISE_FAR_APART_TAPS_TOUCH_NOISE_FILTER_H_ |
6 #define UI_EVENTS_OZONE_EVDEV_TOUCH_NOISE_FAR_APART_TAPS_TOUCH_NOISE_FILTER_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_TOUCH_NOISE_FAR_APART_TAPS_TOUCH_NOISE_FILTER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "ui/events/ozone/evdev/touch_noise/touch_noise_filter.h" | 10 #include "ui/events/ozone/evdev/touch_noise/touch_noise_filter.h" |
11 | 11 |
12 namespace ui { | 12 namespace ui { |
13 | 13 |
14 class FarApartTapsTouchNoiseFilter : public TouchNoiseFilter { | 14 class FarApartTapsTouchNoiseFilter : public TouchNoiseFilter { |
15 public: | 15 public: |
16 FarApartTapsTouchNoiseFilter() {} | 16 FarApartTapsTouchNoiseFilter() {} |
17 ~FarApartTapsTouchNoiseFilter() override {} | 17 ~FarApartTapsTouchNoiseFilter() override {} |
18 | 18 |
19 // TouchNoiseFilter: | 19 // TouchNoiseFilter: |
20 void Filter(const std::vector<InProgressTouchEvdev>& touches, | 20 void Filter(const std::vector<InProgressTouchEvdev>& touches, |
21 base::TimeDelta time, | 21 base::TimeTicks time, |
22 std::bitset<kNumTouchEvdevSlots>* slots_with_noise) override; | 22 std::bitset<kNumTouchEvdevSlots>* slots_with_noise) override; |
23 | 23 |
24 private: | 24 private: |
25 struct Tap { | 25 struct Tap { |
26 Tap() : x(0), y(0) {} | 26 Tap() : x(0), y(0) {} |
27 Tap(base::TimeDelta start, int x, int y) | 27 Tap(base::TimeTicks start, int x, int y) |
28 : start(start), x(x), y(y) {} | 28 : start(start), x(x), y(y) {} |
29 | 29 |
30 bool is_valid() const { return !start.is_zero(); } | 30 bool is_valid() const { return start != base::TimeTicks(); } |
miu
2016/05/16 20:05:35
!start.is_null()
majidvp
2016/05/21 01:38:00
Done.
| |
31 void Invalidate() { start = base::TimeDelta(); } | 31 void Invalidate() { start = base::TimeTicks(); } |
32 | 32 |
33 base::TimeDelta start; | 33 base::TimeTicks start; |
34 float x; | 34 float x; |
35 float y; | 35 float y; |
36 }; | 36 }; |
37 | 37 |
38 // Tracks in progress taps in slots. | 38 // Tracks in progress taps in slots. |
39 Tap tracked_taps_[kNumTouchEvdevSlots]; | 39 Tap tracked_taps_[kNumTouchEvdevSlots]; |
40 | 40 |
41 DISALLOW_COPY_AND_ASSIGN(FarApartTapsTouchNoiseFilter); | 41 DISALLOW_COPY_AND_ASSIGN(FarApartTapsTouchNoiseFilter); |
42 }; | 42 }; |
43 | 43 |
44 } // namespace ui | 44 } // namespace ui |
45 | 45 |
46 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_NOISE_FAR_APART_TAPS_TOUCH_NOISE_FILTER_H _ | 46 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_NOISE_FAR_APART_TAPS_TOUCH_NOISE_FILTER_H _ |
OLD | NEW |