@@ -526,30 +540,25 @@ actual open class SkiaLayer internal constructor(
...
@@ -526,30 +540,25 @@ actual open class SkiaLayer internal constructor(
/**
/**
* Redraw on the next animation Frame (on vsync signal if vsync is enabled).
* Redraw on the next animation Frame (on vsync signal if vsync is enabled).
*/
*/
actualfunneedRedraw(){
actualfunneedRedraw(throttledToVsync:Boolean){
check(isEventDispatchThread()){"Method should be called from AWT event dispatch thread"}
check(isEventDispatchThread()){"Method should be called from AWT event dispatch thread"}
check(!isDisposed){"SkiaLayer is disposed"}
check(!isDisposed){"SkiaLayer is disposed"}
redrawer?.needRedraw()
redrawer?.needRedraw(throttledToVsync)
}
}
@Suppress("LeakingThis")
privatevalfpsCounter=defaultFPSCounter(this)
internalfunupdate(nanoTime:Long){
internalfunupdate(nanoTime:Long){
check(isEventDispatchThread()){"Method should be called from AWT event dispatch thread"}
check(isEventDispatchThread()){"Method should be called from AWT event dispatch thread"}
check(!isDisposed){"SkiaLayer is disposed"}
check(!isDisposed){"SkiaLayer is disposed"}
checkContentScale()
checkContentScale()
FrameWatcher.nextFrame()
FrameWatcher.nextFrame()
fpsCounter?.tick()
// The current approach is to render into a picture in the main thread, and render this picture in the render thread
// The current approach is to render into a picture in the main thread, and render this picture in the render thread
// If this approach will be changed, create an issue in https://youtrack.jetbrains.com/issues/CMP for changing it in
// If this approach will be changed, create an issue in https://youtrack.jetbrains.com/issues/CMP for changing it in
// https://github.com/JetBrains/compose-multiplatform/blob/e4e2d329709cded91a09cc612d4defbce37aad96/benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/MeasureComposable.kt#L151 as well
// https://github.com/JetBrains/compose-multiplatform/blob/e4e2d329709cded91a09cc612d4defbce37aad96/benchmarks/multiplatform/benchmarks/src/commonMain/kotlin/MeasureComposable.kt#L151 as well