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] Skip mask blur with 0 sigma. #48457

Merged
merged 3 commits into from
Nov 28, 2023

Conversation

jonahwilliams
Copy link
Member

<0 sigma render incorrectly with wide gamut, but these shouldn't produce shadows at all as far as I can tell.

flutter/flutter#138842

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.

Weird, this should be accounted for in the blur. I'm not sure what's going on here.

@@ -202,6 +203,11 @@ bool Canvas::AttemptDrawBlurredRRect(const Rect& rect,
paint.mask_blur_descriptor->style != FilterContents::BlurStyle::kNormal) {
return false;
}
// A blur sigma that is close to zero should not result in any shadow.
if (paint.mask_blur_descriptor->sigma.sigma <= kEhCloseEnough &&
Copy link
Member

Choose a reason for hiding this comment

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

fabsf(paint.mask_blur_descriptor->sigma.sigma) <= kEhCloseEnough ?

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

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 28, 2023
// A blur sigma that is close to zero should not result in any shadow.
if (std::fabs(paint.mask_blur_descriptor->sigma.sigma) <= kEhCloseEnough) {
return true;
}
Copy link
Member

Choose a reason for hiding this comment

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

Could you add an early return to SolidRRectBlurContents too?

Because there's no guard against zero sigma, nothing is protecting us from div by zero in IPGaussian, so NaNs are probably propagating from the shader and getting mapped to a negative number on the float format we use for wide gamut.

Copy link
Member

Choose a reason for hiding this comment

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

(Sorry for the late red light, I just realized what's probably happening here.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea! Yes the nan issue, I remember it now. Thanks @bdero :)

@jonahwilliams jonahwilliams removed the autosubmit Merge PR when tree becomes green via auto submit App label Nov 28, 2023
@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 #48457 at sha 67fa2ba

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!

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 28, 2023
@auto-submit auto-submit bot merged commit 97ede15 into flutter:main Nov 28, 2023
25 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Nov 28, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Nov 28, 2023
…139168)

flutter/engine@fd3a33f...97ede15

2023-11-28 jonahwilliams@google.com [Impeller] Skip mask blur with 0 sigma. (flutter/engine#48457)
2023-11-28 jonahwilliams@google.com [Impeller] match sigma scaling to Skia scaling. (flutter/engine#48434)

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
@jonahwilliams jonahwilliams deleted the no_zero_sigma_elevatin branch November 28, 2023 21:40
jonahwilliams added a commit to jonahwilliams/engine that referenced this pull request Nov 28, 2023
<0 sigma render incorrectly with wide gamut, but these shouldn't produce shadows at all as far as I can tell.

flutter/flutter#138842
auto-submit bot pushed a commit that referenced this pull request Dec 5, 2023
<0 sigma render incorrectly with wide gamut, but these shouldn't produce shadows at all as far as I can tell.

flutter/flutter#138842
caseycrogers pushed a commit to caseycrogers/flutter that referenced this pull request Dec 29, 2023
…lutter#139168)

flutter/engine@fd3a33f...97ede15

2023-11-28 jonahwilliams@google.com [Impeller] Skip mask blur with 0 sigma. (flutter/engine#48457)
2023-11-28 jonahwilliams@google.com [Impeller] match sigma scaling to Skia scaling. (flutter/engine#48434)

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 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 will affect goldens
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants