diff options
author | jzern <jzern@chromium.org> | 2016-02-10 15:14:16 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-10 23:15:30 +0000 |
commit | e4e09c84ed53ac96c5cb86c3d5cdf806406a2c04 (patch) | |
tree | a4184c79dcba08cbdfece35fd8b83e85a1e3e050 | |
parent | 8089a8ae75369aac3784910276feff69b2f1f6cf (diff) | |
download | chromium_src-e4e09c84ed53ac96c5cb86c3d5cdf806406a2c04.zip chromium_src-e4e09c84ed53ac96c5cb86c3d5cdf806406a2c04.tar.gz chromium_src-e4e09c84ed53ac96c5cb86c3d5cdf806406a2c04.tar.bz2 |
libwebp: use -O2 on arm targets
improves performance ~11-22% depending on the device and whether the
image was lossless or lossily compressed.
BUG=416951
Review URL: https://codereview.chromium.org/1657113002
Cr-Commit-Position: refs/heads/master@{#374769}
-rw-r--r-- | third_party/libwebp/BUILD.gn | 32 | ||||
-rw-r--r-- | third_party/libwebp/libwebp.gyp | 8 |
2 files changed, 40 insertions, 0 deletions
diff --git a/third_party/libwebp/BUILD.gn b/third_party/libwebp/BUILD.gn index e53ce28..676a5d1 100644 --- a/third_party/libwebp/BUILD.gn +++ b/third_party/libwebp/BUILD.gn @@ -9,6 +9,9 @@ config("libwebp_config") { include_dirs = [ "." ] } +set_opt_level = + !is_debug && is_posix && (current_cpu == "arm" || current_cpu == "arm64") + use_dsp_neon = current_cpu == "arm64" || (current_cpu == "arm" && arm_version >= 7 && (arm_use_neon || arm_optionally_use_neon)) @@ -29,6 +32,10 @@ source_set("libwebp_dec") { configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] + if (set_opt_level) { + configs -= [ "//build/config/compiler:default_optimization" ] + configs += [ "//build/config/compiler:optimize_max" ] + } deps = [ ":libwebp_dsp", @@ -88,6 +95,10 @@ source_set("libwebp_dsp") { ] configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] + if (set_opt_level) { + configs -= [ "//build/config/compiler:default_optimization" ] + configs += [ "//build/config/compiler:optimize_max" ] + } all_dependent_configs = [ ":libwebp_config" ] deps = [ @@ -118,6 +129,10 @@ source_set("libwebp_dsp_sse41") { ] configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] + if (set_opt_level) { + configs -= [ "//build/config/compiler:default_optimization" ] + configs += [ "//build/config/compiler:optimize_max" ] + } all_dependent_configs = [ ":libwebp_config" ] if (!is_msan) { @@ -144,6 +159,10 @@ source_set("libwebp_dsp_sse2") { ] configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] + if (set_opt_level) { + configs -= [ "//build/config/compiler:default_optimization" ] + configs += [ "//build/config/compiler:optimize_max" ] + } all_dependent_configs = [ ":libwebp_config" ] if (!is_msan) { @@ -167,6 +186,11 @@ if (use_dsp_neon) { include_dirs = [ "." ] + if (set_opt_level) { + configs -= [ "//build/config/compiler:default_optimization" ] + configs += [ "//build/config/compiler:optimize_max" ] + } + if (current_cpu == "arm") { # behavior similar to *.c.neon in an Android.mk configs -= [ "//build/config/compiler:compiler_arm_fpu" ] @@ -210,6 +234,10 @@ source_set("libwebp_enc") { ] configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] + if (set_opt_level) { + configs -= [ "//build/config/compiler:default_optimization" ] + configs += [ "//build/config/compiler:optimize_max" ] + } all_dependent_configs = [ ":libwebp_config" ] @@ -242,6 +270,10 @@ source_set("libwebp_utils") { ] configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] + if (set_opt_level) { + configs -= [ "//build/config/compiler:default_optimization" ] + configs += [ "//build/config/compiler:optimize_max" ] + } all_dependent_configs = [ ":libwebp_config" ] diff --git a/third_party/libwebp/libwebp.gyp b/third_party/libwebp/libwebp.gyp index 7a8533a..a0acff1 100644 --- a/third_party/libwebp/libwebp.gyp +++ b/third_party/libwebp/libwebp.gyp @@ -3,6 +3,14 @@ # found in the LICENSE file. { + 'target_defaults': { + 'conditions': [ + ['os_posix==1 and (target_arch=="arm" or target_arch=="arm64")', { + 'cflags!': [ '-Os' ], + 'cflags': [ '-O2' ], + }], + ], + }, 'targets': [ { 'target_name': 'libwebp_dec', |