diff --git a/backdrop/src/skikoMain/kotlin/com/kyant/backdrop/internal/Paint.kt b/backdrop/src/skikoMain/kotlin/com/kyant/backdrop/internal/Paint.kt index 8b1b3e9..0bdd1c3 100644 --- a/backdrop/src/skikoMain/kotlin/com/kyant/backdrop/internal/Paint.kt +++ b/backdrop/src/skikoMain/kotlin/com/kyant/backdrop/internal/Paint.kt @@ -1,17 +1,18 @@ package com.kyant.backdrop.internal import androidx.compose.ui.graphics.Paint +import androidx.compose.ui.graphics.skiaPaint import com.kyant.backdrop.RuntimeShader import com.kyant.backdrop.asSkikoRuntimeShader import org.jetbrains.skia.FilterBlurMode import org.jetbrains.skia.MaskFilter internal actual fun Paint.blur(radius: Float) { - this.asFrameworkPaint().maskFilter = + this.skiaPaint.maskFilter = if (radius > 0f) MaskFilter.makeBlur(FilterBlurMode.NORMAL, radius) else null } internal actual fun Paint.setRuntimeShader(runtimeShader: RuntimeShader?) { - this.asFrameworkPaint().shader = runtimeShader?.asSkikoRuntimeShader()?.makeShader() + this.skiaPaint.shader = runtimeShader?.asSkikoRuntimeShader()?.makeShader() } diff --git a/backdrop/src/skikoMain/kotlin/com/kyant/backdrop/internal/RenderEffect.kt b/backdrop/src/skikoMain/kotlin/com/kyant/backdrop/internal/RenderEffect.kt index 3a43d52..ee1de05 100644 --- a/backdrop/src/skikoMain/kotlin/com/kyant/backdrop/internal/RenderEffect.kt +++ b/backdrop/src/skikoMain/kotlin/com/kyant/backdrop/internal/RenderEffect.kt @@ -4,16 +4,14 @@ import androidx.compose.ui.graphics.ColorFilter import androidx.compose.ui.graphics.RenderEffect import androidx.compose.ui.graphics.asComposeRenderEffect import androidx.compose.ui.graphics.asSkiaColorFilter +import androidx.compose.ui.graphics.skiaImageFilter import com.kyant.backdrop.RuntimeShader import com.kyant.backdrop.asSkikoRuntimeShader import org.jetbrains.skia.ImageFilter internal actual fun RenderEffect?.chain(other: RenderEffect): RenderEffect { return if (this != null) { - ImageFilter.makeCompose( - other.asSkiaImageFilter(), - this.asSkiaImageFilter() - ).asComposeRenderEffect() + ImageFilter.makeCompose(other.skiaImageFilter, this.skiaImageFilter).asComposeRenderEffect() } else { other } @@ -36,7 +34,7 @@ internal actual fun ColorFilterEffect( ): RenderEffect { return ImageFilter.makeColorFilter( colorFilter.asSkiaColorFilter(), - renderEffect?.asSkiaImageFilter(), + renderEffect?.skiaImageFilter, null ).asComposeRenderEffect() }