Chromium Code Reviews| Index: ui/display/manager/managed_display_info.h |
| diff --git a/ui/display/manager/managed_display_info.h b/ui/display/manager/managed_display_info.h |
| index 1fb48a87982a257e7c798a3641f8f614bc2f7b49..72c8ad0b2d742096e9f23d3632dc622d09dcd58e 100644 |
| --- a/ui/display/manager/managed_display_info.h |
| +++ b/ui/display/manager/managed_display_info.h |
| @@ -6,7 +6,7 @@ |
| #define UI_DISPLAY_MANAGER_MANAGED_DISPLAY_INFO_H_ |
| #include <stdint.h> |
| - |
| +#include <algorithm> |
| #include <array> |
| #include <map> |
| #include <string> |
| @@ -34,6 +34,30 @@ struct DISPLAY_EXPORT TouchCalibrationData { |
| const gfx::Size& bounds); |
| TouchCalibrationData(const TouchCalibrationData& calibration_data); |
| + static bool CalibrationPointPairCompare(const CalibrationPointPair& pair_1, |
| + const CalibrationPointPair& pair_2) { |
| + if (pair_1.first.y() < pair_2.first.y()) |
| + return true; |
| + return pair_1.first.x() < pair_2.first.x(); |
| + } |
| + |
| + bool operator==(TouchCalibrationData other) const { |
| + if (bounds != other.bounds) |
| + return false; |
| + CalibrationPointPairQuad quad_1 = point_pairs; |
| + CalibrationPointPairQuad& quad_2 = other.point_pairs; |
| + |
| + // Make sure the point pairs are in the correct order. |
| + std::sort(quad_1.begin(), quad_1.end(), CalibrationPointPairCompare); |
| + std::sort(quad_2.begin(), quad_2.end(), CalibrationPointPairCompare); |
| + |
|
oshima
2016/12/05 20:43:21
return quad_1 == quad_2;
malaykeshav
2016/12/05 21:53:58
Done
malaykeshav
2016/12/05 21:53:58
Done
|
| + for (size_t row = 0; row < quad_1.size(); row++) { |
| + if (quad_1[row] != quad_2[row]) |
| + return false; |
| + } |
| + return true; |
| + } |
|
oshima
2016/12/05 20:43:21
please move to .cc.
malaykeshav
2016/12/05 21:53:58
done
|
| + |
| // Calibration point pairs used during calibration. Each point pair contains a |
| // display point and the corresponding touch point. |
| CalibrationPointPairQuad point_pairs; |