DrawCommand

sealed interface DrawCommand(source)

A retained drawing command in accumulated tree coordinates.

Commands are returned in retained paint order, including explicit nested child clips and post-child overlays. A backend must execute the list in that order. Backends must intersect drawing with every active PushClip and PushFractionalClip until the matching PopClip. The core records these contracts without clipping, blending, or sampling pixels. Portable commands carry platform-neutral values, while the opt-in Platform variant preserves an opaque version-adapter payload without teaching core its type. Exhaustive backends must handle every variant, including SampledImage, or explicitly reject unsupported commands before producing output. A backend compiled against a smaller variant set can fail when it receives an unknown variant even when the older JVM members remain available.

Inheritors

Types

Link copied to clipboard
data class BlitImage(val image: DrawImage, val source: IntRect, val destination: IntRect) : DrawCommand

Copies an image source rectangle into a tree-coordinate destination rectangle.

Link copied to clipboard
data class BlitImagePixels(val image: DrawImage, val source: IntRect, val destination: IntRect) : DrawCommand

Samples an immutable image independently at every output pixel in a logical destination rectangle.

Link copied to clipboard
data class FillRectangle(val bounds: IntRect, val color: ArgbColor) : DrawCommand

Fills a rectangle with one color.

Link copied to clipboard
data class Platform(val command: PlatformDrawCommand, val bounds: IntRect) : DrawCommand

Preserves an opaque platform payload at one tree-coordinate rectangle.

Link copied to clipboard
data object PopClip : DrawCommand

Ends the most recently begun child clip.

Link copied to clipboard
data class PushClip(val bounds: IntRect) : DrawCommand

Begins clipping subsequent drawing to DrawCommand.PushClip.bounds intersected with every active outer clip.

Link copied to clipboard
data class PushFractionalClip(val bounds: FloatRect) : DrawCommand

Begins a clip whose transformed edges remain fractional until final pixel coverage is determined.

Link copied to clipboard
data class SampledImage(val image: DrawImage, val source: FloatRect, val destination: FloatRect, val tint: ArgbColor = ArgbColor(-1), val alphaCutoff: Float = 0.1f, val orientation: SampledImageOrientation) : DrawCommand

Samples an immutable image through fractional geometry at the backend's final physical pixel density.