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

Side by Side Diff: ui/gfx/platform_font_linux.cc

Issue 929733002: Fix Pango font rendering with HiDPi displays on Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Pango font rendering with HiDPi displays on Linux Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/platform_font_linux.h" 5 #include "ui/gfx/platform_font_linux.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 &query.families, &query.style, 84 &query.families, &query.style,
85 &query.pixel_size)) 85 &query.pixel_size))
86 << "Failed to parse font description " << *default_font_description_; 86 << "Failed to parse font description " << *default_font_description_;
87 params = gfx::GetFontRenderParams(query, &family); 87 params = gfx::GetFontRenderParams(query, &family);
88 size_pixels = query.pixel_size; 88 size_pixels = query.pixel_size;
89 style = query.style; 89 style = query.style;
90 } 90 }
91 #else 91 #else
92 // On Linux, LinuxFontDelegate is used to query the native toolkit (e.g. 92 // On Linux, LinuxFontDelegate is used to query the native toolkit (e.g.
93 // GTK+) for the default UI font. 93 // GTK+) for the default UI font.
94 const LinuxFontDelegate* delegate = LinuxFontDelegate::instance(); 94 LinuxFontDelegate* delegate = LinuxFontDelegate::instance();
Daniel Erat 2015/03/19 17:11:44 you should be able to preserve the 'const' here
stapelberg 2015/03/19 17:20:56 Done.
95 if (delegate) { 95 if (delegate) {
96 delegate->GetDefaultFontDescription( 96 delegate->GetDefaultFontDescription(
97 &family, &size_pixels, &style, &params); 97 &family, &size_pixels, &style, &params);
98 } 98 }
99 #endif 99 #endif
100 100
101 g_default_font.Get() = new PlatformFontLinux( 101 g_default_font.Get() = new PlatformFontLinux(
102 CreateSkTypeface(style, &family), family, size_pixels, style, params); 102 CreateSkTypeface(style, &family), family, size_pixels, style, params);
103 } 103 }
104 104
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 return new PlatformFontLinux; 272 return new PlatformFontLinux;
273 } 273 }
274 274
275 // static 275 // static
276 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name, 276 PlatformFont* PlatformFont::CreateFromNameAndSize(const std::string& font_name,
277 int font_size) { 277 int font_size) {
278 return new PlatformFontLinux(font_name, font_size); 278 return new PlatformFontLinux(font_name, font_size);
279 } 279 }
280 280
281 } // namespace gfx 281 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698