-
Notifications
You must be signed in to change notification settings - Fork 6k
Use "blur_sigma" instead of "blur_radius" in Shadow. #25760
Conversation
|
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. 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. |
|
This PR is modifying some of the code in the imported third party libraries so I think @jason-simmons should be looking at this and considering the import status of the code in whether these changes will make tracking the third party code harder in the long run. Also, at least one of the data members still uses the old "radius" naming even though it is holding a "sigma" value. Should it be changed to Sigma as well? |
|
LGTM The code in However, the SkParagraph SkParagraph should be updated similarly to this PR. But that will need to happen separately in the Skia sources. |
|
Would it make sense to file a Skia bug about that and then a "follow-on" Flutter bug to fix the naming in this code when that gets addressed? |
|
Sent a PR to update SkParagraph: https://skia-review.googlesource.com/c/skia/+/401496 |
|
The change to update SkParagraph and the engine to use This PR will need to be rebased on top of the latest engine. |
5dfda33 to
9444b0a
Compare
| if (!offset.isZero()) | ||
| return true; | ||
| if (blur_radius != 0.0) | ||
| if (blur_sigma != 0.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have an issue here. A 0 radius does not convert into a 0 sigma, so the test for 0 no longer works.
One thing I notice is that the dart conversion function used above says that it is based on the Skia version and provides a link to the Skia conversion code. If you take a look at the Skia equations, they make sure that a radius of 0 produces a sigma of 0 and that a sigma of less than 0.5 produces a radius of 0.
The net effect should be that we might want to update our Dart conversion function to match the 0 => 0 behavior of the Skia function and to change this test to blur_sigma <= 0.5?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sence, thanks! the test should be "blur_sigma > 0.5" which means it is a valid value. right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, > 0.5 means it will do something. I got that backwards.
|
@flar I didn't figure out why the "Linux Android AOT Engine" failed. Seems I don't have the privilege to re-trigger it, could you please give a help? Thanks. |
flar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
The test failure can be resolve by rebasing the fix to the top of tree. |
This is a bug-fix. The Skia 'SkMaskFilter::MakeBlur()' interface expects a 'blur_sigma' value but currently we pass it a 'radius'.
|
This will merge when the tree goes green. Thanks! |
* aac3658 Roll Skia from 14efdd3d50db to 3010f3d79193 (4 revisions) (flutter/engine#25857) * f45f52f Move path part files to libraries (flutter/engine#25842) * d96669f Roll Skia from 3010f3d79193 to 5276ba274b38 (1 revision) (flutter/engine#25859) * 43994ab Use "blur_sigma" instead of "blur_radius" in Shadow. (flutter/engine#25760) * 74ac010 Roll Dart SDK from 1e3e5efcd47e to 6397e8b91103 (18 revisions) (flutter/engine#25861) * d462cfd Remove flake inducing timeouts (flutter/engine#25847) * 258f63a Roll Skia from 5276ba274b38 to 31fddc376993 (14 revisions) (flutter/engine#25862) * 1bf01a1 fuchsia: Reliably forward View insets (flutter/engine#25381) * 2740062 Roll Skia from 31fddc376993 to 097263bb5089 (1 revision) (flutter/engine#25865) * 4aae6b3 Roll Dart SDK from 6397e8b91103 to ee8eb0a65efa (1 revision) (flutter/engine#25869) * d1f31c7 Roll Skia from 097263bb5089 to 5dfb3f40684b (1 revision) (flutter/engine#25870) * 428ef10 deflake (flutter/engine#25864) * 01b9db8 Roll Dart SDK from ee8eb0a65efa to 8c109a734bdc (1 revision) (flutter/engine#25872) * e623c09 Roll Dart SDK from 8c109a734bdc to b98a1eec5eb5 (1 revision) (flutter/engine#25873) * 7ce6226 Roll Dart SDK from b98a1eec5eb5 to 6ecae204598d (1 revision) (flutter/engine#25874) * 554c24c Roll Skia from 5dfb3f40684b to 5c95bcb48b9b (1 revision) (flutter/engine#25876) * 03bd2e3 Roll Dart SDK from 6ecae204598d to 3cc6cdab8eaf (2 revisions) (flutter/engine#25877) * 53fdd89 Roll Skia from 5c95bcb48b9b to c779d432f336 (1 revision) (flutter/engine#25880) * 98ee65b Roll Skia from c779d432f336 to ff8b52df55ff (2 revisions) (flutter/engine#25881) * d84caa7 Roll Dart SDK from 3cc6cdab8eaf to b8f4018535fa (2 revisions) (flutter/engine#25885) * 156760e Roll Skia from ff8b52df55ff to ec79349bad50 (1 revision) (flutter/engine#25886) * 23cd8e5 Revert the Dart SDK to 1e3e5efcd47edeb7ae5a69e146c8ea0559305a98 (flutter/engine#25887) * 578449f Fix crash when both FlutterFragmentActivity and FlutterFragment are destroyed and recreated (flutter/engine#25851)
This is a bug-fix. (flutter/flutter#81145)
issue: #81145
The Skia 'SkMaskFilter::MakeBlur()' interface expects a 'blur_sigma'
value but currently we pass it a 'radius'.
The skt::TextShadow class also direcly passes its |fBlurRadius|
directly to SkMaskFilter::MakeBlur() without converting it to a
'blur_sigma', which makes the |fBlurRadius| member actually means
"blur_sigma" instead of "blur_radius".
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.