-
- All Implemented Interfaces:
-
app.rive.core.CheckableAutoCloseable,java.lang.AutoCloseable
public abstract class RiveSurface implements CheckableAutoCloseable
A backend agnostic collection of surface properties needed for rendering.
A draw key, which uniquely identifies draw operations in the CommandQueue
The dimensions of the surface in pixels
⚠️ This class assumes ownership of all resources and should be closed when no longer needed. Closing schedules ordered disposal on the owning CommandQueue.
Alone it is not sufficient for rendering, as it lacks a backend-specific surface, which is provided by subclasses.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classRiveSurface.Companion
-
Method Summary
Modifier and Type Method Description final IntegergetWidth()The width of the surface in pixels. final UnitsetWidth(Integer width)final IntegergetHeight()The height of the surface in pixels. final UnitsetHeight(Integer height)BooleangetClosed()final UniquePointergetSurfaceNativePointer()Opaque native backend surface resource. final DrawKeygetDrawKey()final BooleangetResizable()Whether this surface supports in-place size changes. Unitclose()Schedules surface disposal on the owning command queue. -
-
Method Detail
-
getSurfaceNativePointer
final UniquePointer getSurfaceNativePointer()
Opaque native backend surface resource.
The concrete backend surface owns its render target and is disposed through command queue ordering when close is called.
-
getDrawKey
final DrawKey getDrawKey()
-
getResizable
final Boolean getResizable()
Whether this surface supports in-place size changes.
For surfaces created from a CloseableSurface, this value is copied from the backing creation object at construction time. Window surfaces backed by resizable Android resources, such as SurfaceTextureSurface, can resize in place. Fixed-size surfaces, such as ImageReaderSurface and off-screen image surfaces, must be recreated at the desired size instead.
-
close
Unit close()
Schedules surface disposal on the owning command queue.
This is safe to call from the main thread. After calling close, callers must not use this surface again. Pending coalesced draws for this surface are canceled before native disposal is queued. Draws already admitted to execution may still complete.
-
-
-
-