SurfaceTextureSurface

class SurfaceTextureSurface(surfaceTexture: SurfaceTexture, val width: Int, val height: Int) : 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.

Parameters

surfaceTexture

Texture source backing the created Surface.

width

Creation-time width in physical pixels.

height

Creation-time height in physical pixels.

Throws

If width or height is not positive.

Constructors

Link copied to clipboard
constructor(surfaceTexture: SurfaceTexture, width: Int, height: Int)

Properties

Link copied to clipboard
open override val height: Int
Link copied to clipboard
open override val resizable: Boolean = true

Whether the backing Android resource supports in-place size changes.

Link copied to clipboard
open override val surface: Surface

Surface used to create the backend render target.

Link copied to clipboard
open override val width: Int

Functions

Link copied to clipboard
open override fun close()

Releases the Android resources backing surface.