|
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 |
|
15 | | -extern float fudge; |
16 | | - |
17 | 16 | namespace impeller { |
18 | 17 |
|
19 | 18 | /// A color matrix which inverts colors. |
@@ -126,12 +125,15 @@ std::shared_ptr<Contents> Paint::WithColorFilter( |
126 | 125 | std::shared_ptr<FilterContents> Paint::MaskBlurDescriptor::CreateMaskBlur( |
127 | 126 | std::shared_ptr<TextureContents> texture_contents, |
128 | 127 | const std::shared_ptr<ColorFilter>& color_filter) const { |
| 128 | + Scalar expand_amount = GaussianBlurFilterContents::CalculateBlurRadius( |
| 129 | + GaussianBlurFilterContents::ScaleSigma(sigma.sigma)); |
129 | 130 | texture_contents->SetSourceRect( |
130 | | - texture_contents->GetSourceRect().Expand(fudge, fudge)); |
| 131 | + texture_contents->GetSourceRect().Expand(expand_amount, expand_amount)); |
131 | 132 | auto mask = std::make_shared<SolidColorContents>(); |
132 | 133 | mask->SetColor(Color::White()); |
133 | 134 | std::optional<Rect> coverage = texture_contents->GetCoverage({}); |
134 | | - texture_contents->SetDestinationRect(coverage.value().Expand(fudge, fudge)); |
| 135 | + texture_contents->SetDestinationRect( |
| 136 | + coverage.value().Expand(expand_amount, expand_amount)); |
135 | 137 | auto descriptor = texture_contents->GetSamplerDescriptor(); |
136 | 138 | texture_contents->SetSamplerDescriptor(descriptor); |
137 | 139 | std::shared_ptr<Geometry> geometry = Geometry::MakeRect(coverage.value()); |
|
0 commit comments