| OLD | NEW |
| 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/base/win/dpi.h" | 5 #include "ui/base/win/dpi.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include "base/win/scoped_hdc.h" | 9 #include "base/win/scoped_hdc.h" |
| 10 | 10 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 } | 40 } |
| 41 | 41 |
| 42 bool IsInHighDPIMode() { | 42 bool IsInHighDPIMode() { |
| 43 gfx::Size dpi(GetDPI()); | 43 gfx::Size dpi(GetDPI()); |
| 44 return dpi.width() > kDefaultDPIX || dpi.height() > kDefaultDPIY; | 44 return dpi.width() > kDefaultDPIX || dpi.height() > kDefaultDPIY; |
| 45 } | 45 } |
| 46 | 46 |
| 47 void EnableHighDPISupport() { | 47 void EnableHighDPISupport() { |
| 48 typedef BOOL(WINAPI *SetProcessDPIAwarePtr)(VOID); | 48 typedef BOOL(WINAPI *SetProcessDPIAwarePtr)(VOID); |
| 49 SetProcessDPIAwarePtr set_process_dpi_aware_func = | 49 SetProcessDPIAwarePtr set_process_dpi_aware_func = |
| 50 GetProcAddress(GetModuleHandleA("user32.dll"), "SetProcessDPIAware"); | 50 reinterpret_cast<SetProcessDPIAwarePtr>( |
| 51 GetProcAddress(GetModuleHandleA("user32.dll"), "SetProcessDPIAware")); |
| 51 if (set_process_dpi_aware_func) | 52 if (set_process_dpi_aware_func) |
| 52 set_process_dpi_aware_func(); | 53 set_process_dpi_aware_func(); |
| 53 } | 54 } |
| 54 | 55 |
| 55 } // namespace ui | 56 } // namespace ui |
| OLD | NEW |