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

Unified Diff: tests/SkNxTest.cpp

Issue 1202013002: Update some Sk4px APIs. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: fix none Created 5 years, 6 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/SkNxTest.cpp
diff --git a/tests/SkNxTest.cpp b/tests/SkNxTest.cpp
index eab625d41e3fe2f6e71d2ac2e4658850d9859e2a..3719044025e7a145ae43a2504d4a34d58c66c015 100644
--- a/tests/SkNxTest.cpp
+++ b/tests/SkNxTest.cpp
@@ -174,15 +174,15 @@ DEF_TEST(Sk4px_muldiv255round, r) {
int exact = (a*b+127)/255;
// Duplicate a and b 16x each.
- Sk4px av((SkAlpha)a),
- bv((SkAlpha)b);
+ auto av = Sk4px::DupAlpha(a),
+ bv = Sk4px::DupAlpha(b);
// This way should always be exactly correct.
- int correct = av.mulWiden(bv).div255RoundNarrow().kth<0>();
+ int correct = (av * bv).div255().kth<0>();
REPORTER_ASSERT(r, correct == exact);
// We're a bit more flexible on this method: correct for 0 or 255, otherwise off by <=1.
- int fast = av.fastMulDiv255Round(bv).kth<0>();
+ int fast = av.approxMulDiv255(bv).kth<0>();
REPORTER_ASSERT(r, fast-exact >= -1 && fast-exact <= 1);
if (a == 0 || a == 255 || b == 0 || b == 255) {
REPORTER_ASSERT(r, fast == exact);
« 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