Skip to content

Move strech fragment shader to widget layer#187960

Merged
auto-submit[bot] merged 2 commits into
flutter:masterfrom
chunhtai:move-strech
Jun 26, 2026
Merged

Move strech fragment shader to widget layer#187960
auto-submit[bot] merged 2 commits into
flutter:masterfrom
chunhtai:move-strech

Conversation

@chunhtai

@chunhtai chunhtai commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

This fragment is used in widget layer. With the decoupling, this fragment should stay in flutter/flutter

In this pr, I moved the shader from material/shaders to widgets/shaders, also adjust the flutter tooling to use the updated file path

fixes #187807

Pre-launch Checklist

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

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jun 12, 2026
@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. labels Jun 12, 2026

@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 refactors how framework shaders are bundled by separating material shaders (ink_sparkle.frag) and widgets shaders (stretch_effect.frag) into their respective directories instead of treating them all as material shaders. The corresponding asset bundle and asset tests are updated to mock and assert these new paths. The review feedback suggests refactoring the updated tests to use loops over the shader definitions to reduce boilerplate and improve readability.

Comment thread packages/flutter_tools/test/general.shard/asset_bundle_test.dart
Comment thread packages/flutter_tools/test/general.shard/asset_test.dart
Comment thread packages/flutter_tools/test/general.shard/asset_test.dart
result.add(
_Asset(
baseDir: materialShaderPath,
relativeUri: Uri(path: 'ink_sparkle.frag'),

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 needs to be removed when the material in flutter/flutter is removed.

The material_ui need to attach this fragment shader as part of its pubspec so that the InkSparkle effect will use the version in the material_ui

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.

Can you leave a TODO here with a tracking issue?

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

justinmc
justinmc previously approved these changes Jun 12, 2026

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

LGTM 👍 . I agree that the shader should be in Widgets. Besides the fact that it's used there, it's really system UI that Android devs will want even if they aren't using Material.

But the description says fixes #187807, does this PR still need to add IMPELLER_OPENGLES_UNFLIPPED_DEPRECATED to the shader?

@chunhtai

Copy link
Copy Markdown
Contributor Author

need to add IMPELLER_OPENGLES_UNFLIPPED_DEPRECATED to the shader?

We only need this if material_ui provides this file.

If we move it to widget layer, it will by in sync with impeller breaking change, so we don't need to worry about backward and forward compatibility

@chunhtai chunhtai added the override code freeze Override an active code freeze. label Jun 12, 2026
@justinmc

Copy link
Copy Markdown
Contributor

Google tests are failing, but it looks like it's just a couple of tests that are expecting the shaders/stretch_effect.frag file to exist among some assets. Probably we need a g3fix that just removes the filename from the test. Or should it still exist?

@Piinks Piinks added Decoupling: Not ready to port yet Instructions will be provided when this is ready to move to flutter/packages. and removed override code freeze Override an active code freeze. labels Jun 24, 2026
@Piinks

Piinks commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

I think we should deprecate the public classes in the file that is being moved in material_ui when it is ready to accept changes, otherwise it will be breaking to just remove it.

I've marked this PR as not ready to port to flutter/packages yet.
We'll provide instructions to move this change over to material_ui once it is ready to receive PRs. Thank you!

The changes in the widgets library will remain here after.

@chunhtai

Copy link
Copy Markdown
Contributor Author

We can keep the file in material just for the code freeze and create another issue to remove it from both flutter/flutter and flutter/package later

@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 24, 2026
@chunhtai chunhtai added CICD Run CI/CD and removed Decoupling: Not ready to port yet Instructions will be provided when this is ready to move to flutter/packages. labels Jun 24, 2026
@chunhtai

Copy link
Copy Markdown
Contributor Author

removing the do not port label as this is non breaking and the removal of the file will be a follow up

@github-actions github-actions Bot removed the CICD Run CI/CD label Jun 25, 2026
@chunhtai chunhtai requested a review from justinmc June 25, 2026 03:35
@chunhtai chunhtai added the CICD Run CI/CD label Jun 25, 2026

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

We can keep the file in material just for the code freeze and create another issue to remove it from both flutter/flutter and flutter/package later

That makes sense to me 👍

I reran a failing test that seemed like it might have been a flake, not sure though.

@chunhtai chunhtai added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 26, 2026
@auto-submit auto-submit Bot added this pull request to the merge queue Jun 26, 2026
Merged via the queue into flutter:master with commit 7b116af Jun 26, 2026
169 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD 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.

[material_ui] Fragment shader needs to use IMPELLER_OPENGLES_UNFLIPPED_DEPRECATED to migrate the y flip breaking change

4 participants