diff options
author | 2016-06-01 07:08:56 -0700 | |
---|---|---|
committer | 2016-06-01 07:08:56 -0700 | |
commit | e3fa811657ecf4ab694d026752a81080c6b10611 (patch) | |
tree | 59836ffdb94ac987cd68fb6270e5e3d21cd56273 /include/core/SkPreConfig.h | |
parent | ba150cc283301a28693a18d4aa9d14b1a1616ab3 (diff) |
[GN] Add support for disabling opts via SK_BUILD_NO_OPTS define.
When targetting iOS and using gyp to generate the build files, it is not
possible to select files to build depending on the architecture. Due to
that, the skia code was disabling all optimisation when SK_BUILD_FOR_IOS
was defined.
Since it is possible to select the correct optimised version when using
gn, this pessimisation is hurting the build. Introduce a new define to
disable the optimisation SK_BUILD_NO_OPTS. It will be used by Chromium
when building skia for iOS with gyp but not gn.
Define SK_BUILD_NO_OPTS along-side SK_BUILD_FOR_IOS for all files that
look like build configuration (Xcode projects, gyp configuration files,
public.bzl) in order to avoid introducing breakage on those builds.
BUG=607933
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2002423002
Review-Url: https://codereview.chromium.org/2002423002
Diffstat (limited to 'include/core/SkPreConfig.h')
-rw-r--r-- | include/core/SkPreConfig.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/include/core/SkPreConfig.h b/include/core/SkPreConfig.h index b9b46c073a..928c1bda63 100644 --- a/include/core/SkPreConfig.h +++ b/include/core/SkPreConfig.h @@ -118,8 +118,12 @@ #define SK_CPU_SSE_LEVEL_AVX 51 #define SK_CPU_SSE_LEVEL_AVX2 52 -#ifdef SK_BUILD_FOR_IOS - #define SK_CPU_SSE_LEVEL 0 // We're tired of fighting with opts/ and iOS simulator. +// When targetting iOS and using gyp to generate the build files, it is not +// possible to select files to build depending on the architecture (i.e. it +// is not possible to use hand optimized assembly implementation). In that +// configuration SK_BUILD_NO_OPTS is defined. Remove optimisation then. +#ifdef SK_BUILD_NO_OPTS + #define SK_CPU_SSE_LEVEL 0 #endif // Are we in GCC? @@ -190,14 +194,12 @@ #endif #endif -// Disable ARM64 optimizations for iOS due to complications regarding gyp and iOS. -#if defined(__aarch64__) && !defined(SK_BUILD_FOR_IOS) +#if defined(__aarch64__) && !defined(SK_BUILD_NO_OPTS) #define SK_CPU_ARM64 #endif // All 64-bit ARM chips have NEON. Many 32-bit ARM chips do too. -// TODO: Why don't we want NEON on iOS? -#if !defined(SK_ARM_HAS_NEON) && !defined(SK_BUILD_FOR_IOS) && (defined(__ARM_NEON__) || defined(__ARM_NEON)) +#if !defined(SK_ARM_HAS_NEON) && !defined(SK_BUILD_NO_OPTS) && (defined(__ARM_NEON__) || defined(__ARM_NEON)) #define SK_ARM_HAS_NEON #endif |