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

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

Issue 2046213002: Revert of Move immintrin/arm_neon includes to where they are used. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
19 namespace SK_OPTS_NS { 13 namespace SK_OPTS_NS {
20 14
21 static void RGBA_to_rgbA_portable(uint32_t* dst, const void* vsrc, int count) { 15 static void RGBA_to_rgbA_portable(uint32_t* dst, const void* vsrc, int count) {
22 auto src = (const uint32_t*)vsrc; 16 auto src = (const uint32_t*)vsrc;
23 for (int i = 0; i < count; i++) { 17 for (int i = 0; i < count; i++) {
24 uint8_t a = src[i] >> 24, 18 uint8_t a = src[i] >> 24,
25 b = src[i] >> 16, 19 b = src[i] >> 16,
26 g = src[i] >> 8, 20 g = src[i] >> 8,
27 r = src[i] >> 0; 21 r = src[i] >> 0;
28 b = (b*a+127)/255; 22 b = (b*a+127)/255;
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
837 831
838 static void inverted_CMYK_to_BGR1(uint32_t dst[], const void* src, int count) { 832 static void inverted_CMYK_to_BGR1(uint32_t dst[], const void* src, int count) {
839 inverted_CMYK_to_BGR1_portable(dst, src, count); 833 inverted_CMYK_to_BGR1_portable(dst, src, count);
840 } 834 }
841 835
842 #endif 836 #endif
843 837
844 } 838 }
845 839
846 #endif // SkSwizzler_opts_DEFINED 840 #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