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

Invalidate parent layer every time child layer is invalidated #1316

Merged
merged 1 commit into from Apr 25, 2024

Conversation

igordmn
Copy link
Collaborator

@igordmn igordmn commented Apr 24, 2024

Fixes JetBrains/compose-multiplatform#4681

The issue was because of this situation:

  • the parent RenderNodeLayer is drawn and cached it's picture
  • the child RenderNodeLayer isn't drawn, but invalidate is called

invalidate should have updated the parent layer (removing the picture cache), but didn't do that as we do that conditionally. Now invalidate invalidates the parent layer unconditionally.

It is a regression after #1260, but it just revealed the bug, didn't introduce it.

Testing

  • new added tests fail before, work after the fix
  • the issue is no longer reproducible

This should be tested by QA

Release Notes

Fixes - Multiple Platforms

  • (prerelease fix) Fix frozen composition with pager and text field

Fixes JetBrains/compose-multiplatform#4681

The issue was because of this situation:
- the parent RenderNodeLayer is drawn and cached it's `picture`
- the child RenderNodeLayer isn't drawn, but `invalidate` is called

the child's `invalidate` should invalidate parent layer unconditionally, but we called it only if the child was drawn (picture != null), which is incorrect.

It is a regression after #1260, but it just revealed the bug, not introduced it.

## Testing
- new added tests fail before, work after the fix
- the issue is no longer reproducible

This should be tested by QA

## Release Notes
> Fixes - Multiple Platforms
- _(prerelease fix)_ Fix frozen composition with pager and text field
@igordmn igordmn merged commit fa363b3 into jb-main Apr 25, 2024
6 checks passed
@igordmn igordmn deleted the igor.demin/fix-frozen-compose branch April 25, 2024 01:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants