Package io.flutter.view
Interface TextureRegistry
- All Known Implementing Classes:
FlutterRenderer
public interface TextureRegistry
Registry of backend textures used with a single
FlutterView
instance. Entries may be embedded into the Flutter view using the Texture widget.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic interfacestatic interfacestatic interfaceListener invoked when the most recent image has been consumed.static interfaceListener invoked when a memory pressure warning was forward.static enumHow aTextureRegistry.SurfaceProducercreated bycreateSurfaceProducer()manages the lifecycle of the created surface.static interfaceUses a Surface to populate the texture.static interfaceA registry entry for a managed SurfaceTexture.static interfaceAn entry in the texture registry. -
Method Summary
Modifier and TypeMethodDescriptionCreates and registers a texture managed by the Flutter engine.default TextureRegistry.SurfaceProducerCreates and registers aTextureRegistry.SurfaceProducer, or a Flutter-managedSurface.Creates and aTextureRegistry.SurfaceProducer, or a Flutter-managedSurface.Creates and registers a SurfaceTexture managed by the Flutter engine.default voidonTrimMemory(int level) Callback invoked when memory is low.registerSurfaceTexture(SurfaceTexture surfaceTexture) Registers a SurfaceTexture managed by the Flutter engine.
-
Method Details
-
createSurfaceProducer
Creates and registers aTextureRegistry.SurfaceProducer, or a Flutter-managedSurface.Uses the
TextureRegistry.SurfaceLifecycle.manuallifecycle implicitly.- Returns:
- A SurfaceProducer.
-
createSurfaceProducer
@NonNull TextureRegistry.SurfaceProducer createSurfaceProducer(TextureRegistry.SurfaceLifecycle lifecycle) Creates and aTextureRegistry.SurfaceProducer, or a Flutter-managedSurface.- Parameters:
lifecycle- Whether to automatically reset the last image and release the surface.- Returns:
- A SurfaceProducer.
-
createSurfaceTexture
Creates and registers a SurfaceTexture managed by the Flutter engine.- Returns:
- A SurfaceTextureEntry.
-
registerSurfaceTexture
@NonNull TextureRegistry.SurfaceTextureEntry registerSurfaceTexture(@NonNull SurfaceTexture surfaceTexture) Registers a SurfaceTexture managed by the Flutter engine.- Returns:
- A SurfaceTextureEntry.
-
createImageTexture
Creates and registers a texture managed by the Flutter engine.- Returns:
- a ImageTextureEntry.
-
onTrimMemory
default void onTrimMemory(int level) Callback invoked when memory is low.Invoke this from
Activity.onTrimMemory(int).
-