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

Unified Diff: ui/display/win/screen_win.h

Issue 2186163002: Create ScreenWin::GetSystemMetricsInDIP and Correctly Deprecate display::win::GetSystemMetricsInDIP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a comment Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/display/win/dpi.h ('k') | ui/display/win/screen_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/win/screen_win.h
diff --git a/ui/display/win/screen_win.h b/ui/display/win/screen_win.h
index 0a16da017ce1bfb0afe581c5623f185c1bdf4477..422077d521282c11243eb15cb2a9a58e45f6f2fa 100644
--- a/ui/display/win/screen_win.h
+++ b/ui/display/win/screen_win.h
@@ -90,8 +90,15 @@ class DISPLAY_EXPORT ScreenWin : public display::Screen {
static gfx::Size DIPToScreenSize(HWND hwnd, const gfx::Size& dip_size);
// Returns the result of GetSystemMetrics for |metric| scaled to |hwnd|'s DPI.
+ // Use this function if you're already working with screen pixels, as this
+ // helps reduce any cascading rounding errors from DIP to the |hwnd|'s DPI.
static int GetSystemMetricsForHwnd(HWND hwnd, int metric);
+ // Returns the result of GetSystemMetrics for |metric| in DIP.
+ // Use this function if you need to work in DIP and can tolerate cascading
+ // rounding errors towards screen pixels.
+ static int GetSystemMetricsInDIP(int metric);
+
// Returns |hwnd|'s scale factor.
static float GetScaleFactorForHWND(HWND hwnd);
« no previous file with comments | « ui/display/win/dpi.h ('k') | ui/display/win/screen_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698