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

Unified Diff: ui/gfx/win/dpi.cc

Issue 79033002: Disable win/ash on high dpi screens (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Move win8 specific logic into driver. Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/win/dpi.h ('k') | win8/metro_driver/display_properties.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/win/dpi.cc
diff --git a/ui/gfx/win/dpi.cc b/ui/gfx/win/dpi.cc
index acd7ee31a149ebad9a1808e1fc8a6a410b2ab5ba..33abdf63670b73a3e55707c028405e173d9948d8 100644
--- a/ui/gfx/win/dpi.cc
+++ b/ui/gfx/win/dpi.cc
@@ -36,10 +36,30 @@ float GetUnforcedDeviceScaleFactor() {
return static_cast<float>(gfx::GetDPI().width()) /
static_cast<float>(kDefaultDPIX);
}
+
+float GetModernUIScaleWrapper() {
+ float result = 1.0f;
+ typedef float(WINAPI *GetModernUIScalePtr)(VOID);
+ HMODULE lib = LoadLibraryA("metro_driver.dll");
+ if (lib) {
+ GetModernUIScalePtr func =
+ reinterpret_cast<GetModernUIScalePtr>(
+ GetProcAddress(lib, "GetModernUIScale"));
+ if (func)
+ result = func();
+ FreeLibrary(lib);
+ }
+ return result;
+}
+
} // namespace
namespace gfx {
+float GetModernUIScale() {
+ return GetModernUIScaleWrapper();
+}
+
void InitDeviceScaleFactor(float scale) {
DCHECK_NE(0.0f, scale);
g_device_scale_factor = scale;
@@ -163,7 +183,6 @@ double GetUndocumentedDPIScale() {
return scale;
}
-
double GetUndocumentedDPITouchScale() {
static double scale =
(base::win::GetVersion() < base::win::VERSION_WIN8_1) ?
@@ -171,6 +190,5 @@ double GetUndocumentedDPITouchScale() {
return scale;
}
-
} // namespace win
} // namespace gfx
« no previous file with comments | « ui/gfx/win/dpi.h ('k') | win8/metro_driver/display_properties.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698