Skia used to take a blur radius, which is defined thusly in the CSS standard:
"""
…for a long, straight shadow edge, this should create a color transition the length of the blur distance that is perpendicular to and centered on the shadow’s edge, and that ranges from the full shadow color at the radius endpoint inside the shadow to fully transparent at the endpoint outside it.
"""
Then Skia was changed to take sigma, and a conversion function was introduced as shown here[1]. However, using this conversion function creates a shadow with approximately twice the size it should have according to the CSS definition.
This conversion function was copied to ui/gfx/skia_utils.cc[2] where it is causing us to mis-apply blur in gfx::CreateShadowDrawLooper.
This conversion function was also semi-copied to Blink's SkiaUtils.h[3] but the constant was corrected to suit the CSS definition of blur radius.
I don't know if any code is actually using the conversion function that Skia provides but the skia_utils.cc version is causing bugs. Yet without investigating I can't be sure that the code that uses this isn't relying on those bugs. So for now I'm going to introduce a corrected version of gfx::CreateShadowDrawLooper and TODO the investigation/correction process of existing code.
[1] https://cs.chromium.org/chromium/src/third_party/skia/src/effects/SkBlurMask.cpp?rcl=1467126994&l=22
[2] https://cs.chromium.org/chromium/src/ui/gfx/skia_util.cc?rcl=0&l=135
[3] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/graphics/skia/SkiaUtils.h?rcl=0&l=114
Comment 1 by reed@google.com
, Jun 29 2016