Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 9b716e0

Browse files
authored
Revert "[Impeller] Turned on new blur." (#49062)
Reverts #48472 This is causing memory crashes in the device lab: https://ci.chromium.org/ui/p/flutter/builders/prod/Mac_ios%20backdrop_filter_perf_ios__timeline_summary/14324/overview ``` [2023-12-14 15:55:20.660354] [STDOUT] stdout: [+1764 ms] Process 611 stopped [2023-12-14 15:55:20.662620] [STDOUT] stdout: [ +2 ms] * thread #12, name = 'io.flutter.1.raster', stop reason = EXC_RESOURCE (RESOURCE_TYPE_MEMORY: high watermark memory limit exceeded) (limit=2098 MB) [2023-12-14 15:55:20.662686] [STDOUT] stdout: [ ] frame #0: 0x0000000106705e78 Flutter`void std::_LIBCPP_ABI_NAMESPACE::allocator<impeller::Command>::construct[abi:v15000]<impeller::Command, impeller::Command>(impeller::Command*, impeller::Command&&) + 8 [2023-12-14 15:55:20.662784] [STDOUT] stdout: [ ] Flutter`std::_LIBCPP_ABI_NAMESPACE::allocator<impeller::Command>::construct[abi:v15000]<impeller::Command, impeller::Command>: [2023-12-14 15:55:20.662883] [STDOUT] stdout: [ ] -> 0x106705e78 <+8>: str x8, [x0] [2023-12-14 15:55:20.662932] [STDOUT] stdout: [ ] 0x106705e7c <+12>: ldr x8, [x1, #0x8] [2023-12-14 15:55:20.663033] [STDOUT] stdout: [ ] 0x106705e80 <+16>: str x8, [x0, #0x8] [2023-12-14 15:55:20.663097] [STDOUT] stdout: [ ] 0x106705e84 <+20>: ldr x8, [x1, #0x10] [2023-12-14 15:55:20.663194] [STDOUT] stdout: [ ] Target 0: (Runner) stopped. [2023-12-14 15:55:20.663309] [STDOUT] stdout: [ ] thread backtrace all [2023-12-14 15:55:20.663403] [STDOUT] stdout: [ ] process detach ```
1 parent d883683 commit 9b716e0

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

impeller/entity/contents/filters/directional_gaussian_blur_filter_contents.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,6 @@ namespace impeller {
4343
/// - `FilterContents::MakeGaussianBlur`
4444
/// - //flutter/impeller/entity/shaders/gaussian_blur/gaussian_blur.glsl
4545
///
46-
///\deprecated Previously 2 of these were chained to do 2D blurs, use
47-
/// \ref GaussianBlurFilterContents instead since it has better
48-
/// performance.
4946
class DirectionalGaussianBlurFilterContents final : public FilterContents {
5047
public:
5148
DirectionalGaussianBlurFilterContents();

impeller/entity/contents/filters/filter_contents.cc

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,38 @@ std::shared_ptr<FilterContents> FilterContents::MakeGaussianBlur(
5656
Sigma sigma_y,
5757
BlurStyle blur_style,
5858
Entity::TileMode tile_mode) {
59-
auto blur = std::make_shared<GaussianBlurFilterContents>(
60-
sigma_x.sigma, sigma_y.sigma, tile_mode);
61-
blur->SetInputs({input});
62-
return blur;
59+
constexpr bool use_new_filter =
60+
#ifdef IMPELLER_ENABLE_NEW_GAUSSIAN_FILTER
61+
true;
62+
#else
63+
false;
64+
#endif
65+
66+
// TODO(https://github.com/flutter/flutter/issues/131580): Remove once the new
67+
// blur handles all cases.
68+
if (use_new_filter) {
69+
auto blur = std::make_shared<GaussianBlurFilterContents>(
70+
sigma_x.sigma, sigma_y.sigma, tile_mode);
71+
blur->SetInputs({input});
72+
return blur;
73+
}
74+
std::shared_ptr<FilterContents> x_blur = MakeDirectionalGaussianBlur(
75+
/*input=*/input,
76+
/*sigma=*/sigma_x,
77+
/*direction=*/Point(1, 0),
78+
/*blur_style=*/BlurStyle::kNormal,
79+
/*tile_mode=*/tile_mode,
80+
/*is_second_pass=*/false,
81+
/*secondary_sigma=*/{});
82+
std::shared_ptr<FilterContents> y_blur = MakeDirectionalGaussianBlur(
83+
/*input=*/FilterInput::Make(x_blur),
84+
/*sigma=*/sigma_y,
85+
/*direction=*/Point(0, 1),
86+
/*blur_style=*/blur_style,
87+
/*tile_mode=*/tile_mode,
88+
/*is_second_pass=*/true,
89+
/*secondary_sigma=*/sigma_x);
90+
return y_blur;
6391
}
6492

6593
std::shared_ptr<FilterContents> FilterContents::MakeBorderMaskBlur(

0 commit comments

Comments
 (0)