This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Migrate all ColorSourceContents to use a shared rendering routine. #50261
Merged
auto-submit
merged 16 commits into
flutter:main
from
bdero:bdero/colorsourcecontents-utils
Feb 14, 2024
Merged
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ef2b22c
[Impeller] Add shared ColorSourceContents render routine.
bdero 2456438
Move to ColorSourceContents
bdero a27a5f1
jonah review
bdero 7d5cd10
Revert "jonah review"
bdero 7a230e8
jonah review
bdero fc6be29
renames and comments
bdero 3b0f19f
Adopt LinearGradientContents
bdero 5c80aff
Migrate TiledTextureContents
bdero 66072d1
Use callback for pipeline
bdero 5bd771a
Migrate RuntimeEffectContents
bdero 34b2caf
dastardly ifdef!
bdero 3740ba3
Jonah review
bdero 7ce4b58
Migrate ConicalGradientContents
bdero ffd2196
Migrate RadialGradientContents
bdero ccd8718
Migrate SweepGradientContents
bdero 7fcc256
Resolve the pipeline after running the fragment bind callback
bdero File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternative suggestion, make color source contents have a virtual
BindFragmentCallback
method and make this call it. If we have to pass a closure for non trivial cases then its going to end up closing over the entire contents anyway.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a good approach. Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Uhh actually applying this to my follow-up patch is a painful because we have multiple rendering branches for all of the gradients that need different binding behavior.
In all of the use cases we can capture the things we need by reference, and my understanding is that assigning a lambda to a stack
std::function
shouldn't heap allocate as long as the set of captures is reasonably small.One sec, gonna check this...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The different gradients are basically different content classes though
if the contents is less verbose with this change it would make more sense to split them in two IMO.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Briefly discussed offline, we can just switch this out later if necessary / ends up being too annoying. Some legit concerns over expanding our use of
std::function
, like annoying stack traces, compiler differences, etc.