Package 

Class RiveSurface

  • 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.

    • 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.

      • 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.