Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
started only bumping padding if we had it
  • Loading branch information
gaaclarke committed Jul 26, 2024
commit 9655541017aff043dae1c9492b5d587a44cf8de2
17 changes: 12 additions & 5 deletions impeller/entity/contents/filters/gaussian_blur_filter_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,21 @@ DownsamplePassArgs CalculateDownsamplePassArgs(
1.0 / downsample_scalar.x),
CeilToDivisible(source_rect_padded.GetSize().height,
1.0 / downsample_scalar.y));
// Only make the padding divisible if we already have padding. If we don't
// have padding adding more can add artifacts to hard blur edges.
Vector2 divisible_padding(
padding.x +
(divisible_size.x - source_rect_padded.GetSize().width) / 2.0,
padding.y +
(divisible_size.y - source_rect_padded.GetSize().height) / 2.0);
padding.x > 0
? padding.x +
(divisible_size.x - source_rect_padded.GetSize().width) / 2.0
: 0.f,
padding.y > 0
? padding.y +
(divisible_size.y - source_rect_padded.GetSize().height) / 2.0
: 0.f);
source_rect_padded = source_rect.Expand(divisible_padding);

Vector2 effective_scalar = downsample_scalar;
Vector2 effective_scalar =
Vector2(subpass_size) / source_rect_padded.GetSize();
Quad uvs = GaussianBlurFilterContents::CalculateUVs(
input, snapshot_entity, source_rect_padded, input_snapshot_size);
return {
Expand Down