Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: tests/Float16Test.cpp

Issue 2159993003: Improve naive SkColorXform to half floats (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Prettier code Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/opts/SkNx_sse.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/Float16Test.cpp
diff --git a/tests/Float16Test.cpp b/tests/Float16Test.cpp
index 209165252279a3709e3d1bd71f36a4567e8e2426..8ab56048e9fac2cfc98a046c2575e92727d308a9 100644
--- a/tests/Float16Test.cpp
+++ b/tests/Float16Test.cpp
@@ -73,7 +73,9 @@ DEF_TEST(HalfToFloat_finite, r) {
u(f), f);
}
REPORTER_ASSERT(r, SkHalfToFloat_finite(h)[0] == f);
- REPORTER_ASSERT(r, SkFloatToHalf_finite(SkHalfToFloat_finite(h)) == h);
+ uint64_t result;
+ SkFloatToHalf_finite(SkHalfToFloat_finite(h)).store(&result);
+ REPORTER_ASSERT(r, result == h);
}
}
}
@@ -89,7 +91,7 @@ DEF_TEST(FloatToHalf_finite, r) {
float f;
memcpy(&f, &bits, 4);
if (isfinite(f) && isfinite(SkHalfToFloat(SkFloatToHalf(f)))) {
- uint16_t h1 = (uint16_t)SkFloatToHalf_finite(Sk4f(f,0,0,0)),
+ uint16_t h1 = SkFloatToHalf_finite(Sk4f(f,0,0,0))[0],
h2 = SkFloatToHalf(f);
bool ok = (h1 == h2 || h1 == h2-1);
REPORTER_ASSERT(r, ok);
« no previous file with comments | « src/opts/SkNx_sse.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698