Skip to content

Commit

Permalink
Invalidate the cached SkParagraph font collection when a new font man…
Browse files Browse the repository at this point in the history
…ager is installed (flutter#22157)
  • Loading branch information
jason-simmons committed Oct 29, 2020
1 parent d615a97 commit 11ed711
Showing 1 changed file with 17 additions and 0 deletions.
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

0 comments on commit 11ed711

Please sign in to comment.