blob: a11859526d43cb16b8ba35d4426369b3d8c29267 [file] [log] [blame]
load(
"//bazel:skia_rules.bzl",
"exports_files_legacy",
"select_multi",
"skia_cc_deps",
"skia_filegroup",
"split_srcs_and_hdrs",
)
load("//bazel:flags.bzl", "selects", "string_flag_with_values")
licenses(["notice"])
exports_files_legacy()
CORE_FILES = [
"SkCodec.cpp",
"SkCodecImageGenerator.cpp",
"SkCodecImageGenerator.h",
"SkCodecPriv.h",
"SkColorTable.cpp",
"SkColorTable.h",
"SkFrameHolder.h",
"SkMaskSwizzler.cpp",
"SkMaskSwizzler.h",
"SkMasks.cpp",
"SkMasks.h",
"SkPixmapUtils.cpp",
"SkPixmapUtils.h",
"SkSampler.cpp",
"SkSampler.h",
"SkSwizzler.cpp",
"SkSwizzler.h",
]
split_srcs_and_hdrs(
name = "core",
files = CORE_FILES,
)
DECODE_ANDROID_FILES = [
"SkAndroidCodec.cpp",
"SkAndroidCodecAdapter.cpp",
"SkAndroidCodecAdapter.h",
"SkSampledCodec.cpp",
"SkSampledCodec.h",
]
split_srcs_and_hdrs(
name = "decode_android",
files = DECODE_ANDROID_FILES,
)
DECODE_BMP_FILES = [
"SkBmpBaseCodec.cpp",
"SkBmpBaseCodec.h",
"SkBmpCodec.cpp",
"SkBmpCodec.h",
"SkBmpMaskCodec.cpp",
"SkBmpMaskCodec.h",
"SkBmpRLECodec.cpp",
"SkBmpRLECodec.h",
"SkBmpStandardCodec.cpp",
"SkBmpStandardCodec.h",
"SkWbmpCodec.cpp",
"SkWbmpCodec.h",
]
split_srcs_and_hdrs(
name = "decode_bmp",
files = DECODE_BMP_FILES,
)
DECODE_GIF_FILES = [
"SkScalingCodec.h",
"SkWuffsCodec.cpp",
"SkWuffsCodec.h",
]
split_srcs_and_hdrs(
name = "decode_gif",
files = DECODE_GIF_FILES,
)
DECODE_JPEG_FILES = [
"SkEncodedInfo.cpp",
"SkJpegCodec.cpp",
"SkJpegCodec.h",
"SkJpegConstants.h",
"SkJpegDecoderMgr.cpp",
"SkJpegDecoderMgr.h",
"SkJpegSourceMgr.cpp",
"SkJpegSourceMgr.h",
"SkJpegUtility.cpp",
"SkJpegUtility.h",
"SkParseEncodedOrigin.cpp",
"SkParseEncodedOrigin.h",
]
split_srcs_and_hdrs(
name = "decode_jpeg",
files = DECODE_JPEG_FILES,
)
DECODE_PNG_FILES = [
"SkEncodedInfo.cpp",
"SkIcoCodec.cpp",
"SkIcoCodec.h",
"SkPngCodec.cpp",
"SkPngCodec.h",
]
split_srcs_and_hdrs(
name = "decode_png",
files = DECODE_PNG_FILES,
)
DECODE_RAW_FILES = [
"SkRawCodec.cpp",
"SkRawCodec.h",
]
split_srcs_and_hdrs(
name = "decode_raw",
files = DECODE_RAW_FILES,
)
DECODE_WEBP_FILES = [
"SkEncodedInfo.cpp",
"SkParseEncodedOrigin.cpp",
"SkParseEncodedOrigin.h",
"SkScalingCodec.h",
"SkWebpCodec.cpp",
"SkWebpCodec.h",
]
split_srcs_and_hdrs(
name = "decode_webp",
files = DECODE_WEBP_FILES,
)
split_srcs_and_hdrs(
name = "decode_avif",
files = [
"SkAvifCodec.cpp",
"SkAvifCodec.h",
"SkScalingCodec.h",
],
)
split_srcs_and_hdrs(
name = "decode_jxl",
files = [
"SkJpegxlCodec.cpp",
"SkJpegxlCodec.h",
"SkScalingCodec.h",
],
)
string_flag_with_values(
name = "include_decoder",
multiple = True,
values = [
"avif_decode_codec",
"gif_decode_codec",
"jpeg_decode_codec",
"jxl_decode_codec",
"png_decode_codec",
"raw_decode_codec",
"webp_decode_codec",
],
)
selects.config_setting_group(
name = "needs_jpeg",
match_any = [
":jpeg_decode_codec",
":raw_decode_codec",
],
)
selects.config_setting_group(
name = "needs_jpeg_priv",
match_any = [
":needs_jpeg",
"//src/encode:jpeg_encode_codec",
],
)
selects.config_setting_group(
name = "needs_png_priv",
match_any = [
":png_decode_codec",
"//src/encode:png_encode_codec",
],
)
skia_filegroup(
name = "srcs",
srcs = [
":decode_android_srcs",
":decode_bmp_srcs",
":core_srcs",
] + select_multi(
{
":avif_decode_codec": [":decode_avif_srcs"],
":gif_decode_codec": [":decode_gif_srcs"],
":needs_jpeg": [":decode_jpeg_srcs"],
":jxl_decode_codec": [":decode_jxl_srcs"],
":png_decode_codec": [":decode_png_srcs"],
":raw_decode_codec": [":decode_raw_srcs"],
":webp_decode_codec": [":decode_webp_srcs"],
},
),
visibility = ["//src:__pkg__"],
)
skia_filegroup(
name = "private_hdrs",
srcs = [
":decode_android_hdrs",
":decode_bmp_hdrs",
":core_hdrs",
] + select({
":needs_jpeg_priv": ["SkJpegPriv.h"], # used by src/encode/SkJPEGWriteUtility
"//conditions:default": [],
}) + select({
":needs_png_priv": ["SkPngPriv.h"], # used by src/encode/SkPngEncoder
"//conditions:default": [],
}) + select_multi(
{
":avif_decode_codec": [":decode_avif_hdrs"],
":gif_decode_codec": [":decode_gif_hdrs"],
":needs_jpeg": [":decode_jpeg_hdrs"],
":jxl_decode_codec": [":decode_jxl_hdrs"],
":png_decode_codec": [":decode_png_hdrs"],
":raw_decode_codec": [":decode_raw_hdrs"],
":webp_decode_codec": [":decode_webp_hdrs"],
},
),
visibility = ["//src:__pkg__"],
)
skia_cc_deps(
name = "deps",
visibility = ["//src:__pkg__"],
deps = select_multi(
{
":avif_decode_codec": ["@libavif"],
":gif_decode_codec": ["@wuffs"],
":needs_jpeg": ["@libjpeg_turbo"],
"jxl_decode_codec": ["@libjxl"],
":png_decode_codec": ["@libpng"],
":raw_decode_codec": [
"@dng_sdk",
"@piex",
],
":webp_decode_codec": ["@libwebp"],
},
),
)