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.h" | 5 #include "ui/events/gesture_detection/motion_event.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 namespace ui { | 9 namespace ui { |
10 | 10 |
11 size_t MotionEvent::GetHistorySize() const { | 11 size_t MotionEvent::GetHistorySize() const { |
12 return 0; | 12 return 0; |
13 } | 13 } |
14 | 14 |
15 base::TimeTicks MotionEvent::GetHistoricalEventTime( | 15 base::TimeTicks MotionEvent::GetHistoricalEventTime( |
16 size_t historical_index) const { | 16 size_t historical_index) const { |
17 NOTIMPLEMENTED(); | 17 NOTIMPLEMENTED(); |
18 return base::TimeTicks(); | 18 return base::TimeTicks(); |
19 } | 19 } |
20 | 20 |
21 float MotionEvent::GetHistoricalTouchMajor(size_t pointer_index, | 21 float MotionEvent::GetHistoricalTouchMajor(size_t pointer_index, |
22 size_t historical_index) const { | 22 size_t historical_index) const { |
23 NOTIMPLEMENTED(); | 23 NOTIMPLEMENTED(); |
24 return 0.f; | 24 return 0.f; |
25 } | 25 } |
26 | 26 |
| 27 float MotionEvent::GetHistoricalTouchMinor(size_t pointer_index, |
| 28 size_t historical_index) const { |
| 29 NOTIMPLEMENTED(); |
| 30 return 0.f; |
| 31 } |
| 32 |
| 33 float MotionEvent::GetHistoricalOrientation(size_t pointer_index, |
| 34 size_t historical_index) const { |
| 35 NOTIMPLEMENTED(); |
| 36 return 0.f; |
| 37 } |
| 38 |
27 float MotionEvent::GetHistoricalX(size_t pointer_index, | 39 float MotionEvent::GetHistoricalX(size_t pointer_index, |
28 size_t historical_index) const { | 40 size_t historical_index) const { |
29 NOTIMPLEMENTED(); | 41 NOTIMPLEMENTED(); |
30 return 0.f; | 42 return 0.f; |
31 } | 43 } |
32 | 44 |
33 float MotionEvent::GetHistoricalY(size_t pointer_index, | 45 float MotionEvent::GetHistoricalY(size_t pointer_index, |
34 size_t historical_index) const { | 46 size_t historical_index) const { |
35 NOTIMPLEMENTED(); | 47 NOTIMPLEMENTED(); |
36 return 0.f; | 48 return 0.f; |
(...skipping 19 matching lines...) Expand all Loading... |
56 | 68 |
57 for (size_t i = 0; i < lhs.GetPointerCount(); ++i) { | 69 for (size_t i = 0; i < lhs.GetPointerCount(); ++i) { |
58 int rhsi = rhs.FindPointerIndexOfId(lhs.GetPointerId(i)); | 70 int rhsi = rhs.FindPointerIndexOfId(lhs.GetPointerId(i)); |
59 if (rhsi == -1) | 71 if (rhsi == -1) |
60 return false; | 72 return false; |
61 | 73 |
62 if (lhs.GetX(i) != rhs.GetX(rhsi) || lhs.GetY(i) != rhs.GetY(rhsi) || | 74 if (lhs.GetX(i) != rhs.GetX(rhsi) || lhs.GetY(i) != rhs.GetY(rhsi) || |
63 lhs.GetRawX(i) != rhs.GetRawX(rhsi) || | 75 lhs.GetRawX(i) != rhs.GetRawX(rhsi) || |
64 lhs.GetRawY(i) != rhs.GetRawY(rhsi) || | 76 lhs.GetRawY(i) != rhs.GetRawY(rhsi) || |
65 lhs.GetTouchMajor(i) != rhs.GetTouchMajor(rhsi) || | 77 lhs.GetTouchMajor(i) != rhs.GetTouchMajor(rhsi) || |
| 78 lhs.GetTouchMinor(i) != rhs.GetTouchMinor(rhsi) || |
| 79 lhs.GetOrientation(i) != rhs.GetOrientation(rhsi) || |
66 lhs.GetPressure(i) != rhs.GetPressure(rhsi) || | 80 lhs.GetPressure(i) != rhs.GetPressure(rhsi) || |
67 lhs.GetToolType(i) != rhs.GetToolType(rhsi)) | 81 lhs.GetToolType(i) != rhs.GetToolType(rhsi)) |
68 return false; | 82 return false; |
69 | 83 |
70 for (size_t h = 0; h < lhs.GetHistorySize(); ++h) { | 84 for (size_t h = 0; h < lhs.GetHistorySize(); ++h) { |
71 if (lhs.GetHistoricalX(i, h) != rhs.GetHistoricalX(rhsi, h) || | 85 if (lhs.GetHistoricalX(i, h) != rhs.GetHistoricalX(rhsi, h) || |
72 lhs.GetHistoricalY(i, h) != rhs.GetHistoricalY(rhsi, h) || | 86 lhs.GetHistoricalY(i, h) != rhs.GetHistoricalY(rhsi, h) || |
73 lhs.GetHistoricalTouchMajor(i, h) != | 87 lhs.GetHistoricalTouchMajor(i, h) != |
74 rhs.GetHistoricalTouchMajor(rhsi, h)) | 88 rhs.GetHistoricalTouchMajor(rhsi, h) || |
| 89 lhs.GetHistoricalTouchMinor(i, h) != |
| 90 rhs.GetHistoricalTouchMinor(rhsi, h) || |
| 91 lhs.GetHistoricalOrientation(i, h) != |
| 92 rhs.GetHistoricalOrientation(rhsi, h)) |
75 return false; | 93 return false; |
76 } | 94 } |
77 } | 95 } |
78 | 96 |
79 for (size_t h = 0; h < lhs.GetHistorySize(); ++h) { | 97 for (size_t h = 0; h < lhs.GetHistorySize(); ++h) { |
80 if (lhs.GetHistoricalEventTime(h) != rhs.GetHistoricalEventTime(h)) | 98 if (lhs.GetHistoricalEventTime(h) != rhs.GetHistoricalEventTime(h)) |
81 return false; | 99 return false; |
82 } | 100 } |
83 | 101 |
84 return true; | 102 return true; |
85 } | 103 } |
86 | 104 |
87 bool operator!=(const MotionEvent& lhs, const MotionEvent& rhs) { | 105 bool operator!=(const MotionEvent& lhs, const MotionEvent& rhs) { |
88 return !(lhs == rhs); | 106 return !(lhs == rhs); |
89 } | 107 } |
90 | 108 |
91 } // namespace ui | 109 } // namespace ui |
OLD | NEW |