Chromium Code Reviews| 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_BASE_WIN_DPI_H_ | 5 #ifndef UI_BASE_WIN_DPI_H_ |
| 6 #define UI_BASE_WIN_DPI_H_ | 6 #define UI_BASE_WIN_DPI_H_ |
| 7 | 7 |
| 8 #include "ui/gfx/point.h" | 8 #include "ui/gfx/point.h" |
| 9 #include "ui/gfx/rect.h" | 9 #include "ui/gfx/rect.h" |
| 10 #include "ui/gfx/size.h" | 10 #include "ui/gfx/size.h" |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 31 UI_EXPORT gfx::Point ScreenToDIPPoint(const gfx::Point& pixel_point); | 31 UI_EXPORT gfx::Point ScreenToDIPPoint(const gfx::Point& pixel_point); |
| 32 | 32 |
| 33 UI_EXPORT gfx::Rect ScreenToDIPRect(const gfx::Rect& pixel_bounds); | 33 UI_EXPORT gfx::Rect ScreenToDIPRect(const gfx::Rect& pixel_bounds); |
| 34 | 34 |
| 35 UI_EXPORT gfx::Rect DIPToScreenRect(const gfx::Rect& dip_bounds); | 35 UI_EXPORT gfx::Rect DIPToScreenRect(const gfx::Rect& dip_bounds); |
| 36 | 36 |
| 37 UI_EXPORT gfx::Size ScreenToDIPSize(const gfx::Size& size_in_pixels); | 37 UI_EXPORT gfx::Size ScreenToDIPSize(const gfx::Size& size_in_pixels); |
| 38 | 38 |
| 39 UI_EXPORT gfx::Size DIPToScreenSize(const gfx::Size& dip_size); | 39 UI_EXPORT gfx::Size DIPToScreenSize(const gfx::Size& dip_size); |
| 40 | 40 |
| 41 // Win32's GetSystemMetrics uses pixel measures. This function converts to DIP. | |
|
kevers
2013/03/14 19:47:12
Not clear from the comment that this is fetching t
girard
2013/03/14 20:09:49
Done.
| |
| 42 UI_EXPORT int GetSystemMetricsInDIP(int metric); | |
| 43 | |
| 41 // The OS secretly scales apps that are not DPIAware. This is not visible | 44 // The OS secretly scales apps that are not DPIAware. This is not visible |
| 42 // through standard OS calls like GetWindowPos(), or through GetDPIScale(). | 45 // through standard OS calls like GetWindowPos(), or through GetDPIScale(). |
| 43 // Returns the scale factor of the display, where 96 DPI is 1.0. | 46 // Returns the scale factor of the display, where 96 DPI is 1.0. |
| 44 // (Avoid this function... use GetDPIScale() instead.) | 47 // (Avoid this function... use GetDPIScale() instead.) |
| 45 // TODO(girard): Remove this once DPIAware is enabled - http://crbug.com/149881 | 48 // TODO(girard): Remove this once DPIAware is enabled - http://crbug.com/149881 |
| 46 UI_EXPORT double GetUndocumentedDPIScale(); | 49 UI_EXPORT double GetUndocumentedDPIScale(); |
| 47 | 50 |
| 48 } // namespace win | 51 } // namespace win |
| 49 | 52 |
| 50 } // namespace ui | 53 } // namespace ui |
| 51 | 54 |
| 52 #endif // UI_BASE_WIN_DPI_H_ | 55 #endif // UI_BASE_WIN_DPI_H_ |
| OLD | NEW |