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

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: merge and apply review feedback 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') | no next file » | 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..008f0dfddbecebc4c4017c6db91fffa227a48318 100644
--- a/ui/gfx/platform_font_pango.cc
+++ b/ui/gfx/platform_font_pango.cc
@@ -74,19 +74,22 @@ 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(
+ pango_font_description_from_string(
+ default_font_description_->c_str())));
#else
const gfx::LinuxFontDelegate* delegate = gfx::LinuxFontDelegate::instance();
- desc_string = delegate ? delegate->GetDefaultFontDescription() : "sans 10";
+ if (delegate) {
+ description = delegate->GetDefaultPangoFontDescription();
+ } else {
msw 2014/07/18 19:59:46 Should this be a separate check like "if (!descrip
Daniel Erat 2014/07/18 20:26:52 sure. i'd prefer to have the delegate only return
+ description.reset(new ScopedPangoFontDescription(
+ pango_font_description_from_string("sans 10")));
+ }
#endif
-
- ScopedPangoFontDescription desc(
- pango_font_description_from_string(desc_string.c_str()));
- default_font_ = new Font(desc.get());
+ default_font_ = new Font(description->get());
}
InitFromPlatformFont(
« no previous file with comments | « ui/gfx/platform_font_pango.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698