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 #include "ui/gfx/display.h" | 5 #include "ui/gfx/display.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 static const float kForcedDeviceScaleFactor = | 45 static const float kForcedDeviceScaleFactor = |
46 GetForcedDeviceScaleFactorImpl(); | 46 GetForcedDeviceScaleFactorImpl(); |
47 return kForcedDeviceScaleFactor; | 47 return kForcedDeviceScaleFactor; |
48 } | 48 } |
49 | 49 |
50 //static | 50 //static |
51 bool Display::HasForceDeviceScaleFactor() { | 51 bool Display::HasForceDeviceScaleFactor() { |
52 return HasForceDeviceScaleFactorImpl(); | 52 return HasForceDeviceScaleFactorImpl(); |
53 } | 53 } |
54 | 54 |
55 // static | |
56 int64 Display::GetID(uint16 manufacturer_id, | |
57 uint16 product_code, | |
58 uint8 output_index) { | |
59 int64 new_id = ((static_cast<int64>(manufacturer_id) << 24) | | |
60 (static_cast<int64>(product_code) << 8) | output_index); | |
61 DCHECK_NE(kInvalidDisplayID, new_id); | |
62 return new_id; | |
63 } | |
64 | |
65 Display::Display() | 55 Display::Display() |
66 : id_(kInvalidDisplayID), | 56 : id_(kInvalidDisplayID), |
67 device_scale_factor_(GetForcedDeviceScaleFactor()), | 57 device_scale_factor_(GetForcedDeviceScaleFactor()), |
68 rotation_(ROTATE_0) { | 58 rotation_(ROTATE_0) { |
69 } | 59 } |
70 | 60 |
71 Display::Display(int64 id) | 61 Display::Display(int64 id) |
72 : id_(id), | 62 : id_(id), |
73 device_scale_factor_(GetForcedDeviceScaleFactor()), | 63 device_scale_factor_(GetForcedDeviceScaleFactor()), |
74 rotation_(ROTATE_0) { | 64 rotation_(ROTATE_0) { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 141 |
152 int64 Display::InternalDisplayId() { | 142 int64 Display::InternalDisplayId() { |
153 return internal_display_id_; | 143 return internal_display_id_; |
154 } | 144 } |
155 | 145 |
156 void Display::SetInternalDisplayId(int64 internal_display_id) { | 146 void Display::SetInternalDisplayId(int64 internal_display_id) { |
157 internal_display_id_ = internal_display_id; | 147 internal_display_id_ = internal_display_id; |
158 } | 148 } |
159 | 149 |
160 } // namespace gfx | 150 } // namespace gfx |
OLD | NEW |