|
9 | 9 | #include "impeller/entity/contents/color_source_contents.h" |
10 | 10 | #include "impeller/entity/contents/filters/color_filter_contents.h" |
11 | 11 | #include "impeller/entity/contents/filters/filter_contents.h" |
| 12 | +#include "impeller/entity/contents/filters/gaussian_blur_filter_contents.h" |
12 | 13 | #include "impeller/entity/contents/solid_color_contents.h" |
13 | 14 | #include "impeller/entity/geometry/geometry.h" |
14 | 15 |
|
@@ -126,12 +127,15 @@ std::shared_ptr<Contents> Paint::WithColorFilter( |
126 | 127 | std::shared_ptr<FilterContents> Paint::MaskBlurDescriptor::CreateMaskBlur( |
127 | 128 | std::shared_ptr<TextureContents> texture_contents, |
128 | 129 | const std::shared_ptr<ColorFilter>& color_filter) const { |
| 130 | + Scalar expand_amount = GaussianBlurFilterContents::CalculateBlurRadius( |
| 131 | + GaussianBlurFilterContents::ScaleSigma(sigma.sigma)); |
129 | 132 | texture_contents->SetSourceRect( |
130 | | - texture_contents->GetSourceRect().Expand(fudge, fudge)); |
| 133 | + texture_contents->GetSourceRect().Expand(expand_amount, expand_amount)); |
131 | 134 | auto mask = std::make_shared<SolidColorContents>(); |
132 | 135 | mask->SetColor(Color::White()); |
133 | 136 | std::optional<Rect> coverage = texture_contents->GetCoverage({}); |
134 | | - texture_contents->SetDestinationRect(coverage.value().Expand(fudge, fudge)); |
| 137 | + texture_contents->SetDestinationRect( |
| 138 | + coverage.value().Expand(expand_amount, expand_amount)); |
135 | 139 | auto descriptor = texture_contents->GetSamplerDescriptor(); |
136 | 140 | texture_contents->SetSamplerDescriptor(descriptor); |
137 | 141 | std::shared_ptr<Geometry> geometry = Geometry::MakeRect(coverage.value()); |
|
0 commit comments