Skip to content
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] Render Gaussian blurs into smaller textures and scale up with linear sampling #35491

Merged
merged 3 commits into from
Aug 19, 2022

Conversation

bdero
Copy link
Member

@bdero bdero commented Aug 18, 2022

This reduces blur cost by ~80% on the apps we're testing with virtually no difference in quality. We can still easily do a lot better than this -- I'm working on other improvements that I plan to land in follow-ups.

Screen.Recording.2022-08-18.at.2.28.37.AM.mov

@bdero bdero self-assigned this Aug 18, 2022
@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.

Comment on lines +229 to +234
return Snapshot{
.texture = out_texture,
.transform = texture_rotate.Invert() *
Matrix::MakeTranslation(pass_texture_rect.origin) *
Matrix::MakeScale(Vector2(1 / x_scale, 1)),
.sampler_descriptor = sampler_desc};
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems pretty testable to me. If it's currently difficult to unit test a RenderFilter I think we should land this without a test, but we should be able to write some tests against this...

Copy link
Member Author

Choose a reason for hiding this comment

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

Seems reasonable... is it possible to test private interfaces with gtest? I would prefer to keep these internals out of the public API.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added an issue to make this stuff testable flutter/flutter#109795

Copy link
Contributor

Choose a reason for hiding this comment

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

If you make the test fixture a friend you can. If this isn't the right spot to test maybe there's a public method somewhere in the chain we could test?

Copy link
Member Author

Choose a reason for hiding this comment

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

If this isn't the right spot to test maybe there's a public method somewhere in the chain we could test?

I think it makes sense to find a way to make this specific barrier testable (albeit this API will undergo more rewrites).

From an Entities API behavior testing perspective, the clear quantifiable/stable/portable barrier between the user's inputs and colors on the screen is the set of command buffers that Contents populate when they render. Once we have a good story for mocking the render layer, that'll probably be enough to cover most contents reasonably well. But filters are more complicated and we should definitely test behavior of the internal API to detect subtle breakages that will be hard to nail down through a command buffer predicate test.

@chinmaygarde
Copy link
Member

Looks like the linked patch has the autosubmit label but it blocked on the infra issues flutter/flutter#109797

@bdero bdero added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 18, 2022
@auto-submit auto-submit bot merged commit 5ccc5c4 into flutter:main Aug 19, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App e: impeller needs tests
Projects
No open projects
Archived in project
4 participants