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

Unified Diff: ui/base/layout.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, 2 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 side-by-side diff with in-line comments
Download patch
Index: ui/base/layout.cc
diff --git a/ui/base/layout.cc b/ui/base/layout.cc
index aa3aecf55bd625d891f75339c8971406370f7e2f..726f86298986037d228873e199eefab88b9ab2ec 100644
--- a/ui/base/layout.cc
+++ b/ui/base/layout.cc
@@ -15,12 +15,12 @@
#include "ui/base/touch/touch_device.h"
#include "ui/base/ui_base_switches.h"
#include "ui/gfx/display.h"
+#include "ui/gfx/dpi.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/screen.h"
#if defined(OS_WIN)
#include "base/win/metro.h"
-#include "ui/gfx/win/dpi.h"
#include <Windows.h>
#endif // defined(OS_WIN)
@@ -83,9 +83,9 @@ ScaleFactor GetSupportedScaleFactor(float scale) {
}
float GetImageScale(ScaleFactor scale_factor) {
-#if defined(OS_WIN)
+#if defined(OS_WIN) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
if (gfx::IsHighDPIEnabled())
- return gfx::win::GetDeviceScaleFactor();
+ return gfx::GetDeviceScaleFactor();
#endif
return GetScaleForScaleFactor(scale_factor);
}

Powered by Google App Engine
This is Rietveld 408576698