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 #include "ui/events/ozone/evdev/touch_noise/touch_noise_finder.h" | 5 #include "ui/events/ozone/evdev/touch_noise/touch_noise_finder.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 30 matching lines...) Expand all Loading... |
41 InProgressTouchEvdev touch; | 41 InProgressTouchEvdev touch; |
42 touch.x = entry.location.x(); | 42 touch.x = entry.location.x(); |
43 touch.y = entry.location.y(); | 43 touch.y = entry.location.y(); |
44 touch.tracking_id = entry.slot; | 44 touch.tracking_id = entry.slot; |
45 touch.slot = entry.slot; | 45 touch.slot = entry.slot; |
46 touch.was_touching = was_touching.test(touch.slot); | 46 touch.was_touching = was_touching.test(touch.slot); |
47 touch.touching = entry.touching; | 47 touch.touching = entry.touching; |
48 touches.push_back(touch); | 48 touches.push_back(touch); |
49 | 49 |
50 if (i == count - 1 || entry.time_ms != entries[i + 1].time_ms) { | 50 if (i == count - 1 || entry.time_ms != entries[i + 1].time_ms) { |
51 touch_noise_finder_->HandleTouches( | 51 touch_noise_finder_->HandleTouches(touches, |
52 touches, base::TimeDelta::FromMilliseconds(entry.time_ms)); | 52 base::TimeTicks() + TimeDelta::FromMilliseconds(entry.time_ms)); |
53 | 53 |
54 for (size_t j = 0; j < touches.size(); ++j) { | 54 for (size_t j = 0; j < touches.size(); ++j) { |
55 bool expect_noise = entries[j + start_index].expect_noise; | 55 bool expect_noise = entries[j + start_index].expect_noise; |
56 size_t slot = touches[j].slot; | 56 size_t slot = touches[j].slot; |
57 if (touch_noise_finder_->SlotHasNoise(slot) != expect_noise) { | 57 if (touch_noise_finder_->SlotHasNoise(slot) != expect_noise) { |
58 LOG(ERROR) << base::StringPrintf( | 58 LOG(ERROR) << base::StringPrintf( |
59 "Incorrect filtering at %dms for slot %zu", entry.time_ms, | 59 "Incorrect filtering at %dms for slot %zu", entry.time_ms, |
60 slot); | 60 slot); |
61 return false; | 61 return false; |
62 } | 62 } |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 {1000, 1, true, gfx::PointF(10, 10), false}, | 148 {1000, 1, true, gfx::PointF(10, 10), false}, |
149 {2000, 1, true, gfx::PointF(10, 11), false}, | 149 {2000, 1, true, gfx::PointF(10, 11), false}, |
150 {3000, 1, true, gfx::PointF(10, 10), false}, | 150 {3000, 1, true, gfx::PointF(10, 10), false}, |
151 {4000, 1, true, gfx::PointF(10, 11), true}, | 151 {4000, 1, true, gfx::PointF(10, 11), true}, |
152 {5000, 1, true, gfx::PointF(10, 10), true}, | 152 {5000, 1, true, gfx::PointF(10, 10), true}, |
153 {6000, 1, true, gfx::PointF(10, 11), true}}; | 153 {6000, 1, true, gfx::PointF(10, 11), true}}; |
154 EXPECT_TRUE(FilterAndCheck(kTestData, arraysize(kTestData))); | 154 EXPECT_TRUE(FilterAndCheck(kTestData, arraysize(kTestData))); |
155 } | 155 } |
156 | 156 |
157 } // namespace ui | 157 } // namespace ui |
OLD | NEW |