2016-07-27 20:55:26 +00:00
|
|
|
# Copyright 2016 Google Inc.
|
|
|
|
#
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
declare_args() {
|
2017-03-03 14:21:30 +00:00
|
|
|
skia_use_system_libwebp = is_official_build
|
2016-07-27 20:55:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
import("../third_party.gni")
|
|
|
|
|
2016-11-01 15:46:10 +00:00
|
|
|
if (skia_use_system_libwebp) {
|
|
|
|
system("libwebp") {
|
|
|
|
libs = [
|
|
|
|
"webp",
|
|
|
|
"webpdemux",
|
2017-08-01 14:07:25 +00:00
|
|
|
"webpmux",
|
2016-08-26 15:13:04 +00:00
|
|
|
]
|
|
|
|
}
|
2016-11-01 15:46:10 +00:00
|
|
|
} else {
|
2017-07-31 15:57:21 +00:00
|
|
|
config("libwebp_defines") {
|
2016-11-01 15:46:10 +00:00
|
|
|
defines = [
|
|
|
|
# WebP naturally decodes to RGB_565, and we work with BGR_565.
|
|
|
|
# This makes WebP decode to BGR_565 when we ask for RGB_565.
|
|
|
|
# (It also swaps the color order for 4444, but we don't care today.)
|
|
|
|
# TODO: swizzle ourself in SkWebpCodec instead of requiring this non-standard libwebp.
|
|
|
|
"WEBP_SWAP_16BIT_CSP",
|
|
|
|
]
|
2017-07-31 15:57:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
third_party("libwebp_sse41") {
|
2018-02-14 18:09:25 +00:00
|
|
|
public_include_dirs = [
|
|
|
|
"../externals/libwebp/src",
|
|
|
|
"../externals/libwebp",
|
|
|
|
]
|
2017-07-31 15:57:21 +00:00
|
|
|
configs += [ ":libwebp_defines" ]
|
|
|
|
sources = [
|
|
|
|
"../externals/libwebp/src/dsp/alpha_processing_sse41.c",
|
|
|
|
"../externals/libwebp/src/dsp/dec_sse41.c",
|
|
|
|
"../externals/libwebp/src/dsp/enc_sse41.c",
|
|
|
|
"../externals/libwebp/src/dsp/lossless_enc_sse41.c",
|
|
|
|
]
|
|
|
|
if ((current_cpu == "x86" || current_cpu == "x64") &&
|
|
|
|
(!is_win || is_clang)) {
|
2017-08-01 14:07:25 +00:00
|
|
|
cflags_c = [ "-msse4.1" ]
|
2017-07-31 15:57:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
third_party("libwebp_avx2") {
|
2018-02-14 18:09:25 +00:00
|
|
|
public_include_dirs = [
|
|
|
|
"../externals/libwebp/src",
|
|
|
|
"../externals/libwebp",
|
|
|
|
]
|
2017-07-31 15:57:21 +00:00
|
|
|
configs += [ ":libwebp_defines" ]
|
|
|
|
sources = [
|
|
|
|
"../externals/libwebp/src/dsp/enc_avx2.c",
|
|
|
|
]
|
|
|
|
if ((current_cpu == "x86" || current_cpu == "x64") &&
|
|
|
|
(!is_win || is_clang)) {
|
2017-08-01 14:07:25 +00:00
|
|
|
cflags_c = [ "-mavx2" ]
|
2017-07-31 15:57:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
third_party("libwebp") {
|
2018-02-14 18:09:25 +00:00
|
|
|
public_include_dirs = [
|
|
|
|
"../externals/libwebp/src",
|
|
|
|
"../externals/libwebp",
|
|
|
|
]
|
2017-07-31 15:57:21 +00:00
|
|
|
|
|
|
|
deps = [
|
|
|
|
":libwebp_avx2",
|
2017-08-01 14:07:25 +00:00
|
|
|
":libwebp_sse41",
|
2017-07-31 15:57:21 +00:00
|
|
|
]
|
|
|
|
if (is_android) {
|
2017-08-01 14:07:25 +00:00
|
|
|
deps += [ "//third_party/cpu-features" ]
|
2017-07-31 15:57:21 +00:00
|
|
|
}
|
2016-08-01 22:50:27 +00:00
|
|
|
|
2017-07-31 15:57:21 +00:00
|
|
|
configs += [ ":libwebp_defines" ]
|
2016-11-01 15:46:10 +00:00
|
|
|
sources = [
|
2017-02-16 13:57:41 +00:00
|
|
|
"../externals/libwebp/src/dec/alpha_dec.c",
|
|
|
|
"../externals/libwebp/src/dec/buffer_dec.c",
|
|
|
|
"../externals/libwebp/src/dec/frame_dec.c",
|
|
|
|
"../externals/libwebp/src/dec/idec_dec.c",
|
|
|
|
"../externals/libwebp/src/dec/io_dec.c",
|
|
|
|
"../externals/libwebp/src/dec/quant_dec.c",
|
|
|
|
"../externals/libwebp/src/dec/tree_dec.c",
|
|
|
|
"../externals/libwebp/src/dec/vp8_dec.c",
|
|
|
|
"../externals/libwebp/src/dec/vp8l_dec.c",
|
|
|
|
"../externals/libwebp/src/dec/webp_dec.c",
|
2018-02-14 18:09:25 +00:00
|
|
|
"../externals/libwebp/src/demux/anim_decode.c",
|
2016-11-01 15:46:10 +00:00
|
|
|
"../externals/libwebp/src/demux/demux.c",
|
|
|
|
"../externals/libwebp/src/dsp/alpha_processing.c",
|
|
|
|
"../externals/libwebp/src/dsp/alpha_processing_mips_dsp_r2.c",
|
2017-02-16 13:57:41 +00:00
|
|
|
"../externals/libwebp/src/dsp/alpha_processing_neon.c",
|
2016-11-01 15:46:10 +00:00
|
|
|
"../externals/libwebp/src/dsp/alpha_processing_sse2.c",
|
|
|
|
"../externals/libwebp/src/dsp/cost.c",
|
|
|
|
"../externals/libwebp/src/dsp/cost_mips32.c",
|
|
|
|
"../externals/libwebp/src/dsp/cost_mips_dsp_r2.c",
|
|
|
|
"../externals/libwebp/src/dsp/cost_sse2.c",
|
|
|
|
"../externals/libwebp/src/dsp/cpu.c",
|
|
|
|
"../externals/libwebp/src/dsp/dec.c",
|
|
|
|
"../externals/libwebp/src/dsp/dec_clip_tables.c",
|
|
|
|
"../externals/libwebp/src/dsp/dec_mips32.c",
|
|
|
|
"../externals/libwebp/src/dsp/dec_mips_dsp_r2.c",
|
2018-02-14 18:09:25 +00:00
|
|
|
"../externals/libwebp/src/dsp/dec_msa.c",
|
2016-11-01 15:46:10 +00:00
|
|
|
"../externals/libwebp/src/dsp/dec_neon.c",
|
|
|
|
"../externals/libwebp/src/dsp/dec_sse2.c",
|
|
|
|
"../externals/libwebp/src/dsp/enc.c",
|
|
|
|
"../externals/libwebp/src/dsp/enc_mips32.c",
|
|
|
|
"../externals/libwebp/src/dsp/enc_mips_dsp_r2.c",
|
2017-02-16 13:57:41 +00:00
|
|
|
"../externals/libwebp/src/dsp/enc_msa.c",
|
2016-11-01 15:46:10 +00:00
|
|
|
"../externals/libwebp/src/dsp/enc_neon.c",
|
|
|
|
"../externals/libwebp/src/dsp/enc_sse2.c",
|
|
|
|
"../externals/libwebp/src/dsp/filters.c",
|
|
|
|
"../externals/libwebp/src/dsp/filters_mips_dsp_r2.c",
|
2017-02-16 13:57:41 +00:00
|
|
|
"../externals/libwebp/src/dsp/filters_msa.c",
|
|
|
|
"../externals/libwebp/src/dsp/filters_neon.c",
|
2016-11-01 15:46:10 +00:00
|
|
|
"../externals/libwebp/src/dsp/filters_sse2.c",
|
|
|
|
"../externals/libwebp/src/dsp/lossless.c",
|
|
|
|
"../externals/libwebp/src/dsp/lossless_enc.c",
|
|
|
|
"../externals/libwebp/src/dsp/lossless_enc_mips32.c",
|
|
|
|
"../externals/libwebp/src/dsp/lossless_enc_mips_dsp_r2.c",
|
2017-02-16 13:57:41 +00:00
|
|
|
"../externals/libwebp/src/dsp/lossless_enc_msa.c",
|
2016-11-01 15:46:10 +00:00
|
|
|
"../externals/libwebp/src/dsp/lossless_enc_neon.c",
|
|
|
|
"../externals/libwebp/src/dsp/lossless_enc_sse2.c",
|
|
|
|
"../externals/libwebp/src/dsp/lossless_mips_dsp_r2.c",
|
2017-02-16 13:57:41 +00:00
|
|
|
"../externals/libwebp/src/dsp/lossless_msa.c",
|
2016-11-01 15:46:10 +00:00
|
|
|
"../externals/libwebp/src/dsp/lossless_neon.c",
|
|
|
|
"../externals/libwebp/src/dsp/lossless_sse2.c",
|
|
|
|
"../externals/libwebp/src/dsp/rescaler.c",
|
|
|
|
"../externals/libwebp/src/dsp/rescaler_mips32.c",
|
|
|
|
"../externals/libwebp/src/dsp/rescaler_mips_dsp_r2.c",
|
2017-02-16 13:57:41 +00:00
|
|
|
"../externals/libwebp/src/dsp/rescaler_msa.c",
|
2016-11-01 15:46:10 +00:00
|
|
|
"../externals/libwebp/src/dsp/rescaler_neon.c",
|
|
|
|
"../externals/libwebp/src/dsp/rescaler_sse2.c",
|
2018-02-14 18:09:25 +00:00
|
|
|
"../externals/libwebp/src/dsp/ssim.c",
|
|
|
|
"../externals/libwebp/src/dsp/ssim_sse2.c",
|
2016-11-01 15:46:10 +00:00
|
|
|
"../externals/libwebp/src/dsp/upsampling.c",
|
|
|
|
"../externals/libwebp/src/dsp/upsampling_mips_dsp_r2.c",
|
2017-02-16 13:57:41 +00:00
|
|
|
"../externals/libwebp/src/dsp/upsampling_msa.c",
|
2016-11-01 15:46:10 +00:00
|
|
|
"../externals/libwebp/src/dsp/upsampling_neon.c",
|
|
|
|
"../externals/libwebp/src/dsp/upsampling_sse2.c",
|
|
|
|
"../externals/libwebp/src/dsp/yuv.c",
|
|
|
|
"../externals/libwebp/src/dsp/yuv_mips32.c",
|
|
|
|
"../externals/libwebp/src/dsp/yuv_mips_dsp_r2.c",
|
2018-02-14 18:09:25 +00:00
|
|
|
"../externals/libwebp/src/dsp/yuv_neon.c",
|
2016-11-01 15:46:10 +00:00
|
|
|
"../externals/libwebp/src/dsp/yuv_sse2.c",
|
2017-02-16 13:57:41 +00:00
|
|
|
"../externals/libwebp/src/enc/alpha_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/analysis_enc.c",
|
2018-02-14 18:09:25 +00:00
|
|
|
"../externals/libwebp/src/enc/backward_references_cost_enc.c",
|
2017-02-16 13:57:41 +00:00
|
|
|
"../externals/libwebp/src/enc/backward_references_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/config_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/cost_enc.c",
|
2018-02-14 18:09:25 +00:00
|
|
|
"../externals/libwebp/src/enc/delta_palettization_enc.c",
|
2017-02-16 13:57:41 +00:00
|
|
|
"../externals/libwebp/src/enc/filter_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/frame_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/histogram_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/iterator_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/near_lossless_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/picture_csp_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/picture_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/picture_psnr_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/picture_rescale_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/picture_tools_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/predictor_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/quant_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/syntax_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/token_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/tree_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/vp8l_enc.c",
|
|
|
|
"../externals/libwebp/src/enc/webp_enc.c",
|
2017-04-06 20:34:38 +00:00
|
|
|
"../externals/libwebp/src/mux/anim_encode.c",
|
|
|
|
"../externals/libwebp/src/mux/muxedit.c",
|
|
|
|
"../externals/libwebp/src/mux/muxinternal.c",
|
|
|
|
"../externals/libwebp/src/mux/muxread.c",
|
2017-02-16 13:57:41 +00:00
|
|
|
"../externals/libwebp/src/utils/bit_reader_utils.c",
|
|
|
|
"../externals/libwebp/src/utils/bit_writer_utils.c",
|
|
|
|
"../externals/libwebp/src/utils/color_cache_utils.c",
|
|
|
|
"../externals/libwebp/src/utils/filters_utils.c",
|
|
|
|
"../externals/libwebp/src/utils/huffman_encode_utils.c",
|
|
|
|
"../externals/libwebp/src/utils/huffman_utils.c",
|
|
|
|
"../externals/libwebp/src/utils/quant_levels_dec_utils.c",
|
|
|
|
"../externals/libwebp/src/utils/quant_levels_utils.c",
|
|
|
|
"../externals/libwebp/src/utils/random_utils.c",
|
|
|
|
"../externals/libwebp/src/utils/rescaler_utils.c",
|
|
|
|
"../externals/libwebp/src/utils/thread_utils.c",
|
2016-11-01 15:46:10 +00:00
|
|
|
"../externals/libwebp/src/utils/utils.c",
|
|
|
|
]
|
|
|
|
}
|
2016-07-27 20:55:26 +00:00
|
|
|
}
|