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 Oct 5, 2023

Resolves flutter/flutter#135916.

Big credits to @gaaclarke for the repros and investigation around this.

Moves back to tracking clip coverage per-pass when not collapsing. This is especially important for SaveLayers with MatrixImageFilters, which can transform the rendered layer texture and thereby move elements inside or outside of existing parent clips.

This should have little to no performance impact, since we should already be generating correct minimal subpass textures based on correct subpass coverage computation.

Before:
Screenshot 2023-10-05 at 1 25 29 PM

Screen.Recording.2023-10-05.at.1.34.35.PM.mov

After:
Screenshot 2023-10-05 at 1 24 17 PM

Screen.Recording.2023-10-05.at.1.36.05.PM.mov

@bdero bdero self-assigned this Oct 5, 2023

// Start non-collapsed subpasses with a fresh clip coverage stack limited by
// the subpass coverage. This is important because image filters applied to
// save layers may transform the subpass texture after its rendered, causing
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
// save layers may transform the subpass texture after its rendered, causing
// save layers may transform the subpass texture after it's rendered, causing

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. 👍

@flutter-dashboard
Copy link

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.

Changes reported for pull request #46597 at sha 993e850

@gaaclarke
Copy link
Member

Oh man, you ran into flutter/flutter#135511. You are going to have to change the color of your circle so the golden test passes.

@gaaclarke
Copy link
Member

I double checked this against flutter/flutter#126583 and it doesn't address this that issue. That makes this the 2nd bug we've found and fixed in service of fixing that bug haha.

@bdero
Copy link
Member Author

bdero commented Oct 5, 2023

Changed the color of the circle and added a scaling version. :)

@bdero bdero requested a review from gaaclarke October 5, 2023 22:02
Copy link
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

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

Code and tests LGTM. I would like to see us document coordinate systems in our docstrings. I found this code frustrating to work with because I didn't know what should be accounted for where.


//----------------------------------------------------------------------------
/// @brief Get the coverage of an unfiltered subpass.
/// @brief Computes the coverage of a given subpass. This is used to
Copy link
Member

Choose a reason for hiding this comment

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

Can you please include the coordinate space of the returned rect? I think it should be relative to it's parent subpass in pixels?

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.

I think it should be relative to it's parent subpass in pixels?

Actually, the output is in screen space. :)

After writing #46524 (comment), I also decided to do another iteration on the GetCoverage docstrings.

Copy link
Member

Choose a reason for hiding this comment

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

Thank you! 🙏

@flutter-dashboard
Copy link

Golden file changes are available for triage from new commit, Click here to view.

Changes reported for pull request #46597 at sha d09eba1


//----------------------------------------------------------------------------
/// @brief Get the coverage of an unfiltered subpass.
/// @brief Computes the coverage of a given subpass. This is used to
Copy link
Member

Choose a reason for hiding this comment

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

Thank you! 🙏

@gaaclarke gaaclarke added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 6, 2023
@auto-submit auto-submit bot merged commit 1bb228d into flutter:main Oct 6, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 6, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 6, 2023
jason-simmons added a commit to jason-simmons/flutter_engine that referenced this pull request Oct 13, 2023
…acks

flutter#46597 creates a new clip coverage
stack for each subpass.  This PR updates some clip coverage operations
and assertions in EntityPass::OnRender to reflect that the current
clip coverage stack only contains the range of depths within the
current subpass.
auto-submit bot pushed a commit that referenced this pull request Oct 16, 2023
…acks (#46912)

#46597 creates a new clip coverage stack for each subpass.  This PR updates some clip coverage operations and assertions in EntityPass::OnRender to reflect that the current clip coverage stack only contains the range of depths within the current subpass.
harryterkelsen pushed a commit that referenced this pull request Oct 23, 2023
Resolves flutter/flutter#135916.

Big credits to @gaaclarke for the repros and investigation around this.

Moves back to tracking clip coverage per-pass when not collapsing. This is especially important for SaveLayers with MatrixImageFilters, which can transform the rendered layer texture and thereby move elements inside or outside of existing parent clips.

This should have little to no performance impact, since we should already be generating correct minimal subpass textures based on correct subpass coverage computation.

Before:
<img width="679" alt="Screenshot 2023-10-05 at 1 25 29 PM" src="https://github.com/flutter/engine/assets/919017/fe63808a-6353-4969-8225-120fd5ee0949">

https://github.com/flutter/engine/assets/919017/9284f055-bee1-40cd-8b7e-f478b00d01da

After:
<img width="679" alt="Screenshot 2023-10-05 at 1 24 17 PM" src="https://github.com/flutter/engine/assets/919017/066b1e25-9611-4e14-a383-cc3a866dbe36">

https://github.com/flutter/engine/assets/919017/0fbd1f96-8920-472c-bb0e-4414187fc72d
harryterkelsen pushed a commit that referenced this pull request Oct 23, 2023
…acks (#46912)

#46597 creates a new clip coverage stack for each subpass.  This PR updates some clip coverage operations and assertions in EntityPass::OnRender to reflect that the current clip coverage stack only contains the range of depths within the current subpass.
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 will affect goldens

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

[Impeller] Image drawn with MatrixImageFilter draws nothing at particular coordinates.

2 participants