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

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: Mac fixes 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 845e3decf87730379363c3d5c3602ad6f41edf87..87f5fa7fa70392e5a77455b4d89cb19b3fce40a1 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