-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Keep track of stencil coverage; don't render unused clips #35966
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
@@ -1433,7 +1433,7 @@ TEST_P(EntityTest, SolidFillShouldRenderIsCorrect) { | |||
{ | |||
auto fill = std::make_shared<SolidColorContents>(); | |||
fill->SetColor(Color::CornflowerBlue()); | |||
ASSERT_FALSE(fill->ShouldRender(Entity{}, {100, 100})); | |||
ASSERT_FALSE(fill->ShouldRender(Entity{}, Rect::MakeSize(Size{100, 100}))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a test or two for the new API?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Added test coverage for the new ShouldRender behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This should resolve flutter/flutter#110442.
Mainly, this gets rid of excess clips which don't make an on-screen difference.
I also wrote this change to stash the appended clip and lazily render it, but this stencil coverage diff alone is turning out to be enough.
WIP because I haven't thoroughly tested it against Wondrous and Gallery yet.