Scoop API

scoop:scoop.ui:0.1.0

SceneContext

class SceneContext

source · line 21
public
public class SceneContext internal constructor(
    private val node: MountedNode,
    private val frame: FrameContext,
    private val layout: NodeLayout,
    private val overlay: OverlayLayout? = None,
    private val pass: ScenePass = ScenePass(),
    private val scrollPath: Array<ScrollReveal> = [],
    private val paintCache: PaintCachePolicy = PaintCachePolicy.None,
    private val epochs: Array<SceneEpoch> = [],
    private val recorder: SceneRecorder? = None
)

Geometry, input and child presentation share one frame state, separate from pixel blocks.

Extensions

function drawLayer

source · line 144
public
public fun drawLayer(key: PaintKey, bounds: Rect, revision: Long, samplingOutset: Double = 1.0, block: (PaintContext) -> Unit): Unit

Records a finite, isolated layer; revision covers every input affecting its pixels.

function withScrollReveal

source · line 210
public
public fun <T> withScrollReveal(viewport: ScrollViewport, region: Rect, axes: ScrollAxes = ScrollAxes.Both, block: (SceneContext) -> T): T

Narrows an existing viewport's reveal region for this actual content subtree.

function saveBackdropLayer

source · line 354
public
public fun saveBackdropLayer(opacity: Double = 1.0, backdrop: ImageFilter? = None, bounds: Rect? = None): Unit

Groups this scene and its children with the current backdrop, including during opacity fades. The optional filter processes the backdrop on entry, leaving subsequent foreground sharp. This reads the current layer only; an outer saveLayer still isolates its contents.

function item

source · line 399
public
public fun item(key: ViewKey): Unit

Presents one placed LazyElement item under this scope's transform and clip. Every placed item must be presented once; cannot be mixed with children(). Looks up only the selected layout, without building or measuring any item.