| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 // static | 45 // static |
| 46 float Display::GetForcedDeviceScaleFactor() { | 46 float Display::GetForcedDeviceScaleFactor() { |
| 47 static const float kForcedDeviceScaleFactor = | 47 static const float kForcedDeviceScaleFactor = |
| 48 GetForcedDeviceScaleFactorImpl(); | 48 GetForcedDeviceScaleFactorImpl(); |
| 49 return kForcedDeviceScaleFactor; | 49 return kForcedDeviceScaleFactor; |
| 50 } | 50 } |
| 51 | 51 |
| 52 //static | 52 //static |
| 53 bool Display::HasForceDeviceScaleFactor() { | 53 bool Display::HasForceDeviceScaleFactor() { |
| 54 return HasForceDeviceScaleFactorImpl(); | 54 static const bool kHasForceDeviceScaleFactor = |
| 55 HasForceDeviceScaleFactorImpl(); |
| 56 return kHasForceDeviceScaleFactor; |
| 55 } | 57 } |
| 56 | 58 |
| 57 Display::Display() | 59 Display::Display() |
| 58 : id_(kInvalidDisplayID), | 60 : id_(kInvalidDisplayID), |
| 59 device_scale_factor_(GetForcedDeviceScaleFactor()), | 61 device_scale_factor_(GetForcedDeviceScaleFactor()), |
| 60 rotation_(ROTATE_0), | 62 rotation_(ROTATE_0), |
| 61 touch_support_(TOUCH_SUPPORT_UNKNOWN) { | 63 touch_support_(TOUCH_SUPPORT_UNKNOWN) { |
| 62 } | 64 } |
| 63 | 65 |
| 64 Display::Display(int64 id) | 66 Display::Display(int64 id) |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 148 |
| 147 int64 Display::InternalDisplayId() { | 149 int64 Display::InternalDisplayId() { |
| 148 return internal_display_id_; | 150 return internal_display_id_; |
| 149 } | 151 } |
| 150 | 152 |
| 151 void Display::SetInternalDisplayId(int64 internal_display_id) { | 153 void Display::SetInternalDisplayId(int64 internal_display_id) { |
| 152 internal_display_id_ = internal_display_id; | 154 internal_display_id_ = internal_display_id; |
| 153 } | 155 } |
| 154 | 156 |
| 155 } // namespace gfx | 157 } // namespace gfx |
| OLD | NEW |