Skip to content

Conversation

@clocksmith
Copy link
Contributor

@clocksmith clocksmith commented Jan 13, 2022

  • Create an InkSparkle effect that matches the Material 3 ripple on Android 12. Similar to InkRipple, but uses the new custom shader API.
  • Uses a generated SPIR-V Fragment Shader from a GLSL source.
  • Uses a generated FragmentShaderManager to make uniform updates and compilation more legible.

Android Samples:
black
pink
green

closes #82850

Note on performance:

Currently, the shader needs to be compiled at run time before the first InkSparkle can be painted. This takes 3-4 milliseconds on a Pixel 6 Pro and 30-35 milliseconds on a 2014 Moto E. The Moto E runs InkRipple at about 5 fps and the InkSparkle at about 5 fps. Even in the worst case, the async shader compilation is negligible, but it could be moved to MaterialApp or Theme creation instead.

Up next:

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

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

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Jan 13, 2022
@clocksmith clocksmith changed the title [WIP] [Material] Create an InkSparkle that matches the M3 Ripple on Android 12 [WIP] [Material] Create an InkSparkle that matches the M3 ripple on Android 12 Jan 13, 2022
@LasseRosenow
Copy link
Contributor

In the gif above, I can see that the whole background immediately gets another color on touch, but as far as I know, the background should only change its color by the circular animation

@clocksmith
Copy link
Contributor Author

clocksmith commented Jan 13, 2022

In the gif above, I can see that the whole background immediately gets another color on touch, but as far as I know, the background should only change its color by the circular animation

@LasseRosenow Good catch, I believe that is the InkHighlight for mouse input, need to verify that it does not show on touch only

@clocksmith clocksmith marked this pull request as ready for review January 13, 2022 17:19
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat.

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.

@flutter-dashboard
Copy link

This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold.

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

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

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

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.

@clocksmith clocksmith changed the title [WIP] [Material] Create an InkSparkle that matches the M3 ripple on Android 12 [Material] Create an InkSparkle that matches the M3 ripple on Android 12 Feb 17, 2022
@clocksmith clocksmith changed the title [Material] Create an InkSparkle that matches the M3 ripple on Android 12 [Material] Create an InkSparkle that matches the Material 3 Ripple Feb 17, 2022
@clocksmith clocksmith changed the title [Material] Create an InkSparkle that matches the Material 3 Ripple [Material] Create an InkSparkle that matches the Material 3 ripple effect Feb 17, 2022
@skia-gold
Copy link

Gold has detected about 15 new digest(s) on patchset 3.
View them at https://flutter-gold.skia.org/cl/github/96598

@skia-gold
Copy link

Gold has detected about 17 new digest(s) on patchset 5.
View them at https://flutter-gold.skia.org/cl/github/96598

@clocksmith clocksmith requested a review from darrenaustin March 1, 2022 17:22
@skia-gold
Copy link

Gold has detected about 22 new digest(s) on patchset 8.
View them at https://flutter-gold.skia.org/cl/github/96598

engine-flutter-autoroll and others added 21 commits March 7, 2022 21:36
@clocksmith
Copy link
Contributor Author

clocksmith commented Mar 8, 2022

Reopened as #99731

@clocksmith clocksmith deleted the m3-ripple branch March 8, 2022 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: animation Animation APIs f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Introduce new Android 12 style ink ripple