Skip to content

Commit

Permalink
Clear the surface before each frame in SkikoComposeUiTest.
Browse files Browse the repository at this point in the history
  • Loading branch information
m-sasha committed Feb 3, 2025
1 parent 9ba5947 commit 10389f5
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import kotlinx.coroutines.test.TestScope
import kotlinx.coroutines.test.UnconfinedTestDispatcher
import kotlinx.coroutines.test.runTest
import kotlinx.coroutines.yield
import org.jetbrains.skia.Color
import org.jetbrains.skia.IRect
import org.jetbrains.skia.Surface
import org.jetbrains.skiko.currentNanoTime
Expand Down Expand Up @@ -237,6 +238,7 @@ class SkikoComposeUiTest @InternalTestApi constructor(
* Render the scene at the given time.
*/
private fun render(timeMillis: Long) {
surface.canvas.clear(Color.TRANSPARENT)
scene.render(
surface.canvas.asComposeCanvas(),
timeMillis * NanoSecondsPerMilliSecond
Expand Down

0 comments on commit 10389f5

Please sign in to comment.