Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(362)

Side by Side Diff: ui/gfx/dpi_win.h

Issue 23769011: Move a bunch of windows stuff from ui/base/win to ui/gfx/win (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moar bustage. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/gfx/display.cc ('k') | ui/gfx/dpi_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_GFX_DPI_WIN_H_
6 #define UI_GFX_DPI_WIN_H_
7
8 #include "ui/gfx/gfx_export.h"
9 #include "ui/gfx/point.h"
10 #include "ui/gfx/rect.h"
11 #include "ui/gfx/size.h"
12
13 namespace gfx {
14
15 UI_EXPORT Size GetDPI();
16
17 // Gets the scale factor of the display. For example, if the display DPI is
18 // 96 then the scale factor is 1.0.
19 UI_EXPORT float GetDPIScale();
20
21 UI_EXPORT bool IsInHighDPIMode();
22
23 UI_EXPORT void EnableHighDPISupport();
24
25 // TODO(kevers|girard): Move above methods into win namespace.
26
27 namespace win {
28
29 UI_EXPORT float GetDeviceScaleFactor();
30
31 UI_EXPORT Point ScreenToDIPPoint(const Point& pixel_point);
32
33 UI_EXPORT Point DIPToScreenPoint(const Point& dip_point);
34
35 UI_EXPORT Rect ScreenToDIPRect(const Rect& pixel_bounds);
36
37 UI_EXPORT Rect DIPToScreenRect(const Rect& dip_bounds);
38
39 UI_EXPORT Size ScreenToDIPSize(const Size& size_in_pixels);
40
41 UI_EXPORT Size DIPToScreenSize(const Size& dip_size);
42
43 // Win32's GetSystemMetrics uses pixel measures. This function calls
44 // GetSystemMetrics for the given |metric|, then converts the result to DIP.
45 UI_EXPORT int GetSystemMetricsInDIP(int metric);
46
47 // Sometimes the OS secretly scales apps that are not DPIAware. This is not
48 // visible through standard OS calls like GetWindowPos(), or through
49 // GetDPIScale().
50 // Returns the scale factor of the display, where 96 DPI is 1.0.
51 // (Avoid this function... use GetDPIScale() instead.)
52 // TODO(girard): Remove this once DPIAware is enabled - http://crbug.com/149881
53 UI_EXPORT double GetUndocumentedDPIScale();
54
55 // Win7 and Win8 send touch events scaled according to the current DPI
56 // scaling. Win8.1 corrects this, and sends touch events in DPI units.
57 // This function returns the appropriate scaling factor for touch events.
58 UI_EXPORT double GetUndocumentedDPITouchScale();
59
60 } // namespace win
61 } // namespace gfx
62
63 #endif // UI_GFX_DPI_WIN_H_
OLDNEW
« no previous file with comments | « ui/gfx/display.cc ('k') | ui/gfx/dpi_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698