Package-level declarations

Types

Link copied to clipboard
value class Bitmask(value: Int = 0)

Immutable integer-backed set of bit flags.

Link copied to clipboard
@RequiresOptIn(message = "This is an internal Haze API and should not be used outside of the library. It may be changed or removed without notice.")
annotation class InternalHazeApi

Marks public declarations reserved for Haze's internal module-to-module implementation.

Link copied to clipboard

A runtime shader render effect whose uniforms can be updated without recompiling its source.

Link copied to clipboard
actual typealias PlatformColorFilter = ColorFilter

Platform-specific color filter type.

expect class PlatformColorFilter

Platform-specific color filter type.

actual typealias PlatformColorFilter = ColorFilter
typealias PlatformColorFilter = ColorFilter

Platform-specific color filter type.

Link copied to clipboard
actual typealias PlatformContext = Context

Android Context used as the Haze platform context.

expect abstract class PlatformContext

Platform-specific context required by built-in Haze renderers.

actual abstract class PlatformContext

Stateless platform context used by Skiko-backed Haze renderers.

Link copied to clipboard

Platform-specific render effect type.

Platform-specific render effect type.

actual typealias PlatformRenderEffect = ImageFilter
typealias PlatformRenderEffect = ImageFilter

Platform-specific render effect type.

Link copied to clipboard
actual class PlatformRuntimeEffect(sksl: String)

On Android, we use RuntimeShader directly rather than a RuntimeEffect. This class wraps the SKSL to create RuntimeShader instances on demand.

Platform-specific runtime effect type for compiling shaders.

actual typealias PlatformRuntimeEffect = RuntimeEffect
typealias PlatformRuntimeEffect = RuntimeEffect

Platform-specific runtime effect type for compiling shaders.

Link copied to clipboard
@Target(allowedTargets = [AnnotationTarget.CLASS])
annotation class Poko

Generates value-based equals, hashCode, and toString implementations for the class.

Link copied to clipboard

A platform runtime shader or its native render-effect graph could not be constructed.

Link copied to clipboard

Interface for setting uniforms on runtime shaders.

Functions

Link copied to clipboard

Converts this platform render effect to a Compose RenderEffect.

Converts this platform render effect to a Compose RenderEffect.

Converts this platform render effect to a Compose RenderEffect.

Link copied to clipboard
fun PlatformRenderEffect.blendForeground(foreground: PlatformRenderEffect, blendMode: BlendMode, offset: Offset = Offset.Unspecified): PlatformRenderEffect

Blends this render effect with a foreground effect.

Link copied to clipboard
@RequiresApi(value = 29)
actual fun createBlendColorFilter(color: Int, blendMode: BlendMode): PlatformColorFilter

Creates a color filter that blends with a given color.

Creates a color filter that blends with a given color.

Creates a color filter that blends with a given color.

Link copied to clipboard
@RequiresApi(value = 31)
actual fun createBlendRenderEffect(blendMode: BlendMode, background: PlatformRenderEffect, foreground: PlatformRenderEffect, crop: Rect?): PlatformRenderEffect

Creates a blend PlatformRenderEffect from two render effects.

expect fun createBlendRenderEffect(blendMode: BlendMode, background: PlatformRenderEffect, foreground: PlatformRenderEffect, crop: Rect? = null): PlatformRenderEffect

Creates a blend PlatformRenderEffect from two render effects.

Creates a blend PlatformRenderEffect from two render effects.

Link copied to clipboard
@RequiresApi(value = 31)
actual fun createBlurRenderEffect(radiusX: Float, radiusY: Float, tileMode: TileMode, input: PlatformRenderEffect?, crop: Rect?): PlatformRenderEffect?

Creates a blur PlatformRenderEffect.

expect fun createBlurRenderEffect(radiusX: Float, radiusY: Float, tileMode: TileMode, input: PlatformRenderEffect? = null, crop: Rect? = null): PlatformRenderEffect?

Creates a blur PlatformRenderEffect.

actual fun createBlurRenderEffect(radiusX: Float, radiusY: Float, tileMode: TileMode, input: PlatformRenderEffect?, crop: Rect?): PlatformRenderEffect?

Creates a blur PlatformRenderEffect.

Link copied to clipboard

Creates a color filter PlatformRenderEffect.

Creates a color filter PlatformRenderEffect.

Link copied to clipboard
@RequiresApi(value = 33)
actual fun createFractalNoiseShader(baseFrequencyX: Float, baseFrequencyY: Float, numOctaves: Int, seed: Float): Shader

Creates a fractal noise shader.

expect fun createFractalNoiseShader(baseFrequencyX: Float, baseFrequencyY: Float, numOctaves: Int, seed: Float): Shader

Creates a fractal noise shader.

actual fun createFractalNoiseShader(baseFrequencyX: Float, baseFrequencyY: Float, numOctaves: Int, seed: Float): Shader

Creates a fractal noise shader.

Link copied to clipboard

Creates a mutable-uniform runtime shader render effect with the given child shaders.

Creates a mutable-uniform runtime shader render effect with the given child shaders.

Creates a mutable-uniform runtime shader render effect with the given child shaders.

Link copied to clipboard
@RequiresApi(value = 31)
actual fun createOffsetRenderEffect(offsetX: Float, offsetY: Float, input: PlatformRenderEffect?, crop: Rect?): PlatformRenderEffect

Creates an offset PlatformRenderEffect.

expect fun createOffsetRenderEffect(offsetX: Float, offsetY: Float, input: PlatformRenderEffect? = null, crop: Rect? = null): PlatformRenderEffect

Creates an offset PlatformRenderEffect.

actual fun createOffsetRenderEffect(offsetX: Float, offsetY: Float, input: PlatformRenderEffect?, crop: Rect?): PlatformRenderEffect

Creates an offset PlatformRenderEffect.

Link copied to clipboard

Creates a separable progressive blur clipped to size at offset.

Link copied to clipboard

Creates a PlatformRuntimeEffect from SKSL shader code.

Creates a PlatformRuntimeEffect from SKSL shader code.

Creates a PlatformRuntimeEffect from SKSL shader code.

Link copied to clipboard

Creates a runtime shader PlatformRenderEffect with the given effect and child shaders.

Creates a runtime shader PlatformRenderEffect with the given effect and child shaders.

Creates a runtime shader PlatformRenderEffect with the given effect and child shaders.

Link copied to clipboard
@RequiresApi(value = 31)
actual fun createShaderRenderEffect(shader: Shader, crop: Rect?): PlatformRenderEffect

Creates a PlatformRenderEffect from a shader.

expect fun createShaderRenderEffect(shader: Shader, crop: Rect? = null): PlatformRenderEffect

Creates a PlatformRenderEffect from a shader.

Creates a PlatformRenderEffect from a shader.

Link copied to clipboard

Returns whether the device supports Android runtime-shader render effects.

Returns whether runtime-shader render effects are supported on the current platform.

Returns true because Skiko supports runtime-shader render effects.

Link copied to clipboard

Returns the Android context associated with this modifier node.

Returns the PlatformContext associated with this modifier node.

Link copied to clipboard

Chains this render effect with another, composing them.

Chains this render effect with another, composing them.

Chains this render effect with another, composing them.

Link copied to clipboard

Converts a Compose BlendMode to Android's AndroidBlendMode.

Link copied to clipboard

Converts a Compose ColorFilter to an Android platform PlatformColorFilter.

Converts a Compose ColorFilter to a Skia platform PlatformColorFilter.

Link copied to clipboard
fun BlendMode.toSkiaBlendMode(): BlendMode

Converts a Compose BlendMode to Skia's SkiaBlendMode.

Link copied to clipboard
actual inline fun <R> trace(sectionName: String, block: () -> R): R

Runs block inside a synchronous Android trace section named sectionName.

expect inline fun <R> trace(sectionName: String, block: () -> R): R

Runs block inside a synchronous platform trace section named sectionName.

actual inline fun <R> trace(sectionName: String, block: () -> R): R

Runs block inside a Compose trace section named sectionName.

Link copied to clipboard
actual inline suspend fun <R> traceAsync(sectionName: String, cookie: Int, crossinline block: suspend () -> R): R

Runs block inside an asynchronous Android trace section identified by cookie.

expect inline suspend fun <R> traceAsync(sectionName: String, cookie: Int, crossinline block: suspend () -> R): R

Runs block inside an asynchronous platform trace section identified by cookie.

actual inline suspend fun <R> traceAsync(sectionName: String, cookie: Int, crossinline block: suspend () -> R): R

Runs block; Skiko does not currently emit an asynchronous platform trace section.