Skip to content

Conversation

@flar
Copy link
Contributor

@flar flar commented May 13, 2025

Nearly all parts of the Impeller rendering pipeline now rely on DlPath and PathSource objects for their path description needs. The impeller path only exists for impeller's unit tests and benchmarks to have a local way to construct paths. We implement path construction for the DlPath object via DlPathBuilder which makes the impeller family of path objects functionally obsolete and so they are now deleted.

@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems engine flutter/engine related. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels May 13, 2025
@dkwingsmt
Copy link
Contributor

The RoundSuperellipse parts look good to me! Thank you for the cleanup!

@flar
Copy link
Contributor Author

flar commented May 13, 2025

Currently I have most of the libtess stuff commented out and some of the other tessellator stuff may also be commented out while I see what the status of the libtess library and Dart file is. I can convert it, but I wanted to make sure libtess was still being used before I did so.

@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 #168760 at sha 1201176

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

unfortunately the libtess stuff is still used, as that library is compiled to a shared library that is used by package:vector_graphics. but it doesn't need to use the impeller path stuff, it could use Skia path: the binary size isn't important as it is not shipped in applications

@flar
Copy link
Contributor Author

flar commented May 13, 2025

There are many cases in the goldens where we rendered a ui.Canvas.drawArc call via "pathbuilder.addArc" and that implementation switched from the cubic-based approximation used in impeller::PathBuilder to the conic-based version (more accurate) in DlPathBuilder/SkPath.

There is also a group of diffs that look like the edge conditions on some of the paths were affected (perhaps due to changes in the way that impeller vs. Skia computes bounds).

@flar
Copy link
Contributor Author

flar commented May 13, 2025

unfortunately the libtess stuff is still used, as that library is compiled to a shared library that is used by package:vector_graphics. but it doesn't need to use the impeller path stuff, it could use Skia path: the binary size isn't important as it is not shipped in applications

@chinmaygarde suggested that we could remove it from the repo and ship it separately.

@flar
Copy link
Contributor Author

flar commented May 13, 2025

Yes, it appears that Skia adds an arc to a path greedily by 90 degree increments until it reaches the last <90 degree tail end - which means that the control points of the conics for those quarter circles will lie outside the "bounds" of the arc if the beginning isn't quadrant aligned.

There is a method on SkPath to compute a tight bounds, but I'd like to avoid using that unless necessary. I can either create a custom ArcPathSource which will generate conics that don't have control points outside the bounds and/or which reports its bounds based on the bounds of the ellipse it inscribes and the start/end points themselves.

@jonahwilliams
Copy link
Contributor

The vector graphics compiler will handle the library being missing (https://github.com/flutter/packages/blob/14685811ed39d018b763ec45e8d520f6d82f8073/packages/vector_graphics_compiler/lib/src/_initialize_tessellator_io.dart#L11) but the functionality that relies on that library will stop working.

suggested that we could remove it from the repo and ship it separately.

But from where and when? The easiest place to build this is going to be from flutter/flutter. If its not too much trouble, I'd try to adapt the Skia paths to work in the libtess library. otherwise we can remove it, but lets not add it somewhere else - just get rid of it.

@flar
Copy link
Contributor Author

flar commented May 14, 2025

But from where and when? The easiest place to build this is going to be from flutter/flutter. If its not too much trouble, I'd try to adapt the Skia paths to work in the libtess library. otherwise we can remove it, but lets not add it somewhere else - just get rid of it.

It's not as complicated as using Skia. The files can use the path iteration like the rest of Impeller, I just have to do the plumbing...

@flar
Copy link
Contributor Author

flar commented May 14, 2025

libtess is back now

namespace flutter {
namespace testing {

class DlPathVerbCounter : public DlPathReceiver {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It occurs to me that I could have added a method to Dlpath for this. Hmm. It's only needed to report metrics for benchmarks though, so ... meh.

@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 #168760 at sha 4e57cf1

@flar
Copy link
Contributor Author

flar commented May 15, 2025

The goldens look as would be expected. This should be ready for review...

@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 #168760 at sha e5cabad

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 18, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 19, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 19, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 19, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 19, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 19, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 19, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 19, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 20, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 21, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 21, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 21, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 21, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 21, 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

a: text input Entering text in a text field or keyboard related problems 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.

3 participants