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 "SkHalf.h" | 8 #include "SkHalf.h" |
9 #include "SkOnce.h" | 9 #include "SkOnce.h" |
10 #include "SkOpts.h" | 10 #include "SkOpts.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } | 130 } |
131 | 131 |
132 #elif !defined(SK_ARM_HAS_NEON) && \ | 132 #elif !defined(SK_ARM_HAS_NEON) && \ |
133 defined(SK_CPU_ARM32) && \ | 133 defined(SK_CPU_ARM32) && \ |
134 defined(SK_BUILD_FOR_ANDROID) && \ | 134 defined(SK_BUILD_FOR_ANDROID) && \ |
135 !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) | 135 !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) |
136 if (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) { Init_neon
(); } | 136 if (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) { Init_neon
(); } |
137 #endif | 137 #endif |
138 } | 138 } |
139 | 139 |
140 SK_DECLARE_STATIC_ONCE(gInitOnce); | 140 void Init() { |
141 void Init() { SkOnce(&gInitOnce, init); } | 141 static SkOnce once; |
| 142 once(init); |
| 143 } |
142 | 144 |
143 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS | 145 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS |
144 static struct AutoInit { | 146 static struct AutoInit { |
145 AutoInit() { Init(); } | 147 AutoInit() { Init(); } |
146 } gAutoInit; | 148 } gAutoInit; |
147 #endif | 149 #endif |
148 } | 150 } |
OLD | NEW |