| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/display/manager/managed_display_info.h" | 5 #include "ui/display/manager/managed_display_info.h" |
| 6 | 6 |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 color_profile_ = native_info.color_profile(); | 393 color_profile_ = native_info.color_profile(); |
| 394 } | 394 } |
| 395 } | 395 } |
| 396 | 396 |
| 397 void ManagedDisplayInfo::SetBounds(const gfx::Rect& new_bounds_in_native) { | 397 void ManagedDisplayInfo::SetBounds(const gfx::Rect& new_bounds_in_native) { |
| 398 bounds_in_native_ = new_bounds_in_native; | 398 bounds_in_native_ = new_bounds_in_native; |
| 399 size_in_pixel_ = new_bounds_in_native.size(); | 399 size_in_pixel_ = new_bounds_in_native.size(); |
| 400 UpdateDisplaySize(); | 400 UpdateDisplaySize(); |
| 401 } | 401 } |
| 402 | 402 |
| 403 float ManagedDisplayInfo::GetDensityRatio() const { |
| 404 if (Use125DSFForUIScaling() && device_scale_factor_ == 1.25f) |
| 405 return 1.0f; |
| 406 return device_scale_factor_; |
| 407 } |
| 408 |
| 403 float ManagedDisplayInfo::GetEffectiveDeviceScaleFactor() const { | 409 float ManagedDisplayInfo::GetEffectiveDeviceScaleFactor() const { |
| 404 if (Use125DSFForUIScaling() && device_scale_factor_ == 1.25f) | 410 if (Use125DSFForUIScaling() && device_scale_factor_ == 1.25f) |
| 405 return (configured_ui_scale_ == 0.8f) ? 1.25f : 1.0f; | 411 return (configured_ui_scale_ == 0.8f) ? 1.25f : 1.0f; |
| 406 if (device_scale_factor_ == configured_ui_scale_) | 412 if (device_scale_factor_ == configured_ui_scale_) |
| 407 return 1.0f; | 413 return 1.0f; |
| 408 return device_scale_factor_; | 414 return device_scale_factor_; |
| 409 } | 415 } |
| 410 | 416 |
| 411 float ManagedDisplayInfo::GetEffectiveUIScale() const { | 417 float ManagedDisplayInfo::GetEffectiveUIScale() const { |
| 412 if (Use125DSFForUIScaling() && device_scale_factor_ == 1.25f) | 418 if (Use125DSFForUIScaling() && device_scale_factor_ == 1.25f) |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 synthesized_display_id = kSynthesizedDisplayIdStart; | 534 synthesized_display_id = kSynthesizedDisplayIdStart; |
| 529 } | 535 } |
| 530 | 536 |
| 531 void ManagedDisplayInfo::SetTouchCalibrationData( | 537 void ManagedDisplayInfo::SetTouchCalibrationData( |
| 532 const TouchCalibrationData& touch_calibration_data) { | 538 const TouchCalibrationData& touch_calibration_data) { |
| 533 has_touch_calibration_data_ = true; | 539 has_touch_calibration_data_ = true; |
| 534 touch_calibration_data_ = touch_calibration_data; | 540 touch_calibration_data_ = touch_calibration_data; |
| 535 } | 541 } |
| 536 | 542 |
| 537 } // namespace display | 543 } // namespace display |
| OLD | NEW |