Forward font collection APIs to the SkParagraph font collection (flutter/engine#21734)

This commit is contained in:
Jason Simmons
2020-10-19 16:27:03 -07:00
committed by GitHub
parent 617f0096e3
commit 546df582bb

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>