Repository navigation
Revert: Fix square corner issue - #193189
Merged
auto-submit[bot] merged 2 commits intoSep 23, 2026
Merged
Conversation
This reverts commit 5544f00.
10 tasks done
Contributor
There was a problem hiding this comment.
Code Review
This pull request refactors and simplifies clip depth and clip stack management in Impeller. It increases the maximum canvas depth, simplifies clip depth tracking during save and restore operations, and removes clip height tracking from the entity pass clip stack and clip contents rendering. Additionally, several tests and unused mock dependencies are removed. There are no review comments to evaluate, so I have no feedback to provide.
gaaclarke
approved these changes
Sep 22, 2026
Contributor
|
autosubmit label was removed for flutter/flutter/193189, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label. |
This was referenced Sep 23, 2026
8 of 11 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.
Reverts: Fix square corner issue
Initiated by: @andywolff
Reason for reverting: seems to have caused a test order dependency #192992
Original PR Author: @andywolff
Reviewed By: @gaaclarke
The original PR description is provided below:
Fixes #190602, see my comment on that issue for details about the problems I identified.
Also fixes #162172
What changed
When a route contained rounded clips (such as
CupertinoSheetRoute), intermediate child ink features, and a backdrop filter (such as a blurred app bar), the clip stack replay logic prematurely popped parent clips and exceeded the depth buffer budget across render pass splits, causing subsequent header draws to render with 90° square corners. This PR addresses both mechanisms:First,
EntityPassClipStack::RecordRestorewas popping replay entities unconditionally whenever any clip was restored. In a sheet containing ink decorations (like list item ripple effects), child clip restores at deeper heights would prematurely discard the root parent clip. We now trackclip_heightinReplayResultso that restorations only pop entities whenclip_height > restore_height, preserving parent clips across sibling restores. When replaying those clips inClipContents::Render, we also supply the entity's model matrix to properly recompute the MVP matrix against the new pass's orthographic projection instead of reusing the stale matrix from the prior pass.Second, the pass depth budget was exhausting across backdrop splits.
Canvas::kMaxDepth(1 << 24) was mismatched withEntity::kDepthEpsilon(1.0 / 262144.0, or2^-18), allowing integer depths to exceed the 18-bit precision of the depth buffer. AligningCanvas::kMaxDepthto262,143and capping depth allocations inSave/SaveLayertomin(current_depth_ + total_content_depth, parent_clip_depth)keeps clip replay and subsequent draw operations within valid precision bounds. InCanvas::Restore, we also prevent unconditional depth jumps tokMaxDepthfor unclipped saves, preserving the allocated budget for subsequent sibling draws.Testing
Reproducing this interaction in automated tests required testing the onscreen pass-splitting branch (
IsOnscreen()), which normal offscreen unit tests bypass. We added aScopedOnscreenOverridetest hook inCanvasand constructed a multi-layer display list recreating the route clip, child ink items, blurred backdrop bar, and trailing app bar:clip_stack_unittests.cc: AddedEntityPassClipStackTest.RestoringChildClipPreservesParentReplayEntitiesto isolate parent clip retention across sibling restores.canvas_unittests.cc: AddedAiksTest.ClipDepthMaintainedAcrossBackdropFilterAndLayersto verify depth invariants and precision bounds (<= kMaxDepth), andAiksTest.ParentClipDepthBudgetPreservedAfterBackdropLayerRestoreto verify parent depth budget restoration.dl_golden_unittests.cc(impeller_golden_tests): AddedDlGoldenTest.CanRenderClippedBackdropFilterWithSuperellipsefor pixel-accurate golden image verification in CI against Skia Gold.Pre-launch Checklist
///).