| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_TYPES_DISPLAY_SNAPSHOT_H_ | 5 #ifndef UI_DISPLAY_TYPES_DISPLAY_SNAPSHOT_H_ |
| 6 #define UI_DISPLAY_TYPES_DISPLAY_SNAPSHOT_H_ | 6 #define UI_DISPLAY_TYPES_DISPLAY_SNAPSHOT_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ui/display/types/display_constants.h" | 10 #include "ui/display/types/display_constants.h" |
| 11 #include "ui/display/types/display_mode.h" | 11 #include "ui/display/types/display_mode.h" |
| 12 #include "ui/gfx/geometry/point.h" | 12 #include "ui/gfx/geometry/point.h" |
| 13 #include "ui/gfx/geometry/size.h" | 13 #include "ui/gfx/geometry/size.h" |
| 14 | 14 |
| 15 namespace ui { | 15 namespace ui { |
| 16 | 16 |
| 17 // This class represents the state of a display at one point in time. Platforms | 17 // This class represents the state of a display at one point in time. Platforms |
| 18 // will extend this class in order to add platform specific configuration and | 18 // will extend this class in order to add platform specific configuration and |
| 19 // identifiers required to configure this display. | 19 // identifiers required to configure this display. |
| 20 class DISPLAY_TYPES_EXPORT DisplaySnapshot { | 20 class DISPLAY_TYPES_EXPORT DisplaySnapshot { |
| 21 public: | 21 public: |
| 22 DisplaySnapshot(int64_t display_id, | 22 DisplaySnapshot(int64_t display_id, |
| 23 const gfx::Point& origin, | 23 const gfx::Point& origin, |
| 24 const gfx::Size& physical_size, | 24 const gfx::Size& physical_size, |
| 25 DisplayConnectionType type, | 25 DisplayConnectionType type, |
| 26 bool is_aspect_preserving_scaling, | |
| 27 bool has_overscan, | |
| 28 std::string display_name, | |
| 29 const std::vector<const DisplayMode*>& modes, | 26 const std::vector<const DisplayMode*>& modes, |
| 30 const DisplayMode* current_mode, | 27 const DisplayMode* current_mode, |
| 31 const DisplayMode* native_mode); | 28 const DisplayMode* native_mode); |
| 32 virtual ~DisplaySnapshot(); | 29 virtual ~DisplaySnapshot(); |
| 33 | 30 |
| 34 const gfx::Point& origin() const { return origin_; } | 31 const gfx::Point& origin() const { return origin_; } |
| 35 const gfx::Size& physical_size() const { return physical_size_; } | 32 const gfx::Size& physical_size() const { return physical_size_; } |
| 36 ui::DisplayConnectionType type() const { return type_; } | 33 ui::DisplayConnectionType type() const { return type_; } |
| 37 bool is_aspect_preserving_scaling() const { | |
| 38 return is_aspect_preserving_scaling_; | |
| 39 } | |
| 40 bool has_overscan() const { return has_overscan_; } | |
| 41 std::string display_name() const { return display_name_; } | |
| 42 | 34 |
| 43 int64_t display_id() const { return display_id_; } | 35 int64_t display_id() const { return display_id_; } |
| 44 | 36 |
| 45 const DisplayMode* current_mode() const { return current_mode_; } | 37 const DisplayMode* current_mode() const { return current_mode_; } |
| 46 const DisplayMode* native_mode() const { return native_mode_; } | 38 const DisplayMode* native_mode() const { return native_mode_; } |
| 47 int64_t product_id() const { return product_id_; } | 39 int64_t product_id() const { return product_id_; } |
| 48 | 40 |
| 49 const std::vector<const DisplayMode*>& modes() const { return modes_; } | 41 const std::vector<const DisplayMode*>& modes() const { return modes_; } |
| 50 | 42 |
| 51 void set_current_mode(const DisplayMode* mode) { current_mode_ = mode; } | 43 void set_current_mode(const DisplayMode* mode) { current_mode_ = mode; } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 62 // Display id for this output. | 54 // Display id for this output. |
| 63 int64_t display_id_; | 55 int64_t display_id_; |
| 64 | 56 |
| 65 // Display's origin on the framebuffer. | 57 // Display's origin on the framebuffer. |
| 66 gfx::Point origin_; | 58 gfx::Point origin_; |
| 67 | 59 |
| 68 gfx::Size physical_size_; | 60 gfx::Size physical_size_; |
| 69 | 61 |
| 70 DisplayConnectionType type_; | 62 DisplayConnectionType type_; |
| 71 | 63 |
| 72 bool is_aspect_preserving_scaling_; | |
| 73 | |
| 74 bool has_overscan_; | |
| 75 | |
| 76 std::string display_name_; | |
| 77 | |
| 78 std::vector<const DisplayMode*> modes_; // Not owned. | 64 std::vector<const DisplayMode*> modes_; // Not owned. |
| 79 | 65 |
| 80 // Mode currently being used by the output. | 66 // Mode currently being used by the output. |
| 81 const DisplayMode* current_mode_; | 67 const DisplayMode* current_mode_; |
| 82 | 68 |
| 83 // "Best" mode supported by the output. | 69 // "Best" mode supported by the output. |
| 84 const DisplayMode* native_mode_; | 70 const DisplayMode* native_mode_; |
| 85 | 71 |
| 86 // Combination of manufacturer and product code. | 72 // Combination of manufacturer and product code. |
| 87 int64_t product_id_; | 73 int64_t product_id_; |
| 88 | 74 |
| 89 DISALLOW_COPY_AND_ASSIGN(DisplaySnapshot); | 75 DISALLOW_COPY_AND_ASSIGN(DisplaySnapshot); |
| 90 }; | 76 }; |
| 91 | 77 |
| 92 } // namespace ui | 78 } // namespace ui |
| 93 | 79 |
| 94 #endif // UI_DISPLAY_TYPES_DISPLAY_SNAPSHOT_H_ | 80 #endif // UI_DISPLAY_TYPES_DISPLAY_SNAPSHOT_H_ |
| OLD | NEW |