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

Unified Diff: third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp

Issue 1931393002: Introduce typeface cache in blink::FontCache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wip: others 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
Index: third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp
index 402642e974c814333b0c46c8c418127c5ec65c60..6e54f78cd7ac0987639933a7c055526caa4da8bf 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp
+++ b/third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzFace.cpp
@@ -350,15 +350,16 @@ hb_face_t* HarfBuzzFace::createFace()
return face;
}
-hb_font_t* HarfBuzzFace::createFont(PassRefPtr<UnicodeRangeSet> rangeSet) const
+hb_font_t* HarfBuzzFace::createFont(float size, const FontRenderStyle& style, PassRefPtr<UnicodeRangeSet> rangeSet) const
{
HarfBuzzFontData* hbFontData = new HarfBuzzFontData(m_glyphCacheForFaceCacheEntry, m_face, rangeSet);
+ style.apply(&hbFontData->m_paint);
+ hbFontData->m_paint.setTextSize(SkFloatToScalar(size));
m_platformData->setupPaint(&hbFontData->m_paint);
hbFontData->m_simpleFontData = FontCache::fontCache()->fontDataFromFontPlatformData(m_platformData);
ASSERT(hbFontData->m_simpleFontData);
hb_font_t* font = hb_font_create(m_face);
hb_font_set_funcs(font, harfBuzzSkiaGetFontFuncs(), hbFontData, destroyHarfBuzzFontData);
- float size = m_platformData->size();
int scale = SkiaScalarToHarfBuzzPosition(size);
hb_font_set_scale(font, scale, scale);
hb_font_make_immutable(font);

Powered by Google App Engine
This is Rietveld 408576698