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

[Impeller] skip lineTo for empty contours. #52290

Merged
merged 7 commits into from
Apr 22, 2024

Conversation

jonahwilliams
Copy link
Member

@jonahwilliams jonahwilliams commented Apr 21, 2024

If we close an empty contour, don't insert a lineTo

Fixes flutter/flutter#146648

@flar
Copy link
Contributor

flar commented Apr 22, 2024

Doesn't this also skip them if the path creator manually closed the path before calling close()? Another win...

Maybe add a test that verifies this happens in addition to the empty path test?

@jonahwilliams
Copy link
Member Author

Okay, we determined goldens didn't run for about a week. Rebasing and hoping to see some diffs on this.

Maybe add a test that verifies this happens in addition to the empty path test?

Good idea. Will add a few of these as non-golden unit tests

@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 #52290 at sha 70d4d93

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 22, 2024
@auto-submit auto-submit bot merged commit 62c9f17 into flutter:main Apr 22, 2024
EXPECT_EQ(path.GetComponentCount(Path::ComponentType::kLinear), 2u);
EXPECT_EQ(path.GetComponentCount(Path::ComponentType::kContour), 2u);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see the test I was looking for, namely:

MoveTo(0, 0)
LineTo(10, 0)
LineTo(10, 10)
LineTo(0, 10)
LineTo(0, 0)
Close()

should have 4 lines in it because the last LineTo returned the pen to the starting position.

Copy link
Contributor

Choose a reason for hiding this comment

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

Look at PathBuilder::AddOval for an example of this that is less degenerate. Drawing the full circle requires the path definition to return to the original point. An oval/circle cannot rely on the implicit Close() segment to finish the path, but previously it got a zero-length segment on the close. With this change that useless segment is no longer added, but we have no tests that ensure this improved behavior.

engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 23, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Apr 23, 2024
…147203)

flutter/engine@33c828f...62c9f17

2024-04-22 jonahwilliams@google.com [Impeller] skip lineTo for empty contours. (flutter/engine#52290)
2024-04-22 skia-flutter-autoroll@skia.org Roll Skia from 3b32e3280b67 to e6de04b82b57 (6 revisions) (flutter/engine#52304)
2024-04-22 jonahwilliams@google.com [Impeller] re-enable gold CTL. (flutter/engine#52299)
2024-04-22 skia-flutter-autoroll@skia.org Roll Dart SDK from 0ed66a4d77cb to 95f95b3118fe (1 revision) (flutter/engine#52301)

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,rmistry@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
@jonahwilliams jonahwilliams deleted the move_contours branch April 23, 2024 01:39
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.

Drawing a path results in an unexpected behavior with Impeller
3 participants