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

Side by Side Diff: win8/metro_driver/display_properties.cc

Issue 659883002: Enable hidpi on Linux, refactor a bit on Windows to share Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: constants Created 6 years, 1 month 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
« ui/gfx/gfx.gyp ('K') | « win8/metro_driver/direct3d_helper.cc ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "stdafx.h" 5 #include "stdafx.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <wrl\implements.h> 8 #include <wrl\implements.h>
9 #include <wrl\wrappers\corewrappers.h> 9 #include <wrl\wrappers\corewrappers.h>
10 #include <windows.foundation.h> 10 #include <windows.foundation.h>
11 #include <windows.graphics.display.h> 11 #include <windows.graphics.display.h>
12 #include "base/win/windows_version.h" 12 #include "base/win/windows_version.h"
13 #include "ui/gfx/win/dpi.h" 13 #include "ui/gfx/dpi.h"
14 #include "winrt_utils.h" 14 #include "winrt_utils.h"
15 15
16 float GetModernUIScale() { 16 float GetModernUIScale() {
17 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { 17 if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
18 Microsoft::WRL::ComPtr< 18 Microsoft::WRL::ComPtr<
19 ABI::Windows::Graphics::Display::IDisplayPropertiesStatics> 19 ABI::Windows::Graphics::Display::IDisplayPropertiesStatics>
20 display_properties; 20 display_properties;
21 if (SUCCEEDED(winrt_utils::CreateActivationFactory( 21 if (SUCCEEDED(winrt_utils::CreateActivationFactory(
22 RuntimeClass_Windows_Graphics_Display_DisplayProperties, 22 RuntimeClass_Windows_Graphics_Display_DisplayProperties,
23 display_properties.GetAddressOf()))) { 23 display_properties.GetAddressOf()))) {
24 ABI::Windows::Graphics::Display::ResolutionScale resolution_scale; 24 ABI::Windows::Graphics::Display::ResolutionScale resolution_scale;
25 if (SUCCEEDED(display_properties->get_ResolutionScale(&resolution_scale))) 25 if (SUCCEEDED(display_properties->get_ResolutionScale(&resolution_scale)))
26 return static_cast<float>(resolution_scale) / 100.0f; 26 return static_cast<float>(resolution_scale) / 100.0f;
27 } 27 }
28 } 28 }
29 return gfx::GetDPIScale(); 29 return gfx::GetDPIScale();
30 } 30 }
OLDNEW
« ui/gfx/gfx.gyp ('K') | « win8/metro_driver/direct3d_helper.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698