Skip to content

Conversation

@MTtankkeo
Copy link
Contributor

Fixed an issue #82906

In the existing Flutter implementation, the Android stretch overscroll effect is achieved using Transform. However, this approach does not evenly stretch the screen as it does in the native Android environment. Therefore, in the Impeller environment, add or modify files to implement the effect using a fragment shader identical to the one used in native Android.

Old Skia (Using Transform)

old.mp4

New Impeller (Using fragment shader)

new.mp4

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions bot added tool Affects the "flutter" command-line tool. See also t: labels. framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. f: scrolling Viewports, list views, slivers, etc. labels May 21, 2025
@TheLastFlame
Copy link
Contributor

Would that happen to be able to fix disabling any blur when stretching? 🤔

Or does the problem remain the same?

@MTtankkeo
Copy link
Contributor Author

MTtankkeo commented May 21, 2025

Would that happen to be able to fix disabling any blur when stretching? 🤔

Or does the problem remain the same?

Can you give me a detailed explanation?

@TheLastFlame
Copy link
Contributor

@MTtankkeo, #138940

@MTtankkeo MTtankkeo requested review from a team and matanlurey as code owners May 21, 2025 13:08
@github-actions github-actions bot added a: desktop Running on desktop team-infra Owned by Infrastructure team team-ios Owned by iOS platform team team-tool Owned by Flutter Tool team d: docs/ flutter/flutter/docs, for contributors labels May 21, 2025
@MTtankkeo
Copy link
Contributor Author

Sorry, i'm commit wrong

@github-actions github-actions bot removed a: desktop Running on desktop team-infra Owned by Infrastructure team team-ios Owned by iOS platform team team-tool Owned by Flutter Tool team d: docs/ flutter/flutter/docs, for contributors labels May 21, 2025
@MTtankkeo MTtankkeo reopened this May 22, 2025
@github-actions github-actions bot added engine flutter/engine related. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels May 22, 2025
@MTtankkeo MTtankkeo closed this May 22, 2025
github-merge-queue bot pushed a commit that referenced this pull request Aug 14, 2025
…peller-only). (#169293)

> Sorry, Closing PR #169196 and reopening this in a new PR for clarity
and a cleaner commit history.

Fixes #82906

In the existing Flutter implementation, the Android stretch overscroll
effect is achieved using Transform. However, this approach does not
evenly stretch the screen as it does in the native Android environment.
Therefore, in the Impeller environment, add or modify files to implement
the effect using a fragment shader identical to the one used in native
Android.

> [!NOTE]
> - The addition of a separate test file for StretchOverscrollEffect was
not included because it would likely duplicate coverage already provided
by the changes made in overscroll_stretch_indicator_test.dart within
this PR.
>> However, since determining whether stretching occurred by referencing
global coordinates is currently considered impossible with the new
Fragment Shader approach, the code was modified to partially exclude the
relevant test logic in the Impeller.
>>
>> For reference, in the page_view_test.dart test, there was an issue
with referencing the child Transform widget, but because the
StretchOverscrollEffect widget is defined instead of the Transform
widget in the Impeller environment, the code logic was adjusted
accordingly.
> 
> - Golden image tests were updated as the visual effect changes.

## Reference Source
-
https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/effects/StretchEffect.cpp

## `Old` Skia (Using Transform)

https://github.com/user-attachments/assets/22d8ff96-d875-4722-bf6f-f0ad15b9077d

## `New` Impeller (Using fragment shader)

https://github.com/user-attachments/assets/73b6ef18-06b2-42ea-9793-c391ec2ce282

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[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

---------

Co-authored-by: Tong Mu <[email protected]>
Co-authored-by: Kate Lovett <[email protected]>
SydneyBao pushed a commit to SydneyBao/flutter that referenced this pull request Aug 14, 2025
…peller-only). (flutter#169293)

> Sorry, Closing PR flutter#169196 and reopening this in a new PR for clarity
and a cleaner commit history.

Fixes flutter#82906

In the existing Flutter implementation, the Android stretch overscroll
effect is achieved using Transform. However, this approach does not
evenly stretch the screen as it does in the native Android environment.
Therefore, in the Impeller environment, add or modify files to implement
the effect using a fragment shader identical to the one used in native
Android.

> [!NOTE]
> - The addition of a separate test file for StretchOverscrollEffect was
not included because it would likely duplicate coverage already provided
by the changes made in overscroll_stretch_indicator_test.dart within
this PR.
>> However, since determining whether stretching occurred by referencing
global coordinates is currently considered impossible with the new
Fragment Shader approach, the code was modified to partially exclude the
relevant test logic in the Impeller.
>>
>> For reference, in the page_view_test.dart test, there was an issue
with referencing the child Transform widget, but because the
StretchOverscrollEffect widget is defined instead of the Transform
widget in the Impeller environment, the code logic was adjusted
accordingly.
> 
> - Golden image tests were updated as the visual effect changes.

## Reference Source
-
https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/effects/StretchEffect.cpp

## `Old` Skia (Using Transform)

https://github.com/user-attachments/assets/22d8ff96-d875-4722-bf6f-f0ad15b9077d

## `New` Impeller (Using fragment shader)

https://github.com/user-attachments/assets/73b6ef18-06b2-42ea-9793-c391ec2ce282

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[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

---------

Co-authored-by: Tong Mu <[email protected]>
Co-authored-by: Kate Lovett <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Aug 15, 2025
…hader (Impeller-only). (#169293)" (#173865)

<!-- start_original_pr_link -->
Reverts: #169293
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Does not work on Metal (iOS/macOS):

```
The following _Exception was thrown running a test:
Exception: Asset 'shaders/stretch_effect.frag' does not contain appropriate runtime stage data for current backend (Metal).
```
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: MTtankkeo
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {dkwingsmt, justinmc, chunhtai}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
> Sorry, Closing PR #169196 and reopening this in a new PR for clarity
and a cleaner commit history.

Fixes #82906

In the existing Flutter implementation, the Android stretch overscroll
effect is achieved using Transform. However, this approach does not
evenly stretch the screen as it does in the native Android environment.
Therefore, in the Impeller environment, add or modify files to implement
the effect using a fragment shader identical to the one used in native
Android.

> [!NOTE]
> - The addition of a separate test file for StretchOverscrollEffect was
not included because it would likely duplicate coverage already provided
by the changes made in overscroll_stretch_indicator_test.dart within
this PR.
>> However, since determining whether stretching occurred by referencing
global coordinates is currently considered impossible with the new
Fragment Shader approach, the code was modified to partially exclude the
relevant test logic in the Impeller.
>>
>> For reference, in the page_view_test.dart test, there was an issue
with referencing the child Transform widget, but because the
StretchOverscrollEffect widget is defined instead of the Transform
widget in the Impeller environment, the code logic was adjusted
accordingly.
> 
> - Golden image tests were updated as the visual effect changes.

## Reference Source
-
https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/effects/StretchEffect.cpp

## `Old` Skia (Using Transform)

https://github.com/user-attachments/assets/22d8ff96-d875-4722-bf6f-f0ad15b9077d

## `New` Impeller (Using fragment shader)

https://github.com/user-attachments/assets/73b6ef18-06b2-42ea-9793-c391ec2ce282

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[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

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <[email protected]>
ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request Aug 19, 2025
…peller-only). (flutter#169293)

> Sorry, Closing PR flutter#169196 and reopening this in a new PR for clarity
and a cleaner commit history.

Fixes flutter#82906

In the existing Flutter implementation, the Android stretch overscroll
effect is achieved using Transform. However, this approach does not
evenly stretch the screen as it does in the native Android environment.
Therefore, in the Impeller environment, add or modify files to implement
the effect using a fragment shader identical to the one used in native
Android.

> [!NOTE]
> - The addition of a separate test file for StretchOverscrollEffect was
not included because it would likely duplicate coverage already provided
by the changes made in overscroll_stretch_indicator_test.dart within
this PR.
>> However, since determining whether stretching occurred by referencing
global coordinates is currently considered impossible with the new
Fragment Shader approach, the code was modified to partially exclude the
relevant test logic in the Impeller.
>>
>> For reference, in the page_view_test.dart test, there was an issue
with referencing the child Transform widget, but because the
StretchOverscrollEffect widget is defined instead of the Transform
widget in the Impeller environment, the code logic was adjusted
accordingly.
> 
> - Golden image tests were updated as the visual effect changes.

## Reference Source
-
https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/effects/StretchEffect.cpp

## `Old` Skia (Using Transform)

https://github.com/user-attachments/assets/22d8ff96-d875-4722-bf6f-f0ad15b9077d

## `New` Impeller (Using fragment shader)

https://github.com/user-attachments/assets/73b6ef18-06b2-42ea-9793-c391ec2ce282

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[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

---------

Co-authored-by: Tong Mu <[email protected]>
Co-authored-by: Kate Lovett <[email protected]>
ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request Aug 19, 2025
…hader (Impeller-only). (flutter#169293)" (flutter#173865)

<!-- start_original_pr_link -->
Reverts: flutter#169293
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Does not work on Metal (iOS/macOS):

```
The following _Exception was thrown running a test:
Exception: Asset 'shaders/stretch_effect.frag' does not contain appropriate runtime stage data for current backend (Metal).
```
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: MTtankkeo
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {dkwingsmt, justinmc, chunhtai}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
> Sorry, Closing PR flutter#169196 and reopening this in a new PR for clarity
and a cleaner commit history.

Fixes flutter#82906

In the existing Flutter implementation, the Android stretch overscroll
effect is achieved using Transform. However, this approach does not
evenly stretch the screen as it does in the native Android environment.
Therefore, in the Impeller environment, add or modify files to implement
the effect using a fragment shader identical to the one used in native
Android.

> [!NOTE]
> - The addition of a separate test file for StretchOverscrollEffect was
not included because it would likely duplicate coverage already provided
by the changes made in overscroll_stretch_indicator_test.dart within
this PR.
>> However, since determining whether stretching occurred by referencing
global coordinates is currently considered impossible with the new
Fragment Shader approach, the code was modified to partially exclude the
relevant test logic in the Impeller.
>>
>> For reference, in the page_view_test.dart test, there was an issue
with referencing the child Transform widget, but because the
StretchOverscrollEffect widget is defined instead of the Transform
widget in the Impeller environment, the code logic was adjusted
accordingly.
> 
> - Golden image tests were updated as the visual effect changes.

## Reference Source
-
https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/effects/StretchEffect.cpp

## `Old` Skia (Using Transform)

https://github.com/user-attachments/assets/22d8ff96-d875-4722-bf6f-f0ad15b9077d

## `New` Impeller (Using fragment shader)

https://github.com/user-attachments/assets/73b6ef18-06b2-42ea-9793-c391ec2ce282

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[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

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <[email protected]>
SydneyBao pushed a commit to SydneyBao/flutter that referenced this pull request Aug 22, 2025
…hader (Impeller-only). (flutter#169293)" (flutter#173865)

<!-- start_original_pr_link -->
Reverts: flutter#169293
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Does not work on Metal (iOS/macOS):

```
The following _Exception was thrown running a test:
Exception: Asset 'shaders/stretch_effect.frag' does not contain appropriate runtime stage data for current backend (Metal).
```
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: MTtankkeo
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {dkwingsmt, justinmc, chunhtai}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
> Sorry, Closing PR flutter#169196 and reopening this in a new PR for clarity
and a cleaner commit history.

Fixes flutter#82906

In the existing Flutter implementation, the Android stretch overscroll
effect is achieved using Transform. However, this approach does not
evenly stretch the screen as it does in the native Android environment.
Therefore, in the Impeller environment, add or modify files to implement
the effect using a fragment shader identical to the one used in native
Android.

> [!NOTE]
> - The addition of a separate test file for StretchOverscrollEffect was
not included because it would likely duplicate coverage already provided
by the changes made in overscroll_stretch_indicator_test.dart within
this PR.
>> However, since determining whether stretching occurred by referencing
global coordinates is currently considered impossible with the new
Fragment Shader approach, the code was modified to partially exclude the
relevant test logic in the Impeller.
>>
>> For reference, in the page_view_test.dart test, there was an issue
with referencing the child Transform widget, but because the
StretchOverscrollEffect widget is defined instead of the Transform
widget in the Impeller environment, the code logic was adjusted
accordingly.
> 
> - Golden image tests were updated as the visual effect changes.

## Reference Source
-
https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/effects/StretchEffect.cpp

## `Old` Skia (Using Transform)

https://github.com/user-attachments/assets/22d8ff96-d875-4722-bf6f-f0ad15b9077d

## `New` Impeller (Using fragment shader)

https://github.com/user-attachments/assets/73b6ef18-06b2-42ea-9793-c391ec2ce282

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[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

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <[email protected]>
SydneyBao pushed a commit to SydneyBao/flutter that referenced this pull request Aug 22, 2025
…hader (Impeller-only). (flutter#169293)" (flutter#173865)

<!-- start_original_pr_link -->
Reverts: flutter#169293
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Does not work on Metal (iOS/macOS):

```
The following _Exception was thrown running a test:
Exception: Asset 'shaders/stretch_effect.frag' does not contain appropriate runtime stage data for current backend (Metal).
```
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: MTtankkeo
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {dkwingsmt, justinmc, chunhtai}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
> Sorry, Closing PR flutter#169196 and reopening this in a new PR for clarity
and a cleaner commit history.

Fixes flutter#82906

In the existing Flutter implementation, the Android stretch overscroll
effect is achieved using Transform. However, this approach does not
evenly stretch the screen as it does in the native Android environment.
Therefore, in the Impeller environment, add or modify files to implement
the effect using a fragment shader identical to the one used in native
Android.

> [!NOTE]
> - The addition of a separate test file for StretchOverscrollEffect was
not included because it would likely duplicate coverage already provided
by the changes made in overscroll_stretch_indicator_test.dart within
this PR.
>> However, since determining whether stretching occurred by referencing
global coordinates is currently considered impossible with the new
Fragment Shader approach, the code was modified to partially exclude the
relevant test logic in the Impeller.
>>
>> For reference, in the page_view_test.dart test, there was an issue
with referencing the child Transform widget, but because the
StretchOverscrollEffect widget is defined instead of the Transform
widget in the Impeller environment, the code logic was adjusted
accordingly.
> 
> - Golden image tests were updated as the visual effect changes.

## Reference Source
-
https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/effects/StretchEffect.cpp

## `Old` Skia (Using Transform)

https://github.com/user-attachments/assets/22d8ff96-d875-4722-bf6f-f0ad15b9077d

## `New` Impeller (Using fragment shader)

https://github.com/user-attachments/assets/73b6ef18-06b2-42ea-9793-c391ec2ce282

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[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

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <[email protected]>
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
…peller-only). (flutter#169293)

> Sorry, Closing PR flutter#169196 and reopening this in a new PR for clarity
and a cleaner commit history.

Fixes flutter#82906

In the existing Flutter implementation, the Android stretch overscroll
effect is achieved using Transform. However, this approach does not
evenly stretch the screen as it does in the native Android environment.
Therefore, in the Impeller environment, add or modify files to implement
the effect using a fragment shader identical to the one used in native
Android.

> [!NOTE]
> - The addition of a separate test file for StretchOverscrollEffect was
not included because it would likely duplicate coverage already provided
by the changes made in overscroll_stretch_indicator_test.dart within
this PR.
>> However, since determining whether stretching occurred by referencing
global coordinates is currently considered impossible with the new
Fragment Shader approach, the code was modified to partially exclude the
relevant test logic in the Impeller.
>>
>> For reference, in the page_view_test.dart test, there was an issue
with referencing the child Transform widget, but because the
StretchOverscrollEffect widget is defined instead of the Transform
widget in the Impeller environment, the code logic was adjusted
accordingly.
> 
> - Golden image tests were updated as the visual effect changes.

## Reference Source
-
https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/effects/StretchEffect.cpp

## `Old` Skia (Using Transform)

https://github.com/user-attachments/assets/22d8ff96-d875-4722-bf6f-f0ad15b9077d

## `New` Impeller (Using fragment shader)

https://github.com/user-attachments/assets/73b6ef18-06b2-42ea-9793-c391ec2ce282

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[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

---------

Co-authored-by: Tong Mu <[email protected]>
Co-authored-by: Kate Lovett <[email protected]>
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
…hader (Impeller-only). (flutter#169293)" (flutter#173865)

<!-- start_original_pr_link -->
Reverts: flutter#169293
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Does not work on Metal (iOS/macOS):

```
The following _Exception was thrown running a test:
Exception: Asset 'shaders/stretch_effect.frag' does not contain appropriate runtime stage data for current backend (Metal).
```
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: MTtankkeo
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {dkwingsmt, justinmc, chunhtai}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
> Sorry, Closing PR flutter#169196 and reopening this in a new PR for clarity
and a cleaner commit history.

Fixes flutter#82906

In the existing Flutter implementation, the Android stretch overscroll
effect is achieved using Transform. However, this approach does not
evenly stretch the screen as it does in the native Android environment.
Therefore, in the Impeller environment, add or modify files to implement
the effect using a fragment shader identical to the one used in native
Android.

> [!NOTE]
> - The addition of a separate test file for StretchOverscrollEffect was
not included because it would likely duplicate coverage already provided
by the changes made in overscroll_stretch_indicator_test.dart within
this PR.
>> However, since determining whether stretching occurred by referencing
global coordinates is currently considered impossible with the new
Fragment Shader approach, the code was modified to partially exclude the
relevant test logic in the Impeller.
>>
>> For reference, in the page_view_test.dart test, there was an issue
with referencing the child Transform widget, but because the
StretchOverscrollEffect widget is defined instead of the Transform
widget in the Impeller environment, the code logic was adjusted
accordingly.
> 
> - Golden image tests were updated as the visual effect changes.

## Reference Source
-
https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/effects/StretchEffect.cpp

## `Old` Skia (Using Transform)

https://github.com/user-attachments/assets/22d8ff96-d875-4722-bf6f-f0ad15b9077d

## `New` Impeller (Using fragment shader)

https://github.com/user-attachments/assets/73b6ef18-06b2-42ea-9793-c391ec2ce282

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[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

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <[email protected]>
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
…peller-only). (flutter#169293)

> Sorry, Closing PR flutter#169196 and reopening this in a new PR for clarity
and a cleaner commit history.

Fixes flutter#82906

In the existing Flutter implementation, the Android stretch overscroll
effect is achieved using Transform. However, this approach does not
evenly stretch the screen as it does in the native Android environment.
Therefore, in the Impeller environment, add or modify files to implement
the effect using a fragment shader identical to the one used in native
Android.

> [!NOTE]
> - The addition of a separate test file for StretchOverscrollEffect was
not included because it would likely duplicate coverage already provided
by the changes made in overscroll_stretch_indicator_test.dart within
this PR.
>> However, since determining whether stretching occurred by referencing
global coordinates is currently considered impossible with the new
Fragment Shader approach, the code was modified to partially exclude the
relevant test logic in the Impeller.
>>
>> For reference, in the page_view_test.dart test, there was an issue
with referencing the child Transform widget, but because the
StretchOverscrollEffect widget is defined instead of the Transform
widget in the Impeller environment, the code logic was adjusted
accordingly.
> 
> - Golden image tests were updated as the visual effect changes.

## Reference Source
-
https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/effects/StretchEffect.cpp

## `Old` Skia (Using Transform)

https://github.com/user-attachments/assets/22d8ff96-d875-4722-bf6f-f0ad15b9077d

## `New` Impeller (Using fragment shader)

https://github.com/user-attachments/assets/73b6ef18-06b2-42ea-9793-c391ec2ce282

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[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

---------

Co-authored-by: Tong Mu <[email protected]>
Co-authored-by: Kate Lovett <[email protected]>
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
…hader (Impeller-only). (flutter#169293)" (flutter#173865)

<!-- start_original_pr_link -->
Reverts: flutter#169293
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Does not work on Metal (iOS/macOS):

```
The following _Exception was thrown running a test:
Exception: Asset 'shaders/stretch_effect.frag' does not contain appropriate runtime stage data for current backend (Metal).
```
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: MTtankkeo
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {dkwingsmt, justinmc, chunhtai}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
> Sorry, Closing PR flutter#169196 and reopening this in a new PR for clarity
and a cleaner commit history.

Fixes flutter#82906

In the existing Flutter implementation, the Android stretch overscroll
effect is achieved using Transform. However, this approach does not
evenly stretch the screen as it does in the native Android environment.
Therefore, in the Impeller environment, add or modify files to implement
the effect using a fragment shader identical to the one used in native
Android.

> [!NOTE]
> - The addition of a separate test file for StretchOverscrollEffect was
not included because it would likely duplicate coverage already provided
by the changes made in overscroll_stretch_indicator_test.dart within
this PR.
>> However, since determining whether stretching occurred by referencing
global coordinates is currently considered impossible with the new
Fragment Shader approach, the code was modified to partially exclude the
relevant test logic in the Impeller.
>>
>> For reference, in the page_view_test.dart test, there was an issue
with referencing the child Transform widget, but because the
StretchOverscrollEffect widget is defined instead of the Transform
widget in the Impeller environment, the code logic was adjusted
accordingly.
> 
> - Golden image tests were updated as the visual effect changes.

## Reference Source
-
https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/effects/StretchEffect.cpp

## `Old` Skia (Using Transform)

https://github.com/user-attachments/assets/22d8ff96-d875-4722-bf6f-f0ad15b9077d

## `New` Impeller (Using fragment shader)

https://github.com/user-attachments/assets/73b6ef18-06b2-42ea-9793-c391ec2ce282

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[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

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <[email protected]>
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
…peller-only). (flutter#169293)

> Sorry, Closing PR flutter#169196 and reopening this in a new PR for clarity
and a cleaner commit history.

Fixes flutter#82906

In the existing Flutter implementation, the Android stretch overscroll
effect is achieved using Transform. However, this approach does not
evenly stretch the screen as it does in the native Android environment.
Therefore, in the Impeller environment, add or modify files to implement
the effect using a fragment shader identical to the one used in native
Android.

> [!NOTE]
> - The addition of a separate test file for StretchOverscrollEffect was
not included because it would likely duplicate coverage already provided
by the changes made in overscroll_stretch_indicator_test.dart within
this PR.
>> However, since determining whether stretching occurred by referencing
global coordinates is currently considered impossible with the new
Fragment Shader approach, the code was modified to partially exclude the
relevant test logic in the Impeller.
>>
>> For reference, in the page_view_test.dart test, there was an issue
with referencing the child Transform widget, but because the
StretchOverscrollEffect widget is defined instead of the Transform
widget in the Impeller environment, the code logic was adjusted
accordingly.
> 
> - Golden image tests were updated as the visual effect changes.

## Reference Source
-
https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/effects/StretchEffect.cpp

## `Old` Skia (Using Transform)

https://github.com/user-attachments/assets/22d8ff96-d875-4722-bf6f-f0ad15b9077d

## `New` Impeller (Using fragment shader)

https://github.com/user-attachments/assets/73b6ef18-06b2-42ea-9793-c391ec2ce282

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[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

---------

Co-authored-by: Tong Mu <[email protected]>
Co-authored-by: Kate Lovett <[email protected]>
lucaantonelli pushed a commit to lucaantonelli/flutter that referenced this pull request Nov 21, 2025
…hader (Impeller-only). (flutter#169293)" (flutter#173865)

<!-- start_original_pr_link -->
Reverts: flutter#169293
<!-- end_original_pr_link -->
<!-- start_initiating_author -->
Initiated by: matanlurey
<!-- end_initiating_author -->
<!-- start_revert_reason -->
Reason for reverting: Does not work on Metal (iOS/macOS):

```
The following _Exception was thrown running a test:
Exception: Asset 'shaders/stretch_effect.frag' does not contain appropriate runtime stage data for current backend (Metal).
```
<!-- end_revert_reason -->
<!-- start_original_pr_author -->
Original PR Author: MTtankkeo
<!-- end_original_pr_author -->

<!-- start_reviewers -->
Reviewed By: {dkwingsmt, justinmc, chunhtai}
<!-- end_reviewers -->

<!-- start_revert_body -->
This change reverts the following previous change:
> Sorry, Closing PR flutter#169196 and reopening this in a new PR for clarity
and a cleaner commit history.

Fixes flutter#82906

In the existing Flutter implementation, the Android stretch overscroll
effect is achieved using Transform. However, this approach does not
evenly stretch the screen as it does in the native Android environment.
Therefore, in the Impeller environment, add or modify files to implement
the effect using a fragment shader identical to the one used in native
Android.

> [!NOTE]
> - The addition of a separate test file for StretchOverscrollEffect was
not included because it would likely duplicate coverage already provided
by the changes made in overscroll_stretch_indicator_test.dart within
this PR.
>> However, since determining whether stretching occurred by referencing
global coordinates is currently considered impossible with the new
Fragment Shader approach, the code was modified to partially exclude the
relevant test logic in the Impeller.
>>
>> For reference, in the page_view_test.dart test, there was an issue
with referencing the child Transform widget, but because the
StretchOverscrollEffect widget is defined instead of the Transform
widget in the Impeller environment, the code logic was adjusted
accordingly.
> 
> - Golden image tests were updated as the visual effect changes.

## Reference Source
-
https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/libs/hwui/effects/StretchEffect.cpp

## `Old` Skia (Using Transform)

https://github.com/user-attachments/assets/22d8ff96-d875-4722-bf6f-f0ad15b9077d

## `New` Impeller (Using fragment shader)

https://github.com/user-attachments/assets/73b6ef18-06b2-42ea-9793-c391ec2ce282

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [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.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[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

<!-- end_revert_body -->

Co-authored-by: auto-submit[bot] <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e: impeller Impeller rendering backend issues and features requests engine flutter/engine related. See also e: labels. f: material design flutter/packages/flutter/material repository. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants