Invalidate the cached SkParagraph font collection when a new font manager is installed (flutter/engine#22157)

This commit is contained in:
Jason Simmons
2020-10-29 09:31:04 -07:00
committed by GitHub
parent 56c54ca40e
commit edd1e923fc

View File

@@ -103,18 +103,34 @@ void FontCollection::SetupDefaultFontManager() {
void FontCollection::SetDefaultFontManager(sk_sp<SkFontMgr> font_manager) {
default_font_manager_ = font_manager;
#if FLUTTER_ENABLE_SKSHAPER
skt_collection_.reset();
#endif
}
void FontCollection::SetAssetFontManager(sk_sp<SkFontMgr> font_manager) {
asset_font_manager_ = font_manager;
#if FLUTTER_ENABLE_SKSHAPER
skt_collection_.reset();
#endif
}
void FontCollection::SetDynamicFontManager(sk_sp<SkFontMgr> font_manager) {
dynamic_font_manager_ = font_manager;
#if FLUTTER_ENABLE_SKSHAPER
skt_collection_.reset();
#endif
}
void FontCollection::SetTestFontManager(sk_sp<SkFontMgr> font_manager) {
test_font_manager_ = font_manager;
#if FLUTTER_ENABLE_SKSHAPER
skt_collection_.reset();
#endif
}
// Return the available font managers in the order they should be queried.
@@ -365,6 +381,7 @@ void FontCollection::ClearFontFamilyCache() {
}
#endif
}
#if FLUTTER_ENABLE_SKSHAPER
sk_sp<skia::textlayout::FontCollection>