Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Invalidate the cached SkParagraph font collection when a new font manager is installed #22157

Merged
merged 1 commit into from
Oct 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions third_party/txt/src/txt/font_collection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -365,6 +381,7 @@ void FontCollection::ClearFontFamilyCache() {
}
#endif
}

#if FLUTTER_ENABLE_SKSHAPER

sk_sp<skia::textlayout::FontCollection>
Expand Down