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

Unified Diff: ui/base/win/dpi_setup.cc

Issue 23498059: Remove last dependencies on ui/base from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: last rebase Created 7 years, 3 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
« no previous file with comments | « ui/base/win/dpi_setup.h ('k') | ui/base/win/foreground_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/win/dpi_setup.cc
diff --git a/ui/base/win/dpi_setup.cc b/ui/base/win/dpi_setup.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b80b8126d068e3ac16371429d16caf360f3dcc6a
--- /dev/null
+++ b/ui/base/win/dpi_setup.cc
@@ -0,0 +1,26 @@
+// Copyright (c) 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 "ui/base/win/dpi_setup.h"
+
+#include "ui/base/layout.h"
+#include "ui/gfx/display.h"
+#include "ui/gfx/win/dpi.h"
+
+namespace ui {
+namespace win {
+
+void InitDeviceScaleFactor() {
+ float scale = 1.0f;
+ if (gfx::IsHighDPIEnabled()) {
+ float scale = gfx::Display::HasForceDeviceScaleFactor() ?
+ gfx::Display::GetForcedDeviceScaleFactor() : gfx::GetDPIScale();
+ // Quantize to nearest supported scale factor.
+ scale = ui::GetImageScale(ui::GetSupportedScaleFactor(scale));
+ }
+ gfx::InitDeviceScaleFactor(scale);
+}
+
+} // namespace win
+} // namespace ui
« no previous file with comments | « ui/base/win/dpi_setup.h ('k') | ui/base/win/foreground_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698