New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
iOS modify invalidation logic #797
Conversation
* limitations under the License. | ||
*/ | ||
|
||
package bugs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we move it to more specific package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to, it's our sandbox
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This package already exists, so if want to rename it we should do it in a separate PR.
I don't have preference to either naming style (bugs
or androidx.compose.mpp.demo.bugs
). Both are fine to me.
compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/window/MetalRedrawer.kt
Show resolved
Hide resolved
* limitations under the License. | ||
*/ | ||
|
||
package bugs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This package already exists, so if want to rename it we should do it in a separate PR.
I don't have preference to either naming style (bugs
or androidx.compose.mpp.demo.bugs
). Both are fine to me.
compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/window/MetalRedrawer.kt
Outdated
Show resolved
Hide resolved
# Conflicts: # compose/ui/ui/src/uikitMain/kotlin/androidx/compose/ui/window/MetalRedrawer.kt
Rationale
If subsequent
setPaused: true:
setPaused: false
happen on different main RunLoop jobs, actual restart of CADisplayLink takes 16 ms (two intervals).Proposed Changes
Since invalidation, which triggers unpause, happens asynchronously, we can avoid that behavior by forcing
needRedraw
call to unpause CADisplayLink for at least two frames (instead of one).Remove
getMainDispatcher
.Dispatchers.Main
works correctly now and doesn't need a workaround.Testing
Test: check that animations are 120hz on 120hz devices, even when there are no touches tracked.
Issues Fixed
Fixes: scheduling causing JetBrains/compose-multiplatform#3605. It's not the only reason for lower FPS.