| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 touch_support_(TOUCH_SUPPORT_UNKNOWN) { | 49 touch_support_(TOUCH_SUPPORT_UNKNOWN) { |
| 50 } | 50 } |
| 51 | 51 |
| 52 Display::Display(int64 id, const gfx::Rect& bounds) | 52 Display::Display(int64 id, const gfx::Rect& bounds) |
| 53 : id_(id), | 53 : id_(id), |
| 54 bounds_(bounds), | 54 bounds_(bounds), |
| 55 work_area_(bounds), | 55 work_area_(bounds), |
| 56 device_scale_factor_(GetForcedDeviceScaleFactor()), | 56 device_scale_factor_(GetForcedDeviceScaleFactor()), |
| 57 rotation_(ROTATE_0), | 57 rotation_(ROTATE_0), |
| 58 touch_support_(TOUCH_SUPPORT_UNKNOWN) { | 58 touch_support_(TOUCH_SUPPORT_UNKNOWN) { |
| 59 #if defined(USE_AURA) | |
| 60 SetScaleAndBounds(device_scale_factor_, bounds); | |
| 61 #endif | |
| 62 } | 59 } |
| 63 | 60 |
| 64 Display::~Display() { | 61 Display::~Display() { |
| 65 } | 62 } |
| 66 | 63 |
| 67 int Display::RotationAsDegree() const { | 64 int Display::RotationAsDegree() const { |
| 68 switch (rotation_) { | 65 switch (rotation_) { |
| 69 case ROTATE_0: | 66 case ROTATE_0: |
| 70 return 0; | 67 return 0; |
| 71 case ROTATE_90: | 68 case ROTATE_90: |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 160 |
| 164 int64 Display::InternalDisplayId() { | 161 int64 Display::InternalDisplayId() { |
| 165 return internal_display_id_; | 162 return internal_display_id_; |
| 166 } | 163 } |
| 167 | 164 |
| 168 void Display::SetInternalDisplayId(int64 internal_display_id) { | 165 void Display::SetInternalDisplayId(int64 internal_display_id) { |
| 169 internal_display_id_ = internal_display_id; | 166 internal_display_id_ = internal_display_id; |
| 170 } | 167 } |
| 171 | 168 |
| 172 } // namespace gfx | 169 } // namespace gfx |
| OLD | NEW |