summaryrefslogtreecommitdiffstats
path: root/skia/BUILD.gn
blob: cba5ceb721715be3b7521a5c3e558fd8c54669bb (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
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/features.gni")
import("//build/config/ui.gni")
import("//testing/test.gni")
if (current_cpu == "arm") {
  import("//build/config/arm.gni")
}
if (current_cpu == "mipsel" || current_cpu == "mips64el") {
  import("//build/config/mips.gni")
}

skia_support_gpu = !is_ios
skia_support_pdf = !is_ios && (enable_basic_printing || enable_print_preview)

# The list of Skia defines that are to be set for blink.
gypi_blink_skia_defines =
    exec_script("//build/gypi_to_gn.py",
                [
                  rebase_path(
                      "//third_party/WebKit/public/blink_skia_config.gypi"),
                  "--replace=<(skia_include_path)=//third_party/skia/include",
                  "--replace=<(skia_src_path)=//third_party/skia/src",
                ],
                "scope",
                [ "//third_party/WebKit/public/blink_skia_config.gypi" ])

# The list of Skia defines that are to be set for chromium.
gypi_skia_defines =
    exec_script("//build/gypi_to_gn.py",
                [
                  rebase_path(
                      "//third_party/skia/gyp/skia_for_chromium_defines.gypi"),
                  "--replace=<(skia_include_path)=//third_party/skia/include",
                  "--replace=<(skia_src_path)=//third_party/skia/src",
                ],
                "scope",
                [ "//third_party/skia/gyp/skia_for_chromium_defines.gypi" ])

# The list of Skia core sources that are to be set for chromium.
gypi_skia_core =
    exec_script("//build/gypi_to_gn.py",
                [
                  rebase_path("//third_party/skia/gyp/core.gypi"),
                  "--replace=<(skia_include_path)=//third_party/skia/include",
                  "--replace=<(skia_src_path)=//third_party/skia/src",
                ],
                "scope",
                [ "//third_party/skia/gyp/core.gypi" ])

# The list of Skia gpu sources that are to be set for chromium.
if (skia_support_gpu) {
  gypi_skia_gpu =
      exec_script("//build/gypi_to_gn.py",
                  [
                    rebase_path("//third_party/skia/gyp/gpu.gypi"),
                    "--replace=<(skia_include_path)=//third_party/skia/include",
                    "--replace=<(skia_src_path)=//third_party/skia/src",
                  ],
                  "scope",
                  [ "//third_party/skia/gyp/gpu.gypi" ])
}

# The list of Skia pdf sources that are to be set for chromium.
if (skia_support_pdf) {
  gypi_skia_pdf =
      exec_script("//build/gypi_to_gn.py",
                  [
                    rebase_path("//third_party/skia/gyp/pdf.gypi"),
                    "--replace=<(skia_include_path)=//third_party/skia/include",
                    "--replace=<(skia_src_path)=//third_party/skia/src",
                  ],
                  "scope",
                  [ "//third_party/skia/gyp/pdf.gypi" ])
}

# The list of Skia effects that are to be set for chromium.
gypi_skia_effects =
    exec_script("//build/gypi_to_gn.py",
                [
                  rebase_path("//third_party/skia/gyp/effects.gypi"),
                  "--replace=<(skia_include_path)=//third_party/skia/include",
                  "--replace=<(skia_src_path)=//third_party/skia/src",
                ],
                "scope",
                [ "//third_party/skia/gyp/effects.gypi" ])

# The list of Skia utils that are to be set for chromium.
gypi_skia_utils =
    exec_script("//build/gypi_to_gn.py",
                [
                  rebase_path("//third_party/skia/gyp/utils.gypi"),
                  "--replace=<(skia_include_path)=//third_party/skia/include",
                  "--replace=<(skia_src_path)=//third_party/skia/src",
                ],
                "scope",
                [ "//third_party/skia/gyp/utils.gypi" ])

gypi_skia_opts =
    exec_script("//build/gypi_to_gn.py",
                [
                  rebase_path("//third_party/skia/gyp/opts.gypi"),
                  "--replace=<(skia_include_path)=//third_party/skia/include",
                  "--replace=<(skia_src_path)=//third_party/skia/src",
                ],
                "scope",
                [ "//third_party/skia/gyp/opts.gypi" ])

# The list of Skia files is kept in skia_gn_files.gypi. Read it.
gypi_values =
    exec_script("//build/gypi_to_gn.py",
                [
                  rebase_path("skia_gn_files.gypi"),
                  "--replace=<(skia_include_path)=//third_party/skia/include",
                  "--replace=<(skia_src_path)=//third_party/skia/src",
                ],
                "scope",
                [ "skia_gn_files.gypi" ])

# External-facing config for dependent code.
config("skia_config") {
  include_dirs = [
    "config",
    "ext",
    "//third_party/skia/include/c",
    "//third_party/skia/include/config",
    "//third_party/skia/include/core",
    "//third_party/skia/include/effects",
    "//third_party/skia/include/images",
    "//third_party/skia/include/lazy",
    "//third_party/skia/include/pathops",
    "//third_party/skia/include/pdf",
    "//third_party/skia/include/pipe",
    "//third_party/skia/include/ports",
    "//third_party/skia/include/utils",
  ]

  defines = gypi_blink_skia_defines.blink_skia_defines
  defines += gypi_skia_defines.skia_for_chromium_defines

  defines += []

  if (is_component_build) {
    defines += [
      "SKIA_DLL",
      "GR_GL_IGNORE_ES3_MSAA=0",
    ]
  }

  if (skia_support_gpu) {
    include_dirs += [
      "//third_party/skia/include/gpu",
      "//third_party/skia/src/gpu",
    ]
    defines += [ "SK_SUPPORT_GPU=1" ]
  } else {
    defines += [ "SK_SUPPORT_GPU=0" ]
  }

  if (is_android) {
    defines += [
      "SK_BUILD_FOR_ANDROID",
      "USE_CHROMIUM_SKIA",
    ]
  }

  if (is_mac) {
    defines += [ "SK_BUILD_FOR_MAC" ]
  }

  if (is_win) {
    defines += [ "GR_GL_FUNCTION_TYPE=__stdcall" ]
  }
}

# Internal-facing config for Skia library code.
config("skia_library_config") {
  # These include directories are only included for Skia code and are not
  # exported to dependents. It's not clear if this is on purpose, but this
  # matches the GYP build.
  include_dirs = [
    "//third_party/skia/include/private",
    "//third_party/skia/src/core",
    "//third_party/skia/src/image",
    "//third_party/skia/src/opts",
    "//third_party/skia/src/pdf",
    "//third_party/skia/src/ports",
    "//third_party/skia/src/sfnt",
    "//third_party/skia/src/utils",
    "//third_party/skia/src/lazy",
  ]
  if (is_mac || is_ios) {
    include_dirs += [ "//third_party/skia/include/utils/mac" ]
  }
  if (is_mac) {
    include_dirs += [ "//third_party/skia/include/utils/ios" ]
  }

  defines = []

  if (is_component_build) {
    defines += [ "SKIA_IMPLEMENTATION=1" ]
  }

  if (current_cpu == "arm") {
    if (arm_use_neon) {
      defines += [ "SK_ARM_HAS_NEON" ]
    } else if (arm_optionally_use_neon) {
      defines += [ "SK_ARM_HAS_OPTIONAL_NEON" ]
    }
  }

  # Settings for text blitting, chosen to approximate the system browser.
  if (is_linux) {
    defines += [
      "SK_GAMMA_EXPONENT=1.2",
      "SK_GAMMA_CONTRAST=0.2",
    ]
  } else if (is_android) {
    defines += [
      "SK_GAMMA_APPLY_TO_A8",
      "SK_GAMMA_EXPONENT=1.4",
      "SK_GAMMA_CONTRAST=0.0",
    ]
  } else if (is_win) {
    defines += [
      "SK_GAMMA_SRGB",
      "SK_GAMMA_CONTRAST=0.5",
    ]
  } else if (is_mac) {
    defines += [
      "SK_GAMMA_SRGB",
      "SK_GAMMA_CONTRAST=0.0",
    ]
  }

  if (is_android) {
    defines += [
      # Android devices are typically more memory constrained, so default to a
      # smaller glyph cache (it may be overriden at runtime when the renderer
      # starts up, depending on the actual device memory).
      "SK_DEFAULT_FONT_CACHE_LIMIT=1048576",  # 1024 * 1024
    ]
  } else {
    defines += [ "SK_DEFAULT_FONT_CACHE_LIMIT=20971520" ]  # 20 * 1024 * 1024
  }

  if (is_win) {
    include_dirs += [
      "//third_party/skia/include/utils/win",
      "//third_party/skia/src/utils/win",
    ]

    defines += [
      # On windows, GDI handles are a scarse system-wide resource so we have to
      # keep the glyph cache, which holds up to 4 GDI handles per entry, to a
      # fairly small size. http://crbug.com/314387
      "SK_DEFAULT_FONT_CACHE_COUNT_LIMIT=256",
    ]

    cflags = [
      "/wd4244",  # conversion from 'type1( __int64)' to 'type2 (unsigned int)'
      "/wd4267",  # conversion from 'size_t' (64 bit) to 'type'(32 bit).
      "/wd4341",  # signed value is out of range for enum constant.
      "/wd4345",  # Object is default-initialized if initialization is omitted.
      "/wd4390",  # ';'empty statement found in looping;is it what was intended?
      "/wd4554",  # 'operator' : check operator precedence for possible error
      "/wd4748",  # compiler will disable optimizations if a function has inline
                  # assembly code contains flow control(jmp or jcc) statements.

      "/wd4800",  # forcing value to bool 'true/false'(assigning int to bool).
    ]
  }
}

component("skia") {
  sources = [
    # Chrome sources.
    "ext/SkDiscardableMemory_chrome.cc",
    "ext/SkMemory_new_handler.cpp",
    "ext/analysis_canvas.cc",
    "ext/benchmarking_canvas.cc",
    "ext/convolver.cc",
    "ext/event_tracer_impl.cc",
    "ext/fontmgr_default_win.cc",
    "ext/google_logging.cc",
    "ext/image_operations.cc",
    "ext/opacity_filter_canvas.cc",
    "ext/pixel_ref_utils.cc",
    "ext/platform_canvas.cc",
    "ext/platform_device.cc",
    "ext/platform_device_linux.cc",
    "ext/platform_device_mac.cc",
    "ext/platform_device_win.cc",
    "ext/recursive_gaussian_convolution.cc",
    "ext/skia_memory_dump_provider.cc",
    "ext/skia_utils_base.cc",
    "ext/skia_utils_ios.mm",
    "ext/skia_utils_mac.mm",
    "ext/skia_utils_win.cc",
  ]

  if (current_cpu == "x86" || current_cpu == "x64") {
    sources += [ "ext/convolver_SSE2.cc" ]
  } else if (current_cpu == "mipsel" && mips_dsp_rev >= 2) {
    sources += [ "ext/convolver_mips_dspr2.cc" ]
  }

  # The skia gypi values are relative to the skia_dir, so we need to rebase.
  sources += gypi_skia_core.sources
  sources += gypi_skia_effects.sources
  sources += gypi_skia_utils.sources
  sources += gypi_values.skia_library_sources

  # This and skia_opts are really the same conceptual target so share headers.
  allow_circular_includes_from = [ ":skia_opts" ]

  if (current_cpu == "arm") {
    sources += [ "//third_party/skia/src/core/SkUtilsArm.cpp" ]
  }

  # GPU
  if (skia_support_gpu) {
    sources += gypi_skia_gpu.skgpu_sources
    sources += gypi_skia_gpu.skgpu_null_gl_sources
  }

  # Remove unused util files include in utils.gypi
  sources -= [
    "//third_party/skia/src/utils/SkBitmapHasher.cpp",
    "//third_party/skia/src/utils/SkBoundaryPatch.cpp",
    "//third_party/skia/src/utils/SkCamera.cpp",
    "//third_party/skia/src/utils/SkCubicInterval.cpp",
    "//third_party/skia/src/utils/SkCullPoints.cpp",
    "//third_party/skia/src/utils/SkDumpCanvas.cpp",
    "//third_party/skia/src/utils/SkFrontBufferedStream.cpp",
    "//third_party/skia/src/utils/SkInterpolator.cpp",
    "//third_party/skia/src/utils/SkLayer.cpp",
    "//third_party/skia/src/utils/SkMD5.cpp",
    "//third_party/skia/src/utils/SkMeshUtils.cpp",
    "//third_party/skia/src/utils/SkNinePatch.cpp",
    "//third_party/skia/src/utils/SkOSFile.cpp",
    "//third_party/skia/src/utils/SkParsePath.cpp",
    "//third_party/skia/src/utils/SkSHA1.cpp",

    # We don't currently need to change thread affinity, so leave out this complexity for now.
    "//third_party/skia/src/utils/SkThreadUtils_pthread_linux.cpp",
    "//third_party/skia/src/utils/SkThreadUtils_pthread_mach.cpp",

    #testing
    "//third_party/skia/src/fonts/SkGScalerContext.cpp",
  ]

  if (is_win) {
    sources -= [
      # Keeping _win.cpp
      "//third_party/skia/src/utils/SkThreadUtils_pthread.cpp",
      "//third_party/skia/src/utils/SkThreadUtils_pthread_other.cpp",
    ]
  } else {
    sources -= [
      # Keeping _pthread.cpp and _pthread_other.cpp.
      "//third_party/skia/src/utils/SkThreadUtils_win.cpp",
    ]
  }

  # need separate win section to handle chromes auto gn filter
  # (build/config/BUILDCONFIG.gn)
  if (is_win) {
    sources -= [
      #windows
      "//third_party/skia/src/utils/win/SkAutoCoInitialize.cpp",
      "//third_party/skia/src/utils/win/SkIStream.cpp",
      "//third_party/skia/src/utils/win/SkWGL_win.cpp",
    ]
  }

  if (is_android && (!enable_basic_printing && !enable_print_preview)) {
    sources -= [ "ext/skia_utils_base.cc" ]
  }

  # Fixup skia library sources.
  if (is_win) {
    sources -= [
      "//third_party/skia/src/ports/SkOSFile_posix.cpp",
      "//third_party/skia/src/ports/SkTLS_pthread.cpp",
      "//third_party/skia/src/ports/SkTime_Unix.cpp",
    ]
  } else {
    sources -= [
      "//third_party/skia/src/ports/SkFontHost_win.cpp",
      "//third_party/skia/src/ports/SkFontMgr_win_dw.cpp",
      "//third_party/skia/src/ports/SkOSFile_win.cpp",
      "//third_party/skia/src/ports/SkRemotableFontMgr_win_dw.cpp",
      "//third_party/skia/src/ports/SkScalerContext_win_dw.cpp",
      "//third_party/skia/src/ports/SkTLS_win.cpp",
      "//third_party/skia/src/ports/SkTypeface_win_dw.cpp",
    ]
  }
  if (!is_android) {
    sources -= [
      "//third_party/skia/src/ports/SkFontMgr_android.cpp",
      "//third_party/skia/src/ports/SkFontMgr_android_factory.cpp",
      "//third_party/skia/src/ports/SkFontMgr_android_parser.cpp",
    ]
  }
  if (!is_mac) {
    sources -= [ "//third_party/skia/src/ports/SkFontHost_mac.cpp" ]
  }

  if (!is_linux) {
    sources -= [
      "//third_party/skia/src/fonts/SkFontMgr_fontconfig.cpp",
      "//third_party/skia/src/ports/SkFontConfigInterface_direct.cpp",
      "//third_party/skia/src/ports/SkFontHost_fontconfig.cpp",
    ]
  }

  if (!is_linux && !is_android) {
    sources -= [
      "//third_party/skia/src/ports/SkFontHost_FreeType.cpp",
      "//third_party/skia/src/ports/SkFontHost_FreeType_common.cpp",
    ]
  }

  # Select the right BitmapPlatformDevice.
  if (is_win) {
    sources += [ "ext/bitmap_platform_device_win.cc" ]
  } else if (is_mac) {
    sources += [ "ext/bitmap_platform_device_mac.cc" ]
  } else if (use_cairo) {
    sources += [ "ext/bitmap_platform_device_cairo.cc" ]
  } else {
    sources += [ "ext/bitmap_platform_device_skia.cc" ]
  }

  if (is_clang) {
    # Skia won't compile with some of the more strict clang warnings.
    # e.g. it does:
    #  SkASSERT(!"sk_out_of_memory");
    configs -= [ "//build/config/clang:extra_warnings" ]
  }

  configs -= [ "//build/config/compiler:chromium_code" ]
  configs += [
    ":skia_library_config",
    "//build/config:precompiled_headers",
    "//build/config/compiler:no_chromium_code",
  ]
  public_configs = [ ":skia_config" ]

  deps = [
    ":skia_opts",
    "//base",
    "//base/third_party/dynamic_annotations",
    "//third_party/zlib",
  ]

  if (is_linux) {
    configs += [
      "//build/config/linux:fontconfig",
      "//build/config/linux:freetype2",
    ]
    if (use_pango) {
      configs += [ "//build/config/linux:pangocairo" ]
    }
    deps += [ "//third_party/icu:icuuc" ]
  }

  if (is_android) {
    set_sources_assignment_filter([])
    sources += [ "ext/platform_device_linux.cc" ]
    set_sources_assignment_filter(sources_assignment_filter)
    deps += [
      "//third_party/expat",
      "//third_party/freetype-android:freetype",
      "//third_party/android_tools:cpu_features",
    ]
  }

  if (skia_support_pdf) {
    deps += [ "//third_party/sfntly" ]
    sources += gypi_skia_pdf.sources
  }

  if (is_android && !is_debug) {
    configs -= [ "//build/config/compiler:optimize" ]
    configs += [ "//build/config/compiler:optimize_max" ]
  }
}

# Separated out so it can be compiled with different flags for SSE.
if (current_cpu == "x86" || current_cpu == "x64") {
  source_set("skia_opts_sse3") {
    sources = gypi_skia_opts.ssse3_sources
    if (!is_win || is_clang) {
      cflags = [ "-mssse3" ]
    }
    if (is_win) {
      defines = [ "SK_CPU_SSE_LEVEL=31" ]
    }
    visibility = [ ":skia_opts" ]
    configs -= [ "//build/config/compiler:chromium_code" ]
    configs += [
      ":skia_config",
      ":skia_library_config",
      "//build/config/compiler:no_chromium_code",
    ]
  }
  source_set("skia_opts_sse4") {
    sources = gypi_skia_opts.sse41_sources
    if (!is_win || is_clang) {
      cflags = [ "-msse4.1" ]
    }
    if (is_win) {
      defines = [ "SK_CPU_SSE_LEVEL=41" ]
    }
    visibility = [ ":skia_opts" ]
    configs -= [ "//build/config/compiler:chromium_code" ]
    configs += [
      ":skia_config",
      ":skia_library_config",
      "//build/config/compiler:no_chromium_code",
    ]
  }
}
source_set("skia_opts") {
  cflags = []
  defines = []

  deps = [
    "//base",
  ]

  if (current_cpu == "x86" || current_cpu == "x64") {
    sources = gypi_skia_opts.sse2_sources
    deps += [
      ":skia_opts_sse3",
      ":skia_opts_sse4",
    ]
  } else if (current_cpu == "arm") {
    # The assembly uses the frame pointer register (r7 in Thumb/r11 in
    # ARM), the compiler doesn't like that.
    cflags += [ "-fomit-frame-pointer" ]

    if (arm_version >= 7) {
      sources = gypi_skia_opts.armv7_sources
      if (arm_use_neon || arm_optionally_use_neon) {
        sources += gypi_skia_opts.neon_sources

        # Root build config sets -mfpu=$arm_fpu, which we expect to be neon
        # when running this.
        if (!arm_use_neon) {
          configs -= [ "//build/config/compiler:compiler_arm_fpu" ]
          cflags += [ "-mfpu=neon" ]
        }
      }
    } else {
      sources = gypi_skia_opts.none_sourcees
    }
  } else if (current_cpu == "mipsel") {
    cflags += [ "-fomit-frame-pointer" ]

    if (mips_dsp_rev >= 1) {
      sources = gypi_skia_opts.mips_dsp_sources
    } else {
      sources = gypi_skia_opts.none_sources
    }
  } else {
    assert(false, "Need to port cpu specific stuff from skia_library_opts.gyp")
  }

  if (is_android && !is_debug) {
    configs -= [ "//build/config/compiler:optimize" ]
    configs += [ "//build/config/compiler:optimize_max" ]
  }

  configs -= [ "//build/config/compiler:chromium_code" ]
  configs += [
    ":skia_config",
    ":skia_library_config",
    "//build/config/compiler:no_chromium_code",
  ]

  visibility = [ ":skia" ]
}

# TODO(GYP): Delete this after we've converted everything to GN.
# The _run targets exist only for compatibility w/ GYP.
group("skia_unittests_run") {
  testonly = true
  deps = [
    ":skia_unittests",
  ]
}

test("skia_unittests") {
  sources = [
    "ext/analysis_canvas_unittest.cc",
    "ext/bitmap_platform_device_mac_unittest.cc",
    "ext/convolver_unittest.cc",
    "ext/image_operations_unittest.cc",
    "ext/pixel_ref_utils_unittest.cc",
    "ext/platform_canvas_unittest.cc",
    "ext/recursive_gaussian_convolution_unittest.cc",
    "ext/refptr_unittest.cc",
    "ext/skia_memory_dump_provider_unittest.cc",
    "ext/skia_utils_ios_unittest.mm",
    "ext/skia_utils_mac_unittest.mm",
  ]

  if (!is_win && !is_mac) {
    sources -= [ "ext/platform_canvas_unittest.cc" ]
  }

  deps = [
    ":skia",
    "//base",
    "//base/test:run_all_unittests",
    "//testing/gtest",
    "//ui/gfx",
    "//ui/gfx/geometry",
  ]

  if (!is_ios) {
    deps += [ "//cc:test_support" ]  # TODO: Fix this test to not depend on cc.
  }
}

if (is_linux && !is_chromeos) {
  # TODO(GYP): Figure out which of these work and are needed on other platforms.
  executable("image_operations_bench") {
    sources = [
      "ext/image_operations_bench.cc",
    ]

    deps = [
      ":skia",
      "//base",
    ]
  }

  executable("filter_fuzz_stub") {
    testonly = true
    sources = [
      "tools/filter_fuzz_stub/filter_fuzz_stub.cc",
    ]

    deps = [
      ":skia",
      "//base",
      "//base/test:test_support",
    ]
  }
}