Repository navigation
perf(composition): Thread damage clip as bounds, not paths (6.8) - #24788
Conversation
Every visual on every scroll frame intersected its accumulated clip as an SKPath, and under a rounded ancestor clip (any Fluent Button) its damage contribution went through an exact path region: a stroke outset, a path intersect and a DamageRegion.Union boolean. Damage only needs bounds, so thread a root-space rect through the render walk and contribute rects, matching master (74afcfc, dbb62a5). The rect is a superset of the exact region, so this only widens damage. ItemsRepeater grid of 2837 Fluent Buttons, 12 x 60 scroll steps, UI-thread render time: 2374 ms -> 338 ms (6.5.237: 157 ms). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AzHtsXz33DcziPre7h3b9f
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AzHtsXz33DcziPre7h3b9f
|
Claude finished @MartinZikmund's task in 4m 48s —— View job Review complete
Verdict: fix-first — the rect-based damage refactor itself is correct and well-reasoned (bounds-of-bounds under an affine transform is always a conservative superset, so the "damage only widens" invariant holds through Findings by severity:
Cross-cutting notes:
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24788/wasm-skia-net9/index.html |
|
The build 235990 did not find any UI Test snapshots differences. |
Visual no longer consumes the path returned by Paint(), so ShapeVisual and BorderVisual were building it for nothing on every repaint. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01G7PsEU6gSpLZXrYuK8WWpt
|
Claude finished @MartinZikmund's task in 36s —— View job Review complete
Verdict: ship — commit
No new issues found in this incremental change — it's a pure deletion of now-unreachable code plus a one-line test annotation, nothing else was touched. No inline comments were needed this pass. |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
Core repaint-region semantics can cause subtle visual artifacts and warrant final rendering-focused human review.
Review effort: Balanced
Findings: None
What changed in this PR
Optimizes Skia compositor damage tracking on 6.8 by replacing per-visual path operations with conservative rectangle bounds.
Changes:
- Threads root-space
SKRectclip bounds through rendering. - Removes cached exact content paths and accumulates rectangular damage.
- Tests movement beneath a rounded clip.
Review findings: No specific issues identified.
| File | Description |
|---|---|
Given_Visual_Damage.cs |
Adds rounded-clip movement coverage. |
Visual.skia.cs |
Propagates clip bounds instead of paths. |
Visual.Damage.skia.cs |
Calculates rect-only damage regions. |
ShapeVisual.skia.cs |
Removes exact content-path construction. |
BorderVisual.skia.cs |
Removes exact content-path construction. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24788/wasm-skia-net9/index.html |
|
The build 236899 did not find any UI Test snapshots differences. |
|
|
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
GitHub Issue: closes #23984
PR Type:
🐞 Bugfix (performance regression)
What changed? 🚀
#24612 backported part of #23986 to 6.8. Scroll frames still ran path booleans for every visual, because the clip was threaded through the render walk as an
SKPath:Visual.Renderintersected each visual's accumulated clip withSKPath.Op.Button), the clip isn't a rect. Each moved visual's damage then went through a stroke outset, a path intersect and aDamageRegion.Unionpath boolean.Damage only uses clip bounds, so this threads a root-space
SKRectthrough the walk and hasTryGetPaintDamageRegioncontribute rects only. It ports the intent of master's 74afcfc and dbb62a5 to theSKPath-based compositor on this branch. The rect is always a superset of the exact region, so damage can only widen, never miss.The old exact branch also stored each visual's content path; that field is dropped. Clip caching from #24230 was measured too and is under 3% of the frame here, so it isn't part of this fix. The mergify backports of #24230 (#24697/#24698) were closed.
Measurements 📊
ItemsRepeater+UniformGridLayout, 2,837 FluentButtontiles,ChangeViewin 60 steps of 40 px, repeated 12 times. Skia Win32 at 250%.dotnet-tracedotnet-sampled-thread-timeon the UI thread:Managed allocation is unchanged (~1.1 MB per 60 steps, no Gen0 GCs); this is CPU only. The remaining gap is mostly Win32 accessibility (#24784, separate PR) and layout.
PR Checklist ✅
Screenshots Compare Test Runresults.Validation
Given_Visual_Damage3/3, including the newWhen_Visual_Moves_Under_Rounded_Clip_Then_Old_And_New_Areas_Are_Damaged. A composition/Border/ScrollViewer/ItemsRepeater/RenderTargetBitmap sweep passed apart from 4Given_ScrollViewerlayout asserts that fail only at non-100% display scale (175 vs 175.2); those are pre-existing and unrelated.Uno.UI.Composition.Skiabuilt withoutUnoFastDevBuild, so analyzers ran.🤖 Generated with Claude Code
https://claude.ai/code/session_01AzHtsXz33DcziPre7h3b9f