未验证 提交 cd98f6bd 编写于 作者: J Jason Simmons 提交者: GitHub

Clear the font collection's cache when a font is dynamically loaded (#7436)

Fixes https://github.com/flutter/flutter/issues/26293
上级 dea6a084
......@@ -158,6 +158,7 @@ void FontCollection::LoadFontFromList(const uint8_t* font_data,
} else {
font_provider.RegisterTypeface(typeface, family_name);
}
collection_->ClearFontFamilyCache();
}
} // namespace blink
......@@ -286,4 +286,8 @@ FontCollection::GetFallbackFontFamily(const sk_sp<SkFontMgr>& manager,
return insert_it.first->second;
}
void FontCollection::ClearFontFamilyCache() {
font_collections_cache_.clear();
}
} // namespace txt
......@@ -59,6 +59,9 @@ class FontCollection : public std::enable_shared_from_this<FontCollection> {
// missing from the requested font family.
void DisableFontFallback();
// Remove all entries in the font family cache.
void ClearFontFamilyCache();
private:
struct FamilyKey {
FamilyKey(const std::vector<std::string>& families, const std::string& loc);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册