diff options
author | girard@chromium.org <girard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 13:22:59 +0000 |
---|---|---|
committer | girard@chromium.org <girard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-22 13:22:59 +0000 |
commit | 40bd0e2dbb489669dedd5eaab25f1dee629e9b09 (patch) | |
tree | 54345cd9f0f2a56abcd72137e1cef2be7a051e66 /win8 | |
parent | 8d33ef915d77c93f9a5a726a6861719ed8fd0732 (diff) | |
download | chromium_src-40bd0e2dbb489669dedd5eaab25f1dee629e9b09.zip chromium_src-40bd0e2dbb489669dedd5eaab25f1dee629e9b09.tar.gz chromium_src-40bd0e2dbb489669dedd5eaab25f1dee629e9b09.tar.bz2 |
Disable win/ash on high dpi screens
BUG=321694
Review URL: https://codereview.chromium.org/79033002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236762 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8')
-rw-r--r-- | win8/metro_driver/display_properties.cc | 34 | ||||
-rw-r--r-- | win8/metro_driver/metro_driver.gyp | 1 |
2 files changed, 35 insertions, 0 deletions
diff --git a/win8/metro_driver/display_properties.cc b/win8/metro_driver/display_properties.cc new file mode 100644 index 0000000..a7cf427 --- /dev/null +++ b/win8/metro_driver/display_properties.cc @@ -0,0 +1,34 @@ +// Copyright 2013 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "stdafx.h" + +#include <windows.h> +#include <wrl\implements.h> +#include <wrl\wrappers\corewrappers.h> +#include <windows.foundation.h> +#include <windows.graphics.display.h> +#include "base/win/scoped_com_initializer.h" +#include "winrt_utils.h" + +#pragma comment(lib, "runtimeobject.lib") + +extern "C" { + + __declspec(dllexport) float GetModernUIScale() { + base::win::ScopedCOMInitializer com_init; + Microsoft::WRL::ComPtr< + ABI::Windows::Graphics::Display::IDisplayPropertiesStatics> + display_properties; + if (SUCCEEDED(winrt_utils::CreateActivationFactory( + RuntimeClass_Windows_Graphics_Display_DisplayProperties, + display_properties.GetAddressOf()))) { + ABI::Windows::Graphics::Display::ResolutionScale resolution_scale; + if (SUCCEEDED(display_properties->get_ResolutionScale(&resolution_scale))) + return static_cast<float>(resolution_scale) / 100.0f; + } + return 1.0f; +} + +} diff --git a/win8/metro_driver/metro_driver.gyp b/win8/metro_driver/metro_driver.gyp index c4797fb..33e7e48 100644 --- a/win8/metro_driver/metro_driver.gyp +++ b/win8/metro_driver/metro_driver.gyp @@ -64,6 +64,7 @@ 'metro_driver_version_resources', ], 'sources': [ + 'display_properties.cc', 'metro_driver.cc', 'metro_driver.h', 'stdafx.h', |