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 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 for (size_t i = 0; i < lhs.GetPointerCount(); ++i) { | 57 for (size_t i = 0; i < lhs.GetPointerCount(); ++i) { |
58 int rhsi = rhs.FindPointerIndexOfId(lhs.GetPointerId(i)); | 58 int rhsi = rhs.FindPointerIndexOfId(lhs.GetPointerId(i)); |
59 if (rhsi == -1) | 59 if (rhsi == -1) |
60 return false; | 60 return false; |
61 | 61 |
62 if (lhs.GetX(i) != rhs.GetX(rhsi) || lhs.GetY(i) != rhs.GetY(rhsi) || | 62 if (lhs.GetX(i) != rhs.GetX(rhsi) || lhs.GetY(i) != rhs.GetY(rhsi) || |
63 lhs.GetRawX(i) != rhs.GetRawX(rhsi) || | 63 lhs.GetRawX(i) != rhs.GetRawX(rhsi) || |
64 lhs.GetRawY(i) != rhs.GetRawY(rhsi) || | 64 lhs.GetRawY(i) != rhs.GetRawY(rhsi) || |
65 lhs.GetTouchMajor(i) != rhs.GetTouchMajor(rhsi) || | 65 lhs.GetTouchMajor(i) != rhs.GetTouchMajor(rhsi) || |
| 66 lhs.GetTouchMinor(i) != rhs.GetTouchMinor(rhsi) || |
| 67 lhs.GetOrientation(i) != rhs.GetOrientation(rhsi) || |
66 lhs.GetPressure(i) != rhs.GetPressure(rhsi) || | 68 lhs.GetPressure(i) != rhs.GetPressure(rhsi) || |
67 lhs.GetToolType(i) != rhs.GetToolType(rhsi)) | 69 lhs.GetToolType(i) != rhs.GetToolType(rhsi)) |
68 return false; | 70 return false; |
69 | 71 |
70 for (size_t h = 0; h < lhs.GetHistorySize(); ++h) { | 72 for (size_t h = 0; h < lhs.GetHistorySize(); ++h) { |
71 if (lhs.GetHistoricalX(i, h) != rhs.GetHistoricalX(rhsi, h) || | 73 if (lhs.GetHistoricalX(i, h) != rhs.GetHistoricalX(rhsi, h) || |
72 lhs.GetHistoricalY(i, h) != rhs.GetHistoricalY(rhsi, h) || | 74 lhs.GetHistoricalY(i, h) != rhs.GetHistoricalY(rhsi, h) || |
73 lhs.GetHistoricalTouchMajor(i, h) != | 75 lhs.GetHistoricalTouchMajor(i, h) != |
74 rhs.GetHistoricalTouchMajor(rhsi, h)) | 76 rhs.GetHistoricalTouchMajor(rhsi, h)) |
75 return false; | 77 return false; |
76 } | 78 } |
77 } | 79 } |
78 | 80 |
79 for (size_t h = 0; h < lhs.GetHistorySize(); ++h) { | 81 for (size_t h = 0; h < lhs.GetHistorySize(); ++h) { |
80 if (lhs.GetHistoricalEventTime(h) != rhs.GetHistoricalEventTime(h)) | 82 if (lhs.GetHistoricalEventTime(h) != rhs.GetHistoricalEventTime(h)) |
81 return false; | 83 return false; |
82 } | 84 } |
83 | 85 |
84 return true; | 86 return true; |
85 } | 87 } |
86 | 88 |
87 bool operator!=(const MotionEvent& lhs, const MotionEvent& rhs) { | 89 bool operator!=(const MotionEvent& lhs, const MotionEvent& rhs) { |
88 return !(lhs == rhs); | 90 return !(lhs == rhs); |
89 } | 91 } |
90 | 92 |
91 } // namespace ui | 93 } // namespace ui |
OLD | NEW |