PaintScope

interface PaintScope(source)

Collects drawing commands for one node in its local coordinate space.

The scope is owned by the PaintNode.paint callback and is valid only until that callback returns. Every access must use the tree's owner thread. Access after the callback or from another thread fails. Commands are retained as the complete local display list in emission order. The runtime does not clip local commands to the node or parent bounds. Checked coordinate arithmetic is the only overflow guard. The tree is poisoned once pipeline work has started only when a callback or scope exception escapes the owning paint callback.

Inheritors

Properties

Link copied to clipboard
abstract val size: IntSize

The node's measured size.

Functions

Link copied to clipboard
abstract fun blitImage(image: DrawImage, source: IntRect, localDestination: IntRect)

Adds a local image blit command.

Link copied to clipboard
abstract fun drawPlatform(command: PlatformDrawCommand, localBounds: IntRect)

Adds one opaque platform draw command at a local half-open rectangle.

Link copied to clipboard
abstract fun fillRectangle(localBounds: IntRect, color: ArgbColor)

Adds a local fill command.

Link copied to clipboard
open fun sampledImage(image: DrawImage, source: FloatRect, localDestination: FloatRect, tint: ArgbColor = ArgbColor(-1), alphaCutoff: Float = 0.1f)

Adds an image sampled at the final physical pixel centers without rounding its geometry to logical pixels.

open fun sampledImage(image: DrawImage, source: FloatRect, localDestination: FloatRect, orientation: SampledImageOrientation, tint: ArgbColor = ArgbColor(-1), alphaCutoff: Float = 0.1f)

Adds a sampled image with explicit source-axis directions while keeping both rectangles normalized.

Link copied to clipboard
open fun withClip(localBounds: IntRect, content: () -> Unit)

Clips commands emitted during content without changing their local geometry or sampling coordinates.