Skip to content

Commit

Permalink
Merge pull request #41 from skydoves/improve/node-io
Browse files Browse the repository at this point in the history
Runblocking on the IO dispatchers on the blurring bitmaps
  • Loading branch information
skydoves authored Sep 15, 2024
2 parents bb9cb09 + 4f2ea81 commit 3fc7b67
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import androidx.compose.ui.unit.Constraints
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.offset
import com.skydoves.cloudy.internals.render.iterativeBlur
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.runBlocking

/**
Expand Down Expand Up @@ -123,7 +124,7 @@ private class CloudyModifierNode(
onStateChanged.invoke(CloudyState.Loading)

try {
val targetBitmap: Bitmap = runBlocking {
val targetBitmap: Bitmap = runBlocking(Dispatchers.IO) {
graphicsLayer.toImageBitmap().asAndroidBitmap()
.copy(Bitmap.Config.ARGB_8888, true)
} ?: throw RuntimeException("Couldn't capture a bitmap from the composable tree")
Expand Down

0 comments on commit 3fc7b67

Please sign in to comment.