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

Side by Side Diff: src/core/SkUtilsArm.cpp

Issue 22193002: Enable SkUtilsArm on all ARM platforms and always use NDK compliant NEON dectection. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« gyp/core.gyp ('K') | « gyp/core.gyp ('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 /* 2 /*
3 * Copyright 2012 The Android Open Source Project 3 * Copyright 2012 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkUtilsArm.h" 9 #include "SkUtilsArm.h"
10 10
11 #if SK_ARM_NEON_IS_DYNAMIC 11 #if SK_ARM_NEON_IS_DYNAMIC
12 12
13 #include <unistd.h> 13 #include <unistd.h>
14 #include <fcntl.h> 14 #include <fcntl.h>
15 #include <errno.h> 15 #include <errno.h>
16 #include <string.h> 16 #include <string.h>
17 #include <pthread.h> 17 #include <pthread.h>
18 18
19 // Set USE_ANDROID_NDK_CPU_FEATURES to use the Android NDK's 19 // Set USE_ANDROID_NDK_CPU_FEATURES to use the Android NDK's
20 // cpu-features helper library to detect NEON at runtime. See 20 // cpu-features helper library to detect NEON at runtime. See
21 // http://crbug.com/164154 to see why this is needed in Chromium 21 // http://crbug.com/164154 to see why this is needed in Chromium
22 // for Android. 22 // for Android.
23 #if defined(SK_BUILD_FOR_ANDROID) && defined(SK_BUILD_FOR_CHROMIUM) 23 #if defined(SK_BUILD_FOR_ANDROID)
24 # define USE_ANDROID_NDK_CPU_FEATURES 1 24 # define USE_ANDROID_NDK_CPU_FEATURES 1
25 #else 25 #else
26 # define USE_ANDROID_NDK_CPU_FEATURES 0 26 # define USE_ANDROID_NDK_CPU_FEATURES 0
27 #endif 27 #endif
28 28
29 #if USE_ANDROID_NDK_CPU_FEATURES 29 #if USE_ANDROID_NDK_CPU_FEATURES
30 # include <cpu-features.h> 30 # include <cpu-features.h>
31 #endif 31 #endif
32 32
33 // Set NEON_DEBUG to 1 to allow debugging of the CPU features probing. 33 // Set NEON_DEBUG to 1 to allow debugging of the CPU features probing.
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 void sk_cpu_arm_probe_features(void) { 188 void sk_cpu_arm_probe_features(void) {
189 sHasArmNeon = sk_cpu_arm_check_neon(); 189 sHasArmNeon = sk_cpu_arm_check_neon();
190 } 190 }
191 191
192 bool sk_cpu_arm_has_neon(void) { 192 bool sk_cpu_arm_has_neon(void) {
193 pthread_once(&sOnce, sk_cpu_arm_probe_features); 193 pthread_once(&sOnce, sk_cpu_arm_probe_features);
194 return sHasArmNeon; 194 return sHasArmNeon;
195 } 195 }
196 196
197 #endif // SK_ARM_NEON_IS_DYNAMIC 197 #endif // SK_ARM_NEON_IS_DYNAMIC
OLDNEW
« gyp/core.gyp ('K') | « gyp/core.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698