[skottie] Fix GaussianBlur repeat edge pixels
Per [1], repeat edge pixels involves two changes:
- the output is cropped to the content bounding box
- the image filter tile mode is changed to kClamp
Currently we only implement the latter part.
To fully support the option, introduce a "CropRect" sksg::ImageFilter
attribute (which is always passed explicitly to Skia image filters),
and a "Cropping" sksg::ImageFilterEffect attribute which controls
whether the effect node is pushing a crop rect to the image filter
node.
The reason for having a separate Cropping attribute is that content
bounding box information is only available in the sksg Effect node,
and not it the ImageFilter node -- so the crop calculation must live
in that layer.
Also update the Gaussian blur effect to flip both attributes depending
on repeat edge pixels state.
[1] https://www.youtube.com/watch?v=2ORequJEx1w
Bug: b/40039025
Change-Id: I5d88f2d77032840297cc00a989aede54e9a401b7
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/744857
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
Commit-Queue: Florin Malita <fmalita@chromium.org>
4 files changed