Flutter Engine
The Flutter Engine
Public Member Functions | Package Functions | List of all members
io.flutter.view.FlutterView.SurfaceTextureRegistryEntry Class Reference
Inheritance diagram for io.flutter.view.FlutterView.SurfaceTextureRegistryEntry:
io.flutter.view.TextureRegistry.SurfaceTextureEntry io.flutter.view.TextureRegistry.TextureEntry

Public Member Functions

SurfaceTextureWrapper textureWrapper ()
 
SurfaceTexture surfaceTexture ()
 
long id ()
 
void release ()
 
- Public Member Functions inherited from io.flutter.view.TextureRegistry.SurfaceTextureEntry
SurfaceTexture surfaceTexture ()
 
default void setOnFrameConsumedListener (@Nullable OnFrameConsumedListener listener)
 
default void setOnTrimMemoryListener (@Nullable OnTrimMemoryListener listener)
 
long id ()
 
void release ()
 

Package Functions

 SurfaceTextureRegistryEntry (long id, SurfaceTexture surfaceTexture)
 

Detailed Description

Definition at line 922 of file FlutterView.java.

Constructor & Destructor Documentation

◆ SurfaceTextureRegistryEntry()

io.flutter.view.FlutterView.SurfaceTextureRegistryEntry.SurfaceTextureRegistryEntry ( long  id,
SurfaceTexture  surfaceTexture 
)
inlinepackage

Definition at line 927 of file FlutterView.java.

927 {
928 this.id = id;
929 this.textureWrapper = new SurfaceTextureWrapper(surfaceTexture);
930
931 // The callback relies on being executed on the UI thread (unsynchronised read of
932 // mNativeView
933 // and also the engine code check for platform thread in
934 // Shell::OnPlatformViewMarkTextureFrameAvailable),
935 // so we explicitly pass a Handler for the current thread.
936 this.surfaceTexture().setOnFrameAvailableListener(onFrameListener, new Handler());
937 }

Member Function Documentation

◆ id()

long io.flutter.view.FlutterView.SurfaceTextureRegistryEntry.id ( )
inline
Returns
The identity of this texture.

Implements io.flutter.view.TextureRegistry.TextureEntry.

Definition at line 968 of file FlutterView.java.

968 {
969 return id;
970 }

◆ release()

void io.flutter.view.FlutterView.SurfaceTextureRegistryEntry.release ( )
inline

Deregisters and releases all resources .

Implements io.flutter.view.TextureRegistry.TextureEntry.

Definition at line 973 of file FlutterView.java.

973 {
974 if (released) {
975 return;
976 }
977 released = true;
978
979 // The ordering of the next 3 calls is important:
980 // First we remove the frame listener, then we release the SurfaceTexture, and only after we
981 // unregister
982 // the texture which actually deletes the GL texture.
983
984 // Otherwise onFrameAvailableListener might be called after mNativeView==null
985 // (https://github.com/flutter/flutter/issues/20951). See also the check in onFrameAvailable.
986 surfaceTexture().setOnFrameAvailableListener(null);
987 textureWrapper.release();
988 mNativeView.getFlutterJNI().unregisterTexture(id);
989 }

◆ surfaceTexture()

SurfaceTexture io.flutter.view.FlutterView.SurfaceTextureRegistryEntry.surfaceTexture ( )
inline
Returns
The managed SurfaceTexture.

Implements io.flutter.view.TextureRegistry.SurfaceTextureEntry.

Definition at line 963 of file FlutterView.java.

963 {
964 return textureWrapper.surfaceTexture();
965 }

◆ textureWrapper()

SurfaceTextureWrapper io.flutter.view.FlutterView.SurfaceTextureRegistryEntry.textureWrapper ( )
inline

Definition at line 957 of file FlutterView.java.

957 {
958 return textureWrapper;
959 }

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