mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
[Impeller] When the blur sigma approaches zero, passthrough (flutter/engine#35423)
This commit is contained in:
parent
993488a28d
commit
ed24407fca
@ -27,14 +27,6 @@ DirectionalGaussianBlurFilterContents::
|
||||
~DirectionalGaussianBlurFilterContents() = default;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@ -105,6 +97,10 @@ std::optional<Snapshot> DirectionalGaussianBlurFilterContents::RenderFilter(
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
if (blur_sigma_.sigma < kEhCloseEnough) {
|
||||
return input_snapshot.value(); // No blur to render.
|
||||
}
|
||||
|
||||
auto maybe_input_uvs = input_snapshot->GetCoverageUVs(coverage);
|
||||
if (!maybe_input_uvs.has_value()) {
|
||||
return std::nullopt;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user