-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Impeller] Compute UV coordinates lazily in PositionUVWriter #50879
[Impeller] Compute UV coordinates lazily in PositionUVWriter #50879
Conversation
|
||
const std::vector<TextureFillVertexShader::PerVertexData>& GetData() const { | ||
const std::vector<TextureFillVertexShader::PerVertexData>& GetData() { |
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.
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...
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.
I think that is probably fine
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.
LGTM
…144049) flutter/engine@fbc9b88...5d1c0d4 2024-02-23 flar@google.com [Impeller] Compute UV coordinates lazily in PositionUVWriter (flutter/engine#50879) 2024-02-23 skia-flutter-autoroll@skia.org 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 jimgraham@google.com,rmistry@google.com,zra@google.com 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
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.