-
- All Implemented Interfaces:
-
app.rive.core.CloseableSurface,java.lang.AutoCloseable
public final class ImageReaderSurface implements CloseableSurface
CloseableSurface backed by an ImageReader.
The Surface is owned by the ImageReader, so closing this wrapper closes only the reader. That invalidates the surface after Rive has finished all queued work that targets it.
-
-
Constructor Summary
Constructors Constructor Description ImageReaderSurface(ImageReader imageReader)
-
Method Summary
Modifier and Type Method Description SurfacegetSurface()Surface used to create the backend render target. IntegergetWidth()Creation-time width in physical pixels. IntegergetHeight()Creation-time height in physical pixels. BooleangetResizable()Whether the backing Android resource supports in-place size changes. Unitclose()Releases the Android resources backing surface. -
-
Constructor Detail
-
ImageReaderSurface
ImageReaderSurface(ImageReader imageReader)
- Parameters:
imageReader- Reader that owns the render target surface.
-
-
Method Detail
-
getSurface
Surface getSurface()
Surface used to create the backend render target.
-
getResizable
Boolean getResizable()
Whether the backing Android resource supports in-place size changes.
-
close
Unit close()
Releases the Android resources backing surface.
Callers normally should not call this directly after passing the instance to CommandQueue.createRiveSurface. Implementations must be idempotent and tolerate being closed by CommandQueue.createRiveSurface on creation failure, or later on the command server thread when the wrapping RiveSurface is closed.
-
-
-
-