|
26 | 26 | #import "flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformPlugin.h"
|
27 | 27 | #import "flutter/shell/platform/darwin/ios/framework/Source/FlutterSpellCheckPlugin.h"
|
28 | 28 | #import "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h"
|
| 29 | +#import "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextureRegistryRelay.h" |
29 | 30 | #import "flutter/shell/platform/darwin/ios/framework/Source/FlutterUndoManagerDelegate.h"
|
30 | 31 | #import "flutter/shell/platform/darwin/ios/framework/Source/FlutterUndoManagerPlugin.h"
|
31 | 32 | #import "flutter/shell/platform/darwin/ios/framework/Source/FlutterViewController_Internal.h"
|
@@ -87,7 +88,8 @@ - (instancetype)initWithPlugin:(NSString*)pluginKey flutterEngine:(FlutterEngine
|
87 | 88 | @interface FlutterEngine () <FlutterIndirectScribbleDelegate,
|
88 | 89 | FlutterUndoManagerDelegate,
|
89 | 90 | FlutterTextInputDelegate,
|
90 |
| - FlutterBinaryMessenger> |
| 91 | + FlutterBinaryMessenger, |
| 92 | + FlutterTextureRegistry> |
91 | 93 | // Maintains a dictionary of plugin names that have registered with the engine. Used by
|
92 | 94 | // FlutterEngineRegistrar to implement a FlutterPluginRegistrar.
|
93 | 95 | @property(nonatomic, readonly) NSMutableDictionary* pluginPublications;
|
@@ -138,6 +140,7 @@ @implementation FlutterEngine {
|
138 | 140 | BOOL _allowHeadlessExecution;
|
139 | 141 | BOOL _restorationEnabled;
|
140 | 142 | FlutterBinaryMessengerRelay* _binaryMessenger;
|
| 143 | + FlutterTextureRegistryRelay* _textureRegistry; |
141 | 144 | std::unique_ptr<flutter::ConnectionCollection> _connections;
|
142 | 145 | }
|
143 | 146 |
|
@@ -197,6 +200,7 @@ - (instancetype)initWithName:(NSString*)labelPrefix
|
197 | 200 | [self recreatePlatformViewController];
|
198 | 201 |
|
199 | 202 | _binaryMessenger = [[FlutterBinaryMessengerRelay alloc] initWithParent:self];
|
| 203 | + _textureRegistry = [[FlutterTextureRegistryRelay alloc] initWithParent:self]; |
200 | 204 | _connections.reset(new flutter::ConnectionCollection());
|
201 | 205 |
|
202 | 206 | NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
|
@@ -261,7 +265,10 @@ - (void)dealloc {
|
261 | 265 | [_pluginPublications release];
|
262 | 266 | [_registrars release];
|
263 | 267 | _binaryMessenger.parent = nil;
|
| 268 | + _textureRegistry.parent = nil; |
264 | 269 | [_binaryMessenger release];
|
| 270 | + [_textureRegistry release]; |
| 271 | + _textureRegistry = nil; |
265 | 272 | [_isolateId release];
|
266 | 273 |
|
267 | 274 | NSNotificationCenter* center = [NSNotificationCenter defaultCenter];
|
@@ -1073,6 +1080,10 @@ - (void)flutterViewAccessibilityDidCall {
|
1073 | 1080 | return _binaryMessenger;
|
1074 | 1081 | }
|
1075 | 1082 |
|
| 1083 | +- (NSObject<FlutterTextureRegistry>*)textureRegistry { |
| 1084 | + return _textureRegistry; |
| 1085 | +} |
| 1086 | + |
1076 | 1087 | // For test only. Ideally we should create a dependency injector for all dependencies and
|
1077 | 1088 | // remove this.
|
1078 | 1089 | - (void)setBinaryMessenger:(FlutterBinaryMessengerRelay*)binaryMessenger {
|
@@ -1333,7 +1344,7 @@ - (void)dealloc {
|
1333 | 1344 | }
|
1334 | 1345 |
|
1335 | 1346 | - (NSObject<FlutterTextureRegistry>*)textures {
|
1336 |
| - return _flutterEngine; |
| 1347 | + return _flutterEngine.textureRegistry; |
1337 | 1348 | }
|
1338 | 1349 |
|
1339 | 1350 | - (void)publish:(NSObject*)value {
|
|
0 commit comments