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

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

Issue 2045633002: Move immintrin/arm_neon includes to where they are used. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: check for libc++ Created 4 years, 6 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/opts/SkNx_sse.h ('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 2016 Google Inc. 2 * Copyright 2016 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 SkSwizzler_opts_DEFINED 8 #ifndef SkSwizzler_opts_DEFINED
9 #define SkSwizzler_opts_DEFINED 9 #define SkSwizzler_opts_DEFINED
10 10
11 #include "SkColorPriv.h" 11 #include "SkColorPriv.h"
12 12
13 #if SK_CPU_SSE_LEVEL >= SK_CPU_SSE_LEVEL_SSSE3
14 #include <immintrin.h>
15 #elif defined(SK_ARM_HAS_NEON)
16 #include <arm_neon.h>
17 #endif
18
13 namespace SK_OPTS_NS { 19 namespace SK_OPTS_NS {
14 20
15 static void RGBA_to_rgbA_portable(uint32_t* dst, const void* vsrc, int count) { 21 static void RGBA_to_rgbA_portable(uint32_t* dst, const void* vsrc, int count) {
16 auto src = (const uint32_t*)vsrc; 22 auto src = (const uint32_t*)vsrc;
17 for (int i = 0; i < count; i++) { 23 for (int i = 0; i < count; i++) {
18 uint8_t a = src[i] >> 24, 24 uint8_t a = src[i] >> 24,
19 b = src[i] >> 16, 25 b = src[i] >> 16,
20 g = src[i] >> 8, 26 g = src[i] >> 8,
21 r = src[i] >> 0; 27 r = src[i] >> 0;
22 b = (b*a+127)/255; 28 b = (b*a+127)/255;
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 837
832 static void inverted_CMYK_to_BGR1(uint32_t dst[], const void* src, int count) { 838 static void inverted_CMYK_to_BGR1(uint32_t dst[], const void* src, int count) {
833 inverted_CMYK_to_BGR1_portable(dst, src, count); 839 inverted_CMYK_to_BGR1_portable(dst, src, count);
834 } 840 }
835 841
836 #endif 842 #endif
837 843
838 } 844 }
839 845
840 #endif // SkSwizzler_opts_DEFINED 846 #endif // SkSwizzler_opts_DEFINED
OLDNEW
« no previous file with comments | « src/opts/SkNx_sse.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698