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

Unified Diff: ui/gfx/dpi_linux.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/gfx/dpi_linux.cc
diff --git a/ui/gfx/dpi_linux.cc b/ui/gfx/dpi_linux.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b2463eba170a0f06f0d6250704652f50cd074c77
--- /dev/null
+++ b/ui/gfx/dpi_linux.cc
@@ -0,0 +1,31 @@
+// Copyright 2014 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/gfx/dpi.h"
+
+#include "ui/gfx/linux_font_delegate.h"
+
+namespace gfx {
+
+Size GetDPI() {
+ static int dpi = 0;
+ static bool should_initialize = true;
+
+ if (should_initialize) {
+ const gfx::LinuxFontDelegate* delegate = gfx::LinuxFontDelegate::instance();
+ if (delegate)
+ dpi = delegate->GetFontDPI();
+ if (dpi <= 0)
+ dpi = 96;
+ }
+ return Size(dpi, dpi);
+}
+
+bool IsHighDPIEnabled() {
+#if defined(OS_LINUX)
sky 2014/10/22 21:11:18 This ifdef shouldn't be necessary, right?
scottmg 2014/10/22 23:56:18 Done.
+ return true;
+#endif
+}
+
+} // namespace gfx

Powered by Google App Engine
This is Rietveld 408576698