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

Unified Diff: chrome/browser/ui/extensions/icon_with_badge_image_source.cc

Issue 1819753003: Allow various font weights in gfx. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: A tiny fix for the ResourceBundle... Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/extensions/icon_with_badge_image_source.cc
diff --git a/chrome/browser/ui/extensions/icon_with_badge_image_source.cc b/chrome/browser/ui/extensions/icon_with_badge_image_source.cc
index a23c62f5908b2d23799a256e02329d6bd271ce28..4d69bbeb7b7a0c74d9e482cc2ad7ecc6784fa85f 100644
--- a/chrome/browser/ui/extensions/icon_with_badge_image_source.cc
+++ b/chrome/browser/ui/extensions/icon_with_badge_image_source.cc
@@ -67,8 +67,9 @@ SkPaint* GetBadgeTextPaintSingleton() {
text_paint->setAntiAlias(true);
text_paint->setTextAlign(SkPaint::kLeft_Align);
- skia::RefPtr<SkTypeface> typeface = skia::AdoptRef(
- SkTypeface::CreateFromName(kPreferredTypeface, SkTypeface::kBold));
+ skia::RefPtr<SkTypeface> typeface =
+ skia::AdoptRef(SkTypeface::CreateFromName(
+ kPreferredTypeface, SkFontStyle(SkTypeface::kBold)));
// Skia doesn't do any font fallback---if the user is missing the font then
// typeface will be NULL. If we don't do manual fallback then we'll crash.
if (typeface) {
@@ -81,7 +82,7 @@ SkPaint* GetBadgeTextPaintSingleton() {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont);
typeface = skia::AdoptRef(SkTypeface::CreateFromName(
- base_font.GetFontName().c_str(), SkTypeface::kNormal));
+ base_font.GetFontName().c_str(), SkFontStyle()));
DCHECK(typeface);
}

Powered by Google App Engine
This is Rietveld 408576698