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

Conversation

gaaclarke
Copy link
Member

@gaaclarke gaaclarke commented Nov 27, 2023

fixes flutter/flutter#139085

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.

@gaaclarke gaaclarke marked this pull request as ready for review November 27, 2023 23:37

std::shared_ptr<Texture> texture = MakeTexture(desc);
auto texture_contents = std::make_shared<TextureContents>();
texture_contents->SetSourceRect(Rect::MakeSize(texture->GetSize()));
Copy link
Member Author

Choose a reason for hiding this comment

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

@bdero is this something I have to worry about? I don't think your tester has a way of modifying this.

Copy link
Member

Choose a reason for hiding this comment

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

Having a smaller source rect will result in the snapshot performing a subpass instead of just passing through the texture, but the snapshot will look otherwise very similar as far as the blur is concerned.

Comment on lines 299 to 302
EXPECT_TRUE(RectNear(result_coverage.value(),
Rect::MakeLTRB(49.f, 39.f, 151.f, 141.f)));
EXPECT_TRUE(RectNear(contents_coverage.value(),
Rect::MakeLTRB(98.f, 78.f, 302.f, 282.f)));
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure why this is correct, this matches our existing behavior. I'm guessing because one is relative to the subpass @bdero ?

Copy link
Member

Choose a reason for hiding this comment

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

(This turned out to be an ordering issue in the test)

@jonahwilliams
Copy link
Contributor

Woot! Taking a look.

@jonahwilliams
Copy link
Contributor

I can confirm that the text shadow backgrounds are showing up correctly now!

I don't know that these next issues are specific to this PR so feel free to land and move on:

I am noticing two specific artifacts: when resizing the blur the shakes are back. This can be seen in wonderous on the timeline view. I pulled up the downsampled texture and it looks pretty chunk in a way that might explain the banding, I could be wrong but with linear sampling I'd expect smoother edges. maybe this is due to missing mip maps?

8C83E8F5-62BB-487D-8A89-B62529D99290

Second issue is that the blur doesn't go all the way to the edge in flutter/flutter#132735 (comment) . Maybe the halo stuff is incorrect, or the returned snapshot transform needs to align top left to the start of the blur and not the halo? (I'm not sure what the halo is).

Skia

C0387F2A-94E1-46DF-A5A7-53260AE3F869

Impeller

82691619-8F3A-4500-99F1-D05E23E1B933

Copy link
Contributor

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

LGTM

@jonahwilliams
Copy link
Contributor

Or maybe the issue isn't mip levels, its just that we need to clamp the blur to be less agressive at downscaling (sigma 4 minimum like Skia)

@gaaclarke
Copy link
Member Author

I could be wrong but with linear sampling I'd expect smoother edges. maybe this is due to missing mip maps?

I think that may just be our aggressive downsampling. We might want to ease up on that.

I'll start playing around with wonderous now that it seems like we got the easy stuff done.

@jonahwilliams
Copy link
Contributor

I think you're right. It looks like we scale down our blur radius so its about 4. something. Skia will scale down the sigma to 4 something, but that corresponds to a radius of roughly ~6ish I think

@jonahwilliams
Copy link
Contributor

another possibility is that we need to use linear everywhere

@gaaclarke gaaclarke merged commit 4168cf7 into flutter:main Nov 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 28, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 28, 2023
fluttermirroringbot pushed a commit to flutter/flutter that referenced this pull request Nov 28, 2023
…139163)

flutter/engine@d375d5b...fd3a33f

2023-11-28 skia-flutter-autoroll@skia.org Roll Skia from 8752700a2565 to f07025afd712 (1 revision) (flutter/engine#48462)
2023-11-28 30870216+gaaclarke@users.noreply.github.com [Impeller] implements incorporating the gaussian blur snapshot transform (flutter/engine#48426)

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 matanl@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
caseycrogers pushed a commit to caseycrogers/flutter that referenced this pull request Dec 29, 2023
…lutter#139163)

flutter/engine@d375d5b...fd3a33f

2023-11-28 skia-flutter-autoroll@skia.org Roll Skia from 8752700a2565 to f07025afd712 (1 revision) (flutter/engine#48462)
2023-11-28 30870216+gaaclarke@users.noreply.github.com [Impeller] implements incorporating the gaussian blur snapshot transform (flutter/engine#48426)

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 matanl@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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

[Impeller] Gaussian blur should respect the snapshot transform

3 participants