This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[Impeller] Compute UV coordinates lazily in PositionUVWriter#50879
Merged
auto-submit[bot] merged 1 commit intoflutter:mainfrom Feb 23, 2024
Merged
[Impeller] Compute UV coordinates lazily in PositionUVWriter#50879auto-submit[bot] merged 1 commit intoflutter:mainfrom
auto-submit[bot] merged 1 commit intoflutter:mainfrom
Conversation
Contributor
Author
flar
commented
Feb 22, 2024
| effect_transform_(effect_transform) {} | ||
|
|
||
| const std::vector<TextureFillVertexShader::PerVertexData>& GetData() const { | ||
| const std::vector<TextureFillVertexShader::PerVertexData>& GetData() { |
Contributor
Author
There was a problem hiding this comment.
Note that I removed the "const" qualifier here so that the code could lazily update the data_ array. The corresponding method in the regular PositionWriter is still declared "const" because it has no such lazy work to do and these 2 classes are "related" but do not inherit from each other.
I was waffling on whether both should be consistent in whether they are declared "const", for symmetry, or not...
Contributor
There was a problem hiding this comment.
I think that is probably fine
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Feb 23, 2024
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Feb 23, 2024
flutter/engine@fbc9b88...5d1c0d4 2024-02-23 [email protected] [Impeller] Compute UV coordinates lazily in PositionUVWriter (flutter/engine#50879) 2024-02-23 [email protected] Roll Skia from 49dd7ed24bec to fde4d63c5e61 (3 revisions) (flutter/engine#50917) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Contributor
Author
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.

The stroking code was performing texture coordinate conversion on each created vertex. Since there were often very few calculations needed for each vertex, interspersing a coordinate transform with each vertex append was clogging up the code.
This change will defer the calculation of the texture coordinates until the end of the stroking process so that the polyline widening code can do its job efficiently and then later the coordinate conversion code can do its job also efficiently in a tight loop. This change also opened up the opportunity to optimize a common case (no effect transform) even more than before.