Skip to content

Commit c5d2e01

Browse files
authored
[Impeller] moved the kernel size assert to a more appropriate location. (flutter#50880)
This is the more appropriate location for the assert now. This is important if we want to fiddle with the downsample amount now the the kernel is effectively half as big. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent 73a6e07 commit c5d2e01

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

impeller/entity/contents/filters/gaussian_blur_filter_contents.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,11 @@ fml::StatusOr<RenderTarget> MakeBlurSubpass(
173173
linear_sampler_descriptor));
174174
GaussianBlurVertexShader::BindFrameInfo(
175175
pass, host_buffer.EmplaceUniform(frame_info));
176+
KernelPipeline::FragmentShader::KernelSamples kernel_samples =
177+
LerpHackKernelSamples(GenerateBlurInfo(blur_info));
178+
FML_CHECK(kernel_samples.sample_count < kMaxKernelSize);
176179
GaussianBlurFragmentShader::BindKernelSamples(
177-
pass, host_buffer.EmplaceUniform(
178-
LerpHackKernelSamples(GenerateBlurInfo(blur_info))));
180+
pass, host_buffer.EmplaceUniform(kernel_samples));
179181
return pass.Draw().ok();
180182
};
181183
if (destination_target.has_value()) {
@@ -478,7 +480,6 @@ KernelPipeline::FragmentShader::KernelSamples GenerateBlurInfo(
478480
KernelPipeline::FragmentShader::KernelSamples result;
479481
result.sample_count =
480482
((2 * parameters.blur_radius) / parameters.step_size) + 1;
481-
FML_CHECK(result.sample_count < kMaxKernelSize);
482483

483484
// Chop off the last samples if the radius >= 3 where they account for < 1.56%
484485
// of the result.

0 commit comments

Comments
 (0)