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_MODE_H_ | 5 #ifndef UI_DISPLAY_TYPES_DISPLAY_MODE_H_ |
6 #define UI_DISPLAY_TYPES_DISPLAY_MODE_H_ | 6 #define UI_DISPLAY_TYPES_DISPLAY_MODE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "ui/display/types/display_types_export.h" | 12 #include "ui/display/types/display_types_export.h" |
13 #include "ui/gfx/buffer_types.h" | |
13 #include "ui/gfx/geometry/size.h" | 14 #include "ui/gfx/geometry/size.h" |
14 | 15 |
15 namespace ui { | 16 namespace ui { |
16 | 17 |
17 // This class represents the basic information for a native mode. Platforms will | 18 // This class represents the basic information for a native mode. Platforms will |
18 // extend this class to add platform specific information about the mode. | 19 // extend this class to add platform specific information about the mode. |
19 class DISPLAY_TYPES_EXPORT DisplayMode { | 20 class DISPLAY_TYPES_EXPORT DisplayMode { |
20 public: | 21 public: |
21 DisplayMode(const gfx::Size& size, bool interlaced, float refresh_rate); | 22 DisplayMode(const gfx::Size& size, bool interlaced, float refresh_rate); |
22 virtual ~DisplayMode(); | 23 virtual ~DisplayMode(); |
23 virtual std::unique_ptr<DisplayMode> Clone() const; | 24 virtual std::unique_ptr<DisplayMode> Clone() const; |
24 | 25 |
25 const gfx::Size& size() const { return size_; } | 26 const gfx::Size& size() const { return size_; } |
26 bool is_interlaced() const { return is_interlaced_; } | 27 bool is_interlaced() const { return is_interlaced_; } |
27 float refresh_rate() const { return refresh_rate_; } | 28 float refresh_rate() const { return refresh_rate_; } |
28 | 29 |
29 virtual std::string ToString() const; | 30 virtual std::string ToString() const; |
30 | 31 |
32 // Return the buffer format to be used for the primary | |
33 // plane buffer. | |
34 static gfx::BufferFormat PrimaryFormat(); | |
dnicoara
2016/08/05 13:59:45
This would better fit onto the DisplaySnapshot sin
Daniele Castagna
2016/08/06 04:48:07
Done.
| |
35 | |
31 private: | 36 private: |
32 gfx::Size size_; | 37 gfx::Size size_; |
33 bool is_interlaced_; | 38 bool is_interlaced_; |
34 float refresh_rate_; | 39 float refresh_rate_; |
35 | 40 |
36 DISALLOW_COPY_AND_ASSIGN(DisplayMode); | 41 DISALLOW_COPY_AND_ASSIGN(DisplayMode); |
37 }; | 42 }; |
38 | 43 |
39 } // namespace ui | 44 } // namespace ui |
40 | 45 |
41 #endif // UI_DISPLAY_TYPES_DISPLAY_MODE_H_ | 46 #endif // UI_DISPLAY_TYPES_DISPLAY_MODE_H_ |
OLD | NEW |