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

Conversation

@bdero
Copy link
Member

@bdero bdero commented Jul 24, 2023

Resolves flutter/flutter#131100

  • Skip rect clips that we know won't further restrict the clip shape.
  • Don't append clips to enforce subpass bounds. We currently don't collapse passes when subpass clips are added anyhow, so just a restriction to subpass collapsing in order to keep the current behavior intact.
  • Small refactor to reduce confusion: Just place the subpass bounds limit into EntityPass itself instead of the delegate.

Built on #43946 (because iOS currently fails validation without it).

Gallery home screen before/after:

compare

@bdero bdero self-assigned this Jul 24, 2023
@flutter-dashboard

This comment was marked as outdated.

@bdero bdero force-pushed the bdero/elide-noop-clips branch 2 times, most recently from b79516d to 766d36b Compare July 24, 2023 08:28
Comment on lines 288 to 292
auto transformed_rect =
rect.TransformBounds(xformation_stack_.back().xformation);
if (transformed_rect.Contains(*cull_rect)) {
return; // This clip will do nothing, so skip it.
}
Copy link
Contributor

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 😆 )

Copy link
Member Author

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);
Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@bdero bdero force-pushed the bdero/elide-noop-clips branch from 046defd to ef2de50 Compare July 24, 2023 19:08
/// it.
void SetBoundsLimit(std::optional<Rect> bounds_limit);

/// @brief Set the bounds limit, which is provided by the user when creating
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// @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

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

@@ -1,4 +1,5 @@
// Copyright 2013 The Flutter Authors. All rights reserved.
// Copyright 2013 The Flutter Authors. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Copyright 2013 The Flutter Authors. All rights reserved.

Copy link
Member Author

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,
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, done.

Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

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

LGTM with nits

@bdero bdero added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 24, 2023
@auto-submit
Copy link
Contributor

auto-submit bot commented Jul 24, 2023

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.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 24, 2023
@bdero bdero added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 24, 2023
@auto-submit auto-submit bot merged commit 410838b into flutter:main Jul 25, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 25, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jul 25, 2023
…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
LouiseHsu pushed a commit to LouiseHsu/flutter that referenced this pull request Jul 31, 2023
…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
vashworth pushed a commit to vashworth/flutter that referenced this pull request Aug 2, 2023
…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
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

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

[Impeller] fullscreen clips can de-opt clear color optimization.

4 participants