Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate DisplayList unit tests to DL/Impeller geometry classes #161453

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

flar
Copy link
Contributor

@flar flar commented Jan 10, 2025

Address the first item in #161456 (Unit tests in the display_list/ directory)

Some new DlPath::Make<Shape> factories were added to make test writing simpler.

DlPath is now bi-directional! You can construct one from either an SkPath or an impeller::Path and it will auto-convert to the other as needed. This allows unit tests with custom paths to rely on impeller::Path for path construction instead of SkPath (as long as only simple move/line/quad/curve verbs are needed).

RoundRect now normalizes the argument rect in all constructors to match Flutter expectations and SkRRect legacy behavior. This behavior was already being enforced in ui.rrect but the unit tests we have to verify the behavior are written against the RoundRect object itself so this was the simplest way to make the unit tests work right, while ensuring that we maintain correct behavior for ui objects. Ideally these issues would be tested at the ui native interface instead of as unit tests on our internal objects and we should be allowed to decide how we want our internal APIs to behave with regard to this concept.

Skia inverted path types are no longer allowed in DlPath and all use of them should be eliminated in the engine (except to test if they crash when used in a debug unit test)

A couple of unit tests for DlOpSpy and Impeller's interop package were migrated here along for the ride even though this PR was focused primarily on display_list/ unit tests.

@github-actions github-actions bot added engine flutter/engine repository. See also e: labels. e: impeller Impeller rendering backend issues and features requests labels Jan 10, 2025
@flar flar force-pushed the migrate-dl-unit-tests-dl-geometry branch from 43be635 to 6ff28ab Compare January 11, 2025 01:30
@flar flar marked this pull request as ready for review January 11, 2025 21:45
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 repository. See also e: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant