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

Side by Side Diff: ui/display/manager/managed_display_info.h

Issue 2540383002: Updates display manager and display preferences to handle touch calibration data. (Closed)
Patch Set: Merge with ToT 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 unified diff | Download patch
« no previous file with comments | « ui/display/manager/display_manager.cc ('k') | ui/display/manager/managed_display_info.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 #ifndef UI_DISPLAY_MANAGER_MANAGED_DISPLAY_INFO_H_ 5 #ifndef UI_DISPLAY_MANAGER_MANAGED_DISPLAY_INFO_H_
6 #define UI_DISPLAY_MANAGER_MANAGED_DISPLAY_INFO_H_ 6 #define UI_DISPLAY_MANAGER_MANAGED_DISPLAY_INFO_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9 #include <algorithm>
10 #include <array> 10 #include <array>
11 #include <map> 11 #include <map>
12 #include <string> 12 #include <string>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/files/file_path.h" 15 #include "base/files/file_path.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "ui/display/display.h" 17 #include "ui/display/display.h"
18 #include "ui/display/manager/display_manager_export.h" 18 #include "ui/display/manager/display_manager_export.h"
19 #include "ui/display/types/display_constants.h" 19 #include "ui/display/types/display_constants.h"
20 #include "ui/gfx/geometry/insets.h" 20 #include "ui/gfx/geometry/insets.h"
21 #include "ui/gfx/geometry/rect.h" 21 #include "ui/gfx/geometry/rect.h"
22 22
23 namespace display { 23 namespace display {
24 24
25 // A struct that represents all the data required for touch calibration for the 25 // A struct that represents all the data required for touch calibration for the
26 // display. 26 // display.
27 struct DISPLAY_MANAGER_EXPORT TouchCalibrationData { 27 struct DISPLAY_MANAGER_EXPORT TouchCalibrationData {
28 // CalibrationPointPair.first -> display point 28 // CalibrationPointPair.first -> display point
29 // CalibrationPointPair.second -> touch point 29 // CalibrationPointPair.second -> touch point
30 using CalibrationPointPair = std::pair<gfx::Point, gfx::Point>; 30 using CalibrationPointPair = std::pair<gfx::Point, gfx::Point>;
31 using CalibrationPointPairQuad = std::array<CalibrationPointPair, 4>; 31 using CalibrationPointPairQuad = std::array<CalibrationPointPair, 4>;
32 TouchCalibrationData(); 32 TouchCalibrationData();
33 TouchCalibrationData(const CalibrationPointPairQuad& point_pairs, 33 TouchCalibrationData(const CalibrationPointPairQuad& point_pairs,
34 const gfx::Size& bounds); 34 const gfx::Size& bounds);
35 TouchCalibrationData(const TouchCalibrationData& calibration_data); 35 TouchCalibrationData(const TouchCalibrationData& calibration_data);
36 36
37 static bool CalibrationPointPairCompare(const CalibrationPointPair& pair_1,
38 const CalibrationPointPair& pair_2) {
39 return pair_1.first.y() < pair_2.first.y()
40 ? true
41 : pair_1.first.x() < pair_2.first.x();
42 }
43
44 bool operator==(TouchCalibrationData other) const;
45
37 // Calibration point pairs used during calibration. Each point pair contains a 46 // Calibration point pairs used during calibration. Each point pair contains a
38 // display point and the corresponding touch point. 47 // display point and the corresponding touch point.
39 CalibrationPointPairQuad point_pairs; 48 CalibrationPointPairQuad point_pairs;
40 49
41 // Bounds of the touch display when the calibration was performed. 50 // Bounds of the touch display when the calibration was performed.
42 gfx::Size bounds; 51 gfx::Size bounds;
43 }; 52 };
44 53
45 // A class that represents the display's mode info. 54 // A class that represents the display's mode info.
46 class DISPLAY_MANAGER_EXPORT ManagedDisplayMode 55 class DISPLAY_MANAGER_EXPORT ManagedDisplayMode
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 // If you add a new member, you need to update Copy(). 400 // If you add a new member, you need to update Copy().
392 }; 401 };
393 402
394 // Resets the synthesized display id for testing. This 403 // Resets the synthesized display id for testing. This
395 // is necessary to avoid overflowing the output index. 404 // is necessary to avoid overflowing the output index.
396 void DISPLAY_MANAGER_EXPORT ResetDisplayIdForTest(); 405 void DISPLAY_MANAGER_EXPORT ResetDisplayIdForTest();
397 406
398 } // namespace display 407 } // namespace display
399 408
400 #endif // UI_DISPLAY_MANAGER_MANAGED_DISPLAY_INFO_H_ 409 #endif // UI_DISPLAY_MANAGER_MANAGED_DISPLAY_INFO_H_
OLDNEW
« no previous file with comments | « ui/display/manager/display_manager.cc ('k') | ui/display/manager/managed_display_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698