[Impeller] When the blur sigma approaches zero, passthrough (flutter/engine#35423)
This commit is contained in:
@@ -27,14 +27,6 @@ DirectionalGaussianBlurFilterContents::
|
|||||||
~DirectionalGaussianBlurFilterContents() = default;
|
~DirectionalGaussianBlurFilterContents() = default;
|
||||||
|
|
||||||
void DirectionalGaussianBlurFilterContents::SetSigma(Sigma sigma) {
|
void DirectionalGaussianBlurFilterContents::SetSigma(Sigma sigma) {
|
||||||
if (sigma.sigma < kEhCloseEnough) {
|
|
||||||
// This cutoff is an implementation detail of the blur that's tied to the
|
|
||||||
// fragment shader. When the blur is set to 0, having a value slightly above
|
|
||||||
// zero makes the shader do 1 finite sample to pass the image through with
|
|
||||||
// no blur (while retaining correct alpha mask behavior).
|
|
||||||
blur_sigma_ = Sigma{kEhCloseEnough};
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
blur_sigma_ = sigma;
|
blur_sigma_ = sigma;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -105,6 +97,10 @@ std::optional<Snapshot> DirectionalGaussianBlurFilterContents::RenderFilter(
|
|||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (blur_sigma_.sigma < kEhCloseEnough) {
|
||||||
|
return input_snapshot.value(); // No blur to render.
|
||||||
|
}
|
||||||
|
|
||||||
auto maybe_input_uvs = input_snapshot->GetCoverageUVs(coverage);
|
auto maybe_input_uvs = input_snapshot->GetCoverageUVs(coverage);
|
||||||
if (!maybe_input_uvs.has_value()) {
|
if (!maybe_input_uvs.has_value()) {
|
||||||
return std::nullopt;
|
return std::nullopt;
|
||||||
|
|||||||
Reference in New Issue
Block a user