createScaledContentLayer

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.

backgroundShader runs each time the layer's draw block runs, including when the platform replays the block after dropping the layer's display list. Produce the shader there, rather than capturing one, so a shader whose uniforms are shared is configured and drawn in the same call.

Returns null without creating a layer when the scaled layerSize is empty. When fillCapture is true, the input fills the rounded allocation independently on each axis; present that capture with the matching drawScaledContent overload and scaledContentScale.