Flutter Engine
The Flutter Engine
Instance Methods | Properties | List of all members
FlutterTextureRegistryRelay Class Reference

#import <FlutterTextureRegistryRelay.h>

Inheritance diagram for FlutterTextureRegistryRelay:
<FlutterTextureRegistry>

Instance Methods

(instancetype) - initWithParent:
 
(int64_t) - registerTexture: [implementation]
 
(void) - textureFrameAvailable: [implementation]
 
(void) - unregisterTexture: [implementation]
 
(int64_t) - registerTexture:
 
(void) - textureFrameAvailable:
 
(void) - unregisterTexture:
 

Properties

NSObject< FlutterTextureRegistry > * parent
 

Detailed Description

Wrapper around a weakly held collection of registered textures.

Avoids a retain cycle between plugins and the engine.

Definition at line 20 of file FlutterTextureRegistryRelay.h.

Method Documentation

◆ initWithParent:

- (instancetype) initWithParent: (NSObject< FlutterTextureRegistry > *)  parent

◆ registerTexture:

- (int64_t) registerTexture: (NSObject< FlutterTexture > *)  texture
implementation

Registers a FlutterTexture for usage in Flutter and returns an id that can be used to reference that texture when calling into Flutter with channels. Textures must be registered on the platform thread. On success returns the pointer to the registered texture, else returns 0.

Reimplemented from <FlutterTextureRegistry>.

Definition at line 19 of file FlutterTextureRegistryRelay.mm.

22 :(NSObject<FlutterTexture>*)texture {
23 if (!self.parent) {
24 FML_LOG(WARNING) << "Using on an empty registry.";
25 return 0;
26 }
27 return [self.parent registerTexture:texture];
28}
#define FML_LOG(severity)
Definition: logging.h:82
NSObject< FlutterTextureRegistry > * parent
FlTexture * texture

◆ textureFrameAvailable:

- (void) textureFrameAvailable: (int64_t)  textureId
implementation

Notifies Flutter that the content of the previously registered texture has been updated.

This will trigger a call to -[FlutterTexture copyPixelBuffer] on the raster thread.

Reimplemented from <FlutterTextureRegistry>.

Definition at line 19 of file FlutterTextureRegistryRelay.mm.

30 :(int64_t)textureId {
31 if (!self.parent) {
32 FML_LOG(WARNING) << "Using on an empty registry.";
33 }
34 return [self.parent textureFrameAvailable:textureId];
35}

◆ unregisterTexture:

- (void) unregisterTexture: (int64_t)  textureId
implementation

Unregisters a FlutterTexture that has previously regeistered with registerTexture:. Textures must be unregistered on the platform thread.

Parameters
textureIdThe result that was previously returned from registerTexture:.

Reimplemented from <FlutterTextureRegistry>.

Definition at line 19 of file FlutterTextureRegistryRelay.mm.

37 :(int64_t)textureId {
38 if (!self.parent) {
39 FML_LOG(WARNING) << "Using on an empty registry.";
40 }
41 return [self.parent unregisterTexture:textureId];
42}

Property Documentation

◆ parent

- (NSObject<FlutterTextureRegistry>*) parent
readwritenonatomicweak

A weak reference to a FlutterEngine that will be passed texture registration.

Definition at line 25 of file FlutterTextureRegistryRelay.h.


The documentation for this class was generated from the following files: