Skip to content

Commit

Permalink
clean up blur benchmark test
Browse files Browse the repository at this point in the history
  • Loading branch information
aboedo committed Oct 18, 2023
1 parent 19ef51e commit ef31b22
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import com.revenuecat.purchases.ui.revenuecatui.extensions.defaultBackgroundPlac

@Composable
internal fun BoxScope.PaywallBackground(templateConfiguration: TemplateConfiguration) {
// current implementation uses a transformation on API level 30-, modifier on 31+.
// current implementation uses a transformation on API level 30-, modifier on 31+.
val transformation = if (templateConfiguration.configuration.blurredBackgroundImage && Build.VERSION.SDK_INT < 31)
BlurTransformation(
context = LocalContext.current, radius = BackgroundUIConstants.blurSize.toFloatPx(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,6 @@ class BlurBenchmarkTest {
}
}

@Test
fun `Blur images using averages blur`() = runBlocking {
benchmarkBlur("Averages Blur") { image, context, radius ->
image.blurByAveraging(scale = 1f, radius = radius.toInt())
}
}

@Test
fun `Benchmark RenderScript blur`() = runBlocking {
benchmarkBlur("RenderScript Blur") { image, context, radius ->
image.blurUsingRenderScript(context, radius)
}
}

private suspend fun benchmarkBlur(functionName: String, blurFunction: suspend (Bitmap, Context, Float) -> Unit) {
val context = InstrumentationRegistry.getInstrumentation().targetContext
val image = openImage()
Expand Down

0 comments on commit ef31b22

Please sign in to comment.