Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(140)

Unified Diff: ui/display/manager/managed_display_info.h

Issue 2540383002: Updates display manager and display preferences to handle touch calibration data. (Closed)
Patch Set: nit Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..5161844a1db305623d247a9794aa16cd5cbeb376 100644
--- a/ui/display/manager/managed_display_info.h
+++ b/ui/display/manager/managed_display_info.h
@@ -34,6 +34,27 @@ struct DISPLAY_EXPORT TouchCalibrationData {
const gfx::Size& bounds);
TouchCalibrationData(const TouchCalibrationData& calibration_data);
+ bool operator==(TouchCalibrationData other) const {
+ if (bounds != other.bounds)
+ return false;
+ bool checked[4] = {false};
+ size_t match = 0;
+ // The Calibration point pairs need not be in order.
+ for (size_t row = 0; row < point_pairs.size(); row++) {
+ for (size_t o_row=0; o_row < other.point_pairs.size(); o_row++) {
+ if (checked[o_row])
+ continue;
+ if (other.point_pairs[o_row].first == point_pairs[row].first &&
+ other.point_pairs[o_row].second == point_pairs[row].second) {
+ checked[o_row] = true;
+ match++;
+ break;
+ }
+ }
+ }
+ return match == point_pairs.size();
+ }
+
// Calibration point pairs used during calibration. Each point pair contains a
// display point and the corresponding touch point.
CalibrationPointPairQuad point_pairs;

Powered by Google App Engine
This is Rietveld 408576698