OLD | NEW |
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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // Sk4i is = SkNx_cast<int>(fs); // Cast each float to int. | 196 // Sk4i is = SkNx_cast<int>(fs); // Cast each float to int. |
197 // This can be specialized in ../opts/SkNx_foo.h if there's a better platform-sp
ecific cast. | 197 // This can be specialized in ../opts/SkNx_foo.h if there's a better platform-sp
ecific cast. |
198 template <typename D, typename S, int N> | 198 template <typename D, typename S, int N> |
199 SkNx<N,D> SkNx_cast(const SkNx<N,S>& src) { | 199 SkNx<N,D> SkNx_cast(const SkNx<N,S>& src) { |
200 return SkNx_cast_fallback<D,S,N>(src, MakeSkIntSequence<N>()); | 200 return SkNx_cast_fallback<D,S,N>(src, MakeSkIntSequence<N>()); |
201 } | 201 } |
202 | 202 |
203 } // namespace | 203 } // namespace |
204 | 204 |
205 typedef SkNx<2, float> Sk2f; | 205 typedef SkNx<2, float> Sk2f; |
206 typedef SkNx<2, float> Sk2s; | |
207 typedef SkNx<4, float> Sk4f; | 206 typedef SkNx<4, float> Sk4f; |
208 typedef SkNx<4, float> Sk4s; | |
209 typedef SkNx<8, float> Sk8f; | 207 typedef SkNx<8, float> Sk8f; |
210 typedef SkNx<8, float> Sk8s; | 208 |
| 209 typedef SkNx<2, double> Sk2d; |
| 210 typedef SkNx<4, double> Sk4d; |
| 211 typedef SkNx<8, double> Sk8d; |
| 212 |
| 213 typedef SkNx<2, SkScalar> Sk2s; |
| 214 typedef SkNx<4, SkScalar> Sk4s; |
| 215 typedef SkNx<8, SkScalar> Sk8s; |
211 | 216 |
212 typedef SkNx< 4, uint16_t> Sk4h; | 217 typedef SkNx< 4, uint16_t> Sk4h; |
213 typedef SkNx< 8, uint16_t> Sk8h; | 218 typedef SkNx< 8, uint16_t> Sk8h; |
214 typedef SkNx<16, uint16_t> Sk16h; | 219 typedef SkNx<16, uint16_t> Sk16h; |
215 | 220 |
216 typedef SkNx< 4, uint8_t> Sk4b; | 221 typedef SkNx< 4, uint8_t> Sk4b; |
217 typedef SkNx< 8, uint8_t> Sk8b; | 222 typedef SkNx< 8, uint8_t> Sk8b; |
218 typedef SkNx<16, uint8_t> Sk16b; | 223 typedef SkNx<16, uint8_t> Sk16b; |
219 | 224 |
220 typedef SkNx<4, int> Sk4i; | 225 typedef SkNx<4, int> Sk4i; |
(...skipping 12 matching lines...) Expand all Loading... |
233 SkNx_cast<uint8_t>(b).store(p+ 4); | 238 SkNx_cast<uint8_t>(b).store(p+ 4); |
234 SkNx_cast<uint8_t>(c).store(p+ 8); | 239 SkNx_cast<uint8_t>(c).store(p+ 8); |
235 SkNx_cast<uint8_t>(d).store(p+12); | 240 SkNx_cast<uint8_t>(d).store(p+12); |
236 } | 241 } |
237 #endif | 242 #endif |
238 | 243 |
239 #undef REQUIRE | 244 #undef REQUIRE |
240 | 245 |
241 | 246 |
242 #endif//SkNx_DEFINED | 247 #endif//SkNx_DEFINED |
OLD | NEW |