Skip to content

Conversation

@flar
Copy link
Contributor

@flar flar commented May 1, 2025

When basic rendering operations end up in a "general case" situation in Impeller, it converts the basic shape into a path and calls DrawPath. But, the creation of the path is expensive and all the mechanisms behind drawing a path now only need a PathSource object which can replay the path to them.

We now have explicit lightweight path source generators which can feed the path drawing operations directly from the source data without having to create a full impeller::Path object.

@github-actions github-actions bot added engine flutter/engine related. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels May 1, 2025
@flar
Copy link
Contributor Author

flar commented May 1, 2025

The spiritual successor to #167863, now with polymorphism to simplify the geometry object ownership.

@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.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #168125 at sha 0717b03

@flutter-dashboard flutter-dashboard bot added the will affect goldens Changes to golden files label May 1, 2025
@flar
Copy link
Contributor Author

flar commented May 1, 2025

The goldens look fine - similar edge coverage pixels on rounded corners that we've seen before. Most likely caused by the switch from cubics to conics to approximate the corners of round rects. Conics are more accurate and are what Skia uses, but impeller::PathBuilder has been using cubics because Impeller didn't support conics until recently.

@flar
Copy link
Contributor Author

flar commented May 1, 2025

Spot checking some of the Google failures, the first couple of failures were basically someone else's change to Dart code that this PR couldn't have possibly been responsible for.

@flutter-dashboard
Copy link

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

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #168125 at sha 7a35b34

@flar flar requested a review from gaaclarke May 1, 2025 23:40
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.

This approach looks good to me. I just have a couple of notes.


namespace impeller {

/// @brief A geometry that is created from a filled path object.
Copy link
Member

Choose a reason for hiding this comment

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

Does this need some refinement after this change? Probably worth mentioning it's an abstract base class.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've completely revamped the doc comments for these base classes and all of the sub-classes and also moved their implementations into their type-specific source files.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Leaving this open so you can look at all of the class doc comments when I update them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The new stuff is pushed now, and I added an implementation of CoversArea for the new generalized round rect class which wasn't feasible before when it was turned into a path.

@flar
Copy link
Contributor Author

flar commented May 2, 2025

A follow-on task would be to have StrokeParameters defined in a general include file and shared by both Paint and StrokePathGeometry...

@flutter-dashboard
Copy link

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

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #168125 at sha c9e2be9

@flar flar requested a review from gaaclarke May 2, 2025 23:31
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, I think the stroke params really cleaned things up.

@flar flar added the autosubmit Merge PR when tree becomes green via auto submit App label May 3, 2025
@auto-submit auto-submit bot added this pull request to the merge queue May 3, 2025
Merged via the queue into flutter:master with commit 619c02f May 3, 2025
180 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label May 3, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 3, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 3, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
ash2moon pushed a commit to ash2moon/flutter that referenced this pull request May 5, 2025
…lutter#168125)

When basic rendering operations end up in a "general case" situation in
Impeller, it converts the basic shape into a path and calls `DrawPath`.
But, the creation of the path is expensive and all the mechanisms behind
drawing a path now only need a `PathSource` object which can replay the
path to them.

We now have explicit lightweight path source generators which can feed
the path drawing operations directly from the source data without having
to create a full `impeller::Path` object.
ash2moon pushed a commit to ash2moon/flutter that referenced this pull request May 5, 2025
…#168276)

flutter#168125 introduced
StrokeParameters to hold all of the stroke-related values, but was only
used in the rendering code. We now use it across Impeller to describe
stroke decorations.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 5, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 6, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 6, 2025
mboetger pushed a commit to mboetger/flutter that referenced this pull request May 6, 2025
…lutter#168125)

When basic rendering operations end up in a "general case" situation in
Impeller, it converts the basic shape into a path and calls `DrawPath`.
But, the creation of the path is expensive and all the mechanisms behind
drawing a path now only need a `PathSource` object which can replay the
path to them.

We now have explicit lightweight path source generators which can feed
the path drawing operations directly from the source data without having
to create a full `impeller::Path` object.
mboetger pushed a commit to mboetger/flutter that referenced this pull request May 6, 2025
…#168276)

flutter#168125 introduced
StrokeParameters to hold all of the stroke-related values, but was only
used in the rendering code. We now use it across Impeller to describe
stroke decorations.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 7, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 14, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 15, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

e: impeller Impeller rendering backend issues and features requests engine flutter/engine related. See also e: labels. will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants