Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller] geometry changes to support line/point style. #56340

Merged
merged 6 commits into from
Nov 11, 2024

Conversation

jonahwilliams
Copy link
Member

@jonahwilliams jonahwilliams commented Nov 2, 2024

Split off from #55230 . Adds getter that tracks if a Path is a single contour.

################################

flutter/flutter#152702

@@ -71,7 +71,8 @@ class StripVertexWriter : public VertexWriter {
class GLESVertexWriter : public VertexWriter {
public:
explicit GLESVertexWriter(std::vector<Point>& points,
std::vector<uint16_t>& indices);
std::vector<uint16_t>& indices,
bool line_strip = false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a docstring for what line_strip is? Maybe just link to tessellator's documentation.

/// @return A point vector containing the vertices in triangle strip format.
/// Matrix::GetMaxBasisLengthXY of the CTM applied to
/// the path for rendering.
/// @param[in] line_strip if true, generates line strip geometry instead of a
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a "line strip"? A triangle strip that makes a line?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A line strip is a GL_LINE_STRIP geometry. How about a link to the primitive type?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why a tessellator would be generating a line strip, tessellation means converting something to packed polygons (triangles in our case). I see, this is doing stuff like converting a bezier path to a line strip?

Yea, mentioning GL_LINE_STRIP would help to distinguish it from a line make with a triangle strip. Especially since a generating a GL_LINE_STRIP isn't technically tessellation.

The brief for this method also explicitly says it creates a triangle fan structure, that should be updated.

Now that I think of it. Don't you think this would be better off as it's own function instead of a bool parameter? Generally it's advised to make procedures do 1 thing. We can share the code in a helper function.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree with you, a separate method would be better in this case. I suppose since its a line primitive its not exactly tessellation but primitive generation :)

Comment on lines +57 to +58
point_buffer.GetBuffer()->Flush(point_buffer.GetRange());
index_buffer.GetBuffer()->Flush(index_buffer.GetRange());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a test for these changes?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a test case for this, except for the fact that it may or may not work on swiftshader. I don't want to add a mock test for these, instead I think switching to the point arena like we did for strokes is probably better?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, you're saying if this wasn't here the goldens would look wrong? Sounds good to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be racy :(

Copy link
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! thanks

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 7, 2024
Copy link
Contributor

auto-submit bot commented Nov 7, 2024

auto label is removed for flutter/engine/56340, due to - The status or check suite Mac mac_ios_engine has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 7, 2024

std::pair<size_t, size_t> GetVertexCount() const;

const std::vector<Point>& GetOveriszedBuffer() const;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo Overiszed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks!

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 11, 2024
@auto-submit auto-submit bot merged commit 980e4d2 into flutter:main Nov 11, 2024
30 checks passed
@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 11, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 12, 2024
…158485)

flutter/engine@7b3eacd...35041f1

2024-11-11 skia-flutter-autoroll@skia.org Roll Dart SDK from a393f3ed040a to 69170fac244c (1 revision) (flutter/engine#56513)
2024-11-11 chris@bracken.jp iOS,macOS: Refactor TestMetalContext for ARC (flutter/engine#56510)
2024-11-11 jonahwilliams@google.com [Impeller] geometry changes to support line/point style. (flutter/engine#56340)
2024-11-11 skia-flutter-autoroll@skia.org Roll Skia from af6a4f9a85ee to 11046fd10394 (9 revisions) (flutter/engine#56508)
2024-11-11 jonahwilliams@google.com [Impeller] dont unnecessarily copy point data out of display list. (flutter/engine#56492)
2024-11-11 jonahwilliams@google.com [Impeller] fix line/polygon depth and GLES scissor state. (flutter/engine#56494)
2024-11-11 jason-simmons@users.noreply.github.com Do not stop flutter_tester if microtasks are still pending (flutter/engine#56432)
2024-11-11 skia-flutter-autoroll@skia.org Roll Skia from 261316c10484 to af6a4f9a85ee (5 revisions) (flutter/engine#56505)
2024-11-11 skia-flutter-autoroll@skia.org Roll Dart SDK from 4ea43aa234a4 to a393f3ed040a (1 revision) (flutter/engine#56506)

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 jsimmons@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
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
…ine#56340)

Split off from flutter/engine#55230 . Adds getter that tracks if a Path is a single contour.

################################

flutter#152702
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants