| load("//bazel:flags.bzl", "string_flag_with_values") |
| load("//bazel:skia_rules.bzl", "exports_files_legacy", "generate_cpp_files_for_headers", "select_multi", "skia_cc_deps", "skia_cc_library", "skia_filegroup") |
| |
| package( |
| default_applicable_licenses = ["//:license"], |
| ) |
| |
| licenses(["notice"]) |
| |
| exports_files_legacy() |
| |
| string_flag_with_values( |
| name = "include_encoder", |
| multiple = True, |
| values = [ |
| "jpeg_encode_codec", |
| "png_encode_codec", |
| "webp_encode_codec", |
| ], |
| ) |
| |
| # In separate skia_filegroups to export these as gni file lists |
| skia_filegroup( |
| name = "jpeg_encode_srcs", |
| srcs = [ |
| "SkJPEGWriteUtility.cpp", |
| "SkJpegEncoderImpl.cpp", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "jpeg_encode_hdrs", |
| srcs = [ |
| "SkJPEGWriteUtility.h", |
| "SkJpegEncoderImpl.h", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "no_jpeg_encode_srcs", |
| srcs = ["SkJpegEncoder_none.cpp"], |
| ) |
| |
| skia_filegroup( |
| name = "png_encode_hdrs", |
| srcs = ["SkPngEncoderImpl.h"], |
| ) |
| |
| skia_filegroup( |
| name = "png_encode_srcs", |
| srcs = ["SkPngEncoderImpl.cpp"], |
| ) |
| |
| skia_filegroup( |
| name = "no_png_encode_srcs", |
| srcs = ["SkPngEncoder_none.cpp"], |
| ) |
| |
| skia_filegroup( |
| name = "webp_encode_srcs", |
| srcs = ["SkWebpEncoderImpl.cpp"], |
| ) |
| |
| skia_filegroup( |
| name = "no_webp_encode_srcs", |
| srcs = ["SkWebpEncoder_none.cpp"], |
| ) |
| |
| skia_filegroup( |
| name = "srcs", |
| srcs = [ |
| "SkEncoder.cpp", |
| "SkICC.cpp", |
| ] + select_multi( |
| default_cases = { |
| ":jpeg_encode_codec": [":no_jpeg_encode_srcs"], |
| ":png_encode_codec": [":no_png_encode_srcs"], |
| ":webp_encode_codec": [":no_webp_encode_srcs"], |
| }, |
| values_map = { |
| ":jpeg_encode_codec": [":jpeg_encode_srcs"], |
| ":png_encode_codec": [":png_encode_srcs"], |
| ":webp_encode_codec": [":webp_encode_srcs"], |
| }, |
| ), |
| visibility = ["//src:__pkg__"], |
| ) |
| |
| skia_filegroup( |
| name = "private_hdrs", |
| srcs = [ |
| "SkICCPriv.h", |
| "SkImageEncoderFns.h", |
| "SkImageEncoderPriv.h", |
| ] + select_multi({ |
| ":png_encode_codec": [":png_encode_hdrs"], |
| ":jpeg_encode_codec": [ |
| ":jpeg_encode_hdrs", |
| "//src/codec:shared_jpeg_hdrs", |
| ], |
| }), |
| visibility = ["//src:__pkg__"], |
| ) |
| |
| skia_cc_deps( |
| name = "deps", |
| visibility = ["//src:__pkg__"], |
| deps = select_multi( |
| { |
| ":jpeg_encode_codec": ["@libjpeg_turbo"], |
| ":png_encode_codec": ["@libpng"], |
| ":webp_encode_codec": ["@libwebp"], |
| }, |
| ), |
| ) |
| |
| skia_cc_library( |
| name = "icc_support", |
| srcs = [ |
| "SkICC.cpp", |
| ], |
| hdrs = [ |
| "SkICCPriv.h", |
| "//include/encode:icc_hdrs", |
| ], |
| features = ["layering_check"], |
| deps = [ |
| "//:core", |
| "//modules/skcms", |
| "//src/base", |
| "//src/core:core_priv", |
| ], |
| ) |
| |
| skia_cc_library( |
| name = "encoder_common", |
| srcs = [ |
| "SkEncoder.cpp", |
| "//include/encode:encode_hdrs", |
| ], |
| hdrs = [ |
| "SkImageEncoderFns.h", |
| "SkImageEncoderPriv.h", |
| ], |
| features = ["layering_check"], |
| deps = [ |
| ":icc_support", |
| "//:core", |
| "//modules/skcms", |
| "//src/base", |
| "//src/core:core_priv", |
| ], |
| ) |
| |
| skia_cc_library( |
| name = "icc_encode", |
| hdrs = [ |
| "//include/encode:icc_hdrs", |
| ], |
| visibility = ["//:__subpackages__"], |
| deps = [ |
| ":icc_support", |
| ], |
| ) |
| |
| skia_cc_library( |
| name = "png_encode", |
| srcs = [ |
| ":png_encode_hdrs", |
| ":png_encode_srcs", |
| "//src/codec:common_png_srcs", |
| ], |
| hdrs = [ |
| "//include/encode:encode_hdrs", |
| "//include/encode:png_hdrs", |
| ], |
| features = ["layering_check"], |
| visibility = ["//:__pkg__"], |
| deps = [ |
| ":encoder_common", |
| "//:core", |
| "//modules/skcms", |
| "//src/base", |
| "//src/core:core_priv", |
| "@libpng", |
| ], |
| ) |
| |
| skia_cc_library( |
| name = "jpeg_encode", |
| srcs = [ |
| ":jpeg_encode_hdrs", |
| ":jpeg_encode_srcs", |
| "//src/codec:common_jpeg_srcs", |
| ], |
| hdrs = [ |
| "//include/encode:encode_hdrs", |
| "//include/encode:jpeg_hdrs", |
| ], |
| features = ["layering_check"], |
| visibility = ["//:__pkg__"], |
| deps = [ |
| ":encoder_common", |
| "//:core", |
| "//src/base", |
| "//src/core:core_priv", |
| "@libjpeg_turbo", |
| ], |
| ) |
| |
| skia_cc_library( |
| name = "webp_encode", |
| srcs = [ |
| ":webp_encode_srcs", |
| ], |
| hdrs = [ |
| "//include/encode:encode_hdrs", |
| "//include/encode:webp_hdrs", |
| ], |
| features = ["layering_check"], |
| visibility = ["//:__pkg__"], |
| deps = [ |
| ":encoder_common", |
| "//:core", |
| "//src/base", |
| "//src/core:core_priv", |
| "@libwebp", |
| ], |
| ) |
| |
| generate_cpp_files_for_headers( |
| name = "headers_to_compile", |
| headers = [ |
| "SkICCPriv.h", |
| "SkImageEncoderFns.h", |
| "SkImageEncoderPriv.h", |
| ], |
| ) |