Skip to content

[Impeller] Add render target cache clearing and test hook - #193497

Merged
auto-submit[bot] merged 6 commits into
flutter:masterfrom
andywolff:test_randomization
Oct 6, 2026
Merged

auto-submit[bot] merged 6 commits into
flutter:masterfrom
andywolff:test_randomization

Conversation

@andywolff

@andywolff andywolff commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #193015
Part of #192992

During testing, RenderTargetCache retained allocated offscreen render targets across consecutive test cases within the same process. When earlier tests performed offscreen drawing or backdrop filtering passes, dirty textures remained in the cache and were recycled into subsequent test passes, leading to test order flakiness and non-deterministic golden snapshots (#192992).

To address both production memory pressure handling (#193015) and test isolation, I added cache clearing methods across the Impeller rendering pipeline. In the engine, RenderTargetAllocator and RenderTargetCache now provide a Clear() method that drops all cached texture allocations. I wired this cleanup through ContentContext, AiksContext, Rasterizer, Engine, and Shell.

In production, the rasterizer now purges the render target cache when receiving low-memory warning signals (FlutterEngineNotifyLowMemoryWarning / Rasterizer::NotifyLowMemoryWarning).

For tests, I exposed a general PlatformDispatcher.resetInternalState() hook through native platform configuration bindings. This mirrors ServicesBinding.resetInternalState() and will allow test harnesses to purge cached offscreen render targets between tests to prevent texture leakage across test boundaries while keeping the engine test interface extensible. To prevent merge queue and postsubmit analyzer failures against the baseline prebuilt sky_engine, the framework test wiring (TestWidgetsFlutterBinding.postTest and TestPlatformDispatcher.resetInternalState()) is deferred to a follow-up PR once this engine commit rolls.

I also added C++ unit tests in RasterizerTest, ShellTest, EngineTest, and RuntimeControllerTest.

Pre-launch Checklist

@github-actions github-actions Bot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. engine flutter/engine related. See also e: labels. platform-web Web applications specifically e: impeller Impeller rendering backend issues and features requests team-web Owned by Web platform team labels Sep 29, 2026
@andywolff andywolff added the CICD Run CI/CD label Sep 29, 2026
@andywolff
andywolff force-pushed the test_randomization branch 6 times, most recently from f7cc179 to 89615d5 Compare September 30, 2026 05:45
@andywolff
andywolff marked this pull request as ready for review September 30, 2026 16:33

@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 a mechanism to clear cached render targets and textures maintained by the rasterizer. It adds clearRenderTargetCache to PlatformDispatcher along with its native bindings and engine-side implementations across Shell, Engine, Rasterizer, AiksContext, and ContentContext. Additionally, it integrates this clearing mechanism into TestWidgetsFlutterBinding.resetInternalState to ensure test isolation and includes corresponding unit tests. There are no review comments, and I have no feedback to provide.

@andywolff
andywolff requested a review from gaaclarke September 30, 2026 16:51
@loic-sharma
loic-sharma self-requested a review September 30, 2026 17:40
@andywolff
andywolff requested a review from loic-sharma October 1, 2026 19:44
Comment thread engine/src/flutter/shell/common/shell.h Resolved

@loic-sharma loic-sharma 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.

Dart + core engine looks good to me. However, I'm not familiar with Impeller so please also get an approval from someone who is :)

@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.

Looking good, just want more clear assertions in the tests.

Comment on lines +177 to +180
EXPECT_CALL(*surface, GetAiksContext()).WillRepeatedly(Return(aiks_context));
EXPECT_CALL(*surface, MakeRenderContextCurrent()).WillRepeatedly([] {
return std::make_unique<GLContextDefaultResult>(true);
});

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.

Where is the assertion that the caches are cleared?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This test isn't really doing anything useful without that, huh? Thanks for catching. Updated the header and added an EXPECT_CALL, then confirmed that this (and the tests from your other comments) fail when the clear is commented out

Comment on lines +204 to +208
auto aiks_context = std::make_shared<impeller::AiksContext>(nullptr, nullptr);
EXPECT_CALL(*surface, GetAiksContext()).WillRepeatedly(Return(aiks_context));
EXPECT_CALL(*surface, MakeRenderContextCurrent()).WillRepeatedly([] {
return std::make_unique<GLContextDefaultResult>(true);
});

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 here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines +30 to +35
test('TestPlatformDispatcher delegates resetInternalState', () {
final testPlatformDispatcher = TestPlatformDispatcher(
platformDispatcher: PlatformDispatcher.instance,
);
testPlatformDispatcher.resetInternalState();
});

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.

there's no assertion here either

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed and red-green validated

@auto-submit

auto-submit Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/193497, because - The status or check suite Dashboard Checks 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 5, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Oct 6, 2026
Merged via the queue into flutter:master with commit 575f742 Oct 6, 2026
29 of 30 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Oct 6, 2026
chingjun pushed a commit to chingjun/flutter that referenced this pull request Oct 7, 2026
…er#193842)

Part of flutter#192992

Follow-up to flutter#193497.

In flutter#193497, I introduced
`PlatformDispatcher.resetInternalState()` to allow test harnesses to
purge internal engine caches (such as Impeller's offscreen
`RenderTargetCache`) between test cases to ensure test isolation.

Now that the engine changes have rolled into the framework, this PR
connects the framework test harness:
1. Implements `TestPlatformDispatcher.resetInternalState()` in
`packages/flutter_test/lib/src/window.dart` to delegate to the
underlying `PlatformDispatcher`.
2. Invokes `platformDispatcher.resetInternalState()` in
`TestWidgetsFlutterBinding.postTest` alongside
`ServicesBinding.instance.resetInternalState()`.
3. Adds a unit test in
`packages/flutter_test/test/platform_dispatcher_test.dart` to verify
delegation.


## 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 in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [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
[flutter/website]: https://github.com/flutter/website
[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 mentioned this pull request Oct 13, 2026
10 tasks done
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-flutter__flutter that referenced this pull request Oct 21, 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
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
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
…3497)

Fixes flutter#193015
Part of flutter#192992

During testing, `RenderTargetCache` retained allocated offscreen render
targets across consecutive test cases within the same process. When
earlier tests performed offscreen drawing or backdrop filtering passes,
dirty textures remained in the cache and were recycled into subsequent
test passes, leading to test order flakiness and non-deterministic
golden snapshots (flutter#192992).

To address both production memory pressure handling
(flutter#193015) and test isolation, I added cache clearing
methods across the Impeller rendering pipeline. In the engine,
`RenderTargetAllocator` and `RenderTargetCache` now provide a `Clear()`
method that drops all cached texture allocations. I wired this cleanup
through `ContentContext`, `AiksContext`, `Rasterizer`, `Engine`, and
`Shell`.

In production, the rasterizer now purges the render target cache when
receiving low-memory warning signals
(`FlutterEngineNotifyLowMemoryWarning` /
`Rasterizer::NotifyLowMemoryWarning`).

For tests, I exposed a general `PlatformDispatcher.resetInternalState()`
hook through native platform configuration bindings. This mirrors
`ServicesBinding.resetInternalState()` and will allow test harnesses to
purge cached offscreen render targets between tests to prevent texture
leakage across test boundaries while keeping the engine test interface
extensible. To prevent merge queue and postsubmit analyzer failures
against the baseline prebuilt `sky_engine`, the framework test wiring
(`TestWidgetsFlutterBinding.postTest` and
`TestPlatformDispatcher.resetInternalState()`) is deferred to a
follow-up PR once this engine commit rolls.

I also added C++ unit tests in `RasterizerTest`, `ShellTest`,
`EngineTest`, and `RuntimeControllerTest`.


## 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 in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [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
[flutter/website]: https://github.com/flutter/website
[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
…er#193842)

Part of flutter#192992

Follow-up to flutter#193497.

In flutter#193497, I introduced
`PlatformDispatcher.resetInternalState()` to allow test harnesses to
purge internal engine caches (such as Impeller's offscreen
`RenderTargetCache`) between test cases to ensure test isolation.

Now that the engine changes have rolled into the framework, this PR
connects the framework test harness:
1. Implements `TestPlatformDispatcher.resetInternalState()` in
`packages/flutter_test/lib/src/window.dart` to delegate to the
underlying `PlatformDispatcher`.
2. Invokes `platformDispatcher.resetInternalState()` in
`TestWidgetsFlutterBinding.postTest` alongside
`ServicesBinding.instance.resetInternalState()`.
3. Adds a unit test in
`packages/flutter_test/test/platform_dispatcher_test.dart` to verify
delegation.


## 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 in-code documentation (doc comments with
`///`).
- [x] If this PR introduces a new feature or capability, I created and
linked a website documentation issue or PR in [flutter/website] (or
verified none is needed).
- [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
[flutter/website]: https://github.com/flutter/website
[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. platform-web Web applications specifically team-web Owned by Web platform team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clear Impeller's render target cache when there is memory pressure

4 participants