Migrate DisplayList unit tests to DL/Impeller geometry classes #161453
+1,926
−1,882
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 anSkPath
or animpeller::Path
and it will auto-convert to the other as needed. This allows unit tests with custom paths to rely onimpeller::Path
for path construction instead ofSkPath
(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 andSkRRect
legacy behavior. This behavior was already being enforced inui.rrect
but the unit tests we have to verify the behavior are written against theRoundRect
object itself so this was the simplest way to make the unit tests work right, while ensuring that we maintain correct behavior forui
objects. Ideally these issues would be tested at theui
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 ondisplay_list/
unit tests.