HazeEffectRuntimeDrawScope

Built-in-only semantic draw capability.

Source geometry and layers remain owned by core. Built-ins can record the selected input into their own target DrawScope without receiving source handles.

Properties

Link copied to clipboard
open val center: Offset
Link copied to clipboard
abstract val coroutineScope: CoroutineScope

Coroutine scope cancelled when the modifier node detaches.

Link copied to clipboard
abstract val density: Float
Link copied to clipboard
abstract val drawContext: DrawContext
Link copied to clipboard
abstract val fontScale: Float
Link copied to clipboard

Whether the selected input currently contains drawable content.

Link copied to clipboard

Opaque identity of the current input capture, or null when no input is drawable.

Link copied to clipboard
abstract val layerOffset: Offset

Offset from the effect layer origin to the modifier origin.

Link copied to clipboard
abstract val layerSize: Size

Current size of the expanded effect layer.

Link copied to clipboard
Link copied to clipboard
abstract val modifierBounds: Rect

Bounds of the modifier in the current effect layer.

Link copied to clipboard
abstract val modifierSize: Size

Current size of the modifier carrying the effect.

Link copied to clipboard
abstract val sampling: HazeSampling

Input-sampling policy supplied to the typed hazeEffect modifier.

Link copied to clipboard
open val size: Size

Functions

Link copied to clipboard
fun DrawScope.createScaledContentLayer(context: HazeEffectRuntimeDrawScope, backgroundColor: Color, scaleFactor: Float, layerSize: Size, existingLayer: GraphicsLayer? = null, backgroundShader: () -> Shader?? = null, fillCapture: Boolean = false): GraphicsLayer?

Records the effect input of context, scaled by scaleFactor, into existingLayer (or a new layer when it is null or released) over the shader backgroundShader returns or, without one, backgroundColor.

Link copied to clipboard
abstract fun <T> currentValueOf(local: CompositionLocal<T>): T

Returns the current value of local and observes it for redraw.

Link copied to clipboard
abstract fun drawArc(brush: Brush, startAngle: Float, sweepAngle: Float, useCenter: Boolean, topLeft: Offset, size: Size, @FloatRange(from = 0.0, to = 1.0) alpha: Float, style: DrawStyle, colorFilter: ColorFilter?, blendMode: BlendMode)
abstract fun drawArc(color: Color, startAngle: Float, sweepAngle: Float, useCenter: Boolean, topLeft: Offset, size: Size, @FloatRange(from = 0.0, to = 1.0) alpha: Float, style: DrawStyle, colorFilter: ColorFilter?, blendMode: BlendMode)
Link copied to clipboard
abstract fun drawCircle(brush: Brush, radius: Float, center: Offset, @FloatRange(from = 0.0, to = 1.0) alpha: Float, style: DrawStyle, colorFilter: ColorFilter?, blendMode: BlendMode)
abstract fun drawCircle(color: Color, radius: Float, center: Offset, @FloatRange(from = 0.0, to = 1.0) alpha: Float, style: DrawStyle, colorFilter: ColorFilter?, blendMode: BlendMode)
Link copied to clipboard
abstract fun drawImage(image: ImageBitmap, topLeft: Offset, @FloatRange(from = 0.0, to = 1.0) alpha: Float, style: DrawStyle, colorFilter: ColorFilter?, blendMode: BlendMode)
open fun drawImage(image: ImageBitmap, srcOffset: IntOffset, srcSize: IntSize, dstOffset: IntOffset, dstSize: IntSize, @FloatRange(from = 0.0, to = 1.0) alpha: Float, style: DrawStyle, colorFilter: ColorFilter?, blendMode: BlendMode, filterQuality: FilterQuality)
Link copied to clipboard
abstract fun drawInput()

Draws the modifier's selected source-backed or own-content input.

abstract fun DrawScope.drawInput()

Draws the selected input into this DrawScope, in the coordinate space of the expanded effect layer, where the modifier sits at layerOffset. A caller drawing in modifier space must translate by -layerOffset first.

Link copied to clipboard
abstract fun drawLine(brush: Brush, start: Offset, end: Offset, strokeWidth: Float, cap: StrokeCap, pathEffect: PathEffect?, @FloatRange(from = 0.0, to = 1.0) alpha: Float, colorFilter: ColorFilter?, blendMode: BlendMode)
abstract fun drawLine(color: Color, start: Offset, end: Offset, strokeWidth: Float, cap: StrokeCap, pathEffect: PathEffect?, @FloatRange(from = 0.0, to = 1.0) alpha: Float, colorFilter: ColorFilter?, blendMode: BlendMode)
Link copied to clipboard
abstract fun drawOval(brush: Brush, topLeft: Offset, size: Size, @FloatRange(from = 0.0, to = 1.0) alpha: Float, style: DrawStyle, colorFilter: ColorFilter?, blendMode: BlendMode)
abstract fun drawOval(color: Color, topLeft: Offset, size: Size, @FloatRange(from = 0.0, to = 1.0) alpha: Float, style: DrawStyle, colorFilter: ColorFilter?, blendMode: BlendMode)
Link copied to clipboard
abstract fun drawPath(path: Path, brush: Brush, @FloatRange(from = 0.0, to = 1.0) alpha: Float, style: DrawStyle, colorFilter: ColorFilter?, blendMode: BlendMode)
abstract fun drawPath(path: Path, color: Color, @FloatRange(from = 0.0, to = 1.0) alpha: Float, style: DrawStyle, colorFilter: ColorFilter?, blendMode: BlendMode)
Link copied to clipboard
abstract fun drawPoints(points: List<Offset>, pointMode: PointMode, brush: Brush, strokeWidth: Float, cap: StrokeCap, pathEffect: PathEffect?, @FloatRange(from = 0.0, to = 1.0) alpha: Float, colorFilter: ColorFilter?, blendMode: BlendMode)
abstract fun drawPoints(points: List<Offset>, pointMode: PointMode, color: Color, strokeWidth: Float, cap: StrokeCap, pathEffect: PathEffect?, @FloatRange(from = 0.0, to = 1.0) alpha: Float, colorFilter: ColorFilter?, blendMode: BlendMode)
Link copied to clipboard
abstract fun drawRect(brush: Brush, topLeft: Offset, size: Size, @FloatRange(from = 0.0, to = 1.0) alpha: Float, style: DrawStyle, colorFilter: ColorFilter?, blendMode: BlendMode)
abstract fun drawRect(color: Color, topLeft: Offset, size: Size, @FloatRange(from = 0.0, to = 1.0) alpha: Float, style: DrawStyle, colorFilter: ColorFilter?, blendMode: BlendMode)
Link copied to clipboard
abstract fun drawRoundRect(brush: Brush, topLeft: Offset, size: Size, cornerRadius: CornerRadius, @FloatRange(from = 0.0, to = 1.0) alpha: Float, style: DrawStyle, colorFilter: ColorFilter?, blendMode: BlendMode)
abstract fun drawRoundRect(color: Color, topLeft: Offset, size: Size, cornerRadius: CornerRadius, style: DrawStyle, @FloatRange(from = 0.0, to = 1.0) alpha: Float, colorFilter: ColorFilter?, blendMode: BlendMode)
Link copied to clipboard
fun DrawScope.drawScaledContent(offset: Offset, scaledSize: Size, clip: Boolean = true, block: DrawScope.() -> Unit)

Draws block, recorded at scaledSize, scaled up to fill this scope and translated by offset. Clips to this scope when clip is true.

fun DrawScope.drawScaledContent(offset: Offset, captureScale: ScaleFactor, clip: Boolean = true, block: DrawScope.() -> Unit)

Draws content recorded with a per-axis capture scale back at its original geometry.

Link copied to clipboard
abstract fun invalidateDraw()

Schedules a redraw of the effect.

Link copied to clipboard
open fun GraphicsLayer.record(size: IntSize, block: DrawScope.() -> Unit)
Link copied to clipboard

Returns the density currently associated with the modifier node.

Link copied to clipboard

Returns the graphics context used to allocate and release graphics layers.

Link copied to clipboard

Returns the platform context associated with the modifier node.

Link copied to clipboard
Link copied to clipboard
open fun Float.toDp(): Dp
open fun Int.toDp(): Dp
open fun TextUnit.toDp(): Dp
Link copied to clipboard
Link copied to clipboard
open fun Dp.toPx(): Float
Link copied to clipboard
open fun DpRect.toRect(): Rect
Link copied to clipboard
open fun DpSize.toSize(): Size
Link copied to clipboard
open fun Int.toSp(): TextUnit
open fun Dp.toSp(): TextUnit
Link copied to clipboard
inline fun DrawScope.translate(offset: Offset, block: DrawScope.() -> Unit)

Runs block translated by offset, or untranslated when offset is zero or not finite.

Link copied to clipboard

Provides a temporary graphics layer to a built-in renderer and releases it after block.