minor Sk4px cleanup
I've removed a bunch of unused code,
inlined routines that are only used once,
removed platform code where a portable code works fine,
and renamed methods and updated comments.
I'm thinking about getting rid of Sk4px entirely, and boiling it down
instead to a couple helper methods on Sk16b/Sk16h. This is a start.
Change-Id: I35b6c44710aa2cefe8c1e07fc2cb877a4042e8a5
Reviewed-on: https://skia-review.googlesource.com/c/178985
Auto-Submit: Mike Klein <mtklein@google.com>
Commit-Queue: Herb Derby <herb@google.com>
Reviewed-by: Herb Derby <herb@google.com>
diff --git a/tests/SkNxTest.cpp b/tests/SkNxTest.cpp
index 7afedfe..f210974 100644
--- a/tests/SkNxTest.cpp
+++ b/tests/SkNxTest.cpp
@@ -185,8 +185,8 @@
int exact = (a*b+127)/255;
// Duplicate a and b 16x each.
- auto av = Sk4px::DupAlpha(a),
- bv = Sk4px::DupAlpha(b);
+ Sk4px av = Sk16b(a),
+ bv = Sk16b(b);
// This way should always be exactly correct.
int correct = (av * bv).div255()[0];
@@ -202,22 +202,6 @@
}
}
-DEF_TEST(Sk4px_widening, r) {
- SkPMColor colors[] = {
- SkPreMultiplyColor(0xff00ff00),
- SkPreMultiplyColor(0x40008000),
- SkPreMultiplyColor(0x7f020406),
- SkPreMultiplyColor(0x00000000),
- };
- auto packed = Sk4px::Load4(colors);
-
- auto wideLo = packed.widenLo(),
- wideHi = packed.widenHi(),
- wideLoHi = packed.widenLoHi(),
- wideLoHiAlt = wideLo + wideHi;
- REPORTER_ASSERT(r, 0 == memcmp(&wideLoHi, &wideLoHiAlt, sizeof(wideLoHi)));
-}
-
DEF_TEST(SkNx_abs, r) {
auto fs = Sk4f(0.0f, -0.0f, 2.0f, -4.0f).abs();
REPORTER_ASSERT(r, fs[0] == 0.0f);