Skip to content

Reland square corners fix - #194314

Merged
auto-submit[bot] merged 2 commits into
flutter:masterfrom
andywolff:reland_sqfix
Oct 21, 2026
Merged

auto-submit[bot] merged 2 commits into
flutter:masterfrom
andywolff:reland_sqfix

Conversation

@andywolff

@andywolff andywolff commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #192992
Relands #191096
Fixes #190602
Fixes #162172

This PR relands #191096, which resolves the square corners regression in clipped backdrop filters. The original PR was reverted in #193189 due to test flakiness and order dependencies in CI, which were resolved and landed separately in #193497.

This is a pure reland.

Pre-launch Checklist

@andywolff andywolff added the CICD Run CI/CD label Oct 13, 2026
@andywolff

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates Impeller's canvas and clip stack implementation to preserve parent clip states across sibling restorations and prevent premature depth budget exhaustion. Specifically, it introduces a clip height tracking mechanism in EntityPassClipStack to selectively pop child clips, adjusts depth advancement in Canvas::Restore to only occur when clips are recorded, and updates Canvas::kMaxDepth to fit within 18-bit precision. Additionally, ClipContents::Render now supports an optional transform matrix, and several unit tests have been added to verify clip depth maintenance, parent clip preservation, and emulated advanced blends. There are no review comments to address, and I have no further feedback to provide.

@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels Oct 13, 2026
@andywolff
andywolff requested review from flar and gaaclarke October 13, 2026 21:52
@andywolff
andywolff marked this pull request as ready for review October 13, 2026 21:52

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several changes to the Impeller engine's display list and canvas rendering logic to improve clip depth management and backdrop filter rendering. Key updates include modifying Canvas::Restore to conditionally advance depth, updating Canvas::SaveLayer to incorporate the 'is_onscreen' state, and enhancing ClipContents::Render to support optional transformation matrices. Additionally, the EntityPassClipStack was updated to preserve parent clip entities during restoration, and multiple new unit tests were added to verify these behaviors and ensure depth monotonicity across nested layers. I have no feedback to provide as there were no review comments.

@flutter-dashboard

Copy link
Copy Markdown

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #194314 at sha 2e8f991

@flutter-dashboard flutter-dashboard Bot added the will affect goldens Changes to golden files label Oct 13, 2026

@gaaclarke gaaclarke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andywolff it sounds like this PR isn't verbatim the same as the last time it landed. Can you rebase this as 2 commits? One which is the original landing of the PR and the other is the thing you've changed, please?

@flar

flar commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

@andywolff it sounds like this PR isn't verbatim the same as the last time it landed. Can you rebase this as 2 commits? One which is the original landing of the PR and the other is the thing you've changed, please?

If the only issue you are addressing is "wasted depths" then we can/should do that as a separate fix in case it causes its own problems.

@andywolff

Copy link
Copy Markdown
Contributor Author

do that as a separate fix in case it causes its own problems.

Alright, I've changed this PR back to match the original. I'll send you a followup

@gaaclarke gaaclarke left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same code as #191096, lgtm

@andywolff andywolff added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 14, 2026

@flar flar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same code is good

@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 14, 2026
@auto-submit

auto-submit Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/194314, because - The status or check suite Presubmit has failed. Please fix the issues identified (or deflake) before re-applying this label.

@andywolff andywolff added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 21, 2026
@flutter-dashboard

Copy link
Copy Markdown

Golden file changes are available for triage from new commit, Click here to view.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #194314 at sha ffec12c

@auto-submit
auto-submit Bot added this pull request to the merge queue Oct 21, 2026
Merged via the queue into flutter:master with commit 730d1b2 Oct 21, 2026
23 of 24 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 21, 2026
LongCatIsLooong pushed a commit to LongCatIsLooong/flutter that referenced this pull request Oct 22, 2026
Fixes flutter#192992
Relands flutter#191096
Fixes flutter#190602
Fixes flutter#162172

This PR relands flutter#191096, which
resolves the square corners regression in clipped backdrop filters. The
original PR was reverted in
flutter#193189 due to test flakiness and
order dependencies in CI, which were resolved and landed separately in
flutter#193497.

This is a pure reland.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
@andywolff andywolff added the revert Autorevert PR (with "Reason for revert:" comment) label Oct 27, 2026
@flutteractionsbot

Copy link
Copy Markdown
Contributor

A reason for requesting a revert of flutter/flutter/194314 could not be found or the reason was not properly formatted. Begin a comment with 'Reason for revert:' to tell the bot why this issue is being reverted.

@flutteractionsbot flutteractionsbot removed the revert Autorevert PR (with "Reason for revert:" comment) label Oct 27, 2026
@andywolff

Copy link
Copy Markdown
Contributor Author

reason for revert: changed opacity behavior causing golden flakes #195423

@andywolff andywolff added the revert Autorevert PR (with "Reason for revert:" comment) label Oct 27, 2026
@flutteractionsbot

Copy link
Copy Markdown
Contributor

Successfully created revert PR: #195436

@flutteractionsbot flutteractionsbot removed the revert Autorevert PR (with "Reason for revert:" comment) label Oct 27, 2026
mdebbar pushed a commit to molchanovia/flutter that referenced this pull request Oct 27, 2026
Reverts: [Reland square corners
fix](flutter#194314)

Initiated by: @andywolff

Reason for reverting: changed opacity behavior causing golden flakes
flutter#195423

Original PR Author: @andywolff

Reviewed By: @gaaclarke

The original PR description is provided below:

Fixes flutter#192992
Relands flutter#191096
Fixes flutter#190602
Fixes flutter#162172

This PR relands flutter#191096, which
resolves the square corners regression in clipped backdrop filters. The
original PR was reverted in
flutter#193189 due to test flakiness and
order dependencies in CI, which were resolved and landed separately in
flutter#193497.

This is a pure reland.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
Fixes flutter#192992
Relands flutter#191096
Fixes flutter#190602
Fixes flutter#162172

This PR relands flutter#191096, which
resolves the square corners regression in clipped backdrop filters. The
original PR was reverted in
flutter#193189 due to test flakiness and
order dependencies in CI, which were resolved and landed separately in
flutter#193497.

This is a pure reland.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
suryaKommana2662 pushed a commit to suryaKommana2662/flutter that referenced this pull request Oct 29, 2026
Reverts: [Reland square corners
fix](flutter#194314)

Initiated by: @andywolff

Reason for reverting: changed opacity behavior causing golden flakes
flutter#195423

Original PR Author: @andywolff

Reviewed By: @gaaclarke

The original PR description is provided below:

Fixes flutter#192992
Relands flutter#191096
Fixes flutter#190602
Fixes flutter#162172

This PR relands flutter#191096, which
resolves the square corners regression in clipped backdrop filters. The
original PR was reverted in
flutter#193189 due to test flakiness and
order dependencies in CI, which were resolved and landed separately in
flutter#193497.

This is a pure reland.

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [AI contribution guidelines] and understand my
responsibilities, or I am not using AI tools.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[AI contribution guidelines]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD e: impeller Impeller rendering backend issues and features requests engine flutter/engine related. See also e: labels. will affect goldens Changes to golden files

Projects

None yet

4 participants