OLD | NEW |
---|---|
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 Loading... | |
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, ¶ms); | 97 &family, &size_pixels, &style, ¶ms); |
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 Loading... | |
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 |
OLD | NEW |