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 5f67753990a22d64563c4cf6912afab3f7d60633..c2896b1b4a490614680c60dfb77ec0ac7135ee4e 100644 |
| --- a/ui/display/manager/managed_display_info.h |
| +++ b/ui/display/manager/managed_display_info.h |
| @@ -7,6 +7,7 @@ |
| #include <stdint.h> |
| +#include <array> |
| #include <map> |
| #include <string> |
| #include <vector> |
| @@ -21,6 +22,26 @@ |
| namespace display { |
| +// A struct that represents all the data required for touch calibration for the |
| +// display. |
| +struct DISPLAY_EXPORT TouchCalibrationData { |
| + // CalibrationPointPair.first -> display point |
| + // CalibrationPointPair.second -> touch point |
| + using CalibrationPointPair = std::pair<gfx::Point, gfx::Point>; |
| + using CalibrationPoints = std::array<CalibrationPointPair, 4>; |
|
oshima
2016/11/23 21:52:42
how about CalibrationPointPairQuad ?
malaykeshav
2016/11/23 22:11:27
Done
|
| + TouchCalibrationData(); |
| + TouchCalibrationData(const CalibrationPoints& point_pairs, |
| + const gfx::Size& bounds); |
| + TouchCalibrationData(const TouchCalibrationData& calibration_data); |
| + |
| + // Calibration point pairs used during calibration. Each point pair contains a |
| + // display point and the corresponding touch point. |
| + CalibrationPoints point_pairs; |
| + |
| + // Bounds of the touch display when the calibration was performed. |
| + gfx::Size bounds; |
| +}; |
| + |
| // A class that represents the display's mode info. |
| class DISPLAY_EXPORT ManagedDisplayMode |
| : public base::RefCounted<ManagedDisplayMode> { |
| @@ -243,6 +264,15 @@ class DISPLAY_EXPORT ManagedDisplayInfo { |
| // display. |
| void SetManagedDisplayModes(const ManagedDisplayModeList& display_modes); |
| + |
| + // Sets/Gets the touch calibration data for the display. |
|
oshima
2016/11/23 21:52:42
indent
malaykeshav
2016/11/23 22:11:27
Done
|
| + void SetTouchCalibrationData(const TouchCalibrationData& calibration_data); |
| + TouchCalibrationData |
|
oshima
2016/11/23 21:52:42
const &
malaykeshav
2016/11/23 22:11:27
Done
|
| + GetTouchCalibrationData() const { return touch_calibration_data_; } |
| + bool has_touch_calibration_data() const |
| + { return has_touch_calibration_data_; } |
| + void clear_touch_calibration_data() { has_touch_calibration_data_ = false; } |
| + |
| // Returns the native mode size. If a native mode is not present, return an |
| // empty size. |
| gfx::Size GetNativeModeSize() const; |
| @@ -302,6 +332,7 @@ class DISPLAY_EXPORT ManagedDisplayInfo { |
| std::map<Display::RotationSource, Display::Rotation> rotations_; |
| Display::RotationSource active_rotation_source_; |
| Display::TouchSupport touch_support_; |
| + bool has_touch_calibration_data_; |
| // The set of input devices associated with this display. |
| std::vector<int> input_devices_; |
| @@ -354,6 +385,9 @@ class DISPLAY_EXPORT ManagedDisplayInfo { |
| // Maximum cursor size. |
| gfx::Size maximum_cursor_size_; |
| + // Information associated to touch calibration for the display. |
| + TouchCalibrationData touch_calibration_data_; |
| + |
| // If you add a new member, you need to update Copy(). |
| }; |