OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GFX_DISPLAY_H_ | 5 #ifndef UI_GFX_DISPLAY_H_ |
6 #define UI_GFX_DISPLAY_H_ | 6 #define UI_GFX_DISPLAY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "ui/base/ui_export.h" | 10 #include "ui/base/ui_export.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 ~Display(); | 33 ~Display(); |
34 | 34 |
35 // Returns the forced device scale factor, which is given by | 35 // Returns the forced device scale factor, which is given by |
36 // "--force-device-scale-factor". | 36 // "--force-device-scale-factor". |
37 static float GetForcedDeviceScaleFactor(); | 37 static float GetForcedDeviceScaleFactor(); |
38 | 38 |
39 // Indicates if a device scale factor is being explicitly enforced from the | 39 // Indicates if a device scale factor is being explicitly enforced from the |
40 // command line via "--force-device-scale-factor". | 40 // command line via "--force-device-scale-factor". |
41 static bool HasForceDeviceScaleFactor(); | 41 static bool HasForceDeviceScaleFactor(); |
42 | 42 |
43 // Returns 64-bit persistent ID for the specified manufacturer's ID and | |
44 // product_code, and the index of the output it is connected to. | |
45 // |output_index| is used to distinguish the displays of the same type. For | |
46 // example, swapping two identical display between two outputs will not be | |
47 // treated as swap. The 'serial number' field in EDID isn't used here because | |
48 // it is not guaranteed to have unique number and it may have the same fixed | |
49 // value (like 0). | |
50 static int64 GetID(uint16 manufacturer_id, | |
51 uint16 product_code, | |
52 uint8 output_index); | |
53 | |
54 // Sets/Gets unique identifier associated with the display. | 43 // Sets/Gets unique identifier associated with the display. |
55 // -1 means invalid display and it doesn't not exit. | 44 // -1 means invalid display and it doesn't not exit. |
56 int64 id() const { return id_; } | 45 int64 id() const { return id_; } |
57 void set_id(int64 id) { id_ = id; } | 46 void set_id(int64 id) { id_ = id; } |
58 | 47 |
59 // Gets/Sets the display's bounds in gfx::Screen's coordinates. | 48 // Gets/Sets the display's bounds in gfx::Screen's coordinates. |
60 const Rect& bounds() const { return bounds_; } | 49 const Rect& bounds() const { return bounds_; } |
61 void set_bounds(const Rect& bounds) { bounds_ = bounds; } | 50 void set_bounds(const Rect& bounds) { bounds_ = bounds; } |
62 | 51 |
63 // Gets/Sets the display's work area in gfx::Screen's coordinates. | 52 // Gets/Sets the display's work area in gfx::Screen's coordinates. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 int64 id_; | 107 int64 id_; |
119 Rect bounds_; | 108 Rect bounds_; |
120 Rect work_area_; | 109 Rect work_area_; |
121 float device_scale_factor_; | 110 float device_scale_factor_; |
122 Rotation rotation_; | 111 Rotation rotation_; |
123 }; | 112 }; |
124 | 113 |
125 } // namespace gfx | 114 } // namespace gfx |
126 | 115 |
127 #endif // UI_GFX_DISPLAY_H_ | 116 #endif // UI_GFX_DISPLAY_H_ |
OLD | NEW |