diff options
-rw-r--r-- | BUILD.gn | 4 | ||||
-rw-r--r-- | gn/gn_to_bp.py | 2 | ||||
-rw-r--r-- | src/core/SkCpu.cpp | 27 |
3 files changed, 5 insertions, 28 deletions
@@ -12,7 +12,6 @@ if (!defined(is_skia_standalone)) { declare_args() { skia_use_angle = false - skia_use_cpufeatures = is_android skia_use_expat = true skia_use_fontconfig = is_linux skia_use_freetype = is_android || is_fuchsia || is_linux @@ -640,9 +639,6 @@ component("skia") { } if (is_android) { - if (skia_use_cpufeatures) { - deps += [ "//third_party/cpu-features" ] - } deps += [ "//third_party/expat" ] sources += [ "src/ports/SkDebug_android.cpp" ] libs += [ diff --git a/gn/gn_to_bp.py b/gn/gn_to_bp.py index 1791697d37..3e81042ace 100644 --- a/gn/gn_to_bp.py +++ b/gn/gn_to_bp.py @@ -81,7 +81,6 @@ cc_library { "libz", ], static_libs: [ - //"cpufeatures", // TODO: use this for CRC32 detection "libsfntly", "libwebp-decode", "libwebp-encode", @@ -92,7 +91,6 @@ cc_library { # We'll run GN to get the main source lists and include directories for Skia. gn_args = { 'skia_enable_vulkan_debug_layers': 'false', - 'skia_use_cpufeatures': 'false', 'skia_use_system_expat': 'true', 'skia_use_vulkan': 'true', 'target_cpu': '"none"', diff --git a/src/core/SkCpu.cpp b/src/core/SkCpu.cpp index e3e61525ef..28bdf6936d 100644 --- a/src/core/SkCpu.cpp +++ b/src/core/SkCpu.cpp @@ -58,31 +58,14 @@ return features; } -#elif defined(SK_CPU_ARM32) && \ - defined(SK_BUILD_FOR_ANDROID) && \ - !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) - #include "cpu-features.h" +#elif defined(SK_CPU_ARM64) && defined(SK_BUILD_FOR_ANDROID) + #include <asm/hwcap.h> + #include <sys/auxv.h> static uint32_t read_cpu_features() { uint32_t features = 0; - - uint64_t android_features = android_getCpuFeatures(); - if (android_features & ANDROID_CPU_ARM_FEATURE_NEON ) { features |= SkCpu::NEON ; } - if (android_features & ANDROID_CPU_ARM_FEATURE_NEON_FMA) { features |= SkCpu::NEON_FMA; } - if (android_features & ANDROID_CPU_ARM_FEATURE_VFP_FP16) { features |= SkCpu::VFP_FP16; } - return features; - } - -#elif defined(SK_CPU_ARM64) && \ - defined(SK_BUILD_FOR_ANDROID) && \ - !defined(SK_BUILD_FOR_ANDROID_FRAMEWORK) - #include "cpu-features.h" - - static uint32_t read_cpu_features() { - uint32_t features = 0; - - uint64_t android_features = android_getCpuFeatures(); - if (android_features & ANDROID_CPU_ARM64_FEATURE_CRC32) { features |= SkCpu::CRC32; } + uint32_t hwcaps = getauxval(AT_HWCAP); + if (hwcaps & HWCAP_CRC32) { features |= SkCpu::CRC32; } return features; } |