| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 SERVICES_UI_DISPLAY_VIEWPORT_METRICS_H_ | 5 #ifndef SERVICES_UI_DISPLAY_VIEWPORT_METRICS_H_ |
| 6 #define SERVICES_UI_DISPLAY_VIEWPORT_METRICS_H_ | 6 #define SERVICES_UI_DISPLAY_VIEWPORT_METRICS_H_ |
| 7 | 7 |
| 8 #include "ui/display/display.h" | 8 #include "ui/display/display.h" |
| 9 #include "ui/gfx/geometry/rect.h" | 9 #include "ui/gfx/geometry/rect.h" |
| 10 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
| 11 | 11 |
| 12 namespace display { | 12 namespace display { |
| 13 | 13 |
| 14 struct ViewportMetrics { | 14 struct ViewportMetrics { |
| 15 std::string ToString() const; | 15 std::string ToString() const; |
| 16 | 16 |
| 17 gfx::Rect bounds; // DIP. | 17 gfx::Rect bounds; // DIP. |
| 18 gfx::Rect work_area; // DIP. | 18 gfx::Rect work_area; // DIP. |
| 19 gfx::Size pixel_size; | 19 gfx::Size pixel_size; |
| 20 Display::Rotation rotation = Display::ROTATE_0; | 20 Display::Rotation rotation = Display::ROTATE_0; |
| 21 Display::TouchSupport touch_support = Display::TOUCH_SUPPORT_UNKNOWN; |
| 21 float device_scale_factor = 0.0f; | 22 float device_scale_factor = 0.0f; |
| 23 float ui_scale_factor = 0.0f; |
| 22 }; | 24 }; |
| 23 | 25 |
| 24 inline bool operator==(const ViewportMetrics& lhs, const ViewportMetrics& rhs) { | 26 inline bool operator==(const ViewportMetrics& lhs, const ViewportMetrics& rhs) { |
| 25 return lhs.bounds == rhs.bounds && lhs.work_area == rhs.work_area && | 27 return lhs.bounds == rhs.bounds && lhs.work_area == rhs.work_area && |
| 26 lhs.pixel_size == rhs.pixel_size && lhs.rotation == rhs.rotation && | 28 lhs.pixel_size == rhs.pixel_size && lhs.rotation == rhs.rotation && |
| 27 lhs.device_scale_factor == rhs.device_scale_factor; | 29 lhs.touch_support == rhs.touch_support && |
| 30 lhs.device_scale_factor == rhs.device_scale_factor && |
| 31 lhs.ui_scale_factor == rhs.ui_scale_factor; |
| 28 } | 32 } |
| 29 | 33 |
| 30 inline bool operator!=(const ViewportMetrics& lhs, const ViewportMetrics& rhs) { | 34 inline bool operator!=(const ViewportMetrics& lhs, const ViewportMetrics& rhs) { |
| 31 return !(lhs == rhs); | 35 return !(lhs == rhs); |
| 32 } | 36 } |
| 33 | 37 |
| 34 } // namespace display | 38 } // namespace display |
| 35 | 39 |
| 36 #endif // SERVICES_UI_DISPLAY_VIEWPORT_METRICS_H_ | 40 #endif // SERVICES_UI_DISPLAY_VIEWPORT_METRICS_H_ |
| OLD | NEW |