Chromium Code Reviews| 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" |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 bool is_aspect_preserving_scaling() const { | 37 bool is_aspect_preserving_scaling() const { |
| 38 return is_aspect_preserving_scaling_; | 38 return is_aspect_preserving_scaling_; |
| 39 } | 39 } |
| 40 bool has_overscan() const { return has_overscan_; } | 40 bool has_overscan() const { return has_overscan_; } |
| 41 std::string display_name() const { return display_name_; } | 41 std::string display_name() const { return display_name_; } |
| 42 | 42 |
| 43 int64_t display_id() const { return display_id_; } | 43 int64_t display_id() const { return display_id_; } |
| 44 | 44 |
| 45 const DisplayMode* current_mode() const { return current_mode_; } | 45 const DisplayMode* current_mode() const { return current_mode_; } |
| 46 const DisplayMode* native_mode() const { return native_mode_; } | 46 const DisplayMode* native_mode() const { return native_mode_; } |
| 47 int64_t product_id() const { return product_id_; } | |
| 47 | 48 |
| 48 const std::vector<const DisplayMode*>& modes() const { return modes_; } | 49 const std::vector<const DisplayMode*>& modes() const { return modes_; } |
| 49 | 50 |
| 50 void set_current_mode(const DisplayMode* mode) { current_mode_ = mode; } | 51 void set_current_mode(const DisplayMode* mode) { current_mode_ = mode; } |
| 51 void set_origin(const gfx::Point& origin) { origin_ = origin; } | 52 void set_origin(const gfx::Point& origin) { origin_ = origin; } |
| 52 void add_mode(const DisplayMode* mode) { modes_.push_back(mode); } | 53 void add_mode(const DisplayMode* mode) { modes_.push_back(mode); } |
| 53 | 54 |
| 54 // Returns a textual representation of this display state. | 55 // Returns a textual representation of this display state. |
| 55 virtual std::string ToString() const = 0; | 56 virtual std::string ToString() const = 0; |
| 56 | 57 |
| 58 // Used when no product id known. | |
| 59 static const int64_t kInvalidProductID = -1; | |
|
dcheng
2015/05/06 18:27:46
Just curious: why is kInvalidProductID -1, and kDu
| |
| 60 | |
| 57 protected: | 61 protected: |
| 58 // Display id for this output. | 62 // Display id for this output. |
| 59 int64_t display_id_; | 63 int64_t display_id_; |
| 60 | 64 |
| 61 // Display's origin on the framebuffer. | 65 // Display's origin on the framebuffer. |
| 62 gfx::Point origin_; | 66 gfx::Point origin_; |
| 63 | 67 |
| 64 gfx::Size physical_size_; | 68 gfx::Size physical_size_; |
| 65 | 69 |
| 66 DisplayConnectionType type_; | 70 DisplayConnectionType type_; |
| 67 | 71 |
| 68 bool is_aspect_preserving_scaling_; | 72 bool is_aspect_preserving_scaling_; |
| 69 | 73 |
| 70 bool has_overscan_; | 74 bool has_overscan_; |
| 71 | 75 |
| 72 std::string display_name_; | 76 std::string display_name_; |
| 73 | 77 |
| 74 std::vector<const DisplayMode*> modes_; // Not owned. | 78 std::vector<const DisplayMode*> modes_; // Not owned. |
| 75 | 79 |
| 76 // Mode currently being used by the output. | 80 // Mode currently being used by the output. |
| 77 const DisplayMode* current_mode_; | 81 const DisplayMode* current_mode_; |
| 78 | 82 |
| 79 // "Best" mode supported by the output. | 83 // "Best" mode supported by the output. |
| 80 const DisplayMode* native_mode_; | 84 const DisplayMode* native_mode_; |
| 81 | 85 |
| 86 // Combination of manufacturer and product code. | |
| 87 int64_t product_id_; | |
| 88 | |
| 82 DISALLOW_COPY_AND_ASSIGN(DisplaySnapshot); | 89 DISALLOW_COPY_AND_ASSIGN(DisplaySnapshot); |
| 83 }; | 90 }; |
| 84 | 91 |
| 85 } // namespace ui | 92 } // namespace ui |
| 86 | 93 |
| 87 #endif // UI_DISPLAY_TYPES_DISPLAY_SNAPSHOT_H_ | 94 #endif // UI_DISPLAY_TYPES_DISPLAY_SNAPSHOT_H_ |
| OLD | NEW |