| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 public: | 25 public: |
| 26 DisplaySnapshot(int64_t display_id, | 26 DisplaySnapshot(int64_t display_id, |
| 27 const gfx::Point& origin, | 27 const gfx::Point& origin, |
| 28 const gfx::Size& physical_size, | 28 const gfx::Size& physical_size, |
| 29 DisplayConnectionType type, | 29 DisplayConnectionType type, |
| 30 bool is_aspect_preserving_scaling, | 30 bool is_aspect_preserving_scaling, |
| 31 bool has_overscan, | 31 bool has_overscan, |
| 32 std::string display_name, | 32 std::string display_name, |
| 33 const base::FilePath& sys_path, | 33 const base::FilePath& sys_path, |
| 34 const std::vector<const DisplayMode*>& modes, | 34 const std::vector<const DisplayMode*>& modes, |
| 35 const std::vector<uint8_t>& edid, |
| 35 const DisplayMode* current_mode, | 36 const DisplayMode* current_mode, |
| 36 const DisplayMode* native_mode); | 37 const DisplayMode* native_mode); |
| 37 virtual ~DisplaySnapshot(); | 38 virtual ~DisplaySnapshot(); |
| 38 | 39 |
| 39 const gfx::Point& origin() const { return origin_; } | 40 const gfx::Point& origin() const { return origin_; } |
| 40 const gfx::Size& physical_size() const { return physical_size_; } | 41 const gfx::Size& physical_size() const { return physical_size_; } |
| 41 ui::DisplayConnectionType type() const { return type_; } | 42 ui::DisplayConnectionType type() const { return type_; } |
| 42 bool is_aspect_preserving_scaling() const { | 43 bool is_aspect_preserving_scaling() const { |
| 43 return is_aspect_preserving_scaling_; | 44 return is_aspect_preserving_scaling_; |
| 44 } | 45 } |
| 45 bool has_overscan() const { return has_overscan_; } | 46 bool has_overscan() const { return has_overscan_; } |
| 46 std::string display_name() const { return display_name_; } | 47 std::string display_name() const { return display_name_; } |
| 47 const base::FilePath& sys_path() const { return sys_path_; } | 48 const base::FilePath& sys_path() const { return sys_path_; } |
| 48 | 49 |
| 49 int64_t display_id() const { return display_id_; } | 50 int64_t display_id() const { return display_id_; } |
| 50 | 51 |
| 51 const DisplayMode* current_mode() const { return current_mode_; } | 52 const DisplayMode* current_mode() const { return current_mode_; } |
| 52 const DisplayMode* native_mode() const { return native_mode_; } | 53 const DisplayMode* native_mode() const { return native_mode_; } |
| 53 int64_t product_id() const { return product_id_; } | 54 int64_t product_id() const { return product_id_; } |
| 54 | 55 |
| 55 const std::vector<const DisplayMode*>& modes() const { return modes_; } | 56 const std::vector<const DisplayMode*>& modes() const { return modes_; } |
| 57 const std::vector<uint8_t>& edid() const { return edid_; } |
| 56 | 58 |
| 57 void set_current_mode(const DisplayMode* mode) { current_mode_ = mode; } | 59 void set_current_mode(const DisplayMode* mode) { current_mode_ = mode; } |
| 58 void set_origin(const gfx::Point& origin) { origin_ = origin; } | 60 void set_origin(const gfx::Point& origin) { origin_ = origin; } |
| 59 void add_mode(const DisplayMode* mode) { modes_.push_back(mode); } | 61 void add_mode(const DisplayMode* mode) { modes_.push_back(mode); } |
| 60 | 62 |
| 61 // Returns a textual representation of this display state. | 63 // Returns a textual representation of this display state. |
| 62 virtual std::string ToString() const = 0; | 64 virtual std::string ToString() const = 0; |
| 63 | 65 |
| 64 // Used when no product id known. | 66 // Used when no product id known. |
| 65 static const int64_t kInvalidProductID = -1; | 67 static const int64_t kInvalidProductID = -1; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 78 bool is_aspect_preserving_scaling_; | 80 bool is_aspect_preserving_scaling_; |
| 79 | 81 |
| 80 bool has_overscan_; | 82 bool has_overscan_; |
| 81 | 83 |
| 82 std::string display_name_; | 84 std::string display_name_; |
| 83 | 85 |
| 84 base::FilePath sys_path_; | 86 base::FilePath sys_path_; |
| 85 | 87 |
| 86 std::vector<const DisplayMode*> modes_; // Not owned. | 88 std::vector<const DisplayMode*> modes_; // Not owned. |
| 87 | 89 |
| 90 // The display's EDID. It can be empty if nothing extracted such as in the |
| 91 // case of a virtual display. |
| 92 std::vector<uint8_t> edid_; |
| 93 |
| 88 // Mode currently being used by the output. | 94 // Mode currently being used by the output. |
| 89 const DisplayMode* current_mode_; | 95 const DisplayMode* current_mode_; |
| 90 | 96 |
| 91 // "Best" mode supported by the output. | 97 // "Best" mode supported by the output. |
| 92 const DisplayMode* native_mode_; | 98 const DisplayMode* native_mode_; |
| 93 | 99 |
| 94 // Combination of manufacturer and product code. | 100 // Combination of manufacturer and product code. |
| 95 int64_t product_id_; | 101 int64_t product_id_; |
| 96 | 102 |
| 97 DISALLOW_COPY_AND_ASSIGN(DisplaySnapshot); | 103 DISALLOW_COPY_AND_ASSIGN(DisplaySnapshot); |
| 98 }; | 104 }; |
| 99 | 105 |
| 100 } // namespace ui | 106 } // namespace ui |
| 101 | 107 |
| 102 #endif // UI_DISPLAY_TYPES_DISPLAY_SNAPSHOT_H_ | 108 #endif // UI_DISPLAY_TYPES_DISPLAY_SNAPSHOT_H_ |
| OLD | NEW |