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

Side by Side Diff: tests/SkNxTest.cpp

Issue 1590843003: add SkNx::abs(), for now only implemented for Sk4f (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkTAbs Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « src/opts/SkNx_sse.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "Sk4px.h" 8 #include "Sk4px.h"
9 #include "SkNx.h" 9 #include "SkNx.h"
10 #include "SkRandom.h" 10 #include "SkRandom.h"
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 209
210 DEF_TEST(SkNx_cast, r) { 210 DEF_TEST(SkNx_cast, r) {
211 Sk4f fs(-1.7f, -1.4f, 0.5f, 1.9f); 211 Sk4f fs(-1.7f, -1.4f, 0.5f, 1.9f);
212 Sk4i is = SkNx_cast<int>(fs); 212 Sk4i is = SkNx_cast<int>(fs);
213 213
214 REPORTER_ASSERT(r, is.kth<0>() == -1); 214 REPORTER_ASSERT(r, is.kth<0>() == -1);
215 REPORTER_ASSERT(r, is.kth<1>() == -1); 215 REPORTER_ASSERT(r, is.kth<1>() == -1);
216 REPORTER_ASSERT(r, is.kth<2>() == 0); 216 REPORTER_ASSERT(r, is.kth<2>() == 0);
217 REPORTER_ASSERT(r, is.kth<3>() == 1); 217 REPORTER_ASSERT(r, is.kth<3>() == 1);
218 } 218 }
219
220 DEF_TEST(SkNx_abs, r) {
221 auto fs = Sk4f(0.0f, -0.0f, 2.0f, -4.0f).abs();
222 REPORTER_ASSERT(r, fs.kth<0>() == 0.0f);
223 REPORTER_ASSERT(r, fs.kth<1>() == 0.0f);
224 REPORTER_ASSERT(r, fs.kth<2>() == 2.0f);
225 REPORTER_ASSERT(r, fs.kth<3>() == 4.0f);
226 }
OLDNEW
« 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