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 |