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

Conversation

@jonahwilliams
Copy link
Contributor

Fixes flutter/flutter#124175

Converts most filter entities to return an anon contents instead of an entity from a snapshot. This avoids potentially large texture fills and should make rendering this filters marginally more efficient.

The general technique I've used here and in #40927 is to entirely ignore the snapshot uvs and instead just use the exact coordinates. This seems to always be correct, where the snapshot uvs can change based on whether we are applying this to an entity pass or to an individual contents.

The shaders needed to be updated to support taking positions separate from texture coordinates as well.

In a future patch, we could simplify these by making most filters use the same vertex shader.

@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 on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on 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.

@jonahwilliams
Copy link
Contributor Author

Border mask blur is a little funky right now, still working on it.

@jonahwilliams
Copy link
Contributor Author

ahh, I think the issue was actually the blend mode? changing to SrcOver makes it render as expected.

@jonahwilliams
Copy link
Contributor Author

I suppose the question is - in general - do I need to change all of the Src blend modes to be SrcOver to correctly render into parents? I think for the filters I was only looking at cases where the filtered contents were already fully opaque, but maybe I'm overthinking it

@jonahwilliams jonahwilliams requested a review from bdero April 6, 2023 21:58
@jonahwilliams
Copy link
Contributor Author

Will incorporate changes from blend filter PR

Copy link
Contributor Author

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

Reverted changes to morphology filter, since I forgot it was a 2-stage filter like gaussian blur which needs a slightly different approach

Copy link
Member

@bdero bdero left a comment

Choose a reason for hiding this comment

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

LGTM

@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 #40973 at sha bd44442

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Apr 11, 2023
@auto-submit auto-submit bot merged commit a93118c into flutter:main Apr 11, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Apr 11, 2023
zhongwuzw pushed a commit to zhongwuzw/engine that referenced this pull request Apr 14, 2023
…ses (flutter#40973)

[Impeller] convert most filters to utilize entities instead of subpasses
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 needs tests will affect goldens

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

[Impeller] Image/Color filters should return an Entity and not a Snapshot

3 participants