-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Skip rect clips that do nothing. #43948
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
b79516d to
766d36b
Compare
impeller/aiks/canvas.cc
Outdated
| auto transformed_rect = | ||
| rect.TransformBounds(xformation_stack_.back().xformation); | ||
| if (transformed_rect.Contains(*cull_rect)) { | ||
| return; // This clip will do nothing, so skip it. | ||
| } |
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.
This is basically the same as Geometry::CoversArea right? If we use that method instead, then I imagine we could also handle ClipRRects. To do that we could give FilledPathGeometry an optional inner_rect parameter to do the computation (and false if not present)
That would handle the case where a rrect material is scrolled to entirely cover the screen.
I had a similar idea here: jonahwilliams@e3deb28
(Though some of the cullrect math is wrong, its right in your PR though 😆 )
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.
Nice, I like this approach for RRects. Added this in and switched to leaning on Geometry::CoversArea.
|
|
||
| void SetDelegate(std::unique_ptr<EntityPassDelegate> delgate); | ||
|
|
||
| void SetBoundsLimit(std::optional<Rect> bounds_limit); |
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.
This should have a docstring. In other comments you've added in this PR mention "absorbed clips". We should mention that this what we are talking about.
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.
046defd to
ef2de50
Compare
impeller/entity/entity_pass.h
Outdated
| /// it. | ||
| void SetBoundsLimit(std::optional<Rect> bounds_limit); | ||
|
|
||
| /// @brief Set the bounds limit, which is provided by the user when creating |
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.
| /// @brief Set the bounds limit, which is provided by the user when creating | |
| /// @brief Get the bounds limit, which is provided by the user when creating |
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.
Fixed.
impeller/entity/geometry/geometry.h
Outdated
| @@ -1,4 +1,5 @@ | |||
| // Copyright 2013 The Flutter Authors. All rights reserved. | |||
| // Copyright 2013 The Flutter Authors. All rights reserved. | |||
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.
| // Copyright 2013 The Flutter Authors. All rights reserved. |
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.
Fixed.
| return path_.GetTransformedBoundingBox(transform); | ||
| } | ||
|
|
||
| bool FillPathGeometry::CoversArea(const Matrix& transform, |
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.
I would add a few sanity unit tests that cover the rrect cases, i.e. large rect, empty rect, et cetera.
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.
Good idea, done.
jonahwilliams
left a comment
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 with nits
|
auto label is removed for flutter/engine, pr: 43948, due to - The status or check suite Mac mac_clang_tidy has failed. Please fix the issues identified (or deflake) before re-applying this label. |
…131230) flutter/engine@ceb2674...9a0192d 2023-07-25 [email protected] Roll Fuchsia Mac SDK from hUgYN9tEps515M1lg... to DO73K2Twew-a51xHm... (flutter/engine#43981) 2023-07-25 [email protected] Roll Skia from 4554d1b35b6e to e99aea2cffef (2 revisions) (flutter/engine#43980) 2023-07-25 [email protected] [Impeller] Skip rect clips that do nothing. (flutter/engine#43948) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from hUgYN9tEps51 to DO73K2Twew-a 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 [email protected],[email protected],[email protected] 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#131230) flutter/engine@ceb2674...9a0192d 2023-07-25 [email protected] Roll Fuchsia Mac SDK from hUgYN9tEps515M1lg... to DO73K2Twew-a51xHm... (flutter/engine#43981) 2023-07-25 [email protected] Roll Skia from 4554d1b35b6e to e99aea2cffef (2 revisions) (flutter/engine#43980) 2023-07-25 [email protected] [Impeller] Skip rect clips that do nothing. (flutter/engine#43948) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from hUgYN9tEps51 to DO73K2Twew-a 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 [email protected],[email protected],[email protected] 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#131230) flutter/engine@ceb2674...9a0192d 2023-07-25 [email protected] Roll Fuchsia Mac SDK from hUgYN9tEps515M1lg... to DO73K2Twew-a51xHm... (flutter/engine#43981) 2023-07-25 [email protected] Roll Skia from 4554d1b35b6e to e99aea2cffef (2 revisions) (flutter/engine#43980) 2023-07-25 [email protected] [Impeller] Skip rect clips that do nothing. (flutter/engine#43948) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from hUgYN9tEps51 to DO73K2Twew-a 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 [email protected],[email protected],[email protected] 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Resolves flutter/flutter#131100
EntityPassitself instead of the delegate.Built on #43946 (because iOS currently fails validation without it).
Gallery home screen before/after: