Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(458)

Side by Side Diff: BUILD.gn

Issue 2267343004: GN: more optional components: jpeg, pdf, png, xml (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Do not include png.h from SkPngCodec.h Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/codec/SkPngCodec.h » ('j') | src/codec/SkPngCodec.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 Google Inc. 1 # Copyright 2016 Google Inc.
2 # 2 #
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 declare_args() { 6 declare_args() {
7 skia_use_expat = true
7 skia_use_giflib = !is_fuchsia 8 skia_use_giflib = !is_fuchsia
9 skia_use_libjpeg_turbo = true
10 skia_use_libpng = true
8 skia_use_libwebp = !is_fuchsia 11 skia_use_libwebp = !is_fuchsia
12 skia_use_sfntly = !is_fuchsia
13 skia_use_zlib = true
9 } 14 }
10 15
11 skia_public_includes = [ 16 skia_public_includes = [
12 "include/android", 17 "include/android",
13 "include/c", 18 "include/c",
14 "include/codec", 19 "include/codec",
15 "include/config", 20 "include/config",
16 "include/core", 21 "include/core",
17 "include/effects", 22 "include/effects",
18 "include/gpu", 23 "include/gpu",
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 "src/pathops", 58 "src/pathops",
54 "src/pdf", 59 "src/pdf",
55 "src/ports", 60 "src/ports",
56 "src/sfnt", 61 "src/sfnt",
57 "src/utils", 62 "src/utils",
58 "src/utils/win", 63 "src/utils/win",
59 "third_party/etc1", 64 "third_party/etc1",
60 "third_party/ktx", 65 "third_party/ktx",
61 ] 66 ]
62 67
63 defines = [ 68 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
64 "SK_GAMMA_APPLY_TO_A8",
65
66 "SK_HAS_JPEG_LIBRARY",
67 "SK_HAS_PNG_LIBRARY",
68
69 # TODO(halcanary): make this the default; this is the value Android uses.
70 "SK_SFNTLY_SUBSETTER=\"sample/chromium/font_subsetter.h\"",
71 ]
72 if (is_linux) { 69 if (is_linux) {
73 defines += [ "SK_SAMPLES_FOR_X" ] 70 defines += [ "SK_SAMPLES_FOR_X" ]
74 } 71 }
75 } 72 }
76 73
77 # Any code that's linked into Skia-the-library should use this config via += ski a_library_configs. 74 # Any code that's linked into Skia-the-library should use this config via += ski a_library_configs.
78 config("skia_library") { 75 config("skia_library") {
79 visibility = [ ":*" ] 76 visibility = [ ":*" ]
80 defines = [ "SKIA_IMPLEMENTATION=1" ] 77 defines = [ "SKIA_IMPLEMENTATION=1" ]
81 } 78 }
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 209
213 configs += skia_library_configs 210 configs += skia_library_configs
214 deps = [ 211 deps = [
215 "//third_party/giflib", 212 "//third_party/giflib",
216 ] 213 ]
217 sources = [ 214 sources = [
218 "src/codec/SkGifCodec.cpp", 215 "src/codec/SkGifCodec.cpp",
219 ] 216 ]
220 } 217 }
221 218
219 optional("jpeg") {
220 enabled = skia_use_libjpeg_turbo
221 public_defines = [ "SK_HAS_JPEG_LIBRARY" ]
222
223 configs += skia_library_configs
224 deps = [
225 "//third_party/libjpeg-turbo:libjpeg",
226 ]
227 sources = [
228 "src/codec/SkJpegCodec.cpp",
229 "src/codec/SkJpegDecoderMgr.cpp",
230 "src/codec/SkJpegUtility.cpp",
231 "src/images/SkJPEGImageEncoder.cpp",
232 "src/images/SkJPEGWriteUtility.cpp",
233 ]
234 }
235
236 optional("pdf") {
237 enabled = skia_use_zlib
238 public_defines = []
239
240 configs += skia_library_configs
241 deps = [
242 "//third_party/zlib",
243 ]
244 sources = pdf_gypi.sources
245
246 if (skia_use_sfntly) {
247 deps += [ "//third_party/sfntly" ]
248 public_defines += [
249 # TODO(halcanary): make this the default; this is the value Android uses.
250 "SK_SFNTLY_SUBSETTER=\"sample/chromium/font_subsetter.h\"",
251 ]
252 }
253 }
254
255 optional("png") {
256 enabled = skia_use_libpng
257 public_defines = [ "SK_HAS_PNG_LIBRARY" ]
258
259 configs += skia_library_configs
260 deps = [
261 "//third_party/libpng",
262 ]
263 sources = [
264 "src/codec/SkIcoCodec.cpp",
265 "src/codec/SkPngCodec.cpp",
266 "src/images/SkPNGImageEncoder.cpp",
267 ]
268 }
269
222 optional("webp") { 270 optional("webp") {
223 enabled = skia_use_libwebp 271 enabled = skia_use_libwebp
224 public_defines = [ "SK_HAS_WEBP_LIBRARY" ] 272 public_defines = [ "SK_HAS_WEBP_LIBRARY" ]
225 273
226 configs += skia_library_configs 274 configs += skia_library_configs
227 deps = [ 275 deps = [
228 "//third_party/libwebp", 276 "//third_party/libwebp",
229 ] 277 ]
230 sources = [ 278 sources = [
231 "src/codec/SkWebpAdapterCodec.cpp", 279 "src/codec/SkWebpAdapterCodec.cpp",
232 "src/codec/SkWebpCodec.cpp", 280 "src/codec/SkWebpCodec.cpp",
233 "src/images/SkWEBPImageEncoder.cpp", 281 "src/images/SkWEBPImageEncoder.cpp",
234 ] 282 ]
235 } 283 }
236 284
285 optional("xml") {
286 enabled = skia_use_expat
287 public_defines = []
288
289 configs += skia_library_configs
290 deps = [
291 "//third_party/expat",
292 ]
293 sources = [
294 "src/xml/SkDOM.cpp",
295 "src/xml/SkXMLParser.cpp",
296 "src/xml/SkXMLWriter.cpp",
297 ]
298 }
299
237 component("skia") { 300 component("skia") {
238 public_configs = [ ":skia_public" ] 301 public_configs = [ ":skia_public" ]
239 configs += skia_library_configs 302 configs += skia_library_configs
240 303
241 deps = [ 304 deps = [
242 ":gif", 305 ":gif",
306 ":jpeg",
307 ":pdf",
308 ":png",
243 ":webp", 309 ":webp",
244 "//third_party/expat", 310 ":xml",
245 "//third_party/libjpeg-turbo:libjpeg",
246 "//third_party/libpng",
247 "//third_party/sfntly",
248 "//third_party/zlib",
249 ] 311 ]
250 if (is_x86) { 312 if (is_x86) {
251 deps += [ 313 deps += [
252 ":opts_avx", 314 ":opts_avx",
253 ":opts_sse2", 315 ":opts_sse2",
254 ":opts_sse41", 316 ":opts_sse41",
255 ":opts_sse42", 317 ":opts_sse42",
256 ":opts_ssse3", 318 ":opts_ssse3",
257 ] 319 ]
258 } else { 320 } else {
259 deps += [ ":opts_none" ] 321 deps += [ ":opts_none" ]
260 } 322 }
261 323
262 if (!is_win) { 324 if (!is_win) {
263 libs = [ "pthread" ] 325 libs = [ "pthread" ]
264 } 326 }
265 327
266 sources = [] 328 sources = []
267 sources += core_gypi.sources 329 sources += core_gypi.sources
268 sources += effects_gypi.sources 330 sources += effects_gypi.sources
269 sources += gpu_gypi.skgpu_sources 331 sources += gpu_gypi.skgpu_sources
270 sources += pdf_gypi.sources
271 sources += utils_gypi.sources 332 sources += utils_gypi.sources
272 sources += [ 333 sources += [
273 "src/android/SkBitmapRegionCodec.cpp", 334 "src/android/SkBitmapRegionCodec.cpp",
274 "src/android/SkBitmapRegionDecoder.cpp", 335 "src/android/SkBitmapRegionDecoder.cpp",
275 "src/codec/SkAndroidCodec.cpp", 336 "src/codec/SkAndroidCodec.cpp",
276 "src/codec/SkBmpCodec.cpp", 337 "src/codec/SkBmpCodec.cpp",
277 "src/codec/SkBmpMaskCodec.cpp", 338 "src/codec/SkBmpMaskCodec.cpp",
278 "src/codec/SkBmpRLECodec.cpp", 339 "src/codec/SkBmpRLECodec.cpp",
279 "src/codec/SkBmpStandardCodec.cpp", 340 "src/codec/SkBmpStandardCodec.cpp",
280 "src/codec/SkCodec.cpp", 341 "src/codec/SkCodec.cpp",
281 "src/codec/SkCodecImageGenerator.cpp", 342 "src/codec/SkCodecImageGenerator.cpp",
282 "src/codec/SkIcoCodec.cpp",
283 "src/codec/SkJpegCodec.cpp",
284 "src/codec/SkJpegDecoderMgr.cpp",
285 "src/codec/SkJpegUtility.cpp",
286 "src/codec/SkMaskSwizzler.cpp", 343 "src/codec/SkMaskSwizzler.cpp",
287 "src/codec/SkMasks.cpp", 344 "src/codec/SkMasks.cpp",
288 "src/codec/SkPngCodec.cpp",
289 "src/codec/SkSampledCodec.cpp", 345 "src/codec/SkSampledCodec.cpp",
290 "src/codec/SkSampler.cpp", 346 "src/codec/SkSampler.cpp",
291 "src/codec/SkSwizzler.cpp", 347 "src/codec/SkSwizzler.cpp",
292 "src/codec/SkWbmpCodec.cpp", 348 "src/codec/SkWbmpCodec.cpp",
293 "src/gpu/gl/GrGLDefaultInterface_native.cpp", 349 "src/gpu/gl/GrGLDefaultInterface_native.cpp",
294 "src/images/SkImageEncoder.cpp", 350 "src/images/SkImageEncoder.cpp",
295 "src/images/SkImageEncoder_Factory.cpp", 351 "src/images/SkImageEncoder_Factory.cpp",
296 "src/images/SkJPEGImageEncoder.cpp",
297 "src/images/SkJPEGWriteUtility.cpp",
298 "src/images/SkKTXImageEncoder.cpp", 352 "src/images/SkKTXImageEncoder.cpp",
299 "src/images/SkPNGImageEncoder.cpp",
300 "src/ports/SkDiscardableMemory_none.cpp", 353 "src/ports/SkDiscardableMemory_none.cpp",
301 "src/ports/SkGlobalInitialization_default.cpp", 354 "src/ports/SkGlobalInitialization_default.cpp",
302 "src/ports/SkImageGenerator_skia.cpp", 355 "src/ports/SkImageGenerator_skia.cpp",
303 "src/ports/SkMemory_malloc.cpp", 356 "src/ports/SkMemory_malloc.cpp",
304 "src/ports/SkOSFile_stdio.cpp", 357 "src/ports/SkOSFile_stdio.cpp",
305 "src/sfnt/SkOTTable_name.cpp", 358 "src/sfnt/SkOTTable_name.cpp",
306 "src/sfnt/SkOTUtils.cpp", 359 "src/sfnt/SkOTUtils.cpp",
307 "src/svg/SkSVGCanvas.cpp", 360 "src/svg/SkSVGCanvas.cpp",
308 "src/svg/SkSVGDevice.cpp", 361 "src/svg/SkSVGDevice.cpp",
309 "src/utils/mac/SkStream_mac.cpp", 362 "src/utils/mac/SkStream_mac.cpp",
310 "src/xml/SkDOM.cpp",
311 "src/xml/SkXMLParser.cpp",
312 "src/xml/SkXMLWriter.cpp",
313 "third_party/etc1/etc1.cpp", 363 "third_party/etc1/etc1.cpp",
314 "third_party/ktx/ktx.cpp", 364 "third_party/ktx/ktx.cpp",
315 ] 365 ]
316 sources -= [ 366 sources -= [
317 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp", 367 "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
318 "src/gpu/gl/GrGLDefaultInterface_none.cpp", 368 "src/gpu/gl/GrGLDefaultInterface_none.cpp",
319 ] 369 ]
320 370
321 if (is_win) { 371 if (is_win) {
322 sources += [ 372 sources += [
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 "tools/SkShaper_harfbuzz.cpp", 711 "tools/SkShaper_harfbuzz.cpp",
662 "tools/using_skia_and_harfbuzz.cpp", 712 "tools/using_skia_and_harfbuzz.cpp",
663 ] 713 ]
664 deps = [ 714 deps = [
665 ":skia", 715 ":skia",
666 "//third_party/harfbuzz", 716 "//third_party/harfbuzz",
667 ] 717 ]
668 testonly = true 718 testonly = true
669 } 719 }
670 } 720 }
OLDNEW
« no previous file with comments | « no previous file | src/codec/SkPngCodec.h » ('j') | src/codec/SkPngCodec.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698