Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(101)

Side by Side Diff: ui/display/types/display_snapshot.h

Issue 667753002: Treat displays with and without EDID the same way (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 bool has_proper_display_id,
24 const gfx::Point& origin, 23 const gfx::Point& origin,
25 const gfx::Size& physical_size, 24 const gfx::Size& physical_size,
26 DisplayConnectionType type, 25 DisplayConnectionType type,
27 bool is_aspect_preserving_scaling, 26 bool is_aspect_preserving_scaling,
28 bool has_overscan, 27 bool has_overscan,
29 std::string display_name, 28 std::string display_name,
30 const std::vector<const DisplayMode*>& modes, 29 const std::vector<const DisplayMode*>& modes,
31 const DisplayMode* current_mode, 30 const DisplayMode* current_mode,
32 const DisplayMode* native_mode); 31 const DisplayMode* native_mode);
33 virtual ~DisplaySnapshot(); 32 virtual ~DisplaySnapshot();
34 33
35 const gfx::Point& origin() const { return origin_; } 34 const gfx::Point& origin() const { return origin_; }
36 const gfx::Size& physical_size() const { return physical_size_; } 35 const gfx::Size& physical_size() const { return physical_size_; }
37 ui::DisplayConnectionType type() const { return type_; } 36 ui::DisplayConnectionType type() const { return type_; }
38 bool is_aspect_preserving_scaling() const { 37 bool is_aspect_preserving_scaling() const {
39 return is_aspect_preserving_scaling_; 38 return is_aspect_preserving_scaling_;
40 } 39 }
41 bool has_overscan() const { return has_overscan_; } 40 bool has_overscan() const { return has_overscan_; }
42 std::string display_name() const { return display_name_; } 41 std::string display_name() const { return display_name_; }
43 42
44 int64_t display_id() const { return display_id_; } 43 int64_t display_id() const { return display_id_; }
45 bool has_proper_display_id() const { return has_proper_display_id_; }
46 44
47 const DisplayMode* current_mode() const { return current_mode_; } 45 const DisplayMode* current_mode() const { return current_mode_; }
48 const DisplayMode* native_mode() const { return native_mode_; } 46 const DisplayMode* native_mode() const { return native_mode_; }
49 47
50 const std::vector<const DisplayMode*>& modes() const { return modes_; } 48 const std::vector<const DisplayMode*>& modes() const { return modes_; }
51 49
52 void set_current_mode(const DisplayMode* mode) { current_mode_ = mode; } 50 void set_current_mode(const DisplayMode* mode) { current_mode_ = mode; }
53 void set_origin(const gfx::Point& origin) { origin_ = origin; } 51 void set_origin(const gfx::Point& origin) { origin_ = origin; }
54 void add_mode(const DisplayMode* mode) { modes_.push_back(mode); } 52 void add_mode(const DisplayMode* mode) { modes_.push_back(mode); }
55 53
56 // Returns a textual representation of this display state. 54 // Returns a textual representation of this display state.
57 virtual std::string ToString() const = 0; 55 virtual std::string ToString() const = 0;
58 56
59 protected: 57 protected:
60 // Display id for this output. 58 // Display id for this output.
61 int64_t display_id_; 59 int64_t display_id_;
62 bool has_proper_display_id_;
63 60
64 // Display's origin on the framebuffer. 61 // Display's origin on the framebuffer.
65 gfx::Point origin_; 62 gfx::Point origin_;
66 63
67 gfx::Size physical_size_; 64 gfx::Size physical_size_;
68 65
69 DisplayConnectionType type_; 66 DisplayConnectionType type_;
70 67
71 bool is_aspect_preserving_scaling_; 68 bool is_aspect_preserving_scaling_;
72 69
73 bool has_overscan_; 70 bool has_overscan_;
74 71
75 std::string display_name_; 72 std::string display_name_;
76 73
77 std::vector<const DisplayMode*> modes_; // Not owned. 74 std::vector<const DisplayMode*> modes_; // Not owned.
78 75
79 // Mode currently being used by the output. 76 // Mode currently being used by the output.
80 const DisplayMode* current_mode_; 77 const DisplayMode* current_mode_;
81 78
82 // "Best" mode supported by the output. 79 // "Best" mode supported by the output.
83 const DisplayMode* native_mode_; 80 const DisplayMode* native_mode_;
84 81
85 DISALLOW_COPY_AND_ASSIGN(DisplaySnapshot); 82 DISALLOW_COPY_AND_ASSIGN(DisplaySnapshot);
86 }; 83 };
87 84
88 } // namespace ui 85 } // namespace ui
89 86
90 #endif // UI_DISPLAY_TYPES_DISPLAY_SNAPSHOT_H_ 87 #endif // UI_DISPLAY_TYPES_DISPLAY_SNAPSHOT_H_
OLDNEW
« no previous file with comments | « ui/display/chromeos/x11/native_display_event_dispatcher_x11_unittest.cc ('k') | ui/display/types/display_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698