Repository navigation
fix(composition): Damage a removed subtree where it was last replayed (backport #25908) - #26191
Closed
mergify[bot] wants to merge 2 commits into
Closed
mergify[bot] wants to merge 2 commits into
mergify[bot] wants to merge 2 commits into
Conversation
A stable subtree moved by an ancestor (a scrolled page) is replayed from its cached children picture, so its descendants are not walked and keep the bounds they had before the move. Removing it damaged those old bounds only, leaving its pixels on screen. Removal now also damages the replayed area each collapsed subtree tracks. Fixes #25478 Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> (cherry picked from commit 3efde89)
The collapsed-subtree test now asserts the scroller's children were replayed from their cached picture (it is the scroller, not the content, that collapses once the scroll moves it), so it can't pass by walking the marker. A sibling test covers the drop-shadow fallback, which replays its own recording of the subtree under a scroll. Both fail without their branch in ContributeRemovalDamage. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> (cherry picked from commit 07b32f5)
2 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub Issue: closes #25478
PR Type:
🐞 Bugfix
What changed? 🚀
Navigating away from a page whose
ScrollViewerhad been scrolled left parts of the old page on screen, at their scrolled positions. A full repaint (resize) cleared them.Partial repaint only redraws the reported damage. A stable subtree (enough visuals, unchanged for enough frames) is recorded once into a cached children picture. Scrolling moves that subtree without changing it, so
RenderChildrenStepreplays the cached picture under the new matrix and doesn't walk its descendants. Their_lastRenderBoundstherefore stay at the pre-scroll positions. The subtree root keeps_childrenContentDamageRectup to date on every moved replay, butContributeRemovalDamageonly damaged each visual's own_lastRenderBounds. Removing the page repainted the stale positions and never the area its content actually occupied.ContributeRemovalDamagenow also damages:_childrenContentDamageRect, the area a collapsed subtree was last replayed at;_shadowFallbackDamageRect, the cached shadow recording's area, which is replayed the same way.Like
_lastRenderBounds, both flags are cleared once reported, so a visual inserted elsewhere later starts with no stale rects. The descendants' stale bounds are still damaged as before, which is harmless over-damage.Not covered: a collapsed subtree whose root is an ancestor of the removed visual, moved without being re-walked. Scrolling invalidates the pictures above the scrolled content, so the reported scenario doesn't go through that path.
Validation
Given_Visual_Damage.When_Scrolled_Collapsed_Subtree_Is_Removed_Then_Its_Current_Area_Is_Damaged. It builds root → page → scroller → content (enough visuals to collapse), lets the content collapse, scrolls the scroller by 100px, then removes the page and checks the damage covers the content's current position.masterit fails: the removal damage only covers the pre-scroll positions (around y = 1 and y = 11).Given_Visual_DamageandGiven_CompositionTargeton Skia desktop (Win32): 30 passed, 0 failed, 1 inconclusive (WebGPU-only), 1 skipped (minimized-window case).PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code
This is an automatic backport of pull request #25908 done by [Mergify](https://mergify.com).