| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef UI_DISPLAY_WIN_DPI_H_ | 5 #ifndef UI_DISPLAY_WIN_DPI_H_ |
| 6 #define UI_DISPLAY_WIN_DPI_H_ | 6 #define UI_DISPLAY_WIN_DPI_H_ |
| 7 | 7 |
| 8 #include "ui/display/display_export.h" | 8 #include "ui/display/display_export.h" |
| 9 #include "ui/gfx/geometry/size.h" | 9 #include "ui/gfx/geometry/size.h" |
| 10 | 10 |
| 11 namespace display { | 11 namespace display { |
| 12 namespace win { | 12 namespace win { |
| 13 | 13 |
| 14 // Deprecated. Use --force-device-scale-factor instead. | 14 // Deprecated. Use --force-device-scale-factor instead. |
| 15 // | 15 // |
| 16 // Sets the device scale factor that will be used unless overridden on the | 16 // Sets the device scale factor that will be used unless overridden on the |
| 17 // command line by --force-device-scale-factor. | 17 // command line by --force-device-scale-factor. |
| 18 DISPLAY_EXPORT void SetDefaultDeviceScaleFactor(float scale); | 18 DISPLAY_EXPORT void SetDefaultDeviceScaleFactor(float scale); |
| 19 | 19 |
| 20 // Deprecated. Use win::ScreenWin::GetScaleFactorForHWND instead. | 20 // Deprecated. Use win::ScreenWin::GetScaleFactorForHWND instead. |
| 21 // | 21 // |
| 22 // Gets the system's scale factor. For example, if the system DPI is 96 then the | 22 // Gets the system's scale factor. For example, if the system DPI is 96 then the |
| 23 // scale factor is 1.0. This does not handle per-monitor DPI. | 23 // scale factor is 1.0. This does not handle per-monitor DPI. |
| 24 DISPLAY_EXPORT float GetDPIScale(); | 24 DISPLAY_EXPORT float GetDPIScale(); |
| 25 | 25 |
| 26 // Equivalent to GetDPIScale() but ignores the --force-device-scale-factor flag. |
| 27 float GetUnforcedDeviceScaleFactor(); |
| 28 |
| 26 // Returns the equivalent DPI for |device_scaling_factor|. | 29 // Returns the equivalent DPI for |device_scaling_factor|. |
| 27 DISPLAY_EXPORT int GetDPIFromScalingFactor(float device_scaling_factor); | 30 DISPLAY_EXPORT int GetDPIFromScalingFactor(float device_scaling_factor); |
| 28 | 31 |
| 29 // Returns the equivalent scaling factor for |dpi|. | 32 // Returns the equivalent scaling factor for |dpi|. |
| 30 DISPLAY_EXPORT float GetScalingFactorFromDPI(int dpi); | 33 DISPLAY_EXPORT float GetScalingFactorFromDPI(int dpi); |
| 31 | 34 |
| 32 } // namespace win | 35 } // namespace win |
| 33 } // namespace display | 36 } // namespace display |
| 34 | 37 |
| 35 #endif // UI_DISPLAY_WIN_DPI_H_ | 38 #endif // UI_DISPLAY_WIN_DPI_H_ |
| OLD | NEW |