summaryrefslogtreecommitdiff
path: root/chromium/third_party/skia/src/codec/BUILD.bazel
blob: 37d2ed0a0a3012cb668c3c75d26e9e5b4ac174a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
load(
    "//bazel:macros.bzl",
    "cc_library",
    "exports_files_legacy",
    "select_multi",
    "selects",
    "split_srcs_and_hdrs",
)

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",
    "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",
    "SkJpegDecoderMgr.cpp",
    "SkJpegDecoderMgr.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,
)

selects.config_setting_group(
    name = "needs_jpeg",
    match_any = [
        "//bazel/common_config_settings:jpeg_decode_codec",
        "//bazel/common_config_settings:raw_decode_codec",
    ],
)

selects.config_setting_group(
    name = "needs_jpeg_priv",
    match_any = [
        ":needs_jpeg",
        "//bazel/common_config_settings:jpeg_encode_codec",
    ],
)

selects.config_setting_group(
    name = "needs_png_priv",
    match_any = [
        "//bazel/common_config_settings:png_decode_codec",
        "//bazel/common_config_settings:png_encode_codec",
    ],
)

filegroup(
    name = "srcs",
    srcs = [
        ":decode_android_srcs",
        ":decode_bmp_srcs",
        ":core_srcs",
    ] + select_multi(
        {
            "//bazel/common_config_settings:gif_decode_codec": [":decode_gif_srcs"],
            ":needs_jpeg": [":decode_jpeg_srcs"],
            "//bazel/common_config_settings:png_decode_codec": [":decode_png_srcs"],
            "//bazel/common_config_settings:raw_decode_codec": [":decode_raw_srcs"],
            "//bazel/common_config_settings:webp_decode_codec": [":decode_webp_srcs"],
        },
        default = [],
    ),
    visibility = ["//src:__pkg__"],
)

filegroup(
    name = "private_hdrs",
    srcs = [
        ":decode_android_hdrs",
        ":decode_bmp_hdrs",
        ":core_hdrs",
    ] + select({
        ":needs_jpeg_priv": ["SkJpegPriv.h"],  # used by src/images/SkJPEGWriteUtility
        "//conditions:default": [],
    }) + select({
        ":needs_png_priv": ["SkPngPriv.h"],  # used by src/images/SkPngEncoder
        "//conditions:default": [],
    }) + select_multi(
        {
            "//bazel/common_config_settings:gif_decode_codec": [":decode_gif_hdrs"],
            ":needs_jpeg": [":decode_jpeg_hdrs"],
            "//bazel/common_config_settings:png_decode_codec": [":decode_png_hdrs"],
            "//bazel/common_config_settings:raw_decode_codec": [":decode_raw_hdrs"],
            "//bazel/common_config_settings:webp_decode_codec": [":decode_webp_hdrs"],
        },
        default = [],
    ),
    visibility = ["//src:__pkg__"],
)

cc_library(
    name = "deps",
    visibility = ["//src:__pkg__"],
    deps = select_multi(
        {
            "//bazel/common_config_settings:gif_decode_codec": ["@wuffs"],
            ":needs_jpeg": ["@libjpeg_turbo"],
            "//bazel/common_config_settings:png_decode_codec": ["@libpng"],
            "//bazel/common_config_settings:raw_decode_codec": [
                "@dng_sdk",
                "@piex",
            ],
            "//bazel/common_config_settings:webp_decode_codec": ["@libwebp"],
        },
        default = [],
    ),
)