aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SkNxTest.cpp
diff options
context:
space:
mode:
authorGravatar mtklein <mtklein@chromium.org>2015-12-14 11:25:18 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-12-14 11:25:18 -0800
commit6f37b4a4757ea3eb00c76162cc37f8a56c3b8bdb (patch)
tree1cf540ae66132e8ba6e59ce5d6f859cd096c1bf3 /tests/SkNxTest.cpp
parent4e4155df100b77d11bd14591c7716743369fde9b (diff)
Unify some SkNx code
- one base case and one N=1 case instead of two each (or three with doubles) - use SkNx_cast instead of FromBytes/toBytes - 4-at-a-time Sk4f::ToBytes becomes a special standalone Sk4f_ToBytes If I did everything right, this'll be perf- and pixel- neutral. https://gold.skia.org/search2?issue=1526523003&unt=true&query=source_type%3Dgm&master=false BUG=skia: CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Review URL: https://codereview.chromium.org/1526523003
Diffstat (limited to 'tests/SkNxTest.cpp')
-rw-r--r--tests/SkNxTest.cpp15
1 files changed, 0 insertions, 15 deletions
diff --git a/tests/SkNxTest.cpp b/tests/SkNxTest.cpp
index b3e03d0a9b..754e9800b1 100644
--- a/tests/SkNxTest.cpp
+++ b/tests/SkNxTest.cpp
@@ -207,21 +207,6 @@ DEF_TEST(Sk4px_widening, r) {
REPORTER_ASSERT(r, 0 == memcmp(&wideLoHi, &wideLoHiAlt, sizeof(wideLoHi)));
}
-DEF_TEST(Sk4f_toBytes, r) {
- uint8_t bytes[4];
-
- // toBytes truncates, not rounds.
- Sk4f(0.7f).toBytes(bytes);
- REPORTER_ASSERT(r, bytes[0] == 0);
-
- // Clamping edge cases.
- Sk4f(-2.0f, -0.7f, 255.9f, 256.0f).toBytes(bytes);
- REPORTER_ASSERT(r, bytes[0] == 0);
- REPORTER_ASSERT(r, bytes[1] == 0);
- REPORTER_ASSERT(r, bytes[2] == 255);
- REPORTER_ASSERT(r, bytes[3] == 255);
-}
-
DEF_TEST(SkNx_cast, r) {
Sk4f fs(-1.7f, -1.4f, 0.5f, 1.9f);
Sk4i is = SkNx_cast<int>(fs);