Skip to content

Conversation

@MatkovIvan
Copy link
Member

It is a simplified adoption of Android's RenderNode.

/**
 * <p>RenderNode is used to build hardware accelerated rendering hierarchies. Each RenderNode
 * contains both a display list as well as a set of properties that affect the rendering of the
 * display list. RenderNodes are used internally for all Views by default and are not typically
 * used directly.</p>
 *
 * <p>RenderNodes are used to divide up the rendering content of a complex scene into smaller
 * pieces that can then be updated individually more cheaply. Updating part of the scene only needs
 * to update the display list or properties of a small number of RenderNode instead of redrawing
 * everything from scratch. A RenderNode only needs its display list re-recorded when its content
 * alone should be changed. RenderNodes can also be transformed without re-recording the display
 * list through the transform properties.</p>

This is a more correct approach to make GraphicsLayer in Compose invalidation independently.

  • Moved drawing callback to C++ side to avoid extra interop costs
  • Switched from SkPicture placeholder to custom SkDrawable implementation

@MatkovIvan MatkovIvan marked this pull request as ready for review January 20, 2025 12:10
@MatkovIvan MatkovIvan requested a review from igordmn January 20, 2025 12:11
MatkovIvan added a commit that referenced this pull request Jan 20, 2025
That approach worked but had performance issues. Also, `SkPicture` is
immutable by design, so we shouldn't try to change that.

#1014 is a more correct and efficient way to implement it
@MatkovIvan MatkovIvan force-pushed the ivan.matkov/render-node branch 2 times, most recently from 5f61628 to 3d3ae4d Compare January 29, 2025 13:41
@MatkovIvan MatkovIvan merged commit 09dae79 into master Jan 30, 2025
6 checks passed
@MatkovIvan MatkovIvan deleted the ivan.matkov/render-node branch January 30, 2025 12:52
MatkovIvan added a commit to JetBrains/compose-multiplatform-core that referenced this pull request Jan 30, 2025
Skiko side change: JetBrains/skiko#1014
Fixes: CMP-5924, CMP-6703 and problems mentioned in #1777. Removes
internal states from draw phase

## Testing
Existing tests, manually

## Release Notes
### Fixes - Multiple Platforms
- Fix light position for during shadow rendering to match [the Material
specification](https://m2.material.io/design/environment/light-shadows.html#light)
and Android behaviour


TBD: Add something about performance improvements in release notes once
we have some specific numbers from our benchmarks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants