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

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

Issue 187073002: Refactoring display configuration state to allow generic state objects (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « ui/display/chromeos/display_mode.cc ('k') | ui/display/chromeos/display_snapshot.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_DISPLAY_CHROMEOS_DISPLAY_SNAPSHOT_H_
6 #define UI_DISPLAY_CHROMEOS_DISPLAY_SNAPSHOT_H_
7
8 #include <vector>
9
10 #include "ui/display/chromeos/display_mode.h"
11 #include "ui/display/chromeos/display_snapshot.h"
12 #include "ui/display/display_constants.h"
13 #include "ui/gfx/geometry/point.h"
14 #include "ui/gfx/geometry/size.h"
15
16 namespace ui {
17
18 // This class represents the state of a display at one point in time. Platforms
19 // will extend this class in order to add platform specific configuration and
20 // identifiers required to configure this display.
21 class DISPLAY_EXPORT DisplaySnapshot {
22 public:
23 DisplaySnapshot(int64_t display_id,
24 bool has_proper_display_id,
25 const gfx::Point& origin,
26 const gfx::Size& physical_size,
27 OutputType type,
28 bool is_aspect_preserving_scaling,
29 const std::vector<const DisplayMode*>& modes,
30 const DisplayMode* current_mode,
31 const DisplayMode* native_mode);
32 virtual ~DisplaySnapshot();
33
34 const gfx::Point& origin() const { return origin_; }
35 const gfx::Size& physical_size() const { return physical_size_; }
36 ui::OutputType type() const { return type_; }
37 bool is_aspect_preserving_scaling() const {
38 return is_aspect_preserving_scaling_;
39 }
40 int64_t display_id() const { return display_id_; }
41 bool has_proper_display_id() const { return has_proper_display_id_; }
42
43 const DisplayMode* current_mode() const { return current_mode_; }
44 const DisplayMode* native_mode() const { return native_mode_; }
45
46 const std::vector<const DisplayMode*>& modes() const { return modes_; }
47
48 void set_current_mode(const DisplayMode* mode) { current_mode_ = mode; }
49 void set_origin(const gfx::Point& origin) { origin_ = origin; }
50 void add_mode(const DisplayMode* mode) { modes_.push_back(mode); }
51
52 // Generates the human readable string for this display. Generally this is
53 // parsed from the EDID information.
54 virtual std::string GetDisplayName() = 0;
55
56 // Returns true if the overscan flag is set to true in the display
57 // information. Generally this is read from the EDID flags.
58 virtual bool GetOverscanFlag() = 0;
59
60 // Returns a textual representation of this display state.
61 virtual std::string ToString() const = 0;
62
63 protected:
64 // Display id for this output.
65 int64_t display_id_;
66 bool has_proper_display_id_;
67
68 // Output's origin on the framebuffer.
69 gfx::Point origin_;
70
71 gfx::Size physical_size_;
72
73 OutputType type_;
74
75 bool is_aspect_preserving_scaling_;
76
77 std::vector<const DisplayMode*> modes_; // Not owned.
78
79 // Mode currently being used by the output.
80 const DisplayMode* current_mode_;
81
82 // "Best" mode supported by the output.
83 const DisplayMode* native_mode_;
84
85 DISALLOW_COPY_AND_ASSIGN(DisplaySnapshot);
86 };
87
88 } // namespace ui
89
90 #endif // UI_DISPLAY_CHROMEOS_DISPLAY_SNAPSHOT_H_
OLDNEW
« no previous file with comments | « ui/display/chromeos/display_mode.cc ('k') | ui/display/chromeos/display_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698