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 Classes
  Modifier and Type
  Interface
  Description
  `static interface`
  `TextureRegistry.GLTextureConsumer`
  `static interface`
  `TextureRegistry.ImageConsumer`
  `static interface`
  `TextureRegistry.ImageTextureEntry`
  `static interface`
  `TextureRegistry.OnFrameConsumedListener`
  Listener invoked when the most recent image has been consumed.
  `static interface`
  `TextureRegistry.OnTrimMemoryListener`
  Listener invoked when a memory pressure warning was forward.
  `static enum`
  `TextureRegistry.SurfaceLifecycle`
  How a `TextureRegistry.SurfaceProducer` created by `createSurfaceProducer()` manages the lifecycle of the created surface.
  `static interface`
  `TextureRegistry.SurfaceProducer`
  Uses a Surface to populate the texture.
  `static interface`
  `TextureRegistry.SurfaceTextureEntry`
  A registry entry for a managed SurfaceTexture.
  `static interface`
  `TextureRegistry.TextureEntry`
  An entry in the texture registry.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TextureRegistry.ImageTextureEntry`
  `createImageTexture()`
  Creates and registers a texture managed by the Flutter engine.
  `default TextureRegistry.SurfaceProducer`
  `createSurfaceProducer()`
  Creates and registers a `TextureRegistry.SurfaceProducer`, or a Flutter-managed `Surface`.
  `TextureRegistry.SurfaceProducer`
  `createSurfaceProducer(TextureRegistry.SurfaceLifecycle lifecycle)`
  Creates and a `TextureRegistry.SurfaceProducer`, or a Flutter-managed `Surface`.
  `TextureRegistry.SurfaceTextureEntry`
  `createSurfaceTexture()`
  Creates and registers a SurfaceTexture managed by the Flutter engine.
  `default void`
  `onTrimMemory(int level)`
  Callback invoked when memory is low.
  `TextureRegistry.SurfaceTextureEntry`
  `registerSurfaceTexture(SurfaceTexture surfaceTexture)`
  Registers a SurfaceTexture managed by the Flutter engine.

- ## Method Details

  - ### createSurfaceProducer

    @NonNull default TextureRegistry.SurfaceProducer createSurfaceProducer()
    Creates and registers a `TextureRegistry.SurfaceProducer`, or a Flutter-managed `Surface`.

    Uses the `TextureRegistry.SurfaceLifecycle.manual` lifecycle implicitly.

    Returns:
      A SurfaceProducer.

  - ### createSurfaceProducer

    @NonNull TextureRegistry.SurfaceProducer createSurfaceProducer(TextureRegistry.SurfaceLifecycle lifecycle)
    Creates and a `TextureRegistry.SurfaceProducer`, or a Flutter-managed `Surface`.
    Parameters:
      `lifecycle` - Whether to automatically reset the last image and release the surface.
    Returns:
      A SurfaceProducer.

  - ### createSurfaceTexture

    @NonNull TextureRegistry.SurfaceTextureEntry 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

    @NonNull TextureRegistry.ImageTextureEntry 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)`.