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

Side by Side Diff: src/opts/SkNx_neon.h

Issue 1128053004: Turn on Sk4px xfermodes when we have NEON too. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 5 years, 7 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/core/SkXfermode.cpp ('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 #ifndef SkNx_neon_DEFINED 8 #ifndef SkNx_neon_DEFINED
9 #define SkNx_neon_DEFINED 9 #define SkNx_neon_DEFINED
10 10
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 348
349 SkNi(uint8_t a, uint8_t b, uint8_t c, uint8_t d, 349 SkNi(uint8_t a, uint8_t b, uint8_t c, uint8_t d,
350 uint8_t e, uint8_t f, uint8_t g, uint8_t h, 350 uint8_t e, uint8_t f, uint8_t g, uint8_t h,
351 uint8_t i, uint8_t j, uint8_t k, uint8_t l, 351 uint8_t i, uint8_t j, uint8_t k, uint8_t l,
352 uint8_t m, uint8_t n, uint8_t o, uint8_t p) { 352 uint8_t m, uint8_t n, uint8_t o, uint8_t p) {
353 fVec = (uint8x16_t) { a,b,c,d, e,f,g,h, i,j,k,l, m,n,o,p }; 353 fVec = (uint8x16_t) { a,b,c,d, e,f,g,h, i,j,k,l, m,n,o,p };
354 } 354 }
355 355
356 void store(uint8_t vals[16]) const { vst1q_u8(vals, fVec); } 356 void store(uint8_t vals[16]) const { vst1q_u8(vals, fVec); }
357 357
358 SkNi saturatedAdd(const SkNi& o) const { return vqaddq_u8(fVec, o.fVec); }
359
358 SkNi operator + (const SkNi& o) const { return vaddq_u8(fVec, o.fVec); } 360 SkNi operator + (const SkNi& o) const { return vaddq_u8(fVec, o.fVec); }
359 SkNi operator - (const SkNi& o) const { return vsubq_u8(fVec, o.fVec); } 361 SkNi operator - (const SkNi& o) const { return vsubq_u8(fVec, o.fVec); }
360 SkNi operator * (const SkNi& o) const { return vmulq_u8(fVec, o.fVec); } 362 SkNi operator * (const SkNi& o) const { return vmulq_u8(fVec, o.fVec); }
361 363
362 SkNi operator << (int bits) const { SHIFT8(vshlq_n_u8, fVec, bits); } 364 SkNi operator << (int bits) const { SHIFT8(vshlq_n_u8, fVec, bits); }
363 SkNi operator >> (int bits) const { SHIFT8(vshrq_n_u8, fVec, bits); } 365 SkNi operator >> (int bits) const { SHIFT8(vshrq_n_u8, fVec, bits); }
364 366
365 template <int k> uint8_t kth() const { 367 template <int k> uint8_t kth() const {
366 SkASSERT(0 <= k && k < 15); 368 SkASSERT(0 <= k && k < 15);
367 return vgetq_lane_u8(fVec, k&16); 369 return vgetq_lane_u8(fVec, k&16);
368 } 370 }
369 371
370 uint8x16_t fVec; 372 uint8x16_t fVec;
371 }; 373 };
372 374
373 #undef SHIFT32 375 #undef SHIFT32
374 #undef SHIFT16 376 #undef SHIFT16
375 #undef SHIFT8 377 #undef SHIFT8
376 378
377 #endif//SkNx_neon_DEFINED 379 #endif//SkNx_neon_DEFINED
OLDNEW
« no previous file with comments | « src/core/SkXfermode.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698