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 "SkBlitRow_opts_SSE4.h" | 8 #include "SkBlitRow_opts_SSE4.h" |
9 | |
10 // Some compilers can't compile SSSE3 or SSE4 intrinsics. We give them stub met
hods. | |
11 // The stubs should never be called, so we make them crash just to confirm that. | |
12 #if SK_CPU_SSE_LEVEL < SK_CPU_SSE_LEVEL_SSE41 | |
13 void S32A_Opaque_BlitRow32_SSE4(SkPMColor* SK_RESTRICT, const SkPMColor* SK_REST
RICT, int, U8CPU) { | |
14 sk_throw(); | |
15 } | |
16 | |
17 #else | |
18 | |
19 #include <smmintrin.h> // SSE4.1 intrinsics | |
20 #include "SkColorPriv.h" | 9 #include "SkColorPriv.h" |
21 #include "SkColor_opts_SSE2.h" | 10 #include "SkColor_opts_SSE2.h" |
22 #include "SkMSAN.h" | 11 #include "SkMSAN.h" |
23 | 12 |
24 void S32A_Opaque_BlitRow32_SSE4(SkPMColor* SK_RESTRICT dst, | 13 void S32A_Opaque_BlitRow32_SSE4(SkPMColor* SK_RESTRICT dst, |
25 const SkPMColor* SK_RESTRICT src, | 14 const SkPMColor* SK_RESTRICT src, |
26 int count, | 15 int count, |
27 U8CPU alpha) { | 16 U8CPU alpha) { |
28 sk_msan_assert_initialized(src, src+count); | 17 sk_msan_assert_initialized(src, src+count); |
29 | 18 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 52 } |
64 | 53 |
65 // Wrap up the last <= 15 pixels. | 54 // Wrap up the last <= 15 pixels. |
66 for (int i = count16*16; i < count; i++) { | 55 for (int i = count16*16; i < count; i++) { |
67 // This check is not really necessarily, but it prevents pointless autov
ectorization. | 56 // This check is not really necessarily, but it prevents pointless autov
ectorization. |
68 if (src[i] & 0xFF000000) { | 57 if (src[i] & 0xFF000000) { |
69 dst[i] = SkPMSrcOver(src[i], dst[i]); | 58 dst[i] = SkPMSrcOver(src[i], dst[i]); |
70 } | 59 } |
71 } | 60 } |
72 } | 61 } |
73 | |
74 #endif | |
OLD | NEW |