Stick to 1/2 scale for final blur decimation step
If the final blur step to reach the max supported blur radius was
between (1/2, 1), the linear coord interpolation would have texture
coords not landing at the intersection of the 4 source colors. Even
though the visual output of a static image after this rendering would
look okay, if the content would animate relative to the blur domain,
it misaligned sampling in the final step could introduce flickering
that would be magnified by the blur passes.
This adds an option to keep the final scale factor locked to 1/2,
which overscales the image. This is not ideal for a general rescale()
to reach a particular size, but the blur code can compensate by
adjusting its sigma.
If desired for the general rescale() case's quality, we could always
overshoot and then linearly blend the upscaled and downscaled levels
into the final target resolution. This added complexity isn't needed
yet.
Bug: b/323960889
Change-Id: Ia582a3d0a06b63a60618c22e1bf0876325cbc3df
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1026796
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Daniel Dilan <danieldilan@google.com>
Reviewed-by: Florin Malita <fmalita@google.com>
4 files changed