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

Unified Diff: ui/gfx/render_text_harfbuzz.cc

Issue 1914443002: Revert of RenderTextMac: Cache the SkTypeface on the TextRun (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/render_text_harfbuzz.h ('k') | ui/gfx/render_text_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text_harfbuzz.cc
diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc
index 9fbcbd178785df64506b6277438c5bdfd400c557..731cc6f24051c2a15b6b6cc31888a03fe38387fa 100644
--- a/ui/gfx/render_text_harfbuzz.cc
+++ b/ui/gfx/render_text_harfbuzz.cc
@@ -562,14 +562,6 @@
0;
}
};
-
-sk_sp<SkTypeface> CreateSkiaTypeface(const gfx::Font& font, int style) {
- int skia_style = SkTypeface::kNormal;
- skia_style |= (style & Font::BOLD) ? SkTypeface::kBold : 0;
- skia_style |= (style & Font::ITALIC) ? SkTypeface::kItalic : 0;
- return sk_sp<SkTypeface>(SkTypeface::CreateFromName(
- font.GetFontName().c_str(), static_cast<SkTypeface::Style>(skia_style)));
-}
} // namespace
@@ -1465,7 +1457,8 @@
const gfx::Font& font,
const FontRenderParams& params,
internal::TextRunHarfBuzz* run) {
- sk_sp<SkTypeface> skia_face(CreateSkiaTypeface(font, run->font_style));
+ skia::RefPtr<SkTypeface> skia_face =
+ internal::CreateSkiaTypeface(font, run->font_style);
if (skia_face == NULL)
return false;
run->skia_face = skia_face;
« no previous file with comments | « ui/gfx/render_text_harfbuzz.h ('k') | ui/gfx/render_text_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698