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

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Apr 16, 2024

Part of flutter/flutter#143077

Only allocate into reused arenas instead of allocating a new vector of data. Fixes flutter/flutter#133348

Also moves tessellation logic into the c/tessellator and out of the impeller tessellator. This was necessary to fix a compilation error. introduced by including host_buffer -> allocator -> fml mapping -> window.h include which has a function definition that conflicts with the c tessellator definition.

Fixes missing points in case a filled path is not explicitly closed.

@flutter-dashboard
Copy link

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.

Changes reported for pull request #52180 at sha 235d02f

@jonahwilliams
Copy link
Contributor Author

One of these goldens looks wrong and the other didn't show up, investigating.

@jonahwilliams
Copy link
Contributor Author

jonahwilliams commented Apr 17, 2024

Should be fixed. THe stroke path issue was different than I thought so I pulled that change out of this PR.


// Note: the origin point is repeated but not referenced in the indices
// below
std::vector<Point> expected = {{0, 0}, {10, 0}, {10, 10}, {0, 10}, {0, 0}};
Copy link
Contributor Author

@jonahwilliams jonahwilliams Apr 17, 2024

Choose a reason for hiding this comment

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

The change here is that the first point is repeated if a contour is closed, where as it isn't repeated if it isn't closed. But we don't reference the first point multiple times (in the index buffer) so the triangles are the same.

This is because we need to make sure that a filled shape without an explicit close includes the first point.

@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

Changes reported for pull request #52180 at sha cdbb63e

@jonahwilliams
Copy link
Contributor Author

PTAL @chinmaygarde

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 18, 2024
@auto-submit auto-submit bot merged commit 46ff024 into flutter:main Apr 18, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 18, 2024
jonahwilliams pushed a commit to jonahwilliams/engine that referenced this pull request Apr 22, 2024
@jason-simmons
Copy link
Member

Noticed an issue in the benchmark results related to this PR before it was reverted.

The index_buffer_->clear() and point_buffer_->clear() calls in Tessellator::TessellateConvexInternal should instead use the index_buffer and point_buffer parameters.

If this is relanded, then Tessellator::TessellateConvexInternal should be made a static method with that patch applied.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App e: impeller will affect goldens

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Impeller] FillPointsForPolyLine and TessellateConvex have too much allocation.

3 participants