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

Side by Side Diff: ui/gfx/win/dpi.cc

Issue 138443006: Disable calls to SetProcessDPIAware under Win8.1 (Rebase) (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 11 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 | « no previous file | 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/gfx/win/dpi.h" 5 #include "ui/gfx/win/dpi.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/win/scoped_hdc.h" 9 #include "base/win/scoped_hdc.h"
10 #include "base/win/windows_version.h" 10 #include "base/win/windows_version.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 switches::kHighDPISupport).compare("1") == 0; 99 switches::kHighDPISupport).compare("1") == 0;
100 } 100 }
101 return false; 101 return false;
102 } 102 }
103 103
104 bool IsInHighDPIMode() { 104 bool IsInHighDPIMode() {
105 return GetDPIScale() > 1.0; 105 return GetDPIScale() > 1.0;
106 } 106 }
107 107
108 void EnableHighDPISupport() { 108 void EnableHighDPISupport() {
109 if (IsHighDPIEnabled()) { 109 if (IsHighDPIEnabled() &&
110 (base::win::GetVersion() < base::win::VERSION_WIN8_1)) {
110 typedef BOOL(WINAPI *SetProcessDPIAwarePtr)(VOID); 111 typedef BOOL(WINAPI *SetProcessDPIAwarePtr)(VOID);
111 SetProcessDPIAwarePtr set_process_dpi_aware_func = 112 SetProcessDPIAwarePtr set_process_dpi_aware_func =
112 reinterpret_cast<SetProcessDPIAwarePtr>( 113 reinterpret_cast<SetProcessDPIAwarePtr>(
113 GetProcAddress(GetModuleHandleA("user32.dll"), 114 GetProcAddress(GetModuleHandleA("user32.dll"),
114 "SetProcessDPIAware")); 115 "SetProcessDPIAware"));
115 if (set_process_dpi_aware_func) 116 if (set_process_dpi_aware_func)
116 set_process_dpi_aware_func(); 117 set_process_dpi_aware_func();
117 } 118 }
118 } 119 }
119 120
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 186
186 double GetUndocumentedDPITouchScale() { 187 double GetUndocumentedDPITouchScale() {
187 static double scale = 188 static double scale =
188 (base::win::GetVersion() < base::win::VERSION_WIN8_1) ? 189 (base::win::GetVersion() < base::win::VERSION_WIN8_1) ?
189 GetUndocumentedDPIScale() : 1.0; 190 GetUndocumentedDPIScale() : 1.0;
190 return scale; 191 return scale;
191 } 192 }
192 193
193 } // namespace win 194 } // namespace win
194 } // namespace gfx 195 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698