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

Side by Side Diff: src/core/SkNx.h

Issue 2134753006: Add Sk4f_RoundToInt (Closed) Base URL: https://skia.googlesource.com/skia.git@xformrefactor
Patch Set: Fix vector conversion 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/opts/SkColorXform_opts.h » ('j') | 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 #ifndef SkNx_DEFINED 8 #ifndef SkNx_DEFINED
9 #define SkNx_DEFINED 9 #define SkNx_DEFINED
10 10
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 typedef SkNx<8, uint16_t> Sk8h; 292 typedef SkNx<8, uint16_t> Sk8h;
293 typedef SkNx<16, uint16_t> Sk16h; 293 typedef SkNx<16, uint16_t> Sk16h;
294 294
295 typedef SkNx<4, int> Sk4i; 295 typedef SkNx<4, int> Sk4i;
296 296
297 // Include platform specific specializations if available. 297 // Include platform specific specializations if available.
298 #if !defined(SKNX_NO_SIMD) && SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2 298 #if !defined(SKNX_NO_SIMD) && SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSE2
299 #include "../opts/SkNx_sse.h" 299 #include "../opts/SkNx_sse.h"
300 #elif !defined(SKNX_NO_SIMD) && defined(SK_ARM_HAS_NEON) 300 #elif !defined(SKNX_NO_SIMD) && defined(SK_ARM_HAS_NEON)
301 #include "../opts/SkNx_neon.h" 301 #include "../opts/SkNx_neon.h"
302 #else
303
304 SI Sk4i Sk4f_round(const Sk4f& x) {
305 return { (int) lrintf (x[0]),
306 (int) lrintf (x[1]),
307 (int) lrintf (x[2]),
308 (int) lrintf (x[3]), };
309 }
310
302 #endif 311 #endif
303 312
304 SI void Sk4f_ToBytes(uint8_t p[16], const Sk4f& a, const Sk4f& b, const Sk4f& c, const Sk4f& d) { 313 SI void Sk4f_ToBytes(uint8_t p[16], const Sk4f& a, const Sk4f& b, const Sk4f& c, const Sk4f& d) {
305 SkNx_cast<uint8_t>(SkNx_join(SkNx_join(a,b), SkNx_join(c,d))).store(p); 314 SkNx_cast<uint8_t>(SkNx_join(SkNx_join(a,b), SkNx_join(c,d))).store(p);
306 } 315 }
307 316
308 #undef SI 317 #undef SI
309 318
310 #endif//SkNx_DEFINED 319 #endif//SkNx_DEFINED
OLDNEW
« no previous file with comments | « no previous file | src/opts/SkColorXform_opts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698