Add a GM that reproduces layout test failures with my new xfermode code.
Inspired by https://storage.googleapis.com/chromium-layout-test-archives/linux_blink_rel/69169/layout-test-results/results.html
I think the root cause is overflow.
Also, adds tests for Sk16b::operator<(). It wasn't wrong, but it was suspect
(used in all three of these xfermode implementations) and so it's best to have
tests.
BUG=skia:
Review URL: https://codereview.chromium.org/1228393006
diff --git a/tests/SkNxTest.cpp b/tests/SkNxTest.cpp
index 3719044..5893214 100644
--- a/tests/SkNxTest.cpp
+++ b/tests/SkNxTest.cpp
@@ -133,11 +133,13 @@
test_Ni<8, int>(r);
}
-DEF_TEST(SkNi_min, r) {
+DEF_TEST(SkNi_min_lt, r) {
// Exhaustively check the 8x8 bit space.
for (int a = 0; a < (1<<8); a++) {
for (int b = 0; b < (1<<8); b++) {
- REPORTER_ASSERT(r, Sk16b::Min(Sk16b(a), Sk16b(b)).kth<0>() == SkTMin(a, b));
+ Sk16b aw(a), bw(b);
+ REPORTER_ASSERT(r, Sk16b::Min(aw, bw).kth<0>() == SkTMin(a, b));
+ REPORTER_ASSERT(r, !(aw < bw).kth<0>() == !(a < b));
}}
// Exhausting the 16x16 bit space is kind of slow, so only do that in release builds.