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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 decltype(matrix_translate) matrix_translate = sk_default::matrix
_translate; | 79 decltype(matrix_translate) matrix_translate = sk_default::matrix
_translate; |
80 decltype(matrix_scale_translate) matrix_scale_translate = sk_default::matrix
_scale_translate; | 80 decltype(matrix_scale_translate) matrix_scale_translate = sk_default::matrix
_scale_translate; |
81 decltype(matrix_affine) matrix_affine = sk_default::matrix
_affine; | 81 decltype(matrix_affine) matrix_affine = sk_default::matrix
_affine; |
82 | 82 |
83 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp. | 83 // Each Init_foo() is defined in src/opts/SkOpts_foo.cpp. |
84 void Init_ssse3(); | 84 void Init_ssse3(); |
85 void Init_sse41(); | 85 void Init_sse41(); |
86 void Init_sse42() {} | 86 void Init_sse42() {} |
87 void Init_avx(); | 87 void Init_avx(); |
88 void Init_avx2() {} | 88 void Init_avx2(); |
89 void Init_neon(); | 89 void Init_neon(); |
90 | 90 |
91 static void init() { | 91 static void init() { |
92 // TODO: Chrome's not linking _sse* opts on iOS simulator builds. Bug o
r feature? | 92 // TODO: Chrome's not linking _sse* opts on iOS simulator builds. Bug o
r feature? |
93 #if defined(SK_CPU_X86) && !defined(SK_BUILD_FOR_IOS) | 93 #if defined(SK_CPU_X86) && !defined(SK_BUILD_FOR_IOS) |
94 uint32_t abcd[] = {0,0,0,0}; | 94 uint32_t abcd[] = {0,0,0,0}; |
95 cpuid(abcd); | 95 cpuid(abcd); |
96 if (abcd[2] & (1<< 9)) { Init_ssse3(); } | 96 if (abcd[2] & (1<< 9)) { Init_ssse3(); } |
97 if (abcd[2] & (1<<19)) { Init_sse41(); } | 97 if (abcd[2] & (1<<19)) { Init_sse41(); } |
98 if (abcd[2] & (1<<20)) { Init_sse42(); } | 98 if (abcd[2] & (1<<20)) { Init_sse42(); } |
(...skipping 19 matching lines...) Expand all Loading... |
118 | 118 |
119 SK_DECLARE_STATIC_ONCE(gInitOnce); | 119 SK_DECLARE_STATIC_ONCE(gInitOnce); |
120 void Init() { SkOnce(&gInitOnce, init); } | 120 void Init() { SkOnce(&gInitOnce, init); } |
121 | 121 |
122 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS | 122 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS |
123 static struct AutoInit { | 123 static struct AutoInit { |
124 AutoInit() { Init(); } | 124 AutoInit() { Init(); } |
125 } gAutoInit; | 125 } gAutoInit; |
126 #endif | 126 #endif |
127 } | 127 } |
OLD | NEW |