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

Side by Side 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, 1 month 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 unified diff | Download patch
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698