This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[Impeller] reduce advanced blend subpass count for single input with foreground color#40886
Merged
auto-submit[bot] merged 3 commits intoflutter:mainfrom Apr 3, 2023
Merged
Conversation
bdero
approved these changes
Apr 3, 2023
| Entity entity; | ||
| entity.SetTransformation(Matrix::MakeTranslation(coverage.origin)); | ||
| entity.SetContents(std::move(contents)); | ||
| return entity; |
Contributor
There was a problem hiding this comment.
To prevent the need for adding new contents that don't really have a use outside of filters (and for just keeping all the logic local), you could also use Contents::MakeAnonymous() here, which I added to help make returning specialized contents easier when optimizing filters like this.
It just takes a render method and coverage, no questions asked. :)
Up to you if you want to do that refactor though.
Contributor
Author
There was a problem hiding this comment.
I do intend to use this a bit more though, for some of the follow ups in flutter/flutter#124025 the bypass the color filter entirely.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 4, 2023
…ut with foreground color (flutter/engine#40886)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 4, 2023
…ut with foreground color (flutter/engine#40886)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 4, 2023
…ut with foreground color (flutter/engine#40886)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 4, 2023
…ut with foreground color (flutter/engine#40886)
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Apr 4, 2023
…ut with foreground color (flutter/engine#40886)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Work towards flutter/flutter#124025
This makes Advanced Blends applied via ColorFiltered take one fewer subpass, and Advanced Blends applied directly to contents (via Paint) take no extra subpasses at all.
To test this, I used the flutter codelabs nextgen UI app. Though this uses a ColorFiltered with a pipeline blend, I changed to using ColorDodge to experiment with the costs of the advanced blend filters. While this reduces the number of subpasses significantly, it only has a minor impact on overall performance.
Before
After