-
- All Implemented Interfaces:
-
app.rive.core.CloseableSurface,java.lang.AutoCloseable
public final class SurfaceTextureSurface implements CloseableSurface
CloseableSurface backed by a SurfaceTexture.
This owns both the temporary Surface wrapper and the SurfaceTexture. Both are intentionally retained until Rive surface destruction so there is a single teardown point ordered by the command queue.
width and height capture the creation-time size. If the SurfaceTexture later changes size, update the created RiveSurface with RiveSurface.resize instead of reusing this wrapper as a source of current dimensions.
-
-
Constructor Summary
Constructors Constructor Description SurfaceTextureSurface(SurfaceTexture surfaceTexture, Integer width, Integer height)
-
Method Summary
-
-
Constructor Detail
-
SurfaceTextureSurface
SurfaceTextureSurface(SurfaceTexture surfaceTexture, Integer width, Integer height)
- Parameters:
surfaceTexture- Texture source backing the created Surface.width- Creation-time width in physical pixels.height- Creation-time height in physical pixels.
-
-
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.
-
-
-
-