Chromium Code Reviews| Index: third_party/libwebp/BUILD.gn |
| diff --git a/third_party/libwebp/BUILD.gn b/third_party/libwebp/BUILD.gn |
| index fbaffd6f57d1954a1f88266e050b8ba582997197..8d9a1b3dbb93ca9da9e47966d64e8b1848fef4a5 100644 |
| --- a/third_party/libwebp/BUILD.gn |
| +++ b/third_party/libwebp/BUILD.gn |
| @@ -3,6 +3,7 @@ |
| # found in the LICENSE file. |
| import("//build/config/arm.gni") |
| +import("//build/config/sanitizers/sanitizers.gni") |
| config("libwebp_config") { |
| include_dirs = [ "." ] |
| @@ -54,30 +55,44 @@ source_set("libwebp_demux") { |
| source_set("libwebp_dsp") { |
| sources = [ |
| "dsp/alpha_processing.c", |
| - "dsp/alpha_processing_sse2.c", |
| + "dsp/alpha_processing_mips_dsp_r2.c", |
| + "dsp/argb.c", |
| + "dsp/argb_mips_dsp_r2.c", |
| + "dsp/cost.c", |
| + "dsp/cost_mips32.c", |
| + "dsp/cost_mips_dsp_r2.c", |
| "dsp/cpu.c", |
| "dsp/dec.c", |
| "dsp/dec_clip_tables.c", |
| "dsp/dec_mips32.c", |
| - "dsp/dec_sse2.c", |
| + "dsp/dec_mips_dsp_r2.c", |
| "dsp/enc.c", |
| "dsp/enc_avx2.c", |
| "dsp/enc_mips32.c", |
| - "dsp/enc_sse2.c", |
| + "dsp/enc_mips_dsp_r2.c", |
| + "dsp/filters.c", |
| + "dsp/filters_mips_dsp_r2.c", |
| "dsp/lossless.c", |
| - "dsp/lossless_mips32.c", |
| - "dsp/lossless_sse2.c", |
| + "dsp/lossless_enc.c", |
| + "dsp/lossless_enc_mips32.c", |
| + "dsp/lossless_enc_mips_dsp_r2.c", |
| + "dsp/lossless_mips_dsp_r2.c", |
| + "dsp/rescaler.c", |
| + "dsp/rescaler_mips32.c", |
| + "dsp/rescaler_mips_dsp_r2.c", |
| "dsp/upsampling.c", |
| - "dsp/upsampling_sse2.c", |
| + "dsp/upsampling_mips_dsp_r2.c", |
| "dsp/yuv.c", |
| "dsp/yuv_mips32.c", |
| - "dsp/yuv_sse2.c", |
| + "dsp/yuv_mips_dsp_r2.c", |
| ] |
| configs -= [ "//build/config/compiler:chromium_code" ] |
| configs += [ "//build/config/compiler:no_chromium_code" ] |
| all_dependent_configs = [ ":libwebp_config" ] |
| deps = [ |
| + ":libwebp_dsp_sse2", |
| + ":libwebp_dsp_sse41", |
| ":libwebp_utils", |
| ] |
| if (is_android) { |
| @@ -86,6 +101,57 @@ source_set("libwebp_dsp") { |
| configs -= [ "//build/config/android:default_cygprofile_instrumentation" ] |
| configs += [ "//build/config/android:no_cygprofile_instrumentation" ] |
| } |
| + if (current_cpu == "x86" || current_cpu == "x64") { |
| + cflags = [ |
| + "-DWEBP_HAVE_SSE2", |
| + "-DWEBP_HAVE_SSE41", |
|
Nico
2015/12/24 15:38:49
gn has a defines thing too: https://code.google.co
jzern
2015/12/24 17:39:22
Thanks. I didn't look around after I hit on some y
|
| + ] |
| + } |
| +} |
| + |
| +source_set("libwebp_dsp_sse41") { |
| + sources = [ |
| + "dsp/alpha_processing_sse41.c", |
| + "dsp/dec_sse41.c", |
| + "dsp/enc_sse41.c", |
| + "dsp/lossless_enc_sse41.c", |
| + ] |
| + configs -= [ "//build/config/compiler:chromium_code" ] |
| + configs += [ "//build/config/compiler:no_chromium_code" ] |
| + |
| + all_dependent_configs = [ ":libwebp_config" ] |
| + if (!is_msan) { |
| + if ((current_cpu == "x86" || current_cpu == "x64") && |
| + (!is_win || is_clang)) { |
| + cflags = [ "-msse4.1" ] |
| + } |
| + } |
| +} |
| + |
| +source_set("libwebp_dsp_sse2") { |
| + sources = [ |
| + "dsp/alpha_processing_sse2.c", |
| + "dsp/argb_sse2.c", |
| + "dsp/cost_sse2.c", |
| + "dsp/dec_sse2.c", |
| + "dsp/enc_sse2.c", |
| + "dsp/filters_sse2.c", |
| + "dsp/lossless_enc_sse2.c", |
| + "dsp/lossless_sse2.c", |
| + "dsp/rescaler_sse2.c", |
| + "dsp/upsampling_sse2.c", |
| + "dsp/yuv_sse2.c", |
| + ] |
| + configs -= [ "//build/config/compiler:chromium_code" ] |
| + configs += [ "//build/config/compiler:no_chromium_code" ] |
| + |
| + all_dependent_configs = [ ":libwebp_config" ] |
| + if (!is_msan) { |
| + if ((current_cpu == "x86" || current_cpu == "x64") && |
| + (!is_win || is_clang)) { |
| + cflags = [ "-msse2" ] |
|
Nico
2015/12/24 15:38:49
sse2 is required by chromium and passed by default
jzern
2015/12/24 17:39:22
true it was working before, I just thought I'd do
|
| + } |
| + } |
| } |
| if (use_dsp_neon) { |
| @@ -93,7 +159,9 @@ if (use_dsp_neon) { |
| sources = [ |
| "dsp/dec_neon.c", |
| "dsp/enc_neon.c", |
| + "dsp/lossless_enc_neon.c", |
| "dsp/lossless_neon.c", |
| + "dsp/rescaler_neon.c", |
| "dsp/upsampling_neon.c", |
| ] |
| @@ -122,10 +190,12 @@ source_set("libwebp_enc") { |
| "enc/backward_references.c", |
| "enc/config.c", |
| "enc/cost.c", |
| + "enc/delta_palettization.c", |
| "enc/filter.c", |
| "enc/frame.c", |
| "enc/histogram.c", |
| "enc/iterator.c", |
| + "enc/near_lossless.c", |
| "enc/picture.c", |
| "enc/picture_csp.c", |
| "enc/picture_psnr.c", |