OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ui/gfx/dpi.h" | |
6 | |
7 #include "ui/gfx/linux_font_delegate.h" | |
8 | |
9 namespace gfx { | |
10 | |
11 Size GetDPI() { | |
12 static int dpi = 0; | |
13 static bool should_initialize = true; | |
14 | |
15 if (should_initialize) { | |
16 const gfx::LinuxFontDelegate* delegate = gfx::LinuxFontDelegate::instance(); | |
17 if (delegate) | |
18 dpi = delegate->GetFontDPI(); | |
19 if (dpi <= 0) | |
20 dpi = 96; | |
21 } | |
22 return Size(dpi, dpi); | |
23 } | |
24 | |
25 bool IsHighDPIEnabled() { | |
26 #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.
| |
27 return true; | |
28 #endif | |
29 } | |
30 | |
31 } // namespace gfx | |
OLD | NEW |