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

Conversation

@harryterkelsen
Copy link
Contributor

@harryterkelsen harryterkelsen commented Oct 25, 2023

Optimize overlays by detecting when Flutter-rendered content intersects with platform views. Overlay canvases are only needed when the content intersects, so by checking for this, we can optimize out most overlays.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or the PR is test-exempt. See testing the engine for instructions on writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

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 or stuartmorgan on the #hackers channel in Chat (don't just cc them here, they won't see it! Use 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.

@github-actions github-actions bot added the platform-web Code specifically for the web engine label Oct 25, 2023
@flutter-dashboard
Copy link

This pull request executed golden file tests, but it has not been updated in a while (20+ days). Test results from Gold expire after as many days, so this pull request will need to be updated with a fresh commit in order to get results from Gold.

Copy link
Contributor

@eyebrowsoffire eyebrowsoffire left a comment

Choose a reason for hiding this comment

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

Mostly looks good, but I had a question about some of the matrix math when calculating the platform view bounds.

@harryterkelsen
Copy link
Contributor Author

Thanks for the reviews! PTAL

Copy link
Contributor

@eyebrowsoffire eyebrowsoffire left a comment

Choose a reason for hiding this comment

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

LGTM! (Suggested a small fix for the analyzer)

@harryterkelsen harryterkelsen merged commit de8d9ee into flutter:main Mar 8, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Mar 9, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Mar 9, 2024
…144862)

flutter/engine@953927e...7541e90

2024-03-08 [email protected] [Impeller] implement mask blur for textures (flutter/engine#51183)
2024-03-08 [email protected] Don't rely on dart binary on PATH in run_test.py (flutter/engine#51302)
2024-03-08 [email protected] Mark the Flutter Views as focusable by setting a tabindex value. (flutter/engine#50876)
2024-03-08 [email protected] Update the instructions for updating licenses. (flutter/engine#51297)
2024-03-08 [email protected] Optimize overlays in CanvasKit (flutter/engine#47317)
2024-03-08 [email protected] Roll Fuchsia Linux SDK from 5Ra_AjCji-uR1GaX7... to lAV5jgp4796siOZgI... (flutter/engine#51296)
2024-03-08 [email protected] [Impeller] Add the KHR prefix to existing swapchain utilities. (flutter/engine#51295)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from 5Ra_AjCji-uR to lAV5jgp4796s

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] 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://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
@eyebrowsoffire
Copy link
Contributor

Awesome! That is absolutely intended by this change. Excellent to see the perf improvements!

harryterkelsen added a commit that referenced this pull request Mar 15, 2024
There is a bug in CanvasKit where a backdrop filter with a platform view
as a child will cause the backdrop filter to apply multiple times. This
change fixes it by only applying the backdrop filter once.

The bug case is more likely to happen since
#47317 landed because when we
encounter an invisible platform view, we always create a new SkPicture
instead of continuing to use the same SkPicture.

BEFORE:

![canvaskit_backdropfilter_with_platformview_BAD](https://github.com/flutter/engine/assets/1961493/c1fa766f-ebf7-4468-9ea7-8ab0d51314c7)

AFTER:

![canvaskit_backdropfilter_with_platformview](https://github.com/flutter/engine/assets/1961493/57d27d62-ee49-43a2-af3f-e532aaba0ffb)


## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide] and the [C++,
Objective-C, Java style guides].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I added new tests to check the change I am making or feature I am
adding, or the PR is [test-exempt]. See [testing the engine] for
instructions on writing and running engine tests.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I signed the [CLA].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[C++, Objective-C, Java style guides]:
https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
[testing the engine]:
https://github.com/flutter/flutter/wiki/Testing-the-engine
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

platform-web Code specifically for the web engine

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants