| 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 #include "SkOpts.h" | 8 #include "SkOpts.h" |
| 9 #include "SkXfermode_opts.h" |
| 9 | 10 |
| 10 namespace sse2 { // This helps identify methods from this file when debugging /
profiling. | 11 namespace sse2 { // This helps identify methods from this file when debugging /
profiling. |
| 11 | 12 |
| 12 static void memset16(uint16_t* dst, uint16_t val, int n) { | 13 static void memset16(uint16_t* dst, uint16_t val, int n) { |
| 13 auto dst8 = (__m128i*)dst; | 14 auto dst8 = (__m128i*)dst; |
| 14 auto val8 = _mm_set1_epi16(val); | 15 auto val8 = _mm_set1_epi16(val); |
| 15 for ( ; n >= 8; n -= 8) { | 16 for ( ; n >= 8; n -= 8) { |
| 16 _mm_storeu_si128(dst8++, val8); | 17 _mm_storeu_si128(dst8++, val8); |
| 17 } | 18 } |
| 18 dst = (uint16_t*)dst8; | 19 dst = (uint16_t*)dst8; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 42 } | 43 } |
| 43 if (n & 1) { | 44 if (n & 1) { |
| 44 *dst = val; | 45 *dst = val; |
| 45 } | 46 } |
| 46 } | 47 } |
| 47 | 48 |
| 48 } // namespace sse2 | 49 } // namespace sse2 |
| 49 | 50 |
| 50 namespace SkOpts { | 51 namespace SkOpts { |
| 51 void Init_sse2() { | 52 void Init_sse2() { |
| 52 memset16 = sse2::memset16; | 53 memset16 = sse2::memset16; |
| 53 memset32 = sse2::memset32; | 54 memset32 = sse2::memset32; |
| 55 create_xfermode = SkCreate4pxXfermode; |
| 54 } | 56 } |
| 55 } | 57 } |
| OLD | NEW |