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

Side by Side Diff: ui/display/win/dpi.h

Issue 1889423002: Move Windows DPI Code from ui/gfx to ui/display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a TODO Created 4 years, 8 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
« no previous file with comments | « ui/display/display.gyp ('k') | ui/display/win/dpi.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 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_GFX_DPI_WIN_H_ 5 #ifndef UI_DISPLAY_WIN_DPI_H_
6 #define UI_GFX_DPI_WIN_H_ 6 #define UI_DISPLAY_WIN_DPI_H_
7 7
8 #include "ui/display/display_export.h"
8 #include "ui/gfx/geometry/size.h" 9 #include "ui/gfx/geometry/size.h"
9 #include "ui/gfx/gfx_export.h"
10 10
11 namespace gfx { 11 namespace display {
12 namespace win {
12 13
13 // Sets the device scale factor that will be used unless overridden on the 14 // Sets the device scale factor that will be used unless overridden on the
14 // command line by --force-device-scale-factor. If this is not called, and that 15 // command line by --force-device-scale-factor. If this is not called, and that
15 // flag is not used, the scale factor used by the DIP conversion functions below 16 // flag is not used, the scale factor used by the DIP conversion functions below
16 // will be that returned by GetDPIScale(). 17 // will be that returned by GetDPIScale().
17 GFX_EXPORT void SetDefaultDeviceScaleFactor(float scale); 18 DISPLAY_EXPORT void SetDefaultDeviceScaleFactor(float scale);
18 19
19 GFX_EXPORT Size GetDPI(); 20 DISPLAY_EXPORT gfx::Size GetDPI();
20 21
21 // Gets the scale factor of the display. For example, if the display DPI is 22 // Gets the scale factor of the display. For example, if the display DPI is
22 // 96 then the scale factor is 1.0. This clamps scale factors <= 1.25 to 1.0 to 23 // 96 then the scale factor is 1.0. This clamps scale factors <= 1.25 to 1.0 to
23 // maintain previous (non-DPI-aware) behavior where only the font size was 24 // maintain previous (non-DPI-aware) behavior where only the font size was
24 // boosted. 25 // boosted.
25 GFX_EXPORT float GetDPIScale(); 26 DISPLAY_EXPORT float GetDPIScale();
26
27 namespace win {
28 27
29 // Win32's GetSystemMetrics uses pixel measures. This function calls 28 // Win32's GetSystemMetrics uses pixel measures. This function calls
30 // GetSystemMetrics for the given |metric|, then converts the result to DIP. 29 // GetSystemMetrics for the given |metric|, then converts the result to DIP.
31 GFX_EXPORT int GetSystemMetricsInDIP(int metric); 30 DISPLAY_EXPORT int GetSystemMetricsInDIP(int metric);
32 31
33 } // namespace win 32 } // namespace win
34 } // namespace gfx 33 } // namespace display
35 34
36 #endif // UI_GFX_DPI_WIN_H_ 35 #endif // UI_DISPLAY_WIN_DPI_H_
OLDNEW
« no previous file with comments | « ui/display/display.gyp ('k') | ui/display/win/dpi.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698