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

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

Issue 2165173002: Only Update the Scale Factor if the Scale Factor Actually Changed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/screen_win.h ('k') | ui/display/win/screen_win_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/display/win/screen_win.cc
diff --git a/ui/display/win/screen_win.cc b/ui/display/win/screen_win.cc
index 89482d36bf74f21f30f735800caa33b3f7344b7e..5104d5c78e552ee803e5cc9456e8af0263e1e713 100644
--- a/ui/display/win/screen_win.cc
+++ b/ui/display/win/screen_win.cc
@@ -313,6 +313,18 @@ int ScreenWin::GetSystemMetricsForHwnd(HWND hwnd, int metric) {
system_metrics_result * metrics_relative_scale_factor));
}
+// static
+float ScreenWin::GetScaleFactorForHWND(HWND hwnd) {
+ if (!g_screen_win_instance)
+ return ScreenWinDisplay().display().device_scale_factor();
+
+ DCHECK(hwnd);
+ HWND rootHwnd = g_screen_win_instance->GetRootWindow(hwnd);
+ ScreenWinDisplay screen_win_display =
+ g_screen_win_instance->GetScreenWinDisplayNearestHWND(rootHwnd);
+ return screen_win_display.display().device_scale_factor();
+}
+
HWND ScreenWin::GetHWNDFromNativeView(gfx::NativeView window) const {
NOTREACHED();
return nullptr;
@@ -529,18 +541,6 @@ ScreenWinDisplay ScreenWin::GetScreenWinDisplay(
}
// static
-float ScreenWin::GetScaleFactorForHWND(HWND hwnd) {
- if (!g_screen_win_instance)
- return ScreenWinDisplay().display().device_scale_factor();
-
- DCHECK(hwnd);
- HWND rootHwnd = g_screen_win_instance->GetRootWindow(hwnd);
- ScreenWinDisplay screen_win_display =
- g_screen_win_instance->GetScreenWinDisplayNearestHWND(rootHwnd);
- return screen_win_display.display().device_scale_factor();
-}
-
-// static
template <typename Getter, typename GetterType>
ScreenWinDisplay ScreenWin::GetScreenWinDisplayVia(Getter getter,
GetterType value) {
« no previous file with comments | « ui/display/win/screen_win.h ('k') | ui/display/win/screen_win_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698