| 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 synthesized_display_id = kSynthesizedDisplayIdStart; | 532 synthesized_display_id = kSynthesizedDisplayIdStart; |
| 527 } | 533 } |
| 528 | 534 |
| 529 void ManagedDisplayInfo::SetTouchCalibrationData( | 535 void ManagedDisplayInfo::SetTouchCalibrationData( |
| 530 const TouchCalibrationData& touch_calibration_data) { | 536 const TouchCalibrationData& touch_calibration_data) { |
| 531 has_touch_calibration_data_ = true; | 537 has_touch_calibration_data_ = true; |
| 532 touch_calibration_data_ = touch_calibration_data; | 538 touch_calibration_data_ = touch_calibration_data; |
| 533 } | 539 } |
| 534 | 540 |
| 535 } // namespace display | 541 } // namespace display |
| OLD | NEW |