diff --git a/third_party/txt/src/txt/font_collection.cc b/third_party/txt/src/txt/font_collection.cc index 6820f14264eeb..01edddb440167 100644 --- a/third_party/txt/src/txt/font_collection.cc +++ b/third_party/txt/src/txt/font_collection.cc @@ -103,18 +103,34 @@ void FontCollection::SetupDefaultFontManager() { void FontCollection::SetDefaultFontManager(sk_sp font_manager) { default_font_manager_ = font_manager; + +#if FLUTTER_ENABLE_SKSHAPER + skt_collection_.reset(); +#endif } void FontCollection::SetAssetFontManager(sk_sp font_manager) { asset_font_manager_ = font_manager; + +#if FLUTTER_ENABLE_SKSHAPER + skt_collection_.reset(); +#endif } void FontCollection::SetDynamicFontManager(sk_sp font_manager) { dynamic_font_manager_ = font_manager; + +#if FLUTTER_ENABLE_SKSHAPER + skt_collection_.reset(); +#endif } void FontCollection::SetTestFontManager(sk_sp 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. @@ -365,6 +381,7 @@ void FontCollection::ClearFontFamilyCache() { } #endif } + #if FLUTTER_ENABLE_SKSHAPER sk_sp