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

Unified Diff: ui/gfx/platform_font_pango.cc

Issue 400193004: Unify desktop Linux and Chrome OS font rendering params. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use initializer list Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/platform_font_pango.h ('k') | ui/gfx/platform_font_pango_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/platform_font_pango.cc
diff --git a/ui/gfx/platform_font_pango.cc b/ui/gfx/platform_font_pango.cc
index 6da7c2dbb4efe5421fbc352496988471bc1c02d5..394363f498a0cc6d31190381b09e3f0a887a1134 100644
--- a/ui/gfx/platform_font_pango.cc
+++ b/ui/gfx/platform_font_pango.cc
@@ -74,19 +74,19 @@ std::string* PlatformFontPango::default_font_description_ = NULL;
PlatformFontPango::PlatformFontPango() {
if (!default_font_) {
- std::string desc_string;
+ scoped_ptr<ScopedPangoFontDescription> description;
#if defined(OS_CHROMEOS)
- // Font name must have been provided by way of SetDefaultFontDescription().
CHECK(default_font_description_);
- desc_string = *default_font_description_;
+ description.reset(
+ new ScopedPangoFontDescription(*default_font_description_));
#else
const gfx::LinuxFontDelegate* delegate = gfx::LinuxFontDelegate::instance();
- desc_string = delegate ? delegate->GetDefaultFontDescription() : "sans 10";
+ if (delegate)
+ description = delegate->GetDefaultPangoFontDescription();
#endif
-
- ScopedPangoFontDescription desc(
- pango_font_description_from_string(desc_string.c_str()));
- default_font_ = new Font(desc.get());
+ if (!description || !description->get())
+ description.reset(new ScopedPangoFontDescription("sans 10"));
+ default_font_ = new Font(description->get());
}
InitFromPlatformFont(
« no previous file with comments | « ui/gfx/platform_font_pango.h ('k') | ui/gfx/platform_font_pango_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698