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

Side by Side Diff: ui/display/win/screen_win.cc

Issue 2695523002: Fix font sizes being incorrect when using --force-device-scale-factor. (Closed)
Patch Set: fix test link Created 3 years, 10 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/win/screen_win.h ('k') | no next file » | 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 (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 #include "ui/display/win/screen_win.h" 5 #include "ui/display/win/screen_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shellscalingapi.h> 8 #include <shellscalingapi.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 if (!g_screen_win_instance) 344 if (!g_screen_win_instance)
345 return ScreenWinDisplay().display().device_scale_factor(); 345 return ScreenWinDisplay().display().device_scale_factor();
346 346
347 DCHECK(hwnd); 347 DCHECK(hwnd);
348 HWND rootHwnd = g_screen_win_instance->GetRootWindow(hwnd); 348 HWND rootHwnd = g_screen_win_instance->GetRootWindow(hwnd);
349 ScreenWinDisplay screen_win_display = 349 ScreenWinDisplay screen_win_display =
350 g_screen_win_instance->GetScreenWinDisplayNearestHWND(rootHwnd); 350 g_screen_win_instance->GetScreenWinDisplayNearestHWND(rootHwnd);
351 return screen_win_display.display().device_scale_factor(); 351 return screen_win_display.display().device_scale_factor();
352 } 352 }
353 353
354 // static
355 float ScreenWin::GetSystemScaleFactor() {
356 return GetUnforcedDeviceScaleFactor();
357 }
358
354 HWND ScreenWin::GetHWNDFromNativeView(gfx::NativeView window) const { 359 HWND ScreenWin::GetHWNDFromNativeView(gfx::NativeView window) const {
355 NOTREACHED(); 360 NOTREACHED();
356 return nullptr; 361 return nullptr;
357 } 362 }
358 363
359 gfx::NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const { 364 gfx::NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const {
360 NOTREACHED(); 365 NOTREACHED();
361 return nullptr; 366 return nullptr;
362 } 367 }
363 368
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 if (std::find(unique_scale_factors.begin(), unique_scale_factors.end(), 592 if (std::find(unique_scale_factors.begin(), unique_scale_factors.end(),
588 reported_scale) == unique_scale_factors.end()) { 593 reported_scale) == unique_scale_factors.end()) {
589 unique_scale_factors.push_back(reported_scale); 594 unique_scale_factors.push_back(reported_scale);
590 UMA_HISTOGRAM_SPARSE_SLOWLY("UI.DeviceScale", reported_scale); 595 UMA_HISTOGRAM_SPARSE_SLOWLY("UI.DeviceScale", reported_scale);
591 } 596 }
592 } 597 }
593 } 598 }
594 599
595 } // namespace win 600 } // namespace win
596 } // namespace display 601 } // namespace display
OLDNEW
« no previous file with comments | « ui/display/win/screen_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698