Skip to content

SkMaskFilter::MakeBlur() expects a "blur_sigma", but Shadow class passes it a "blur_radius" #81145

@heke123

Description

@heke123

In the Shadow class, "blur_radius" are converted to "sigma" when creating a Paint object:

// (flutter/lib/ui/painting.dart)
 double get blurSigma => convertRadiusToSigma(blurRadius);

The "sigma" value will be passed to skia:

// (flutter/lib/ui/painting/paint.cc)
paint_.setMaskFilter(SkMaskFilter::MakeBlur(blur_style, sigma)); 

But, in Shadow::_encodeShadows() still use "radius" which leads to the native paragraph_txt.cc mistakenly use "radius"(it should pass a "sigma" to skia).

// (flutter/lib/ui/painting.dart)
shadowsData.setFloat32(_kBlurOffset + shadowOffset,
          shadow.blurRadius, _kFakeHostEndian);

// (paragraph_txt.cc)
      paint.setMaskFilter(SkMaskFilter::MakeBlur(
          kNormal_SkBlurStyle, text_shadow.blur_radius, false));

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listengineflutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-engineOwned by Engine teamtriaged-engineTriaged by Engine teamwaiting for PR to land (fixed)A fix is in flight

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions