RiveSurface

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.

Parameters

owningCommandQueue

Command queue that owns this surface and performs ordered disposal. The surface acquires its own reference so the queue stays alive until surface disposal has run.

surfaceNativePointer

Opaque native backend surface resource owned by this surface.

drawKey

The key used to uniquely identify the draw operation in the CommandQueue.

width

The width of the surface in pixels.

height

The height of the surface in pixels.

resizable

Whether this surface supports in-place size changes via resize.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val closed: Boolean

Whether this resource has been closed.

Link copied to clipboard
Link copied to clipboard
var height: Int

The height of the surface in pixels.

Link copied to clipboard

Whether this surface supports in-place size changes.

Link copied to clipboard

Opaque native backend surface resource.

Link copied to clipboard
var width: Int

The width of the surface in pixels.

Functions

Link copied to clipboard
open override fun close()

Schedules surface disposal on the owning command queue.