[skif] Cleanup FilterResultTest to prep for color filters
Switches to std::variant to manage the data stored within a test Action
which helps when we have to add `sk_sp<SkColorFilter>`.
Extracts the default expectation calculations into reusable functions
so that it can be shared as new applyFoo() functions are added.
Switches to using SkCanvas::drawPaint() to fill the expected image,
which will be required when handling color filters that affect
transparent black and thus fill out the entire surface. Using an
image shader vs. directly drawing the image changed the expected image
in some cases in benign ways.
This CL switches the fuzzy diffing to use a red-mean distance function
for pixel color differences instead of absolute channel differences.
This function appears to be more forgiving to sampling and AA changes
while still catching the important cases where fundamental logic is
producing very different expected and actual images.
Bug: skia:9283
Change-Id: I81017c79a3d15eee432c737de64d2d6de9ed3cc2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/676417
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
1 file changed