From d560fa20d1d52f440d03fe6e5cd739bf961714aa Mon Sep 17 00:00:00 2001 From: Zachary Anderson Date: Wed, 27 Jul 2022 15:34:21 -0700 Subject: [PATCH] Remove FragmentProgram.fromAssetAsync() (flutter/engine#34951) --- engine/src/flutter/lib/ui/painting.dart | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/engine/src/flutter/lib/ui/painting.dart b/engine/src/flutter/lib/ui/painting.dart index d3e91ab5b7a..b5676ccd58e 100644 --- a/engine/src/flutter/lib/ui/painting.dart +++ b/engine/src/flutter/lib/ui/painting.dart @@ -4051,12 +4051,11 @@ class FragmentProgram extends NativeFieldWrapperClass1 { }); } - // TODO(zra): This is part of a soft transition of the framework to this - // API, which pushes the asset load to an asynchronous operation. - static Future fromAssetAsync(String assetKey) { - return Future.microtask(() => FragmentProgram.fromAsset(assetKey)); - } - + // This is a cache of shaders that have been loaded by + // FragmentProgram.fromAsset. It holds weak references to the FragmentPrograms + // so that the case where an in-use program is requested again can be fast, + // but programs that are no longer referenced are not retained because of the + // cache. static Map> _shaderRegistry = >{};