| 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 #ifndef UI_GFX_DPI_WIN_H_ | 5 #ifndef UI_GFX_DPI_WIN_H_ |
| 6 #define UI_GFX_DPI_WIN_H_ | 6 #define UI_GFX_DPI_WIN_H_ |
| 7 | 7 |
| 8 #include "ui/gfx/gfx_export.h" | 8 #include "ui/gfx/gfx_export.h" |
| 9 #include "ui/gfx/point.h" | 9 #include "ui/gfx/point.h" |
| 10 #include "ui/gfx/rect.h" | 10 #include "ui/gfx/rect.h" |
| 11 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
| 12 | 12 |
| 13 namespace gfx { | 13 namespace gfx { |
| 14 | 14 |
| 15 // Initialization of the scale factor that should be applied for rendering | 15 // Initialization of the scale factor that should be applied for rendering |
| 16 // in this process. Must be called before attempts to call any of the getter | 16 // in this process. Must be called before attempts to call any of the getter |
| 17 // methods below in this file, e.g. in the early toolkit/resource bundle setup. | 17 // methods below in this file, e.g. in the early toolkit/resource bundle setup. |
| 18 // This can be called multiple times during various tests, but subsequent calls | 18 // This can be called multiple times during various tests, but subsequent calls |
| 19 // have no effect. | 19 // have no effect. |
| 20 GFX_EXPORT void InitDeviceScaleFactor(float scale); | 20 GFX_EXPORT void InitDeviceScaleFactor(float scale); |
| 21 | 21 |
| 22 GFX_EXPORT Size GetDPI(); | 22 GFX_EXPORT Size GetDPI(); |
| 23 | 23 |
| 24 // Gets the scale factor of the display. For example, if the display DPI is | 24 // Gets the scale factor of the display. For example, if the display DPI is |
| 25 // 96 then the scale factor is 1.0. Note that this is the "desktop" scale, which | 25 // 96 then the scale factor is 1.0. |
| 26 // may be differnt than GetModernUIScale(). | |
| 27 GFX_EXPORT float GetDPIScale(); | 26 GFX_EXPORT float GetDPIScale(); |
| 28 | 27 |
| 29 // Gets the scale factor of the modern (metro) UI display. Returns 1.0 for | |
| 30 // unscaled or "not running on win8+" | |
| 31 GFX_EXPORT float GetModernUIScale(); | |
| 32 | |
| 33 // Tests to see if the command line flag "--high-dpi-support" is set. | 28 // Tests to see if the command line flag "--high-dpi-support" is set. |
| 34 GFX_EXPORT bool IsHighDPIEnabled(); | 29 GFX_EXPORT bool IsHighDPIEnabled(); |
| 35 | 30 |
| 36 GFX_EXPORT bool IsInHighDPIMode(); | 31 GFX_EXPORT bool IsInHighDPIMode(); |
| 37 | 32 |
| 38 GFX_EXPORT void EnableHighDPISupport(); | 33 GFX_EXPORT void EnableHighDPISupport(); |
| 39 | 34 |
| 40 GFX_EXPORT void ForceHighDPISupportForTesting(float scale); | 35 GFX_EXPORT void ForceHighDPISupportForTesting(float scale); |
| 41 | 36 |
| 42 // TODO(kevers|girard): Move above methods into win namespace. | 37 // TODO(kevers|girard): Move above methods into win namespace. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 71 | 66 |
| 72 // Win7 and Win8 send touch events scaled according to the current DPI | 67 // Win7 and Win8 send touch events scaled according to the current DPI |
| 73 // scaling. Win8.1 corrects this, and sends touch events in DPI units. | 68 // scaling. Win8.1 corrects this, and sends touch events in DPI units. |
| 74 // This function returns the appropriate scaling factor for touch events. | 69 // This function returns the appropriate scaling factor for touch events. |
| 75 GFX_EXPORT double GetUndocumentedDPITouchScale(); | 70 GFX_EXPORT double GetUndocumentedDPITouchScale(); |
| 76 | 71 |
| 77 } // namespace win | 72 } // namespace win |
| 78 } // namespace gfx | 73 } // namespace gfx |
| 79 | 74 |
| 80 #endif // UI_GFX_DPI_WIN_H_ | 75 #endif // UI_GFX_DPI_WIN_H_ |
| OLD | NEW |