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 "SkOnce.h" | 8 #include "SkOnce.h" |
9 #include "SkOpts.h" | 9 #include "SkOpts.h" |
10 | 10 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 decltype(RGBA_to_rgbA) RGBA_to_rgbA = sk_default::RGBA_to_rgbA; | 85 decltype(RGBA_to_rgbA) RGBA_to_rgbA = sk_default::RGBA_to_rgbA; |
86 decltype(RGBA_to_bgrA) RGBA_to_bgrA = sk_default::RGBA_to_bgrA; | 86 decltype(RGBA_to_bgrA) RGBA_to_bgrA = sk_default::RGBA_to_bgrA; |
87 decltype(RGB_to_RGB1) RGB_to_RGB1 = sk_default::RGB_to_RGB1; | 87 decltype(RGB_to_RGB1) RGB_to_RGB1 = sk_default::RGB_to_RGB1; |
88 decltype(RGB_to_BGR1) RGB_to_BGR1 = sk_default::RGB_to_BGR1; | 88 decltype(RGB_to_BGR1) RGB_to_BGR1 = sk_default::RGB_to_BGR1; |
89 | 89 |
90 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp. | 90 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp. |
91 void Init_ssse3(); | 91 void Init_ssse3(); |
92 void Init_sse41(); | 92 void Init_sse41(); |
93 void Init_sse42() {} | 93 void Init_sse42() {} |
94 void Init_avx(); | 94 void Init_avx(); |
95 void Init_avx2(); | 95 void Init_avx2() {} |
96 void Init_neon(); | 96 void Init_neon(); |
97 | 97 |
98 static void init() { | 98 static void init() { |
99 // TODO: Chrome's not linking _sse* opts on iOS simulator builds. Bug o
r feature? | 99 // TODO: Chrome's not linking _sse* opts on iOS simulator builds. Bug o
r feature? |
100 #if defined(SK_CPU_X86) && !defined(SK_BUILD_FOR_IOS) | 100 #if defined(SK_CPU_X86) && !defined(SK_BUILD_FOR_IOS) |
101 uint32_t abcd[] = {0,0,0,0}; | 101 uint32_t abcd[] = {0,0,0,0}; |
102 cpuid(abcd); | 102 cpuid(abcd); |
103 if (abcd[2] & (1<< 9)) { Init_ssse3(); } | 103 if (abcd[2] & (1<< 9)) { Init_ssse3(); } |
104 if (abcd[2] & (1<<19)) { Init_sse41(); } | 104 if (abcd[2] & (1<<19)) { Init_sse41(); } |
105 if (abcd[2] & (1<<20)) { Init_sse42(); } | 105 if (abcd[2] & (1<<20)) { Init_sse42(); } |
(...skipping 19 matching lines...) Expand all Loading... |
125 | 125 |
126 SK_DECLARE_STATIC_ONCE(gInitOnce); | 126 SK_DECLARE_STATIC_ONCE(gInitOnce); |
127 void Init() { SkOnce(&gInitOnce, init); } | 127 void Init() { SkOnce(&gInitOnce, init); } |
128 | 128 |
129 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS | 129 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS |
130 static struct AutoInit { | 130 static struct AutoInit { |
131 AutoInit() { Init(); } | 131 AutoInit() { Init(); } |
132 } gAutoInit; | 132 } gAutoInit; |
133 #endif | 133 #endif |
134 } | 134 } |
OLD | NEW |