Chromium Code Reviews| Index: src/core/SkNx.h |
| diff --git a/src/core/SkNx.h b/src/core/SkNx.h |
| index d0c7f41f1cd1b4b3b8a7e64b4b8fc9a4c6d43408..6e453896c79ee71dc1906df6913a5ef27d9240a4 100644 |
| --- a/src/core/SkNx.h |
| +++ b/src/core/SkNx.h |
| @@ -299,6 +299,22 @@ typedef SkNx<4, int> Sk4i; |
| #include "../opts/SkNx_sse.h" |
| #elif !defined(SKNX_NO_SIMD) && defined(SK_ARM_HAS_NEON) |
| #include "../opts/SkNx_neon.h" |
| +#else |
| + |
| +SI Sk4i Sk4f_RoundToInt(const Sk4f& x) { |
| + return { sk_float_round2int(x[0]), |
|
mtklein
2016/07/11 14:05:03
If we can't implement this in terms of things from
msarett
2016/07/12 15:42:43
lrintf() seems fine to me.
|
| + sk_float_round2int(x[1]), |
| + sk_float_round2int(x[2]), |
| + sk_float_round2int(x[3]), }; |
| +} |
| + |
| +SI uint32_t Sk4f_RoundToByte(const Sk4f& x) { |
|
mtklein
2016/07/11 14:05:03
Why don't we simplify this by adding just one new
msarett
2016/07/12 15:42:43
SGTM
|
| + return sk_float_round2int(x[0]) << 0 |
| + | sk_float_round2int(x[1]) << 8 |
| + | sk_float_round2int(x[2]) << 16 |
| + | sk_float_round2int(x[3]) << 24; |
| +} |
| + |
| #endif |
| SI void Sk4f_ToBytes(uint8_t p[16], const Sk4f& a, const Sk4f& b, const Sk4f& c, const Sk4f& d) { |