OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SERVICES_UI_DISPLAY_VIEWPORT_METRICS_H_ |
| 6 #define SERVICES_UI_DISPLAY_VIEWPORT_METRICS_H_ |
| 7 |
| 8 #include "ui/display/display.h" |
| 9 #include "ui/gfx/geometry/rect.h" |
| 10 #include "ui/gfx/geometry/size.h" |
| 11 |
| 12 namespace display { |
| 13 |
| 14 struct ViewportMetrics { |
| 15 std::string ToString() const; |
| 16 |
| 17 gfx::Rect bounds; // DIP. |
| 18 gfx::Rect work_area; // DIP. |
| 19 gfx::Size pixel_size; |
| 20 Display::Rotation rotation = Display::ROTATE_0; |
| 21 float device_scale_factor = 0.0f; |
| 22 }; |
| 23 |
| 24 inline bool operator==(const ViewportMetrics& lhs, const ViewportMetrics& rhs) { |
| 25 return lhs.bounds == rhs.bounds && lhs.work_area == rhs.work_area && |
| 26 lhs.pixel_size == rhs.pixel_size && lhs.rotation == rhs.rotation && |
| 27 lhs.device_scale_factor == rhs.device_scale_factor; |
| 28 } |
| 29 |
| 30 inline bool operator!=(const ViewportMetrics& lhs, const ViewportMetrics& rhs) { |
| 31 return !(lhs == rhs); |
| 32 } |
| 33 |
| 34 } // namespace display |
| 35 |
| 36 #endif // SERVICES_UI_DISPLAY_VIEWPORT_METRICS_H_ |
OLD | NEW |