-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Impeller] Add FilterContents::GetSourceCoverage to enable filtered saveLayer clipping. #47183
[Impeller] Add FilterContents::GetSourceCoverage to enable filtered saveLayer clipping. #47183
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Sorry for the delay! Doing a lot of catchup today. At a glance this looks really great and I'm not spotting anything unexpected... Would you mind adding a quick golden to |
daf7d97
to
8fe2eca
Compare
One step closer, the culling of the saveLayer is fixed, but it now paints too much of the layer it creates to the screen. The layer size was expanded to collect source pixels for the filter, but the output needs to be clipped back to the SaveLayer bounds (if it had any). Also, the test case clearly shows that the DrawPaint inside of the SaveLayer is not rendering to the whole texture. |
8fe2eca
to
ae669cd
Compare
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. |
I seem to have gone down a route with the new method to pass along the Matrix being used, but that matrix is already installed in the filter being traversed earlier in the
I lean towards methods that carry along the data they need rather than modifying the objects to contain all of the data and having to update that frequently as it is removes temporary state from the objects, but it looks like the design of Impeller is including some of this state in the objects here and there. Not sure how to untangle this particular case. |
And I still need to look into those golden failures. |
Golden file changes are available for triage from new commit, Click here to view. |
I'm suddenly concerned about the new optional functions that I added to rect.h. There seems to be some disagreement about what a nullopt means for the coverage code. Sometimes it means "there is no restriction" and sometimes it means "there is no content" which are opposite interpretations. As a result, the interpretation these methods place on what a nullopt argument means might conflict with a given piece of code. I think we need to untangle that and come up with a single interpretation of nullopt for a rectangle. It should perhaps be "NaN", as in "there is no answer to your question", which can happen in a couple of places - but it should never equal "empty bounds" or "infinite bounds" - we have empty rectangles and (broken) infinite rectangles to handle those cases. |
384d7ca
to
c705e6a
Compare
Golden file changes are available for triage from new commit, Click here to view. |
Yeah I 100% agree w.r.t. the coverage conventions, added a bug around this suggesting a convention: flutter/flutter#137306 |
…filtered saveLayer clipping. (flutter/engine#47183)
…filtered saveLayer clipping. (flutter/engine#47183)
…filtered saveLayer clipping. (flutter/engine#47183)
…filtered saveLayer clipping. (flutter/engine#47183)
…filtered saveLayer clipping. (flutter/engine#47183)
…filtered saveLayer clipping. (flutter/engine#47183)
…filtered saveLayer clipping. (flutter/engine#47183)
…filtered saveLayer clipping. (flutter/engine#47183)
…filtered saveLayer clipping. (flutter/engine#47183)
…filtered saveLayer clipping. (flutter/engine#47183)
…filtered saveLayer clipping. (flutter/engine#47183)
…filtered saveLayer clipping. (flutter/engine#47183)
…sions) (#137422) Manual roll requested by zra@google.com flutter/engine@bedc49e...71e1a04 2023-10-27 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Manual roll Dart SDK from 360370ff93b0 to 18678a3eddb7 (9 revisions)" (flutter/engine#47380) 2023-10-27 skia-flutter-autoroll@skia.org Roll Skia from 0122c0e18d26 to fe9959acc5e0 (1 revision) (flutter/engine#47379) 2023-10-27 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from 1ngqKBnmTtmFM6aBD... to fw9lcUvz8S07_zaAj... (flutter/engine#47377) 2023-10-27 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 37VxdxlPfdkek7mwC... to gPQSfYJVLOgXjxQce... (flutter/engine#47375) 2023-10-27 skia-flutter-autoroll@skia.org Roll Skia from 22f5419438c4 to 0122c0e18d26 (1 revision) (flutter/engine#47373) 2023-10-27 skia-flutter-autoroll@skia.org Roll Skia from 5262cbff56b1 to 22f5419438c4 (1 revision) (flutter/engine#47372) 2023-10-27 skia-flutter-autoroll@skia.org Roll Skia from fe61b3467547 to 5262cbff56b1 (1 revision) (flutter/engine#47371) 2023-10-27 skia-flutter-autoroll@skia.org Roll Skia from fbdd7d97b26e to fe61b3467547 (1 revision) (flutter/engine#47370) 2023-10-27 skia-flutter-autoroll@skia.org Roll Skia from 2246f3473053 to fbdd7d97b26e (2 revisions) (flutter/engine#47369) 2023-10-27 skia-flutter-autoroll@skia.org Roll Skia from ec4c6b3a6690 to 2246f3473053 (1 revision) (flutter/engine#47366) 2023-10-27 flar@google.com [Impeller] Add FilterContents::GetSourceCoverage to enable filtered saveLayer clipping. (flutter/engine#47183) 2023-10-27 skia-flutter-autoroll@skia.org Roll Skia from bc8ca57868d2 to ec4c6b3a6690 (1 revision) (flutter/engine#47365) 2023-10-27 john@johnmccutchan.com Don't re-initialize the default RenderSurface when returning from hybrid composition mode (flutter/engine#47358) 2023-10-27 skia-flutter-autoroll@skia.org Manual roll Dart SDK from 360370ff93b0 to 18678a3eddb7 (9 revisions) (flutter/engine#47357) 2023-10-26 skia-flutter-autoroll@skia.org Roll Skia from 93a0ad4d7ca6 to bc8ca57868d2 (2 revisions) (flutter/engine#47359) 2023-10-26 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from YSn00b0Trsu2vdhIq... to 1ngqKBnmTtmFM6aBD... (flutter/engine#47363) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from 37VxdxlPfdke to gPQSfYJVLOgX fuchsia/sdk/core/mac-amd64 from YSn00b0Trsu2 to fw9lcUvz8S07 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 aaclarke@google.com,rmistry@google.com,zra@google.com 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
…filtered saveLayer clipping. (flutter/engine#47183)
…137429) flutter/engine@bedc49e...a198ad4 2023-10-27 jonahwilliams@google.com [Impeller] Add present wait latch. (flutter/engine#47311) 2023-10-27 zanderso@users.noreply.github.com Move rapidjson to flutter/third_party (flutter/engine#47354) 2023-10-27 jason-simmons@users.noreply.github.com [Impeller] Enable GLES MSAA only if the multisampled_render_to_texture2 extension is available (flutter/engine#47364) 2023-10-27 jason-simmons@users.noreply.github.com [Impeller] Fix leak of framebuffers used in GLES MSAA rendering (flutter/engine#47362) 2023-10-27 98614782+auto-submit[bot]@users.noreply.github.com Reverts "Manual roll Dart SDK from 360370ff93b0 to 18678a3eddb7 (9 revisions)" (flutter/engine#47380) 2023-10-27 skia-flutter-autoroll@skia.org Roll Skia from 0122c0e18d26 to fe9959acc5e0 (1 revision) (flutter/engine#47379) 2023-10-27 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from 1ngqKBnmTtmFM6aBD... to fw9lcUvz8S07_zaAj... (flutter/engine#47377) 2023-10-27 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from 37VxdxlPfdkek7mwC... to gPQSfYJVLOgXjxQce... (flutter/engine#47375) 2023-10-27 skia-flutter-autoroll@skia.org Roll Skia from 22f5419438c4 to 0122c0e18d26 (1 revision) (flutter/engine#47373) 2023-10-27 skia-flutter-autoroll@skia.org Roll Skia from 5262cbff56b1 to 22f5419438c4 (1 revision) (flutter/engine#47372) 2023-10-27 skia-flutter-autoroll@skia.org Roll Skia from fe61b3467547 to 5262cbff56b1 (1 revision) (flutter/engine#47371) 2023-10-27 skia-flutter-autoroll@skia.org Roll Skia from fbdd7d97b26e to fe61b3467547 (1 revision) (flutter/engine#47370) 2023-10-27 skia-flutter-autoroll@skia.org Roll Skia from 2246f3473053 to fbdd7d97b26e (2 revisions) (flutter/engine#47369) 2023-10-27 skia-flutter-autoroll@skia.org Roll Skia from ec4c6b3a6690 to 2246f3473053 (1 revision) (flutter/engine#47366) 2023-10-27 flar@google.com [Impeller] Add FilterContents::GetSourceCoverage to enable filtered saveLayer clipping. (flutter/engine#47183) 2023-10-27 skia-flutter-autoroll@skia.org Roll Skia from bc8ca57868d2 to ec4c6b3a6690 (1 revision) (flutter/engine#47365) 2023-10-27 john@johnmccutchan.com Don't re-initialize the default RenderSurface when returning from hybrid composition mode (flutter/engine#47358) 2023-10-27 skia-flutter-autoroll@skia.org Manual roll Dart SDK from 360370ff93b0 to 18678a3eddb7 (9 revisions) (flutter/engine#47357) 2023-10-26 skia-flutter-autoroll@skia.org Roll Skia from 93a0ad4d7ca6 to bc8ca57868d2 (2 revisions) (flutter/engine#47359) 2023-10-26 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from YSn00b0Trsu2vdhIq... to 1ngqKBnmTtmFM6aBD... (flutter/engine#47363) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from 37VxdxlPfdke to gPQSfYJVLOgX fuchsia/sdk/core/mac-amd64 from YSn00b0Trsu2 to fw9lcUvz8S07 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 aaclarke@google.com,rmistry@google.com,zra@google.com 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
The new method allows a caller to ask for the coverage of the input pixels required to produce an output that spans a given area. This allows the code to clip a saveLayer that has an image filter applied to it.