| OLD | NEW |
| 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 #include "ui/display/manager/managed_display_info.h" | 5 #include "ui/display/manager/managed_display_info.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 TouchCalibrationData::TouchCalibrationData( | 80 TouchCalibrationData::TouchCalibrationData( |
| 81 const TouchCalibrationData::CalibrationPointPairQuad& point_pairs, | 81 const TouchCalibrationData::CalibrationPointPairQuad& point_pairs, |
| 82 const gfx::Size& bounds) : point_pairs(point_pairs), | 82 const gfx::Size& bounds) : point_pairs(point_pairs), |
| 83 bounds(bounds) {} | 83 bounds(bounds) {} |
| 84 | 84 |
| 85 TouchCalibrationData::TouchCalibrationData( | 85 TouchCalibrationData::TouchCalibrationData( |
| 86 const TouchCalibrationData& calibration_data) | 86 const TouchCalibrationData& calibration_data) |
| 87 : point_pairs(calibration_data.point_pairs), | 87 : point_pairs(calibration_data.point_pairs), |
| 88 bounds(calibration_data.bounds) {} | 88 bounds(calibration_data.bounds) {} |
| 89 | 89 |
| 90 bool TouchCalibrationData::operator==(TouchCalibrationData other) const { |
| 91 if (bounds != other.bounds) |
| 92 return false; |
| 93 CalibrationPointPairQuad quad_1 = point_pairs; |
| 94 CalibrationPointPairQuad& quad_2 = other.point_pairs; |
| 95 |
| 96 // Make sure the point pairs are in the correct order. |
| 97 std::sort(quad_1.begin(), quad_1.end(), CalibrationPointPairCompare); |
| 98 std::sort(quad_2.begin(), quad_2.end(), CalibrationPointPairCompare); |
| 99 |
| 100 return quad_1 == quad_2; |
| 101 } |
| 102 |
| 90 ManagedDisplayMode::ManagedDisplayMode() | 103 ManagedDisplayMode::ManagedDisplayMode() |
| 91 : refresh_rate_(0.0f), | 104 : refresh_rate_(0.0f), |
| 92 is_interlaced_(false), | 105 is_interlaced_(false), |
| 93 native_(false), | 106 native_(false), |
| 94 ui_scale_(1.0f), | 107 ui_scale_(1.0f), |
| 95 device_scale_factor_(1.0f) {} | 108 device_scale_factor_(1.0f) {} |
| 96 | 109 |
| 97 ManagedDisplayMode::ManagedDisplayMode(const gfx::Size& size) | 110 ManagedDisplayMode::ManagedDisplayMode(const gfx::Size& size) |
| 98 : size_(size), | 111 : size_(size), |
| 99 refresh_rate_(0.0f), | 112 refresh_rate_(0.0f), |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 synthesized_display_id = kSynthesizedDisplayIdStart; | 528 synthesized_display_id = kSynthesizedDisplayIdStart; |
| 516 } | 529 } |
| 517 | 530 |
| 518 void ManagedDisplayInfo::SetTouchCalibrationData( | 531 void ManagedDisplayInfo::SetTouchCalibrationData( |
| 519 const TouchCalibrationData& touch_calibration_data) { | 532 const TouchCalibrationData& touch_calibration_data) { |
| 520 has_touch_calibration_data_ = true; | 533 has_touch_calibration_data_ = true; |
| 521 touch_calibration_data_ = touch_calibration_data; | 534 touch_calibration_data_ = touch_calibration_data; |
| 522 } | 535 } |
| 523 | 536 |
| 524 } // namespace display | 537 } // namespace display |
| OLD | NEW |