Forward font collection APIs to the SkParagraph font collection (#21734)

This commit is contained in:
Jason Simmons 2020-10-19 16:27:03 -07:00 committed by GitHub
parent bcc557f1ba
commit 6fdcdd99cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -85,6 +85,12 @@ FontCollection::FontCollection() : enable_font_fallback_(true) {}
FontCollection::~FontCollection() {
minikin::Layout::purgeCaches();
#if FLUTTER_ENABLE_SKSHAPER
if (skt_collection_) {
skt_collection_->clearCaches();
}
#endif
}
size_t FontCollection::GetFontManagersCount() const {
@ -127,6 +133,12 @@ std::vector<sk_sp<SkFontMgr>> FontCollection::GetFontManagerOrder() const {
void FontCollection::DisableFontFallback() {
enable_font_fallback_ = false;
#if FLUTTER_ENABLE_SKSHAPER
if (skt_collection_) {
skt_collection_->disableFontFallback();
}
#endif
}
std::shared_ptr<minikin::FontCollection>
@ -346,8 +358,13 @@ FontCollection::GetFallbackFontFamily(const sk_sp<SkFontMgr>& manager,
void FontCollection::ClearFontFamilyCache() {
font_collections_cache_.clear();
}
#if FLUTTER_ENABLE_SKSHAPER
if (skt_collection_) {
skt_collection_->clearCaches();
}
#endif
}
#if FLUTTER_ENABLE_SKSHAPER
sk_sp<skia::textlayout::FontCollection>