Skip to content
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

Merged
merged 11 commits into from Sep 13, 2023

Conversation

elijah-semyonov
Copy link

@elijah-semyonov elijah-semyonov commented Sep 7, 2023

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.

@elijah-semyonov elijah-semyonov marked this pull request as ready for review September 8, 2023 12:51
* limitations under the License.
*/

package bugs
Copy link
Member

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?

Copy link
Author

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

Copy link
Collaborator

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.

* limitations under the License.
*/

package bugs
Copy link
Collaborator

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.

@elijah-semyonov elijah-semyonov merged commit e5e867b into jb-main Sep 13, 2023
3 checks passed
@elijah-semyonov elijah-semyonov deleted the es/ios-modify-invalidation-logic-2 branch September 13, 2023 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants