-
Notifications
You must be signed in to change notification settings - Fork 6k
Geometry Wars: Documentation Edition #49910
Geometry Wars: Documentation Edition #49910
Conversation
|
Ready for review! |
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. |
|
Golden file changes are available for triage from new commit, Click here to view. |
064ceba to
b4503be
Compare
|
There are no longer golden changes or tests in this PR, it's purely documentation. Thanks! |
flar
left a comment
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.
Looks fine, but with some fixes as mentioned in the comments.
impeller/entity/geometry/geometry.cc
Outdated
| texture_coverage.GetNormalizingTransform() * effect_transform; | ||
| // Calculate UV-specific transform based on texture coverage and effect. | ||
| // For example, if the texture is 100x100 and the effect transform is | ||
| // scaling by 2, then the UV transform should be scaling by 0.5. |
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.
Shouldn't that be .02?
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.
Can you clarify? I'm not sure how the reuslt would be 0.02.
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.
In the example given of a 100x100 texture, texture_bounds.GetNormalizingTransform() will result in a Matrix that scales by 0.01. Then, if the effect_transform is Matrix::MakeScale(Vector2{2, 2}), the resulting uv_transform will have x and y basis vectors with scale 0.02.
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.
uv_transform is used to squish local positions (source_rect) into a 0-1 space for texture sampling.
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.
@bdero beat me to it
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.
Thanks both!
impeller/entity/geometry/geometry.h
Outdated
|
|
||
| /// @brief Computes geometry and UV coordinates for a rectangle to be rendered. | ||
| /// | ||
| /// UV is the horizontal and vertical axes within the texture. |
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 you mean the horizontal and vertical coordinates within the texture.
An axis is a direction, not a position.
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.
Done!
bdero
left a comment
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.
Couple of suggestions, but otherwise LGTM :)
impeller/entity/geometry/geometry.h
Outdated
| /// @param entity The entity to use for the transform. | ||
| /// @param pass The render pass to use for the transform. | ||
| GeometryResult ComputeUVGeometryForRect(Rect source_rect, | ||
| Rect texture_coverage, |
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.
Consider renaming to texture_bounds or texture_local_coverage. "Coverage" as a standalone word has a screen/pass space connotation around other parts of the Entities layer.
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.
Done.
impeller/entity/geometry/geometry.h
Outdated
| /// UV is the horizontal and vertical axes within the texture. | ||
| /// | ||
| /// @param source_rect The rectangle to be rendered. | ||
| /// @param texture_coverage The size of the texture to be rendered. |
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.
A more accurate description for this would be something like: "The local space bounding box of the geometry."
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.
Done!
impeller/entity/geometry/geometry.cc
Outdated
| // 2: position | ||
| // 3: UV | ||
| // etc. | ||
| std::vector<Point> data(8); |
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.
bonus points: change this to an arrary so we don't do an extra heap allocation.
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.
Done!
matanlurey
left a comment
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.
PTAL
impeller/entity/geometry/geometry.cc
Outdated
| texture_coverage.GetNormalizingTransform() * effect_transform; | ||
| // Calculate UV-specific transform based on texture coverage and effect. | ||
| // For example, if the texture is 100x100 and the effect transform is | ||
| // scaling by 2, then the UV transform should be scaling by 0.5. |
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.
Can you clarify? I'm not sure how the reuslt would be 0.02.
impeller/entity/geometry/geometry.cc
Outdated
| // 2: position | ||
| // 3: UV | ||
| // etc. | ||
| std::vector<Point> data(8); |
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.
Done!
impeller/entity/geometry/geometry.h
Outdated
|
|
||
| /// @brief Computes geometry and UV coordinates for a rectangle to be rendered. | ||
| /// | ||
| /// UV is the horizontal and vertical axes within the texture. |
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.
Done!
impeller/entity/geometry/geometry.h
Outdated
| /// UV is the horizontal and vertical axes within the texture. | ||
| /// | ||
| /// @param source_rect The rectangle to be rendered. | ||
| /// @param texture_coverage The size of the texture to be rendered. |
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.
Done!
impeller/entity/geometry/geometry.h
Outdated
| /// @param entity The entity to use for the transform. | ||
| /// @param pass The render pass to use for the transform. | ||
| GeometryResult ComputeUVGeometryForRect(Rect source_rect, | ||
| Rect texture_coverage, |
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.
Done.
|
Just wanted to compliment the reference in this PR's title. KUDOS! 🚗💨 |
| std::vector<Point> data(8); | ||
| // Calculate UV-specific transform based on texture coverage and effect. | ||
| // For example, if the texture is 100x100 and the effect transform is | ||
| // scaling by 0.2, texture_bounds.GetNormalizingTransform() will result in a |
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.
This should be 2.0?
…142079) flutter/engine@0b9b538...220416c 2024-01-23 [email protected] Geometry Wars: Documentation Edition (flutter/engine#49910) 2024-01-23 [email protected] Exclude the Dart SDK sdk/lib/svg/dart2js directory from the license crawl (flutter/engine#49977) 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
Document some confusing bits of
geometryfor the next bub.Originally this PR was to add a test and fix a bug, but that's being handled here: #49938.