forked from google/skia
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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 <[email protected]> Commit-Queue: Michael Ludwig <[email protected]>
- Loading branch information
Showing
1 changed file
with
86 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters