Skip to content

Commit 34540e9

Browse files
authored
Remove BorderMaskBlur (flutter#194508)
Removes the BorderMaskBlur pipeline and associated shaders. This is created only in `CreateMaskBlur` when `is_solid_color=false`. The three argument `CreateMaskBlur` is only called in canvas.cc, and hardcodes `is_solid_color=true`. https://github.com/flutter/flutter/blob/669265bc0e5c37c71a9f355743ef0efa6776a01e/engine/src/flutter/impeller/display_list/canvas.cc#L2225 This shader looks like it was used in the olden days, but has been deadcode since 2024. Part of flutter#194511 ## Pre-launch Checklist - [ ] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [ ] I read the [AI contribution guidelines] and understand my responsibilities, or I am not using AI tools. - [ ] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [ ] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [ ] I signed the [CLA]. - [ ] I listed at least one issue that this PR fixes in the description above. - [ ] I updated/added relevant in-code documentation (doc comments with `///`). - [ ] If this PR introduces a new feature or capability, I created and linked a website documentation issue or PR in [flutter/website] (or verified none is needed). - [ ] I added new tests to check the change I am making, or this PR is [test-exempt]. - [ ] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [ ] All existing and new tests are passing.
1 parent eb5650e commit 34540e9

14 files changed

Lines changed: 12 additions & 596 deletions

File tree

‎engine/src/flutter/impeller/display_list/canvas.cc‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,8 +2224,7 @@ bool Canvas::AttemptBlurredTextOptimization(
22242224
// https://github.com/flutter/flutter/issues/133297
22252225
std::shared_ptr<FilterContents> filter =
22262226
paint.mask_blur_descriptor->CreateMaskBlur(
2227-
FilterInput::Make(text_contents),
2228-
/*is_solid_color=*/true, GetCurrentTransform());
2227+
FilterInput::Make(text_contents), GetCurrentTransform());
22292228

22302229
TextFrameFingerprint fingerprint = ComputeTextFrameFingerprint(*text_frame);
22312230
TextShadowCache::TextShadowCacheKey cache_key(

‎engine/src/flutter/impeller/display_list/paint.cc‎

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -309,16 +309,6 @@ std::shared_ptr<Contents> Paint::WithFiltersForSubpassTarget(
309309
return input;
310310
}
311311

312-
std::shared_ptr<Contents> Paint::WithMaskBlur(std::shared_ptr<Contents> input,
313-
bool is_solid_color,
314-
const Matrix& ctm) const {
315-
if (mask_blur_descriptor.has_value()) {
316-
input = mask_blur_descriptor->CreateMaskBlur(FilterInput::Make(input),
317-
is_solid_color, ctm);
318-
}
319-
return input;
320-
}
321-
322312
std::shared_ptr<FilterContents> Paint::WithImageFilter(
323313
ContentContext& renderer,
324314
const FilterInput::Variant& input,
@@ -461,20 +451,15 @@ std::shared_ptr<Contents> Paint::MaskBlurDescriptor::CreateMaskBlur(
461451

462452
std::shared_ptr<FilterContents> Paint::MaskBlurDescriptor::CreateMaskBlur(
463453
const FilterInput::Ref& input,
464-
bool is_solid_color,
465454
const Matrix& ctm) const {
466455
Vector2 blur_sigma(sigma.sigma, sigma.sigma);
467456
if (!respect_ctm) {
468457
blur_sigma /=
469458
Vector2(ctm.GetBasisX().GetLength(), ctm.GetBasisY().GetLength());
470459
}
471-
if (is_solid_color) {
472-
return FilterContents::MakeGaussianBlur(
473-
input, Sigma(blur_sigma.x), Sigma(blur_sigma.y),
474-
Entity::TileMode::kDecal, /*bounds=*/std::nullopt, style);
475-
}
476-
return FilterContents::MakeBorderMaskBlur(input, Sigma(blur_sigma.x),
477-
Sigma(blur_sigma.y), style);
460+
return FilterContents::MakeGaussianBlur(
461+
input, Sigma(blur_sigma.x), Sigma(blur_sigma.y), Entity::TileMode::kDecal,
462+
/*bounds=*/std::nullopt, style);
478463
}
479464

480465
bool Paint::HasColorFilter() const {

‎engine/src/flutter/impeller/display_list/paint.h‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ struct Paint {
3232
FilterInput::Ref,
3333
const Matrix& effect_transform,
3434
Entity::RenderingMode rendering_mode)>;
35-
using MaskFilterProc = std::function<std::shared_ptr<FilterContents>(
36-
FilterInput::Ref,
37-
bool is_solid_color,
38-
const Matrix& effect_transform)>;
3935
using ColorSourceProc = std::function<std::shared_ptr<ColorSourceContents>()>;
4036

4137
/// @brief Whether or not a save layer with the provided paint can perform the
@@ -65,7 +61,6 @@ struct Paint {
6561

6662
std::shared_ptr<FilterContents> CreateMaskBlur(
6763
const FilterInput::Ref& input,
68-
bool is_solid_color,
6964
const Matrix& ctm) const;
7065

7166
std::shared_ptr<Contents> CreateMaskBlur(
@@ -138,10 +133,6 @@ struct Paint {
138133
const Geometry* geometry,
139134
const std::optional<Matrix>& geometry_transform = std::nullopt) const;
140135

141-
std::shared_ptr<Contents> WithMaskBlur(std::shared_ptr<Contents> input,
142-
bool is_solid_color,
143-
const Matrix& ctm) const;
144-
145136
std::shared_ptr<FilterContents> WithImageFilter(
146137
ContentContext& renderer,
147138
const FilterInput::Variant& input,

‎engine/src/flutter/impeller/entity/BUILD.gn‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ impeller_shaders("entity_shaders") {
5555
"shaders/texture_fill_strict_src.frag",
5656
"shaders/blending/porter_duff_blend.frag",
5757
"shaders/blending/porter_duff_blend.vert",
58-
"shaders/filters/border_mask_blur.frag",
5958
"shaders/filters/color_matrix_color_filter.frag",
6059
"shaders/filters/filter_position.vert",
6160
"shaders/filters/filter_position_uv.vert",
@@ -137,8 +136,6 @@ impeller_component("entity") {
137136
"contents/contents.h",
138137
"contents/filters/blend_filter_contents.cc",
139138
"contents/filters/blend_filter_contents.h",
140-
"contents/filters/border_mask_blur_filter_contents.cc",
141-
"contents/filters/border_mask_blur_filter_contents.h",
142139
"contents/filters/color_filter_contents.cc",
143140
"contents/filters/color_filter_contents.h",
144141
"contents/filters/color_matrix_filter_contents.cc",

‎engine/src/flutter/impeller/entity/contents/content_context.cc‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ struct ContentContext::Pipelines {
231231
Variants<BlendSaturationPipeline> blend_saturation;
232232
Variants<BlendScreenPipeline> blend_screen;
233233
Variants<BlendSoftLightPipeline> blend_softlight;
234-
Variants<BorderMaskBlurPipeline> border_mask_blur;
235234
Variants<CirclePipeline> circle;
236235
Variants<ClipPipeline> clip;
237236
Variants<ColorMatrixColorFilterPipeline> color_matrix_color_filter;
@@ -721,8 +720,6 @@ ContentContext::ContentContext(
721720
{supports_decal});
722721
pipelines_->gaussian_blur.CreateDefault(
723722
*context_, options_no_msaa_no_depth_stencil, {supports_decal});
724-
pipelines_->border_mask_blur.CreateDefault(*context_,
725-
options_trianglestrip);
726723
pipelines_->color_matrix_color_filter.CreateDefault(*context_,
727724
options_trianglestrip);
728725
pipelines_->shadow_vertices_.CreateDefault(*context_, options);
@@ -1174,11 +1171,6 @@ PipelineRef ContentContext::GetGaussianBlurPipeline(
11741171
return GetPipeline(this, pipelines_->gaussian_blur, opts);
11751172
}
11761173

1177-
PipelineRef ContentContext::GetBorderMaskBlurPipeline(
1178-
ContentContextOptions opts) const {
1179-
return GetPipeline(this, pipelines_->border_mask_blur, opts);
1180-
}
1181-
11821174
PipelineRef ContentContext::GetMorphologyFilterPipeline(
11831175
ContentContextOptions opts) const {
11841176
return GetPipeline(this, pipelines_->morphology_filter, opts);

‎engine/src/flutter/impeller/entity/contents/content_context.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ class ContentContext {
149149
PipelineRef GetBlendSaturationPipeline(ContentContextOptions opts) const;
150150
PipelineRef GetBlendScreenPipeline(ContentContextOptions opts) const;
151151
PipelineRef GetBlendSoftLightPipeline(ContentContextOptions opts) const;
152-
PipelineRef GetBorderMaskBlurPipeline(ContentContextOptions opts) const;
153152
PipelineRef GetCirclePipeline(ContentContextOptions opts) const;
154153
PipelineRef GetClearBlendPipeline(ContentContextOptions opts) const;
155154
PipelineRef GetClipPipeline(ContentContextOptions opts) const;

‎engine/src/flutter/impeller/entity/contents/filters/border_mask_blur_filter_contents.cc‎

Lines changed: 0 additions & 174 deletions
This file was deleted.

‎engine/src/flutter/impeller/entity/contents/filters/border_mask_blur_filter_contents.h‎

Lines changed: 0 additions & 61 deletions
This file was deleted.

‎engine/src/flutter/impeller/entity/contents/filters/filter_contents.cc‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "flutter/fml/logging.h"
1616
#include "impeller/core/formats.h"
1717
#include "impeller/entity/contents/content_context.h"
18-
#include "impeller/entity/contents/filters/border_mask_blur_filter_contents.h"
1918
#include "impeller/entity/contents/filters/gaussian_blur_filter_contents.h"
2019
#include "impeller/entity/contents/filters/inputs/filter_input.h"
2120
#include "impeller/entity/contents/filters/local_matrix_filter_contents.h"
@@ -49,18 +48,6 @@ std::shared_ptr<FilterContents> FilterContents::MakeGaussianBlur(
4948
return blur;
5049
}
5150

52-
std::shared_ptr<FilterContents> FilterContents::MakeBorderMaskBlur(
53-
FilterInput::Ref input,
54-
Sigma sigma_x,
55-
Sigma sigma_y,
56-
BlurStyle blur_style) {
57-
auto filter = std::make_shared<BorderMaskBlurFilterContents>();
58-
filter->SetInputs({std::move(input)});
59-
filter->SetSigma(sigma_x, sigma_y);
60-
filter->SetBlurStyle(blur_style);
61-
return filter;
62-
}
63-
6451
std::shared_ptr<FilterContents> FilterContents::MakeDirectionalMorphology(
6552
FilterInput::Ref input,
6653
Radius radius,

0 commit comments

Comments
 (0)