blob: 152f8fafe9753f67e53191fc2469a1480ebb8348 [file] [log] [blame]
mtkleinc04ff472016-06-23 10:29:30 -07001# Copyright 2016 Google Inc.
2#
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
Brian Osmanf2c90142017-07-13 15:50:03 -04006import("gn/flutter_defines.gni")
Mike Reed025f7832018-11-12 09:27:05 -05007import("gn/fuchsia_defines.gni")
mikejurka8c24f4f2016-09-12 16:51:58 -07008import("gn/shared_sources.gni")
Hal Canary45812a12019-09-04 08:58:59 -04009import("gn/skia.gni")
10
John Rosasco24cbdab2019-09-25 14:14:35 -070011if (is_fuchsia) {
12 import("//build/fuchsia/sdk.gni")
13 import("build/fuchsia/fuchsia_download_sdk.gni")
14}
15
Stephen White0d70b712019-07-10 15:51:30 -040016if (skia_use_dawn) {
17 import("third_party/externals/dawn/scripts/dawn_features.gni")
18}
19
Adam Barth54ef74a2017-10-13 10:59:38 -070020if (defined(skia_settings)) {
21 import(skia_settings)
22}
23
Hal Canary3388c1a2019-09-16 12:53:17 -040024import("gn/ios.gni")
25
mtkleinc04ff472016-06-23 10:29:30 -070026# Skia public API, generally provided by :skia.
27config("skia_public") {
Mike Klein9e25bb92019-04-29 09:46:36 -050028 include_dirs = [ "." ]
29
Mike Kleinae7e6712016-10-11 17:49:33 -040030 defines = []
Chinmay Gardef832c0a2020-03-18 14:37:23 -070031 cflags_objcc = []
Mike Kleinae7e6712016-10-11 17:49:33 -040032 if (is_component_build) {
33 defines += [ "SKIA_DLL" ]
34 }
Mike Kleinc4cbd742016-09-26 21:37:09 -040035 if (is_fuchsia || is_linux) {
Mike Kleinf0a53692019-04-24 11:42:40 -050036 defines += [ "SK_R32_SHIFT=16" ]
jcgregorio5561e3d2016-08-25 09:25:11 -070037 }
Brian Osmanf2c90142017-07-13 15:50:03 -040038 if (skia_enable_flutter_defines) {
39 defines += flutter_defines
40 }
mtklein06c35c02016-09-20 12:28:12 -070041 if (!skia_enable_gpu) {
42 defines += [ "SK_SUPPORT_GPU=0" ]
43 }
Mike Reed025f7832018-11-12 09:27:05 -050044 if (is_fuchsia) {
45 defines += fuchsia_defines
46 }
Kevin Lubick27ba7032019-03-21 08:13:54 -040047 if (skia_gl_standard == "gles") {
48 defines += [ "SK_ASSUME_GL_ES=1" ]
49 } else if (skia_gl_standard == "gl") {
50 defines += [ "SK_ASSUME_GL=1" ]
Kevin Lubick39026282019-03-28 12:46:40 -040051 } else if (skia_gl_standard == "webgl") {
Kevin Lubick2f9a0982020-08-20 10:33:39 -040052 defines += [
53 "SK_ASSUME_WEBGL=1",
54 "SK_USE_WEBGL",
55 ]
Kevin Lubick27ba7032019-03-21 08:13:54 -040056 }
Chinmay Gardef832c0a2020-03-18 14:37:23 -070057
58 # Some older versions of the Clang toolchain change the visibility of
59 # symbols decorated with API_AVAILABLE macro to be visible. Users of such
60 # toolchains suppress the use of this macro till toolchain updates are made.
61 if (is_mac || is_ios) {
62 if (skia_enable_api_available_macro) {
63 defines += [ "SK_ENABLE_API_AVAILABLE" ]
64 } else {
65 cflags_objcc += [ "-Wno-unguarded-availability" ]
66 }
67 }
mtkleinc04ff472016-06-23 10:29:30 -070068}
69
70# Skia internal APIs, used by Skia itself and a few test tools.
71config("skia_private") {
72 visibility = [ ":*" ]
73
Mike Reeda9e241d2017-05-03 10:52:00 -040074 defines = [ "SK_GAMMA_APPLY_TO_A8" ]
Leon Scroggins IIIc41a5f52018-11-15 15:54:59 -050075 if (skia_use_fixed_gamma_text) {
mtkleinb37c0342016-09-09 11:07:45 -070076 defines += [
77 "SK_GAMMA_EXPONENT=1.4",
78 "SK_GAMMA_CONTRAST=0.0",
79 ]
80 }
Mike Kleinb45d8622019-04-24 14:04:01 -050081 if (is_skia_dev_build) {
82 defines += [
83 "SK_ALLOW_STATIC_GLOBAL_INITIALIZERS=1",
84 "GR_TEST_UTILS=1",
85 ]
mtklein88a7ac02016-09-14 11:16:49 -070086 }
Brian Salomon789e25e2016-09-30 13:41:03 -040087 libs = []
88 lib_dirs = []
Brian Salomonf4ba4ec2020-03-19 15:54:28 -040089 if (skia_use_gl && skia_use_angle) {
Brian Osman34755e22016-12-05 09:46:02 -050090 defines += [ "SK_ANGLE" ]
91 }
Greg Danielb16beb92020-04-27 14:26:21 +000092 if (skia_use_vma) {
93 defines += [ "SK_USE_VMA" ]
94 }
mtkleinc04ff472016-06-23 10:29:30 -070095}
96
97# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
98config("skia_library") {
99 visibility = [ ":*" ]
Mike Kleinf5f4e812019-04-29 15:45:14 +0000100 defines = [ "SKIA_IMPLEMENTATION=1" ]
mtkleinc04ff472016-06-23 10:29:30 -0700101}
102
103skia_library_configs = [
104 ":skia_public",
105 ":skia_private",
106 ":skia_library",
107]
108
mtklein9b8583d2016-08-24 17:32:30 -0700109# Use for CPU-specific Skia code that needs particular compiler flags.
110template("opts") {
Mike Klein6d1df6d2018-11-07 15:03:58 -0500111 visibility = [ ":*" ]
mtklein9b8583d2016-08-24 17:32:30 -0700112 if (invoker.enabled) {
113 source_set(target_name) {
Hal Canaryc25f4e92019-02-26 11:54:25 -0500114 check_includes = false
mtklein9b8583d2016-08-24 17:32:30 -0700115 forward_variables_from(invoker, "*")
116 configs += skia_library_configs
117 }
118 } else {
119 # If not enabled, a phony empty target that swallows all otherwise unused variables.
120 source_set(target_name) {
Hal Canaryc25f4e92019-02-26 11:54:25 -0500121 check_includes = false
mtklein9b8583d2016-08-24 17:32:30 -0700122 forward_variables_from(invoker,
123 "*",
124 [
125 "sources",
126 "cflags",
127 ])
128 }
129 }
anmittala7eaf2e2016-08-17 13:57:26 -0700130}
131
mtklein422310d2016-08-16 18:28:43 -0700132is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700133
mtklein7d6fb2c2016-08-25 14:50:44 -0700134opts("none") {
135 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700136 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700137 cflags = []
138}
139
mtklein7d6fb2c2016-08-25 14:50:44 -0700140opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700141 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700142 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700143 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700144}
145
146opts("arm64") {
147 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700148 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700149 cflags = []
150}
151
152opts("crc32") {
153 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700154 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700155 cflags = [ "-march=armv8-a+crc" ]
156}
157
mtklein9b8583d2016-08-24 17:32:30 -0700158opts("sse2") {
159 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700160 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400161 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400162 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
163 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400164 cflags = [ "-msse2" ]
165 }
mtklein9b8583d2016-08-24 17:32:30 -0700166}
mtkleinc04ff472016-06-23 10:29:30 -0700167
mtklein9b8583d2016-08-24 17:32:30 -0700168opts("ssse3") {
169 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700170 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400171 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400172 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
173 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400174 cflags = [ "-mssse3" ]
175 }
mtklein9b8583d2016-08-24 17:32:30 -0700176}
mtkleinc04ff472016-06-23 10:29:30 -0700177
mtklein9b8583d2016-08-24 17:32:30 -0700178opts("sse41") {
179 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700180 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400181 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400182 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
183 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400184 cflags = [ "-msse4.1" ]
185 }
mtklein9b8583d2016-08-24 17:32:30 -0700186}
mtklein4e976072016-08-08 09:06:27 -0700187
mtklein9b8583d2016-08-24 17:32:30 -0700188opts("sse42") {
189 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700190 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400191 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400192 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
193 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400194 cflags = [ "-msse4.2" ]
195 }
mtklein9b8583d2016-08-24 17:32:30 -0700196}
197
198opts("avx") {
199 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700200 sources = skia_opts.avx_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400201 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000202 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400203 } else {
204 cflags = [ "-mavx" ]
Mike Klein1cc767b2019-12-13 13:02:22 -0500205 if (is_mac && is_debug) {
Mike Kleinf800c1d2020-06-04 11:53:56 -0500206 cflags += [ "-fno-stack-check" ] # Work around skia:9709
Mike Klein1cc767b2019-12-13 13:02:22 -0500207 }
Mike Klein3eb71212016-10-11 17:08:53 -0400208 }
mtkleinc04ff472016-06-23 10:29:30 -0700209}
210
Mike Klein1b9b7d52018-02-27 10:37:40 -0500211opts("hsw") {
212 enabled = is_x86
213 sources = skia_opts.hsw_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400214 if (is_win) {
Mike Klein1b9b7d52018-02-27 10:37:40 -0500215 cflags = [ "/arch:AVX2" ]
216 } else {
Mike Kleine87c4862018-03-23 00:13:58 +0000217 cflags = [ "-march=haswell" ]
Mike Kleindb380222020-01-22 13:53:18 -0600218 if (is_mac && is_debug) {
Mike Kleinf800c1d2020-06-04 11:53:56 -0500219 cflags += [ "-fno-stack-check" ] # Work around skia:9709
Mike Kleindb380222020-01-22 13:53:18 -0600220 }
Mike Klein1b9b7d52018-02-27 10:37:40 -0500221 }
Mike Klein1b9b7d52018-02-27 10:37:40 -0500222}
223
Mike Kleinad56c4c2020-06-05 06:57:30 -0500224opts("skx") {
225 enabled = is_x86
226 sources = skia_opts.skx_sources
227 if (is_win) {
228 cflags = [ "/arch:AVX512" ]
229 } else {
230 cflags = [ "-march=skylake-avx512" ]
231 if (is_mac && is_debug) {
232 cflags += [ "-fno-stack-check" ] # Work around skia:9709
233 }
234 }
235}
236
mtkleinc095df52016-08-24 12:23:52 -0700237# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700238template("optional") {
Mike Klein6d1df6d2018-11-07 15:03:58 -0500239 visibility = [ ":*" ]
mtklein457b42a2016-08-23 13:56:37 -0700240 if (invoker.enabled) {
241 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700242 if (defined(invoker.public_defines)) {
243 defines = invoker.public_defines
244 }
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600245 if (defined(invoker.public_configs)) {
246 configs = invoker.public_configs
247 }
Hal Canary2dad9902019-11-20 16:01:31 -0500248 if (defined(invoker.public_include_dirs)) {
249 include_dirs = invoker.public_include_dirs
250 }
mtklein457b42a2016-08-23 13:56:37 -0700251 }
252 source_set(target_name) {
Hal Canaryc25f4e92019-02-26 11:54:25 -0500253 check_includes = false
mtkleincd01b032016-08-31 04:58:19 -0700254 forward_variables_from(invoker,
255 "*",
256 [
257 "public_defines",
258 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700259 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700260 ])
mtklein457b42a2016-08-23 13:56:37 -0700261 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700262 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700263 if (defined(invoker.configs_to_remove)) {
264 configs -= invoker.configs_to_remove
265 }
mtklein457b42a2016-08-23 13:56:37 -0700266 }
267 } else {
mtklein457b42a2016-08-23 13:56:37 -0700268 source_set(target_name) {
269 forward_variables_from(invoker,
270 "*",
271 [
Ben Wagnerea765a32020-06-05 13:42:30 -0400272 "public",
mtklein457b42a2016-08-23 13:56:37 -0700273 "public_defines",
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400274 "public_deps",
mtklein457b42a2016-08-23 13:56:37 -0700275 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700276 "libs",
Jim Van Verthef820be2020-08-12 10:45:00 -0400277 "frameworks",
mtklein457b42a2016-08-23 13:56:37 -0700278 "sources",
mtkleincd01b032016-08-31 04:58:19 -0700279 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700280 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700281 ])
mtkleincd01b032016-08-31 04:58:19 -0700282 if (defined(invoker.sources_when_disabled)) {
283 sources = invoker.sources_when_disabled
284 }
285 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700286 }
mtkleineb3c4252016-08-23 07:38:09 -0700287 }
mtklein457b42a2016-08-23 13:56:37 -0700288}
mtklein457b42a2016-08-23 13:56:37 -0700289
Leon Scroggins III63cfb362020-04-24 13:00:48 -0400290optional("android_utils") {
291 enabled = skia_enable_android_utils
292
Leon Scroggins III87caae62020-05-04 10:02:45 -0400293 public = [
294 "client_utils/android/BRDAllocator.h",
295 "client_utils/android/BitmapRegionDecoder.h",
296 "client_utils/android/FrontBufferedStream.h",
297 ]
Leon Scroggins III63cfb362020-04-24 13:00:48 -0400298 public_defines = [ "SK_ENABLE_ANDROID_UTILS" ]
Leon Scroggins III87caae62020-05-04 10:02:45 -0400299 sources = [
300 "client_utils/android/BitmapRegionDecoder.cpp",
301 "client_utils/android/FrontBufferedStream.cpp",
302 ]
Leon Scroggins III63cfb362020-04-24 13:00:48 -0400303}
304
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400305group("fontmgr_factory") {
306 public_deps = [ skia_fontmgr_factory ]
307}
308
309optional("fontmgr_empty_factory") {
310 enabled = true
311 sources = [ "src/ports/SkFontMgr_empty_factory.cpp" ]
Ben Wagner75626e42020-06-03 13:20:37 -0400312}
313
mtkleina45be612016-08-29 15:22:10 -0700314optional("fontmgr_android") {
Leon Scroggins IIIbe85c192018-11-13 13:50:12 -0500315 enabled = skia_enable_fontmgr_android
mtkleina45be612016-08-29 15:22:10 -0700316
317 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500318 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700319 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700320 ]
Ben Wagner75626e42020-06-03 13:20:37 -0400321 public = [ "include/ports/SkFontMgr_android.h" ]
mtkleina45be612016-08-29 15:22:10 -0700322 sources = [
323 "src/ports/SkFontMgr_android.cpp",
mtkleina45be612016-08-29 15:22:10 -0700324 "src/ports/SkFontMgr_android_parser.cpp",
Ben Wagner75626e42020-06-03 13:20:37 -0400325 "src/ports/SkFontMgr_android_parser.h",
mtkleina45be612016-08-29 15:22:10 -0700326 ]
327}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400328optional("fontmgr_android_factory") {
329 enabled = skia_enable_fontmgr_android
330 deps = [ ":fontmgr_android" ]
331 sources = [ "src/ports/SkFontMgr_android_factory.cpp" ]
332}
mtkleina45be612016-08-29 15:22:10 -0700333
mtkleind2e39db2016-09-07 07:52:55 -0700334optional("fontmgr_custom") {
Ben Wagner75626e42020-06-03 13:20:37 -0400335 enabled =
336 skia_enable_fontmgr_custom_directory ||
337 skia_enable_fontmgr_custom_embedded || skia_enable_fontmgr_custom_empty
mtkleind2e39db2016-09-07 07:52:55 -0700338
Mike Kleina01c6b02020-04-01 13:47:34 -0500339 deps = [ ":typeface_freetype" ]
Ben Wagner75626e42020-06-03 13:20:37 -0400340 public = [ "src/ports/SkFontMgr_custom.h" ]
341 sources = [ "src/ports/SkFontMgr_custom.cpp" ]
342}
343
344optional("fontmgr_custom_directory") {
345 enabled = skia_enable_fontmgr_custom_directory
346
347 deps = [
348 ":fontmgr_custom",
349 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700350 ]
Ben Wagner75626e42020-06-03 13:20:37 -0400351 public = [ "include/ports/SkFontMgr_directory.h" ]
352 sources = [ "src/ports/SkFontMgr_custom_directory.cpp" ]
353}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400354optional("fontmgr_custom_directory_factory") {
355 enabled = skia_enable_fontmgr_custom_directory
356 deps = [ ":fontmgr_custom_directory" ]
357 sources = [ "src/ports/SkFontMgr_custom_directory_factory.cpp" ]
358}
Ben Wagner75626e42020-06-03 13:20:37 -0400359
360optional("fontmgr_custom_embedded") {
361 enabled = skia_enable_fontmgr_custom_embedded
362
363 deps = [
364 ":fontmgr_custom",
365 ":typeface_freetype",
366 ]
367 sources = [ "src/ports/SkFontMgr_custom_embedded.cpp" ]
mtkleind2e39db2016-09-07 07:52:55 -0700368}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400369optional("fontmgr_custom_embedded_factory") {
370 enabled = skia_enable_fontmgr_custom_embedded
371 deps = [ ":fontmgr_custom_embedded" ]
372 sources = [ "src/ports/SkFontMgr_custom_embedded_factory.cpp" ]
373}
mtkleind2e39db2016-09-07 07:52:55 -0700374
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500375optional("fontmgr_custom_empty") {
376 enabled = skia_enable_fontmgr_custom_empty
Kevin Lubickddd0a332018-12-12 10:35:13 -0500377
Ben Wagner75626e42020-06-03 13:20:37 -0400378 deps = [
379 ":fontmgr_custom",
380 ":typeface_freetype",
Sergey Ulanovf3babcd2018-11-30 17:42:00 -0800381 ]
Ben Wagner75626e42020-06-03 13:20:37 -0400382 public = [ "include/ports/SkFontMgr_empty.h" ]
383 sources = [ "src/ports/SkFontMgr_custom_empty.cpp" ]
Hal Canaryff2742e2018-01-30 11:35:47 -0500384}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400385optional("fontmgr_custom_empty_factory") {
386 enabled = skia_enable_fontmgr_custom_empty
387 deps = [ ":fontmgr_custom_empty" ]
388 sources = [ "src/ports/SkFontMgr_custom_empty_factory.cpp" ]
389}
Hal Canaryff2742e2018-01-30 11:35:47 -0500390
mtklein3cc22182016-08-29 13:26:14 -0700391optional("fontmgr_fontconfig") {
Ben Wagner75626e42020-06-03 13:20:37 -0400392 enabled = skia_enable_fontmgr_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700393
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400394 # The public header includes fontconfig.h and uses FcConfig*
395 public_deps = [ "//third_party:fontconfig" ]
Ben Wagner75626e42020-06-03 13:20:37 -0400396 public = [ "include/ports/SkFontMgr_fontconfig.h" ]
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400397 deps = [ ":typeface_freetype" ]
Ben Wagner75626e42020-06-03 13:20:37 -0400398 sources = [ "src/ports/SkFontMgr_fontconfig.cpp" ]
399}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400400optional("fontmgr_fontconfig_factory") {
401 enabled = skia_enable_fontmgr_fontconfig
402 deps = [ ":fontmgr_fontconfig" ]
403 sources = [ "src/ports/SkFontMgr_fontconfig_factory.cpp" ]
404}
Ben Wagner75626e42020-06-03 13:20:37 -0400405
406optional("fontmgr_FontConfigInterface") {
407 enabled = skia_enable_fontmgr_FontConfigInterface
408
409 deps = [
410 ":typeface_freetype",
411 "//third_party:fontconfig",
412 ]
413 public = [
414 "include/ports/SkFontConfigInterface.h",
415 "include/ports/SkFontMgr_FontConfigInterface.h",
416 ]
mtklein3cc22182016-08-29 13:26:14 -0700417 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700418 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700419 "src/ports/SkFontConfigInterface_direct.cpp",
420 "src/ports/SkFontConfigInterface_direct_factory.cpp",
Ben Wagner75626e42020-06-03 13:20:37 -0400421 "src/ports/SkFontConfigTypeface.h",
mtklein3cc22182016-08-29 13:26:14 -0700422 "src/ports/SkFontMgr_FontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700423 ]
424}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400425optional("fontmgr_FontConfigInterface_factory") {
426 enabled = skia_enable_fontmgr_FontConfigInterface
427 deps = [ ":fontmgr_FontConfigInterface" ]
428 sources = [ "src/ports/SkFontMgr_FontConfigInterface_factory.cpp" ]
429}
mtklein3cc22182016-08-29 13:26:14 -0700430
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500431optional("fontmgr_fuchsia") {
432 enabled = skia_enable_fontmgr_fuchsia
433
Chinmay Garde89820762019-05-06 16:44:06 -0700434 deps = []
435
436 if (is_fuchsia && using_fuchsia_sdk) {
John Rosasco24cbdab2019-09-25 14:14:35 -0700437 deps += [ "//build/fuchsia/fidl:fuchsia.fonts" ]
Chinmay Garde89820762019-05-06 16:44:06 -0700438 } else {
Mike Kleina01c6b02020-04-01 13:47:34 -0500439 deps = [ "//sdk/fidl/fuchsia.fonts" ]
Chinmay Garde89820762019-05-06 16:44:06 -0700440 }
Ben Wagner75626e42020-06-03 13:20:37 -0400441 public = [ "src/ports/SkFontMgr_fuchsia.h" ]
442 sources = [ "src/ports/SkFontMgr_fuchsia.cpp" ]
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500443}
444
Ben Wagner75626e42020-06-03 13:20:37 -0400445optional("fontmgr_mac_ct") {
Ben Wagnerd13487e2020-06-03 23:29:43 -0400446 enabled = skia_use_fonthost_mac
447
Ben Wagner75626e42020-06-03 13:20:37 -0400448 public = [
449 "include/ports/SkFontMgr_mac_ct.h",
450 "include/ports/SkTypeface_mac.h",
451 ]
Ben Wagner0ef90dd2020-06-05 11:25:42 -0400452 sources = [
Ben Wagner0ef90dd2020-06-05 11:25:42 -0400453 "src/ports/SkFontMgr_mac_ct.cpp",
Ben Wagner0ef90dd2020-06-05 11:25:42 -0400454 "src/ports/SkScalerContext_mac_ct.cpp",
455 "src/ports/SkScalerContext_mac_ct.h",
456 "src/ports/SkTypeface_mac_ct.cpp",
457 "src/ports/SkTypeface_mac_ct.h",
458 ]
Ben Wagnerd13487e2020-06-03 23:29:43 -0400459
460 if (is_mac) {
Jim Van Verthef820be2020-08-12 10:45:00 -0400461 frameworks = [
Ben Wagnerd13487e2020-06-03 23:29:43 -0400462 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
463 "AppKit.framework",
464 "ApplicationServices.framework",
465 ]
466 }
467
468 if (is_ios) {
Jim Van Verthef820be2020-08-12 10:45:00 -0400469 frameworks = [
Ben Wagnerd13487e2020-06-03 23:29:43 -0400470 "CoreFoundation.framework",
471 "CoreGraphics.framework",
472 "CoreText.framework",
473
474 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
475 "UIKit.framework",
476 ]
477 }
478}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400479optional("fontmgr_mac_ct_factory") {
480 enabled = skia_use_fonthost_mac
481 deps = [ ":fontmgr_mac_ct" ]
482 sources = [ "src/ports/SkFontMgr_mac_ct_factory.cpp" ]
483}
Ben Wagnerd13487e2020-06-03 23:29:43 -0400484
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500485optional("fontmgr_win") {
486 enabled = skia_enable_fontmgr_win
487
Ben Wagner75626e42020-06-03 13:20:37 -0400488 public = [ "include/ports/SkTypeface_win.h" ]
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500489 sources = [
490 "src/fonts/SkFontMgr_indirect.cpp",
491 "src/ports/SkFontMgr_win_dw.cpp",
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500492 "src/ports/SkScalerContext_win_dw.cpp",
493 "src/ports/SkTypeface_win_dw.cpp",
494 ]
495}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400496optional("fontmgr_win_factory") {
497 enabled = skia_enable_fontmgr_win
498 deps = [ ":fontmgr_win" ]
499 sources = [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
500}
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500501
502optional("fontmgr_win_gdi") {
503 enabled = skia_enable_fontmgr_win_gdi
504
Ben Wagner75626e42020-06-03 13:20:37 -0400505 public = [ "include/ports/SkTypeface_win.h" ]
Mike Kleina01c6b02020-04-01 13:47:34 -0500506 sources = [ "src/ports/SkFontHost_win.cpp" ]
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500507 libs = [ "Gdi32.lib" ]
508}
509
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700510if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400511 executable("sksllex") {
512 sources = [
513 "src/sksl/lex/Main.cpp",
514 "src/sksl/lex/NFA.cpp",
515 "src/sksl/lex/RegexNode.cpp",
516 "src/sksl/lex/RegexParser.cpp",
517 ]
Mike Kleinc0bd9f92019-04-23 12:05:21 -0500518 include_dirs = [ "." ]
Ethan Nicholasca82a922017-09-07 09:39:50 -0400519 }
520
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700521 action("run_sksllex") {
522 script = "gn/run_sksllex.py"
Mike Kleina01c6b02020-04-01 13:47:34 -0500523 deps = [ ":sksllex(//gn/toolchain:$host_toolchain)" ]
524 sources = [ "src/sksl/lex/sksl.lex" ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700525
526 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
527 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
528 outputs = [
529 "$target_out_dir/" +
530 rebase_path("src/sksl/lex/SkSLLexer.h", target_out_dir),
531 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
532 # confused due to the same file being named by two different paths
533 ]
534 sksllex_path = "$root_out_dir/"
535 sksllex_path += "sksllex"
536 if (host_os == "win") {
537 sksllex_path += ".exe"
538 }
539 args = [
540 rebase_path(sksllex_path),
541 rebase_path("bin/clang-format"),
John Stiles796e7022020-06-11 19:57:22 -0400542 rebase_path("bin/fetch-clang-format"),
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700543 rebase_path("src"),
544 ]
545 }
546} else {
547 group("run_sksllex") {
548 }
549}
550
John Stilesd836f842020-09-14 10:21:44 -0400551# `Compile Processors` and `Compile SkSL Tests` both rely on skslc.
552if (skia_compile_processors || skia_compile_sksl_tests) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400553 executable("skslc") {
554 defines = [ "SKSL_STANDALONE" ]
Mike Kleina01c6b02020-04-01 13:47:34 -0500555 sources = [ "src/sksl/SkSLMain.cpp" ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400556 sources += skia_sksl_sources
Brian Osmanfb32ddf2019-06-18 10:14:20 -0400557 sources += skia_sksl_gpu_sources
Mike Kleinc0bd9f92019-04-23 12:05:21 -0500558 include_dirs = [ "." ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400559 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500560 ":run_sksllex",
Stephen White238fc242019-08-26 10:19:23 -0400561 "//third_party/spirv-tools:spvtools",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400562 ]
563 }
564
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400565 skslc_path = "$root_out_dir/"
566 if (host_toolchain != default_toolchain_name) {
567 skslc_path += "$host_toolchain/"
568 }
569 skslc_path += "skslc"
570 if (host_os == "win") {
571 skslc_path += ".exe"
572 }
573
Brian Osmandd496172020-08-08 08:17:18 -0400574 action("create_sksl_fp") {
575 script = "gn/create_sksl_fp.py"
576 sources = [
577 "include/private/GrSharedEnums.h",
578 "src/sksl/sksl_fp_raw.sksl",
579 ]
580 outputs = [ "$root_out_dir/sksl_fp.sksl" ]
581 args = [
582 rebase_path(sources[0]),
583 rebase_path(sources[1]),
584 rebase_path(outputs[0]),
585 ]
586 }
587
588 copy("sksl_pre_includes") {
589 sources = [
590 "src/sksl/sksl_frag.sksl",
591 "src/sksl/sksl_geom.sksl",
592 "src/sksl/sksl_gpu.sksl",
593 "src/sksl/sksl_interp.sksl",
594 "src/sksl/sksl_pipeline.sksl",
595 "src/sksl/sksl_vert.sksl",
596 ]
597 outputs = [ "$root_out_dir/{{source_file_part}}" ]
598 }
599
600 dehydrate_sksl_sources = get_target_outputs(":sksl_pre_includes")
601 dehydrate_sksl_sources += get_target_outputs(":create_sksl_fp")
602
603 dehydrate_sksl_outputs = []
604 foreach(src, dehydrate_sksl_sources) {
605 name = get_path_info(src, "name")
606
607 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
608 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
609 dehydrate_sksl_outputs += [ "$target_out_dir/" + rebase_path(
610 "src/sksl/generated/$name.dehydrated.sksl",
611 target_out_dir) ]
612 }
613
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400614 action("dehydrate_sksl") {
615 script = "gn/dehydrate_sksl.py"
Brian Osmandd496172020-08-08 08:17:18 -0400616 deps = [
617 ":create_sksl_fp",
618 ":sksl_pre_includes",
619 ":skslc(//gn/toolchain:$host_toolchain)",
620 ]
621 sources = dehydrate_sksl_sources
622 outputs = dehydrate_sksl_outputs
Brian Osmana5781382020-08-07 21:28:12 +0000623 args = [
624 rebase_path(skslc_path),
Brian Osmandd496172020-08-08 08:17:18 -0400625 rebase_path("src/sksl/generated"),
Brian Osmana5781382020-08-07 21:28:12 +0000626 ]
Brian Osmandd496172020-08-08 08:17:18 -0400627 args += rebase_path(dehydrate_sksl_sources)
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400628 }
John Stilesd836f842020-09-14 10:21:44 -0400629} else {
630 group("dehydrate_sksl") {
631 }
632}
633
634skia_gpu_processor_outputs = []
635if (skia_compile_processors) {
636 foreach(src, skia_gpu_processor_sources) {
637 dir = get_path_info(src, "dir")
638 name = get_path_info(src, "name")
639
640 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
641 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
642 skia_gpu_processor_outputs += [
643 "$target_out_dir/" +
644 rebase_path("$dir/generated/$name.h", target_out_dir),
645 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
646 # confused due to the same file being named by two different paths
647 ]
648 }
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400649
Ethan Nicholas762466e2017-06-29 10:03:38 -0400650 action("compile_processors") {
651 script = "gn/compile_processors.py"
652 deps = [
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400653 ":create_sksl_fp",
Brian Osmandd496172020-08-08 08:17:18 -0400654 ":sksl_pre_includes",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400655 ":skslc(//gn/toolchain:$host_toolchain)",
656 ]
657 sources = skia_gpu_processor_sources
658 outputs = skia_gpu_processor_outputs
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400659 args = [
660 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400661 rebase_path("bin/clang-format"),
John Stiles796e7022020-06-11 19:57:22 -0400662 rebase_path("bin/fetch-clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400663 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400664 args += rebase_path(skia_gpu_processor_sources)
665 }
666} else {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400667 group("compile_processors") {
668 }
John Stilesd836f842020-09-14 10:21:44 -0400669}
670
671if (skia_compile_sksl_tests) {
672 import("gn/sksl_tests.gni")
673 sksl_fp_tests_outputs = []
674 foreach(src, sksl_fp_tests_sources) {
675 dir = get_path_info(src, "dir")
676 name = get_path_info(src, "name")
677 sksl_fp_tests_outputs += [
678 "$target_out_dir/" + rebase_path("$dir/golden/$name.cpp", target_out_dir),
679 "$target_out_dir/" + rebase_path("$dir/golden/$name.h", target_out_dir),
680 ]
681 }
682
683 sksl_glsl_tests_outputs = []
684 foreach(src, sksl_glsl_tests_sources) {
685 dir = get_path_info(src, "dir")
686 name = get_path_info(src, "name")
687 sksl_glsl_tests_outputs +=
688 [ "$target_out_dir/" +
689 rebase_path("$dir/golden/$name.glsl", target_out_dir) ]
690 }
691
692 action("compile_sksl_tests") {
693 script = "gn/compile_sksl_tests.py"
694 deps = [
695 ":create_sksl_fp",
696 ":sksl_pre_includes",
697 ":skslc(//gn/toolchain:$host_toolchain)",
698 ]
699 sources = sksl_fp_tests_sources + sksl_glsl_tests_sources
700 outputs = sksl_fp_tests_outputs + sksl_glsl_tests_outputs
701 args = [ rebase_path(skslc_path) ]
702 args += rebase_path(sksl_fp_tests_sources)
703 args += rebase_path(sksl_glsl_tests_sources)
704 }
705} else {
706 group("compile_sksl_tests") {
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400707 }
Ethan Nicholas762466e2017-06-29 10:03:38 -0400708}
709
Ben Wagnere27ee6c2019-02-15 14:59:30 -0500710optional("gpu") {
mtklein06c35c02016-09-20 12:28:12 -0700711 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400712 deps = [
713 ":compile_processors",
John Stilesd836f842020-09-14 10:21:44 -0400714 ":compile_sksl_tests",
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400715 ":dehydrate_sksl",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700716 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400717 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700718 if (skia_generate_workarounds) {
719 deps += [ ":workaround_list" ]
720 }
John Rosascoa9b348f2019-11-08 13:18:15 -0800721 public_defines = []
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600722 public_configs = []
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400723 public_deps = []
mtkleine9fb3d52016-09-20 15:11:46 -0700724
Brian Osmanfb32ddf2019-06-18 10:14:20 -0400725 sources =
726 skia_gpu_sources + skia_sksl_gpu_sources + skia_gpu_processor_outputs
Kevin Lubick93faa672018-10-10 15:54:53 -0400727 if (!skia_enable_ccpr) {
728 sources -= skia_ccpr_sources
729 sources += [ "src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp" ]
730 }
Kevin Lubick4bf2c262018-10-15 09:35:54 -0400731 if (!skia_enable_nvpr) {
732 sources -= skia_nvpr_sources
733 sources += [ "src/gpu/GrPathRendering_none.cpp" ]
734 }
mtklein06c35c02016-09-20 12:28:12 -0700735
Mike Klein703cf5a2016-10-13 17:18:04 -0400736 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -0400737 frameworks = []
mtkleine9fb3d52016-09-20 15:11:46 -0700738
John Rosascoa9b348f2019-11-08 13:18:15 -0800739 if (skia_use_gl) {
740 public_defines += [ "SK_GL" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400741 if (is_android) {
742 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
743
744 # this lib is required to link against AHardwareBuffer
745 if (defined(ndk_api) && ndk_api >= 26) {
746 libs += [ "android" ]
747 }
748 } else if (skia_use_egl) {
749 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
750 libs += [ "EGL" ]
Kevin Lubick204c3be2020-08-19 14:30:58 -0400751 } else if (skia_use_webgl) {
752 sources += [ "src/gpu/gl/webgl/GrGLMakeNativeInterface_webgl.cpp" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400753 } else if (is_linux && skia_use_x11) {
754 sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
755 libs += [ "GL" ]
756 } else if (is_mac) {
757 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
758 } else if (is_ios) {
759 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
760 } else if (is_win) {
761 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
762 if (target_cpu != "arm64") {
763 libs += [ "OpenGL32.lib" ]
764 }
765 } else {
766 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
767 }
John Rosascoa9b348f2019-11-08 13:18:15 -0800768 sources += skia_gl_gpu_sources
769 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400770
mtkleine9fb3d52016-09-20 15:11:46 -0700771 if (skia_use_vulkan) {
Greg Danielda16cce2018-08-01 09:23:57 -0400772 public_defines += [ "SK_VULKAN" ]
Greg Danielb16beb92020-04-27 14:26:21 +0000773 if (skia_use_vma) {
774 deps += [ "third_party/vulkanmemoryallocator" ]
775 }
mtkleine9fb3d52016-09-20 15:11:46 -0700776 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700777 if (skia_enable_vulkan_debug_layers) {
778 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
779 }
Craig Stoutcb6b4bd2018-12-13 10:20:07 -0800780 if (is_fuchsia) {
John Rosascoe57ca492019-11-13 14:30:45 -0800781 if (using_fuchsia_sdk) {
Chinmay Garde89820762019-05-06 16:44:06 -0700782 public_deps += [ "$fuchsia_sdk_root/pkg:vulkan" ]
783 } else {
Brian Osman489cf882019-07-09 10:48:28 -0400784 public_deps += [ "//src/graphics/lib/vulkan" ]
Chinmay Garde89820762019-05-06 16:44:06 -0700785 }
Craig Stoutcb6b4bd2018-12-13 10:20:07 -0800786 }
mtkleine9fb3d52016-09-20 15:11:46 -0700787 }
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400788
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400789 if (is_android && (skia_use_gl || skia_use_vulkan)) {
790 # this lib is required to link against AHardwareBuffer
791 if (defined(ndk_api) && ndk_api >= 26) {
792 libs += [ "android" ]
793 }
794 }
795
Stephen White0d70b712019-07-10 15:51:30 -0400796 if (skia_use_dawn) {
797 public_defines += [ "SK_DAWN" ]
Stephen White985741a2019-07-18 11:43:45 -0400798 sources += skia_dawn_sources
Zhenyao Mo4f17b602020-04-13 15:26:17 -0700799 public_deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen Whitefbffb992019-10-17 10:32:40 -0400800 deps += [
Zhenyao Mo4f17b602020-04-13 15:26:17 -0700801 "//third_party/externals/dawn/src/dawn:dawn_proc",
802 "//third_party/externals/dawn/src/dawn:dawncpp",
803 "//third_party/externals/dawn/src/dawn_native",
Stephen White0d70b712019-07-10 15:51:30 -0400804 ]
805 if (dawn_enable_d3d12) {
806 libs += [
807 "d3d12.lib",
808 "dxgi.lib",
809 "d3dcompiler.lib",
810 ]
811 } else if (dawn_enable_metal) {
Jim Van Verthef820be2020-08-12 10:45:00 -0400812 frameworks += [ "Metal.framework" ]
Stephen White0d70b712019-07-10 15:51:30 -0400813 }
814 }
815
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500816 if (skia_use_direct3d) {
817 public_defines += [ "SK_DIRECT3D" ]
Brian Osmanc0243912020-02-19 15:35:26 -0500818 deps += [ "//third_party/spirv-cross:spirv_cross" ]
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500819 sources += skia_direct3d_sources
Jim Van Verth03b8ab22020-02-24 11:36:15 -0500820 if (skia_enable_direct3d_debug_layer) {
821 public_defines += [ "SK_ENABLE_D3D_DEBUG_LAYER" ]
822 }
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500823 libs += [
824 "d3d12.lib",
825 "dxgi.lib",
826 "d3dcompiler.lib",
827 ]
828 }
829
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400830 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400831 if (skia_use_metal) {
832 public_defines += [ "SK_METAL" ]
833 sources += skia_metal_sources
Jim Van Verthef820be2020-08-12 10:45:00 -0400834 frameworks += [ "Metal.framework" ]
835 frameworks += [ "MetalKit.framework" ]
836 frameworks += [ "Foundation.framework" ]
Jim Van Verth36b86af2020-08-24 17:16:46 +0000837 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400838 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500839
Kevin Lubickf4def342018-10-04 12:52:50 -0400840 if (is_debug) {
841 public_defines += [ "SK_ENABLE_DUMP_GPU" ]
842 }
mtklein06c35c02016-09-20 12:28:12 -0700843}
844
Leon Scroggins III41169202019-01-29 09:29:57 -0500845optional("gif") {
Hal Canary2dad9902019-11-20 16:01:31 -0500846 enabled = !skia_use_wuffs && skia_use_libgifcodec
Hal Canary1ec9a282019-11-21 10:15:50 -0500847 _libgifcodec_gni_path = "third_party/externals/libgifcodec/libgifcodec.gni"
848 if ("True" ==
849 exec_script("gn/checkpath.py",
850 [ rebase_path(_libgifcodec_gni_path, root_build_dir) ],
851 "trim string")) {
852 public_defines = [ "SK_USE_LIBGIFCODEC" ]
853 public_include_dirs = [
854 ".",
855 skia_libgifcodec_path,
856 ]
857 include_dirs = public_include_dirs
858 import(_libgifcodec_gni_path)
859 sources = rebase_path(libgifcodec_sources + libgifcodec_public,
860 ".",
861 skia_libgifcodec_path)
862 }
Leon Scroggins III41169202019-01-29 09:29:57 -0500863}
864
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400865optional("heif") {
866 enabled = skia_use_libheif
867 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
868
869 deps = []
870
Mike Kleina01c6b02020-04-01 13:47:34 -0500871 sources = [ "src/codec/SkHeifCodec.cpp" ]
Leon Scroggins III04be2b52017-08-17 15:13:20 -0400872}
873
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -0400874optional("jpeg_decode") {
875 enabled = skia_use_libjpeg_turbo_decode
876 public_defines = [ "SK_CODEC_DECODES_JPEG" ]
877
Mike Kleina01c6b02020-04-01 13:47:34 -0500878 deps = [ "//third_party/libjpeg-turbo:libjpeg" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -0400879 sources = [
880 "src/codec/SkJpegCodec.cpp",
881 "src/codec/SkJpegDecoderMgr.cpp",
882 "src/codec/SkJpegUtility.cpp",
883 ]
884}
885
886optional("jpeg_encode") {
887 enabled = skia_use_libjpeg_turbo_encode
888 public_defines = [ "SK_ENCODE_JPEG" ]
mtklein63213812016-08-24 09:55:56 -0700889
Mike Kleina01c6b02020-04-01 13:47:34 -0500890 deps = [ "//third_party/libjpeg-turbo:libjpeg" ]
891 public = [ "include/encode/SkJpegEncoder.h" ]
mtklein63213812016-08-24 09:55:56 -0700892 sources = [
mtklein63213812016-08-24 09:55:56 -0700893 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -0400894 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -0700895 ]
896}
897
Leon Scroggins III326b9892020-08-05 16:51:10 -0400898optional("ndk_images") {
899 enabled = skia_use_ndk_images
900 public_defines = [ "SK_ENABLE_NDK_IMAGES" ]
901 sources = [
902 "src/ports/SkImageEncoder_NDK.cpp",
903 "src/ports/SkImageGeneratorNDK.cpp",
904 "src/ports/SkNDKConversions.cpp",
905 ]
Leon Scroggins IIIf21d6b92020-08-05 10:44:17 -0400906 libs = [ "jnigraphics" ]
907}
908
mtklein63213812016-08-24 09:55:56 -0700909optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -0500910 enabled = skia_use_zlib && skia_enable_pdf
911 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -0700912
Mike Kleina01c6b02020-04-01 13:47:34 -0500913 deps = [ "//third_party/zlib" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -0400914 if (skia_use_libjpeg_turbo_decode) {
915 deps += [ ":jpeg_decode" ]
916 }
917 if (skia_use_libjpeg_turbo_encode) {
918 deps += [ ":jpeg_encode" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -0400919 }
Robert Phillips9b00f1f2020-03-24 12:29:44 -0400920 public = skia_pdf_public
brettwb9447282016-09-01 14:24:39 -0700921 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -0700922 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
Hal Canary2a3093c2019-02-20 11:25:45 -0500923 if (skia_use_icu && skia_use_harfbuzz && skia_pdf_subset_harfbuzz) {
924 deps += [ "//third_party/harfbuzz" ]
925 defines = [ "SK_PDF_USE_HARFBUZZ_SUBSET" ]
926 } else if (skia_use_icu && skia_use_sfntly) {
mtklein63213812016-08-24 09:55:56 -0700927 deps += [ "//third_party/sfntly" ]
Hal Canary32498f02019-02-04 15:36:31 -0500928 defines = [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -0700929 }
930}
931
Robert Phillips9b00f1f2020-03-24 12:29:44 -0400932optional("xps") {
933 enabled = skia_use_xps && is_win
934 public_defines = [ "SK_SUPPORT_XPS" ]
935 public = skia_xps_public
936 sources = skia_xps_sources
937}
938
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -0400939optional("png_decode") {
940 enabled = skia_use_libpng_decode
941 public_defines = [ "SK_CODEC_DECODES_PNG" ]
mtklein63213812016-08-24 09:55:56 -0700942
Mike Kleina01c6b02020-04-01 13:47:34 -0500943 deps = [ "//third_party/libpng" ]
mtklein63213812016-08-24 09:55:56 -0700944 sources = [
945 "src/codec/SkIcoCodec.cpp",
946 "src/codec/SkPngCodec.cpp",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -0400947 ]
948}
949
950optional("png_encode") {
951 enabled = skia_use_libpng_encode
952 public_defines = [ "SK_ENCODE_PNG" ]
953
Mike Kleina01c6b02020-04-01 13:47:34 -0500954 deps = [ "//third_party/libpng" ]
955 sources = [ "src/images/SkPngEncoder.cpp" ]
mtklein63213812016-08-24 09:55:56 -0700956}
957
scroggof84ad642016-10-31 09:02:57 -0700958optional("raw") {
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -0400959 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo_decode && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -0700960 public_defines = [ "SK_CODEC_DECODES_RAW" ]
961
962 deps = [
963 "//third_party/dng_sdk",
964 "//third_party/libjpeg-turbo:libjpeg",
965 "//third_party/piex",
966 ]
967
968 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
969 # Skia.
970 configs_to_remove = [ "//gn:no_exceptions" ]
971
Mike Kleina01c6b02020-04-01 13:47:34 -0500972 sources = [ "src/codec/SkRawCodec.cpp" ]
scroggof84ad642016-10-31 09:02:57 -0700973}
974
Mike Klein852a8cb2018-05-15 10:46:58 -0400975import("third_party/skcms/skcms.gni")
Brian Osman8dc68c62018-05-30 12:57:45 -0400976source_set("skcms") {
Mike Klein852a8cb2018-05-15 10:46:58 -0400977 cflags = []
978 if (!is_win || is_clang) {
979 cflags += [
980 "-w",
981 "-std=c11",
982 ]
983 }
984
Mike Kleina01c6b02020-04-01 13:47:34 -0500985 public = [ "include/third_party/skcms/skcms.h" ]
Brian Osmanea236bf2019-04-29 10:28:22 -0400986 include_dirs = [ "include/third_party/skcms" ]
Mike Klein852a8cb2018-05-15 10:46:58 -0400987 sources = rebase_path(skcms_sources, ".", "third_party/skcms")
988}
989
mtklein3cc22182016-08-29 13:26:14 -0700990optional("typeface_freetype") {
991 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -0700992
Mike Kleina01c6b02020-04-01 13:47:34 -0500993 deps = [ "//third_party/freetype2" ]
mtklein3cc22182016-08-29 13:26:14 -0700994 sources = [
995 "src/ports/SkFontHost_FreeType.cpp",
996 "src/ports/SkFontHost_FreeType_common.cpp",
Ben Wagner9d5c55c2020-06-27 12:52:14 -0400997 "src/ports/SkFontHost_FreeType_common.h",
mtklein3cc22182016-08-29 13:26:14 -0700998 ]
999}
1000
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001001optional("webp_decode") {
1002 enabled = skia_use_libwebp_decode
1003 public_defines = [ "SK_CODEC_DECODES_WEBP" ]
mtklein457b42a2016-08-23 13:56:37 -07001004
Mike Kleina01c6b02020-04-01 13:47:34 -05001005 deps = [ "//third_party/libwebp" ]
1006 sources = [ "src/codec/SkWebpCodec.cpp" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001007}
1008
1009optional("webp_encode") {
1010 enabled = skia_use_libwebp_encode
1011 public_defines = [ "SK_ENCODE_WEBP" ]
1012
Mike Kleina01c6b02020-04-01 13:47:34 -05001013 deps = [ "//third_party/libwebp" ]
1014 sources = [ "src/images/SkWebpEncoder.cpp" ]
mtkleineb3c4252016-08-23 07:38:09 -07001015}
1016
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001017optional("wuffs") {
1018 enabled = skia_use_wuffs
Nigel Tao5cfa7192020-08-17 21:14:13 +10001019 public_defines = [ "SK_HAS_WUFFS_LIBRARY" ]
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001020
Mike Kleina01c6b02020-04-01 13:47:34 -05001021 deps = [ "//third_party/wuffs" ]
1022 sources = [ "src/codec/SkWuffsCodec.cpp" ]
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001023}
1024
mtklein63213812016-08-24 09:55:56 -07001025optional("xml") {
1026 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +00001027 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -07001028
Mike Kleina01c6b02020-04-01 13:47:34 -05001029 deps = [ "//third_party/expat" ]
mtklein63213812016-08-24 09:55:56 -07001030 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -05001031 "src/svg/SkSVGCanvas.cpp",
1032 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -07001033 "src/xml/SkDOM.cpp",
1034 "src/xml/SkXMLParser.cpp",
1035 "src/xml/SkXMLWriter.cpp",
1036 ]
1037}
1038
Mike Klein853d4ed2020-08-20 00:41:00 +00001039optional("sksl_interpreter") {
1040 enabled = skia_enable_sksl_interpreter
1041 public_defines = [ "SK_ENABLE_SKSL_INTERPRETER" ]
1042}
1043
Mike Klein613ad382019-06-06 11:42:02 -05001044optional("skvm_jit") {
Mike Klein13ec5442020-08-14 07:36:54 -05001045 enabled = skia_enable_skvm_jit_when_possible
1046 public_defines = [ "SKVM_JIT_WHEN_POSSIBLE" ]
Mike Klein2b54e832020-07-10 12:56:07 -05001047 if (skia_vtune_path != "") {
1048 public_defines += [ "SKVM_JIT_VTUNE" ]
1049 public_include_dirs = [ "$skia_vtune_path/include" ]
1050 libs = [ "$skia_vtune_path/lib64/jitprofiling.lib" ]
1051 }
Mike Klein613ad382019-06-06 11:42:02 -05001052}
1053
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001054if (skia_enable_gpu && skia_generate_workarounds) {
1055 action("workaround_list") {
1056 script = "tools/build_workaround_header.py"
1057
Mike Kleina01c6b02020-04-01 13:47:34 -05001058 inputs = [ "src/gpu/gpu_workaround_list.txt" ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001059
1060 # see comments in skia_compile_processors about out dir path shenanigans.
1061 output_file =
Adrienne Walkerab7181d2018-05-14 14:02:03 -07001062 rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001063
Mike Kleina01c6b02020-04-01 13:47:34 -05001064 outputs = [ "$root_out_dir/$output_file" ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001065 args = [
1066 "--output-file",
1067 "$output_file",
1068 ]
1069
1070 foreach(file, inputs) {
1071 args += [ rebase_path(file, root_build_dir) ]
1072 }
1073 }
1074}
1075
mtkleinc04ff472016-06-23 10:29:30 -07001076component("skia") {
1077 public_configs = [ ":skia_public" ]
1078 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -07001079
Mike Klein607b0a72018-11-07 16:17:34 -05001080 public_deps = [
Ben Wagner32d5cfa2020-06-11 14:41:47 -04001081 ":fontmgr_FontConfigInterface",
1082 ":fontmgr_android",
1083 ":fontmgr_custom_directory",
1084 ":fontmgr_custom_embedded",
1085 ":fontmgr_custom_empty",
1086 ":fontmgr_fontconfig",
1087 ":fontmgr_fuchsia",
1088 ":fontmgr_mac_ct",
1089 ":fontmgr_win",
1090 ":fontmgr_win_gdi",
Ben Wagnere27ee6c2019-02-15 14:59:30 -05001091 ":gpu",
Mike Klein607b0a72018-11-07 16:17:34 -05001092 ":pdf",
1093 ":skcms",
Robert Phillips9b00f1f2020-03-24 12:29:44 -04001094 ":xps",
Mike Klein607b0a72018-11-07 16:17:34 -05001095 ]
1096
mtkleinc04ff472016-06-23 10:29:30 -07001097 deps = [
Leon Scroggins III63cfb362020-04-24 13:00:48 -04001098 ":android_utils",
anmittalb8b3f712016-08-25 04:55:19 -07001099 ":arm64",
1100 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -07001101 ":avx",
Mike Klein54378232018-11-08 12:08:05 +00001102 ":compile_processors",
anmittalb8b3f712016-08-25 04:55:19 -07001103 ":crc32",
Ethan Nicholasc18bb512020-07-28 14:46:53 -04001104 ":dehydrate_sksl",
Ben Wagner75626e42020-06-03 13:20:37 -04001105 ":fontmgr_factory",
Leon Scroggins III41169202019-01-29 09:29:57 -05001106 ":gif",
Leon Scroggins III04be2b52017-08-17 15:13:20 -04001107 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -05001108 ":hsw",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001109 ":jpeg_decode",
1110 ":jpeg_encode",
Leon Scroggins III326b9892020-08-05 16:51:10 -04001111 ":ndk_images",
mtklein9b8583d2016-08-24 17:32:30 -07001112 ":none",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001113 ":png_decode",
1114 ":png_encode",
scroggof84ad642016-10-31 09:02:57 -07001115 ":raw",
Mike Klein853d4ed2020-08-20 00:41:00 +00001116 ":sksl_interpreter",
Mike Klein613ad382019-06-06 11:42:02 -05001117 ":skvm_jit",
Mike Kleina9026da2020-06-05 08:57:05 -05001118 ":skx",
mtklein9b8583d2016-08-24 17:32:30 -07001119 ":sse2",
1120 ":sse41",
1121 ":sse42",
1122 ":ssse3",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001123 ":webp_decode",
1124 ":webp_encode",
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001125 ":wuffs",
mtklein63213812016-08-24 09:55:56 -07001126 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -07001127 ]
1128
Chinmay Garde43f115c2016-11-16 15:04:12 -08001129 # This file (and all GN files in Skia) are designed to work with an
1130 # empty sources assignment filter; we handle all that explicitly.
1131 # We clear the filter here for clients who may have set up a global filter.
1132 set_sources_assignment_filter([])
1133
Hal Canaryc25f4e92019-02-26 11:54:25 -05001134 public = skia_core_public
1135 public += skia_utils_public
1136 public += skia_effects_public
1137 public += skia_effects_imagefilter_public
Hal Canaryc25f4e92019-02-26 11:54:25 -05001138
mtkleinc04ff472016-06-23 10:29:30 -07001139 sources = []
brettwb9447282016-09-01 14:24:39 -07001140 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -07001141 sources += skia_utils_sources
Mike Klein54378232018-11-08 12:08:05 +00001142 sources += skia_effects_sources
1143 sources += skia_effects_imagefilter_sources
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001144 sources += skia_sksl_sources
mtkleinc04ff472016-06-23 10:29:30 -07001145 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -04001146 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -05001147 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -07001148 "src/codec/SkAndroidCodec.cpp",
Nigel Tao612a65d2018-11-09 10:10:31 +11001149 "src/codec/SkAndroidCodecAdapter.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -04001150 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001151 "src/codec/SkBmpCodec.cpp",
1152 "src/codec/SkBmpMaskCodec.cpp",
1153 "src/codec/SkBmpRLECodec.cpp",
1154 "src/codec/SkBmpStandardCodec.cpp",
1155 "src/codec/SkCodec.cpp",
1156 "src/codec/SkCodecImageGenerator.cpp",
Leon Scroggins III22f673d2018-05-30 15:33:46 -04001157 "src/codec/SkColorTable.cpp",
Leon Scroggins III36f7e322018-08-27 11:55:46 -04001158 "src/codec/SkEncodedInfo.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001159 "src/codec/SkMaskSwizzler.cpp",
1160 "src/codec/SkMasks.cpp",
Leon Scroggins IIIba458302019-09-24 12:40:11 -04001161 "src/codec/SkParseEncodedOrigin.cpp",
mtklein25c81d42016-07-27 13:55:26 -07001162 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001163 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -07001164 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001165 "src/codec/SkSwizzler.cpp",
1166 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001167 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001168 "src/ports/SkDiscardableMemory_none.cpp",
Mike Klein54378232018-11-08 12:08:05 +00001169 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001170 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001171 "src/ports/SkMemory_malloc.cpp",
1172 "src/ports/SkOSFile_stdio.cpp",
1173 "src/sfnt/SkOTTable_name.cpp",
1174 "src/sfnt/SkOTUtils.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001175 ]
brettwb9447282016-09-01 14:24:39 -07001176
Kevin Lubick32dfdbe2018-10-18 09:47:01 -04001177 defines = []
mtklein7d6fb2c2016-08-25 14:50:44 -07001178 libs = []
1179
mtkleinc04ff472016-06-23 10:29:30 -07001180 if (is_win) {
1181 sources += [
1182 "src/ports/SkDebug_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001183 "src/ports/SkImageEncoder_WIC.cpp",
1184 "src/ports/SkImageGeneratorWIC.cpp",
1185 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -07001186 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001187 ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001188 libs += [
1189 "FontSub.lib",
1190 "Ole32.lib",
1191 "OleAut32.lib",
1192 "User32.lib",
Mike Klein0c5fdcb2017-11-13 12:40:46 -05001193 "Usp10.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -04001194 ]
mtkleinc04ff472016-06-23 10:29:30 -07001195 } else {
1196 sources += [
mtkleinc04ff472016-06-23 10:29:30 -07001197 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -07001198 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001199 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -04001200 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -07001201 }
1202
mtklein7d6fb2c2016-08-25 14:50:44 -07001203 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -05001204 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -05001205 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -05001206 deps += [ "//third_party/cpu-features" ]
1207 }
mtklein06c35c02016-09-20 12:28:12 -07001208 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -07001209 libs += [
1210 "EGL",
1211 "GLESv2",
1212 "log",
1213 ]
1214 }
1215
Kevin Lubick217056c2018-09-20 17:39:31 -04001216 if (is_linux || target_cpu == "wasm") {
mtklein06c35c02016-09-20 12:28:12 -07001217 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -04001218 if (skia_use_egl) {
1219 libs += [ "GLESv2" ]
1220 }
mtkleinc04ff472016-06-23 10:29:30 -07001221 }
1222
1223 if (is_mac) {
1224 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -07001225 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001226 "src/ports/SkImageEncoder_CG.cpp",
1227 "src/ports/SkImageGeneratorCG.cpp",
1228 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001229 frameworks = [
mtklein09e61f72016-08-23 13:35:28 -07001230 "ApplicationServices.framework",
1231 "OpenGL.framework",
1232 ]
mtkleinc04ff472016-06-23 10:29:30 -07001233 }
abarth6fc8ff02016-07-15 15:15:15 -07001234
Mike Klein7d302882016-11-03 14:06:31 -04001235 if (is_ios) {
1236 sources += [
1237 "src/ports/SkDebug_stdio.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001238 "src/ports/SkImageEncoder_CG.cpp",
1239 "src/ports/SkImageGeneratorCG.cpp",
1240 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001241 frameworks = [
Mike Klein7d302882016-11-03 14:06:31 -04001242 "CoreFoundation.framework",
Mike Klein7d302882016-11-03 14:06:31 -04001243 "ImageIO.framework",
1244 "MobileCoreServices.framework",
1245 ]
1246 }
1247
abarth6fc8ff02016-07-15 15:15:15 -07001248 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -07001249 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -07001250 }
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001251
1252 if (skia_enable_spirv_validation) {
Stephen White238fc242019-08-26 10:19:23 -04001253 deps += [ "//third_party/spirv-tools:spvtools_val" ]
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001254 defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
1255 }
Nathaniel Nifong0c4fbf12019-06-25 15:48:47 -04001256
1257 if (skia_include_multiframe_procs) {
1258 sources += [ "tools/SkSharingProc.cpp" ]
1259 }
mtkleinc04ff472016-06-23 10:29:30 -07001260}
1261
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001262# DebugCanvas used in experimental/wasm-skp-debugger
1263if (target_cpu == "wasm") {
1264 static_library("debugcanvas") {
1265 public_configs = [ ":skia_public" ]
1266
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001267 sources = [
Nathaniel Nifong0426c382019-06-21 11:09:19 -04001268 "tools/SkSharingProc.cpp",
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001269 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05001270 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05001271 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05001272 "tools/debugger/DrawCommand.cpp",
1273 "tools/debugger/JsonWriteBuffer.cpp",
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001274 ]
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001275 }
1276}
1277
Kevin Lubickcbcff382018-10-02 09:02:18 -04001278static_library("pathkit") {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001279 check_includes = false
Kevin Lubickcbcff382018-10-02 09:02:18 -04001280 public_configs = [ ":skia_public" ]
1281 configs += skia_library_configs
1282
1283 deps = [
1284 ":arm64",
1285 ":armv7",
1286 ":avx",
1287 ":crc32",
1288 ":hsw",
1289 ":none",
1290 ":sse2",
1291 ":sse41",
1292 ":sse42",
1293 ":ssse3",
1294 ]
1295
1296 # This file (and all GN files in Skia) are designed to work with an
1297 # empty sources assignment filter; we handle all that explicitly.
1298 # We clear the filter here for clients who may have set up a global filter.
1299 set_sources_assignment_filter([])
1300
1301 sources = []
1302 sources += skia_pathops_sources
Hal Canaryc25f4e92019-02-26 11:54:25 -05001303 sources += skia_pathops_public
Kevin Lubickcbcff382018-10-02 09:02:18 -04001304 sources += [
1305 "src/core/SkAnalyticEdge.cpp",
1306 "src/core/SkArenaAlloc.cpp",
Mike Reedcc88f3a2019-02-06 11:40:27 -05001307 "src/core/SkContourMeasure.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001308 "src/core/SkCubicMap.cpp",
1309 "src/core/SkEdge.cpp",
1310 "src/core/SkEdgeBuilder.cpp",
1311 "src/core/SkEdgeClipper.cpp",
1312 "src/core/SkGeometry.cpp",
Brian Salomon71fe9452020-03-02 16:59:40 -05001313 "src/core/SkIDChangeListener.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001314 "src/core/SkLineClipper.cpp",
Hal Canary7823aeb2019-10-30 17:26:45 -04001315 "src/core/SkMalloc.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001316 "src/core/SkMallocPixelRef.cpp",
1317 "src/core/SkMath.cpp",
1318 "src/core/SkMatrix.cpp",
1319 "src/core/SkOpts.cpp",
1320 "src/core/SkPaint.cpp",
1321 "src/core/SkPath.cpp",
Mike Reed06d7c9d2020-08-26 12:56:51 -04001322 "src/core/SkPathBuilder.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001323 "src/core/SkPathEffect.cpp",
1324 "src/core/SkPathMeasure.cpp",
1325 "src/core/SkPathRef.cpp",
1326 "src/core/SkPoint.cpp",
1327 "src/core/SkRRect.cpp",
Mike Klein45f36b52020-06-08 14:10:29 -05001328 "src/core/SkReadBuffer.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001329 "src/core/SkRect.cpp",
1330 "src/core/SkSemaphore.cpp",
1331 "src/core/SkStream.cpp",
1332 "src/core/SkString.cpp",
1333 "src/core/SkStringUtils.cpp",
1334 "src/core/SkStroke.cpp",
1335 "src/core/SkStrokeRec.cpp",
1336 "src/core/SkStrokerPriv.cpp",
1337 "src/core/SkThreadID.cpp",
1338 "src/core/SkUtils.cpp",
1339 "src/effects/SkDashPathEffect.cpp",
1340 "src/effects/SkTrimPathEffect.cpp",
1341 "src/ports/SkDebug_stdio.cpp",
1342 "src/ports/SkMemory_malloc.cpp",
1343 "src/utils/SkDashPath.cpp",
1344 "src/utils/SkParse.cpp",
1345 "src/utils/SkParsePath.cpp",
1346 "src/utils/SkUTF.cpp",
1347 ]
1348}
1349
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001350group("modules") {
1351 deps = [
Kevin Lubick96634842019-03-05 14:09:24 -05001352 "modules/particles",
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001353 "modules/skottie",
Mike Reed63559a52020-06-02 11:34:24 -04001354 "modules/skparagraph",
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001355 "modules/skshaper",
1356 ]
1357}
1358
Brian Osmancd28fa62020-07-07 16:01:26 -04001359config("our_vulkan_headers") {
1360 include_dirs = [ "include/third_party/vulkan" ]
1361}
1362
mtkleinc095df52016-08-24 12:23:52 -07001363# Targets guarded by skia_enable_tools may use //third_party freely.
1364if (skia_enable_tools) {
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001365 skia_public_includes = [
Leon Scroggins III63cfb362020-04-24 13:00:48 -04001366 "client_utils/android",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001367 "include/android",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001368 "include/c",
1369 "include/codec",
1370 "include/config",
1371 "include/core",
1372 "include/docs",
1373 "include/effects",
1374 "include/encode",
1375 "include/gpu",
1376 "include/pathops",
1377 "include/ports",
1378 "include/svg",
1379 "include/utils",
1380 "include/utils/mac",
Julia Lavrova70258c72020-07-15 11:28:57 -04001381 "modules/skparagraph/include",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001382 "modules/skshaper/include",
1383 "modules/skottie/include",
1384 ]
1385
Mike Klein308b5ac2016-12-06 16:03:52 -05001386 # Used by gn_to_bp.py to list our public include dirs.
1387 source_set("public") {
1388 configs += [ ":skia_public" ]
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001389 include_dirs = skia_public_includes
Mike Klein308b5ac2016-12-06 16:03:52 -05001390 }
1391
Mike Kleinc36dedf2016-11-18 09:35:28 -05001392 config("skia.h_config") {
1393 include_dirs = [ "$target_gen_dir" ]
1394 }
1395 action("skia.h") {
1396 public_configs = [ ":skia.h_config" ]
1397 skia_h = "$target_gen_dir/skia.h"
1398 script = "gn/find_headers.py"
Florin Malita6e4d95f2018-05-30 09:27:32 -04001399
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001400 args = [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
1401 [ rebase_path(skia_h, root_build_dir) ] +
1402 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001403 depfile = "$skia_h.deps"
Mike Kleina01c6b02020-04-01 13:47:34 -05001404 outputs = [ skia_h ]
Mike Kleinc36dedf2016-11-18 09:35:28 -05001405 }
1406
Brian Osmanc9a42472018-05-31 13:17:12 -04001407 if (target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001408 executable("fiddle") {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001409 check_includes = false
Mike Kleinc36dedf2016-11-18 09:35:28 -05001410 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001411 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001412 "tools/fiddle/draw.cpp",
1413 "tools/fiddle/fiddle_main.cpp",
1414 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001415
1416 if (skia_use_egl) {
1417 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001418 } else {
1419 sources += [ "tools/fiddle/null_context.cpp" ]
1420 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001421 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001422 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001423 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001424 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001425 ":skia",
1426 ":skia.h",
Florin Malita6e4d95f2018-05-30 09:27:32 -04001427 "modules/skottie",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04001428 "modules/skshaper",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001429 ]
1430 }
1431 }
1432
Mike Kleine5463e62020-06-11 13:53:53 -05001433 config("cpp14") {
1434 if (is_win) {
1435 cflags_cc = [ "/std:c++14" ]
1436 } else {
1437 cflags_cc = [ "-std=c++14" ]
1438 }
1439 }
1440
Brian Osmanc9a42472018-05-31 13:17:12 -04001441 source_set("public_headers_warnings_check") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001442 sources = [ "tools/public_headers_warnings_check.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001443 configs -= [ "//gn:warnings_except_public_headers" ]
Mike Kleine5463e62020-06-11 13:53:53 -05001444 configs += [
1445 ":our_vulkan_headers",
1446 ":cpp14",
1447 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001448 deps = [
1449 ":skia",
1450 ":skia.h",
1451 "modules/skottie",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04001452 "modules/skshaper",
Brian Osmanc9a42472018-05-31 13:17:12 -04001453 ]
Stephen White0d70b712019-07-10 15:51:30 -04001454
1455 if (skia_use_dawn) {
Zhenyao Mo4f17b602020-04-13 15:26:17 -07001456 deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen White0d70b712019-07-10 15:51:30 -04001457 }
Mike Kleinc36dedf2016-11-18 09:35:28 -05001458 }
1459
mtkleinc095df52016-08-24 12:23:52 -07001460 template("test_lib") {
1461 config(target_name + "_config") {
mtkleina627b5c2016-09-20 13:36:47 -07001462 if (defined(invoker.public_defines)) {
1463 defines = invoker.public_defines
1464 }
mtklein25c81d42016-07-27 13:55:26 -07001465 }
mtkleinc095df52016-08-24 12:23:52 -07001466 source_set(target_name) {
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001467 forward_variables_from(invoker, "*", [])
Hal Canaryc25f4e92019-02-26 11:54:25 -05001468 check_includes = false
mtkleinc095df52016-08-24 12:23:52 -07001469 public_configs = [
1470 ":" + target_name + "_config",
1471 ":skia_private",
1472 ]
1473
1474 if (!defined(deps)) {
1475 deps = []
1476 }
1477 deps += [ ":skia" ]
1478 testonly = true
1479 }
mtklein25c81d42016-07-27 13:55:26 -07001480 }
mtklein25c81d42016-07-27 13:55:26 -07001481
Mike Kleine6682eb2017-01-05 10:54:57 -05001482 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001483 if (is_ios) {
Hal Canary3388c1a2019-09-16 12:53:17 -04001484 ios_app_bundle(target_name) {
Jim Van Verth443a9132017-11-28 09:45:26 -05001485 forward_variables_from(invoker,
1486 "*",
1487 [
1488 "output_name",
1489 "visibility",
1490 "is_shared_library",
1491 ])
Mike Kleine6682eb2017-01-05 10:54:57 -05001492 testonly = true
Hal Canary3388c1a2019-09-16 12:53:17 -04001493 extra_configs = [ ":skia_private" ]
1494 launchscreen = "platform_tools/ios/app/LaunchScreen.storyboard"
1495 data_sources = [ "resources" ]
1496 if ("True" == exec_script("//gn/checkdir.py",
1497 [ rebase_path("skps", root_build_dir) ],
1498 "trim string")) {
1499 data_sources += [ "skps" ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001500 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001501 }
1502 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001503 # !is_ios
1504
Jim Van Verth92411c72020-04-03 15:18:31 -04001505 output_dir = root_build_dir
Jim Van Verth443a9132017-11-28 09:45:26 -05001506 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1507 shared_library("lib" + target_name) {
1508 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1509 configs += [ ":skia_private" ]
1510 testonly = true
1511 }
1512 } else {
1513 _executable = target_name
1514 executable(_executable) {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001515 check_includes = false
Jim Van Verth443a9132017-11-28 09:45:26 -05001516 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1517 configs += [ ":skia_private" ]
1518 testonly = true
1519 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001520 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001521 if (is_android && skia_android_serial != "" && defined(_executable)) {
1522 action("push_" + target_name) {
1523 script = "gn/push_to_android.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05001524 deps = [ ":" + _executable ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001525 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
Mike Kleina01c6b02020-04-01 13:47:34 -05001526 outputs = [ _stamp ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001527 args = [
1528 rebase_path("$root_build_dir/$_executable"),
1529 skia_android_serial,
1530 rebase_path(_stamp),
1531 ]
1532 testonly = true
1533 }
Mike Klein7d921032017-01-05 12:20:41 -05001534 }
1535 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001536 }
1537
mtkleinc095df52016-08-24 12:23:52 -07001538 test_lib("gpu_tool_utils") {
Brian Osmanc9a42472018-05-31 13:17:12 -04001539 public_defines = []
mtkleind68f9b02016-09-23 13:18:41 -07001540
Mike Klein9e25bb92019-04-29 09:46:36 -05001541 # Bots and even devs may not have Vulkan headers, so put
1542 # include/third_party/vulkan on our path so they're always available.
1543 all_dependent_configs = [ ":our_vulkan_headers" ]
1544
Mike Klein333fb452019-04-24 08:48:11 -05001545 defines = []
1546 if (skia_enable_discrete_gpu) {
1547 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
1548 }
1549
Brian Osmanc9a42472018-05-31 13:17:12 -04001550 deps = []
Greg Danielda16cce2018-08-01 09:23:57 -04001551 public_deps = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001552 sources = [
Brian Salomon63a0a752020-06-26 13:32:09 -04001553 "tools/gpu/BackendTextureImageFactory.cpp",
1554 "tools/gpu/BackendTextureImageFactory.h",
Robert Phillips00f78de2020-07-01 16:09:43 -04001555 "tools/gpu/FlushFinishTracker.cpp",
1556 "tools/gpu/FlushFinishTracker.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001557 "tools/gpu/GrContextFactory.cpp",
1558 "tools/gpu/GrTest.cpp",
Brian Salomon00a5eb82018-07-11 15:32:05 -04001559 "tools/gpu/MemoryCache.cpp",
1560 "tools/gpu/MemoryCache.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001561 "tools/gpu/ProxyUtils.cpp",
1562 "tools/gpu/TestContext.cpp",
Brian Salomone21af502019-11-22 16:56:36 -05001563 "tools/gpu/TestOps.cpp",
1564 "tools/gpu/TestOps.h",
Michael Ludwigd9958f82019-03-21 13:08:36 -04001565 "tools/gpu/YUVUtils.cpp",
1566 "tools/gpu/YUVUtils.h",
Mike Kleina01c6b02020-04-01 13:47:34 -05001567 "tools/gpu/gl/GLTestContext.cpp", # See comment below about
1568 # GrContextFactory workaround.
Brian Osmanc9a42472018-05-31 13:17:12 -04001569 "tools/gpu/mock/MockTestContext.cpp",
1570 ]
Brian Salomon1171d312020-03-19 08:47:44 -04001571
1572 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04001573 frameworks = []
Brian Salomon1171d312020-03-19 08:47:44 -04001574
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001575 if (skia_use_gl) {
Herb Derby64aa5132020-06-03 12:14:55 -04001576 sources +=
1577 [ "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001578 if (is_ios) {
1579 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001580 frameworks += [ "OpenGLES.framework" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001581 } else if (is_mac) {
1582 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Brian Osman0c757272018-12-10 10:27:26 -05001583 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001584 if (skia_use_angle) {
1585 deps += [ "//third_party/angle2" ]
1586 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1587 }
Brian Salomon1171d312020-03-19 08:47:44 -04001588 }
1589
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001590 # We need the GLTestContext on Vulkan-only builds for the persistent GL context workaround in
1591 # in GrContextFactory. This only matters for OSes that can run Vulkan.
Chris Dalton2b598902020-03-25 10:50:35 -06001592 if ((skia_use_gl || skia_use_vulkan) && target_cpu != "wasm") {
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001593 if (is_android || skia_use_egl) {
1594 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
1595 libs += [ "EGL" ]
1596 } else if (is_linux) {
1597 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
1598 libs += [
1599 "GLU",
1600 "GL",
1601 "X11",
1602 ]
1603 } else if (is_win) {
1604 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1605 libs += [ "Gdi32.lib" ]
1606 if (target_cpu != "arm64") {
1607 libs += [ "OpenGL32.lib" ]
1608 }
1609 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001610 }
Greg Daniel54200e42018-12-11 17:03:39 -05001611
Brian Osmanc9a42472018-05-31 13:17:12 -04001612 if (skia_use_vulkan) {
Robert Phillipsae413d82020-06-10 11:04:51 -04001613 sources += [ "tools/gpu/vk/VkTestContext.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001614 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Robert Phillips0d6ce7c2020-06-11 08:51:50 -04001615 sources += [ "tools/gpu/vk/VkTestHelper.h" ]
1616 sources += [ "tools/gpu/vk/VkTestHelper.cpp" ]
Robert Phillipsae413d82020-06-10 11:04:51 -04001617 sources += [ "tools/gpu/vk/VkTestUtils.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001618 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
Robert Phillipsae413d82020-06-10 11:04:51 -04001619 sources += [ "tools/gpu/vk/VkYcbcrSamplerHelper.h" ]
1620 sources += [ "tools/gpu/vk/VkYcbcrSamplerHelper.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001621 }
1622 if (skia_use_metal) {
1623 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
mtkleina627b5c2016-09-20 13:36:47 -07001624 }
Jim Van Verthb01e12b2020-02-18 14:34:38 -05001625 if (skia_use_direct3d) {
1626 sources += [ "tools/gpu/d3d/D3DTestContext.cpp" ]
Jim Van Verth03b8ab22020-02-24 11:36:15 -05001627 sources += [ "tools/gpu/d3d/D3DTestUtils.cpp" ]
Jim Van Verthb01e12b2020-02-18 14:34:38 -05001628 }
Stephen White985741a2019-07-18 11:43:45 -04001629 if (skia_use_dawn) {
Zhenyao Mo4f17b602020-04-13 15:26:17 -07001630 public_deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen White985741a2019-07-18 11:43:45 -04001631 sources += [ "tools/gpu/dawn/DawnTestContext.cpp" ]
Stephen White3ae5b292020-06-01 15:45:56 -04001632 if (is_clang) {
1633 cflags_cc = [ "-Wno-microsoft-cast" ]
1634 }
Stephen White985741a2019-07-18 11:43:45 -04001635 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001636
1637 if (is_fuchsia && using_fuchsia_sdk) {
1638 libs +=
1639 [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ]
1640 }
Jim Van Verth36b86af2020-08-24 17:16:46 +00001641
1642 cflags_objcc = [ "-fobjc-arc" ]
John Rosasco24cbdab2019-09-25 14:14:35 -07001643 } # test_lib("gpu_tool_utils")
mtklein25c81d42016-07-27 13:55:26 -07001644
mtkleinc095df52016-08-24 12:23:52 -07001645 test_lib("flags") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001646 sources = [ "tools/flags/CommandLineFlags.cpp" ]
mtklein046cb562016-09-16 10:23:12 -07001647 }
Mike Kleinc6142d82019-03-25 10:54:59 -05001648
1649 test_lib("common_flags_config") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001650 sources = [ "tools/flags/CommonFlagsConfig.cpp" ]
1651 deps = [ ":flags" ]
1652 public_deps = [ ":gpu_tool_utils" ]
mtkleinc095df52016-08-24 12:23:52 -07001653 }
Mike Kleinc6142d82019-03-25 10:54:59 -05001654 test_lib("common_flags_gpu") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001655 sources = [ "tools/flags/CommonFlagsGpu.cpp" ]
1656 deps = [ ":flags" ]
1657 public_deps = [ ":gpu_tool_utils" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001658 }
1659 test_lib("common_flags_images") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001660 sources = [ "tools/flags/CommonFlagsImages.cpp" ]
1661 deps = [ ":flags" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001662 }
1663 test_lib("common_flags_aa") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001664 sources = [ "tools/flags/CommonFlagsAA.cpp" ]
1665 deps = [ ":flags" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001666 }
mtklein25c81d42016-07-27 13:55:26 -07001667
Mike Klein499f0ac2019-03-25 13:00:12 -05001668 test_lib("trace") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001669 deps = [ ":flags" ]
Mike Klein499f0ac2019-03-25 13:00:12 -05001670 sources = [
1671 "tools/trace/ChromeTracingTracer.cpp",
1672 "tools/trace/ChromeTracingTracer.h",
1673 "tools/trace/EventTracingPriv.cpp",
1674 "tools/trace/EventTracingPriv.h",
1675 "tools/trace/SkDebugfTracer.cpp",
1676 "tools/trace/SkDebugfTracer.h",
1677 ]
1678 }
1679
mtkleinc095df52016-08-24 12:23:52 -07001680 test_lib("tool_utils") {
mtkleinc095df52016-08-24 12:23:52 -07001681 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001682 "tools/AndroidSkDebugToStdOut.cpp",
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001683 "tools/AutoreleasePool.h",
Robert Phillips96601082018-05-29 16:13:26 -04001684 "tools/DDLPromiseImageHelper.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001685 "tools/DDLPromiseImageHelper.h",
Robert Phillips96601082018-05-29 16:13:26 -04001686 "tools/DDLTileHelper.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001687 "tools/DDLTileHelper.h",
mtklein0590fa52016-09-01 07:06:54 -07001688 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001689 "tools/ProcStats.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001690 "tools/ProcStats.h",
mtkleinc095df52016-08-24 12:23:52 -07001691 "tools/Resources.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001692 "tools/Resources.h",
Hal Canarye574f1e2019-07-15 14:01:37 -04001693 "tools/SkMetaData.cpp",
1694 "tools/SkMetaData.h",
Nathaniel Nifong0426c382019-06-21 11:09:19 -04001695 "tools/SkSharingProc.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001696 "tools/SkSharingProc.h",
1697 "tools/Stats.h",
Mike Kleinea3f0142019-03-20 11:12:10 -05001698 "tools/ToolUtils.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001699 "tools/ToolUtils.h",
mtkleinc095df52016-08-24 12:23:52 -07001700 "tools/UrlDataManager.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001701 "tools/UrlDataManager.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001702 "tools/debugger/DebugCanvas.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001703 "tools/debugger/DebugCanvas.h",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05001704 "tools/debugger/DebugLayerManager.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001705 "tools/debugger/DebugLayerManager.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001706 "tools/debugger/DrawCommand.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001707 "tools/debugger/DrawCommand.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001708 "tools/debugger/JsonWriteBuffer.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001709 "tools/debugger/JsonWriteBuffer.h",
Mike Klein0cffcbf92019-03-20 11:08:46 -05001710 "tools/fonts/RandomScalerContext.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001711 "tools/fonts/RandomScalerContext.h",
Mike Klein0cffcbf92019-03-20 11:08:46 -05001712 "tools/fonts/TestEmptyTypeface.h",
1713 "tools/fonts/TestFontMgr.cpp",
1714 "tools/fonts/TestFontMgr.h",
1715 "tools/fonts/TestSVGTypeface.cpp",
1716 "tools/fonts/TestSVGTypeface.h",
1717 "tools/fonts/TestTypeface.cpp",
1718 "tools/fonts/TestTypeface.h",
Mike Kleinea3f0142019-03-20 11:12:10 -05001719 "tools/fonts/ToolUtilsFont.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001720 "tools/random_parse_path.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001721 "tools/random_parse_path.h",
Hal Canary41248072019-07-11 16:32:53 -04001722 "tools/timer/TimeUtils.h",
mtkleinc095df52016-08-24 12:23:52 -07001723 "tools/timer/Timer.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001724 "tools/timer/Timer.h",
mtkleinc095df52016-08-24 12:23:52 -07001725 ]
Chris Dalton2b598902020-03-25 10:50:35 -06001726 if (target_cpu != "wasm") {
1727 sources += [ "tools/CrashHandler.cpp" ]
1728 }
Mike Kleinadacaef2017-02-06 09:26:14 -05001729 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04001730 frameworks = []
Mike Kleinadacaef2017-02-06 09:26:14 -05001731 if (is_ios) {
1732 sources += [ "tools/ios_utils.m" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001733 sources += [ "tools/ios_utils.h" ]
1734 if (skia_use_metal) {
1735 sources += [ "tools/AutoreleasePool.mm" ]
1736 }
Jim Van Verthef820be2020-08-12 10:45:00 -04001737 frameworks += [ "Foundation.framework" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001738 } else if (is_mac) {
1739 if (skia_use_metal) {
1740 sources += [ "tools/AutoreleasePool.mm" ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001741 frameworks += [ "Foundation.framework" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001742 }
Mike Kleinbf15b662019-04-15 11:32:16 -05001743 } else if (is_win) {
1744 libs += [ "DbgHelp.lib" ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001745 }
Mike Kleinbf15b662019-04-15 11:32:16 -05001746
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001747 defines = []
1748 if (skia_tools_require_resources) {
1749 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1750 }
mtkleinc095df52016-08-24 12:23:52 -07001751 deps = [
Ben Wagner97182cc2018-02-15 10:20:04 -05001752 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001753 ":flags",
Mike Kleine4ad58a2019-03-26 09:05:52 -05001754 ]
Mike Kleina01c6b02020-04-01 13:47:34 -05001755 public_deps = [ ":gpu_tool_utils" ]
mtkleinc095df52016-08-24 12:23:52 -07001756 }
mtklein25c81d42016-07-27 13:55:26 -07001757
Mike Kleine11e5c12019-04-24 12:46:06 -05001758 test_lib("etc1") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001759 sources = [ "third_party/etc1/etc1.cpp" ]
Mike Kleine11e5c12019-04-24 12:46:06 -05001760 }
1761
Mike Klein6e744122016-10-27 12:21:40 -04001762 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001763 test_lib("gm") {
mtkleinc095df52016-08-24 12:23:52 -07001764 sources = gm_sources
John Rosasco24cbdab2019-09-25 14:14:35 -07001765 if (skia_use_gl) {
1766 sources += gl_gm_sources
1767 }
mtkleinc095df52016-08-24 12:23:52 -07001768 deps = [
Mike Kleine11e5c12019-04-24 12:46:06 -05001769 ":etc1",
scroggo19b91532016-10-24 09:03:26 -07001770 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001771 ":skia",
1772 ":tool_utils",
Mike Reed2f0edd52018-05-31 14:22:30 -04001773 "modules/skottie",
Florin Malita26870722018-09-20 14:35:30 -04001774 "modules/skottie:gm",
Mike Reed63559a52020-06-02 11:34:24 -04001775 "modules/skparagraph",
1776 "modules/skparagraph:gm",
Brian Osmanc725e8f2019-04-10 14:08:44 -04001777 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07001778 ]
Mike Kleinc4abade2019-08-09 10:11:35 -04001779 if (is_skia_dev_build) {
1780 sources += [ "gm/fiddle.cpp" ]
1781 deps += [ ":skia.h" ]
1782 }
Mike Kleina01c6b02020-04-01 13:47:34 -05001783 public_deps = [ ":gpu_tool_utils" ]
Mike Reed7bf160e2019-05-17 16:50:51 -04001784
1785 if (skia_use_ffmpeg) {
Florin Malita123e3b82020-04-24 11:10:27 -04001786 deps += [ "experimental/ffmpeg:video_decoder" ]
Mike Reed7bf160e2019-05-17 16:50:51 -04001787 sources += [ "gm/video_decoder.cpp" ]
1788 }
mtkleinc095df52016-08-24 12:23:52 -07001789 }
mtklein25c81d42016-07-27 13:55:26 -07001790
Mike Klein7b7077c2019-06-03 17:10:59 -05001791 test_lib("skvm_builders") {
1792 sources = [
1793 "tools/SkVMBuilders.cpp",
1794 "tools/SkVMBuilders.h",
1795 ]
1796 }
1797
Mike Klein6e744122016-10-27 12:21:40 -04001798 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001799 test_lib("tests") {
Mike Klein6e744122016-10-27 12:21:40 -04001800 sources = tests_sources + pathops_tests_sources
Robert Phillips0c6daf02019-05-16 12:43:11 -04001801 if (skia_use_metal) {
1802 sources += metal_tests_sources
Jim Van Verth36b86af2020-08-24 17:16:46 +00001803 cflags_objcc = [ "-fobjc-arc" ]
Robert Phillips0c6daf02019-05-16 12:43:11 -04001804 }
John Rosasco24cbdab2019-09-25 14:14:35 -07001805 if (skia_use_gl) {
1806 sources += gl_tests_sources
1807 }
Leon Scroggins IIIbe85c192018-11-13 13:50:12 -05001808 if (!skia_enable_fontmgr_android) {
Mike Klein6e744122016-10-27 12:21:40 -04001809 sources -= [ "//tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -07001810 }
Ben Wagner75626e42020-06-03 13:20:37 -04001811 if (!skia_enable_fontmgr_fontconfig) {
Ben Wagner37a06c02018-06-22 21:11:00 +00001812 sources -= [ "//tests/FontMgrFontConfigTest.cpp" ]
1813 }
mtkleinc095df52016-08-24 12:23:52 -07001814 deps = [
Hal Canary0f666812018-03-22 15:21:12 -04001815 ":experimental_svg_model",
mtkleinc095df52016-08-24 12:23:52 -07001816 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001817 ":skia",
Mike Klein7b7077c2019-06-03 17:10:59 -05001818 ":skvm_builders",
mtkleinc095df52016-08-24 12:23:52 -07001819 ":tool_utils",
Florin Malita26ae40f2020-06-08 12:03:48 -04001820 "experimental/skrive:tests",
Florin Malita94d4d3e2018-06-18 13:10:51 -04001821 "modules/skottie:tests",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04001822 "modules/skparagraph:tests",
Brian Osmanccb87522018-06-01 19:20:00 +00001823 "modules/sksg:tests",
Brian Osmanc725e8f2019-04-10 14:08:44 -04001824 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07001825 "//third_party/libpng",
Leon Scroggins III194580d2019-02-22 12:32:16 -05001826 "//third_party/libwebp",
mtkleinc095df52016-08-24 12:23:52 -07001827 "//third_party/zlib",
1828 ]
Mike Kleind63442d2017-03-27 14:16:04 -04001829 public_deps = [
1830 ":gpu_tool_utils", # Test.h #includes headers from this target.
1831 ]
mtkleinc095df52016-08-24 12:23:52 -07001832 }
mtklein2f3416d2016-08-02 16:02:05 -07001833
Mike Klein6e744122016-10-27 12:21:40 -04001834 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001835 test_lib("bench") {
mtkleinc095df52016-08-24 12:23:52 -07001836 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001837 deps = [
1838 ":flags",
1839 ":gm",
1840 ":gpu_tool_utils",
1841 ":skia",
Mike Klein7b7077c2019-06-03 17:10:59 -05001842 ":skvm_builders",
mtkleinc095df52016-08-24 12:23:52 -07001843 ":tool_utils",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04001844 "modules/skparagraph:bench",
Mike Reedd62d4062019-06-12 10:20:44 -04001845 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07001846 ]
1847 }
mtklein2b6870c2016-07-28 14:17:33 -07001848
mtkleinc095df52016-08-24 12:23:52 -07001849 test_lib("experimental_svg_model") {
Hal Canary0f666812018-03-22 15:21:12 -04001850 if (skia_use_expat) {
Hal Canary0f666812018-03-22 15:21:12 -04001851 sources = [
1852 "experimental/svg/model/SkSVGAttribute.cpp",
1853 "experimental/svg/model/SkSVGAttributeParser.cpp",
1854 "experimental/svg/model/SkSVGCircle.cpp",
1855 "experimental/svg/model/SkSVGClipPath.cpp",
1856 "experimental/svg/model/SkSVGContainer.cpp",
1857 "experimental/svg/model/SkSVGDOM.cpp",
1858 "experimental/svg/model/SkSVGEllipse.cpp",
1859 "experimental/svg/model/SkSVGGradient.cpp",
1860 "experimental/svg/model/SkSVGLine.cpp",
1861 "experimental/svg/model/SkSVGLinearGradient.cpp",
1862 "experimental/svg/model/SkSVGNode.cpp",
1863 "experimental/svg/model/SkSVGPath.cpp",
1864 "experimental/svg/model/SkSVGPattern.cpp",
1865 "experimental/svg/model/SkSVGPoly.cpp",
1866 "experimental/svg/model/SkSVGRadialGradient.cpp",
1867 "experimental/svg/model/SkSVGRect.cpp",
1868 "experimental/svg/model/SkSVGRenderContext.cpp",
1869 "experimental/svg/model/SkSVGSVG.cpp",
1870 "experimental/svg/model/SkSVGShape.cpp",
1871 "experimental/svg/model/SkSVGStop.cpp",
Xavier Phane29cdaf2020-03-26 16:15:14 +00001872 "experimental/svg/model/SkSVGText.cpp",
Hal Canary0f666812018-03-22 15:21:12 -04001873 "experimental/svg/model/SkSVGTransformableNode.cpp",
1874 "experimental/svg/model/SkSVGUse.cpp",
Florin Malitaf4403e72020-04-10 14:14:04 +00001875 "experimental/svg/model/SkSVGValue.cpp",
Hal Canary0f666812018-03-22 15:21:12 -04001876 ]
1877 deps = [
1878 ":skia",
1879 ":xml",
1880 ]
1881 }
mtkleinc095df52016-08-24 12:23:52 -07001882 }
fmalitaa2b9fdf2016-08-03 19:53:36 -07001883
Mike Reedd62d4062019-06-12 10:20:44 -04001884 test_lib("experimental_xform") {
1885 sources = [
1886 "experimental/xform/SkShape.cpp",
1887 "experimental/xform/SkXform.cpp",
1888 "experimental/xform/XContext.cpp",
1889 ]
Mike Kleina01c6b02020-04-01 13:47:34 -05001890 deps = [ ":skia" ]
Mike Reedd62d4062019-06-12 10:20:44 -04001891 }
1892
Florin Malitabfe876a2018-09-02 12:33:59 -04001893 if (is_linux || is_mac) {
Florin Malita79725d32018-06-05 16:16:57 -04001894 test_app("skottie_tool") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001895 deps = [ "modules/skottie:tool" ]
Florin Malita79725d32018-06-05 16:16:57 -04001896 }
1897 }
1898
Hal Canary5b39dc82019-04-17 13:29:46 -04001899 test_app("make_skqp_model") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001900 sources = [ "tools/skqp/make_skqp_model.cpp" ]
1901 deps = [ ":skia" ]
Hal Canary5b39dc82019-04-17 13:29:46 -04001902 }
1903
Chris Dalton2b598902020-03-25 10:50:35 -06001904 import("gn/samples.gni")
1905 test_lib("samples") {
1906 sources = samples_sources
1907 if (skia_enable_ccpr) {
1908 sources += samples_sources_ccpr
Kevin Lubickebf648e2017-09-21 13:45:16 -04001909 }
Mike Kleina01c6b02020-04-01 13:47:34 -05001910 public_deps = [ ":tool_utils" ]
Chris Dalton2b598902020-03-25 10:50:35 -06001911 deps = [
1912 ":experimental_svg_model",
1913 ":flags",
1914 ":gpu_tool_utils",
1915 ":xml",
Jorge Betancourtb8621312020-09-10 15:16:35 -04001916 "modules/audioplayer",
Chris Dalton2b598902020-03-25 10:50:35 -06001917 "modules/skparagraph:samples",
1918 "modules/skshaper",
1919 ]
Chris Dalton2b598902020-03-25 10:50:35 -06001920 }
1921 if (target_cpu != "wasm") {
Nigel Tao3ab9b1f2020-05-28 13:29:13 +10001922 test_app("convert-to-nia") {
1923 sources = [ "tools/convert-to-nia.cpp" ]
1924 deps = [ ":skia" ]
1925 }
Mike Klein7af351a2018-07-27 09:54:43 -04001926 test_app("imgcvt") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001927 sources = [ "tools/imgcvt.cpp" ]
Mike Klein7af351a2018-07-27 09:54:43 -04001928 deps = [
1929 ":skcms",
1930 ":skia",
1931 ]
1932 }
Mike Klein735c7ba2019-03-25 12:57:58 -05001933 test_lib("hash_and_encode") {
Mike Klein735c7ba2019-03-25 12:57:58 -05001934 sources = [
1935 "tools/HashAndEncode.cpp",
1936 "tools/HashAndEncode.h",
1937 ]
1938 deps = [
1939 ":flags",
1940 ":skia",
1941 "//third_party/libpng",
1942 ]
1943 }
1944 test_app("fm") {
1945 sources = [
Mike Kleinfee00792019-11-21 16:18:47 -06001946 "dm/DMGpuTestProcs.cpp", # blech
Mike Klein735c7ba2019-03-25 12:57:58 -05001947 "tools/fm/fm.cpp",
1948 ]
1949 deps = [
1950 ":common_flags_aa",
1951 ":common_flags_gpu",
Mike Klein6253d902019-03-27 15:09:12 -05001952 ":experimental_svg_model",
Mike Klein735c7ba2019-03-25 12:57:58 -05001953 ":flags",
1954 ":gm",
1955 ":gpu_tool_utils",
1956 ":hash_and_encode",
1957 ":skia",
Mike Kleinfee00792019-11-21 16:18:47 -06001958 ":tests",
Mike Klein735c7ba2019-03-25 12:57:58 -05001959 ":tool_utils",
1960 ":trace",
Mike Klein22924262019-04-02 14:14:56 -04001961 "modules/skottie",
1962 "modules/skottie:utils",
Mike Klein735c7ba2019-03-25 12:57:58 -05001963 ]
1964 }
Kevin Lubickebf648e2017-09-21 13:45:16 -04001965 test_app("dm") {
1966 sources = [
1967 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04001968 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001969 "dm/DMJsonWriter.cpp",
1970 "dm/DMSrcSink.cpp",
1971 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04001972 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05001973 ":common_flags_aa",
1974 ":common_flags_config",
1975 ":common_flags_gpu",
1976 ":common_flags_images",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001977 ":experimental_svg_model",
1978 ":flags",
1979 ":gm",
1980 ":gpu_tool_utils",
Mike Klein735c7ba2019-03-25 12:57:58 -05001981 ":hash_and_encode",
Kevin Lubickebf648e2017-09-21 13:45:16 -04001982 ":skia",
1983 ":tests",
1984 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05001985 ":trace",
Florin Malita02616ea2020-06-25 13:33:17 -04001986 "experimental/skrive",
Florin Malita3d856bd2018-05-26 09:49:28 -04001987 "modules/skottie",
Florin Malitaa8316552018-11-09 16:19:44 -05001988 "modules/skottie:utils",
Mike Klein38af9432016-11-11 11:39:44 -05001989 ]
1990 }
Brian Osman16adfa32016-10-18 14:42:44 -04001991 }
1992
Mike Kleina8a51ce2018-01-09 12:34:11 -05001993 if (!is_win) {
1994 test_app("remote_demo") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001995 sources = [ "tools/remote_demo.cpp" ]
1996 deps = [ ":skia" ]
Mike Kleina8a51ce2018-01-09 12:34:11 -05001997 }
1998 }
1999
Hal Canarye107faa2019-10-23 12:52:33 -04002000 if (!is_win) {
2001 test_app("blob_cache_sim") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002002 sources = [ "tools/blob_cache_sim.cpp" ]
2003 deps = [ ":skia" ]
Hal Canarye107faa2019-10-23 12:52:33 -04002004 }
2005 }
2006
Mike Kleine6682eb2017-01-05 10:54:57 -05002007 test_app("nanobench") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002008 sources = [ "bench/nanobench.cpp" ]
mtklein2b6870c2016-07-28 14:17:33 -07002009 deps = [
2010 ":bench",
Mike Kleinc6142d82019-03-25 10:54:59 -05002011 ":common_flags_aa",
2012 ":common_flags_config",
2013 ":common_flags_gpu",
2014 ":common_flags_images",
fmalita6519c212016-09-14 08:05:17 -07002015 ":experimental_svg_model",
mtklein2b6870c2016-07-28 14:17:33 -07002016 ":flags",
2017 ":gm",
2018 ":gpu_tool_utils",
2019 ":skia",
2020 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05002021 ":trace",
Mike Reed63559a52020-06-02 11:34:24 -04002022 "modules/skparagraph",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04002023 "modules/skshaper",
mtklein2b6870c2016-07-28 14:17:33 -07002024 ]
mtklein2b6870c2016-07-28 14:17:33 -07002025 }
halcanary19a97202016-08-03 15:08:04 -07002026
Ravi Mistry10d36c52017-01-31 09:49:18 -05002027 test_app("skpinfo") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002028 sources = [ "tools/skpinfo.cpp" ]
Ravi Mistry10d36c52017-01-31 09:49:18 -05002029 deps = [
2030 ":flags",
2031 ":skia",
2032 ]
2033 }
2034
Mike Reedc0ee21f2019-05-28 16:11:03 -04002035 if (skia_use_ffmpeg) {
2036 test_app("skottie2movie") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002037 sources = [ "tools/skottie2movie.cpp" ]
Mike Reedc0ee21f2019-05-28 16:11:03 -04002038 deps = [
2039 ":flags",
Mike Reed5f12eaa2019-09-24 12:01:58 -04002040 ":gpu_tool_utils",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002041 ":skia",
Florin Malitaec403602020-04-24 12:14:03 -04002042 "experimental/ffmpeg:video_encoder",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002043 "modules/skottie",
Mike Reed5093e232019-05-30 10:10:50 -04002044 "modules/skottie:utils",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002045 ]
2046 }
2047 }
2048
Brian Osmanc9a42472018-05-31 13:17:12 -04002049 test_app("skpbench") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002050 sources = [ "tools/skpbench/skpbench.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002051 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05002052 ":common_flags_config",
2053 ":common_flags_gpu",
Brian Osmanc9a42472018-05-31 13:17:12 -04002054 ":flags",
2055 ":gpu_tool_utils",
2056 ":skia",
2057 ":tool_utils",
2058 ]
csmartdalton4b5179b2016-09-19 11:03:58 -07002059 }
2060
Mike Kleine6682eb2017-01-05 10:54:57 -05002061 test_app("sktexttopdf") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002062 sources = [ "tools/using_skia_and_harfbuzz.cpp" ]
halcanary3eee9d92016-09-10 07:01:53 -07002063 deps = [
2064 ":skia",
Herb Derby264182c2018-05-29 15:53:40 -04002065 "modules/skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07002066 ]
halcanary3eee9d92016-09-10 07:01:53 -07002067 }
mtklein046cb562016-09-16 10:23:12 -07002068
Ben Wagner219f3622017-07-17 15:32:25 -04002069 test_app("create_test_font") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002070 sources = [ "tools/fonts/create_test_font.cpp" ]
2071 deps = [ ":skia" ]
Ben Wagner219f3622017-07-17 15:32:25 -04002072 assert_no_deps = [
2073 # tool_utils requires the output of this app.
2074 ":tool_utils",
2075 ]
2076 }
2077
Florin Malita5d3ff432018-07-31 16:38:43 -04002078 if (skia_use_expat) {
2079 test_app("create_test_font_color") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002080 sources = [ "tools/fonts/create_test_font_color.cpp" ]
Florin Malita5d3ff432018-07-31 16:38:43 -04002081 deps = [
2082 ":flags",
2083 ":skia",
2084 ":tool_utils",
2085 ]
2086 }
Ben Wagner97182cc2018-02-15 10:20:04 -05002087 }
2088
Mike Kleine6682eb2017-01-05 10:54:57 -05002089 test_app("get_images_from_skps") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002090 sources = [ "tools/get_images_from_skps.cpp" ]
mtklein046cb562016-09-16 10:23:12 -07002091 deps = [
2092 ":flags",
2093 ":skia",
mtklein046cb562016-09-16 10:23:12 -07002094 ]
mtklein046cb562016-09-16 10:23:12 -07002095 }
mtkleinecbc5262016-09-22 11:51:24 -07002096
Brian Osman6788a542018-12-10 11:56:01 -05002097 if (!is_ios && target_cpu != "wasm" && !(is_win && target_cpu == "arm64")) {
Mike Kleine6682eb2017-01-05 10:54:57 -05002098 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04002099 sources = [
2100 "tools/skiaserve/Request.cpp",
2101 "tools/skiaserve/Response.cpp",
2102 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04002103 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
2104 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
2105 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
2106 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
2107 "tools/skiaserve/urlhandlers/DataHandler.cpp",
2108 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
2109 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
2110 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
2111 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05002112 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
2113 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04002114 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
2115 "tools/skiaserve/urlhandlers/PostHandler.cpp",
2116 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
2117 "tools/skiaserve/urlhandlers/RootHandler.cpp",
2118 ]
2119 deps = [
2120 ":flags",
2121 ":gpu_tool_utils",
2122 ":skia",
2123 ":tool_utils",
Mike Klein7d302882016-11-03 14:06:31 -04002124 "//third_party/libmicrohttpd",
Mike Klein7d302882016-11-03 14:06:31 -04002125 ]
Mike Klein7d302882016-11-03 14:06:31 -04002126 }
mtkleinecbc5262016-09-22 11:51:24 -07002127 }
kjlubick14f984b2016-10-03 11:49:45 -07002128
Mike Kleine6682eb2017-01-05 10:54:57 -05002129 test_app("fuzz") {
kjlubick14f984b2016-10-03 11:49:45 -07002130 sources = [
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04002131 "fuzz/Fuzz.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002132 "fuzz/Fuzz.h",
Hal Canary24ac42b2017-02-14 13:35:14 -05002133 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05002134 "fuzz/FuzzCommon.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002135 "fuzz/FuzzCommon.h",
Zepeng Hu94007012020-07-22 14:37:46 +00002136 "fuzz/FuzzCreateDDL.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05002137 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04002138 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002139 "fuzz/FuzzGradients.cpp",
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04002140 "fuzz/FuzzMain.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002141 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05002142 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002143 "fuzz/FuzzPathop.cpp",
Jim Van Verth061cc212018-07-11 14:09:09 -04002144 "fuzz/FuzzPolyUtils.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04002145 "fuzz/FuzzRegionOp.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04002146 "fuzz/oss_fuzz/FuzzAndroidCodec.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05002147 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
2148 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002149 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04002150 "fuzz/oss_fuzz/FuzzIncrementalImage.cpp",
Florin Malita80452be2018-06-19 11:27:20 -04002151 "fuzz/oss_fuzz/FuzzJSON.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002152 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05002153 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
2154 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Zepeng Hufcb7ba02020-07-31 17:21:29 +00002155 "fuzz/oss_fuzz/FuzzSKP.cpp",
Kevin Lubicke9c1ce82019-03-11 11:09:40 -04002156 "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp",
2157 "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp",
Kevin Lubick0f0a7102019-03-18 16:20:55 -04002158 "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp",
Kevin Lubicke9c1ce82019-03-11 11:09:40 -04002159 "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp",
Zepeng Huedaf3022020-06-12 12:20:59 +00002160 "fuzz/oss_fuzz/FuzzSVG.cpp",
Kevin Lubick2be14d32019-10-21 13:44:48 -04002161 "fuzz/oss_fuzz/FuzzSkDescriptorDeserialize.cpp",
Zepeng Hua5783f32020-07-10 13:36:20 +00002162 "fuzz/oss_fuzz/FuzzSkRuntimeEffect.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002163 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05002164 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002165 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05002166 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002167 "tools/debugger/DrawCommand.cpp",
2168 "tools/debugger/JsonWriteBuffer.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002169 ]
2170 deps = [
2171 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04002172 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07002173 ":skia",
Florin Malita3d856bd2018-05-26 09:49:28 -04002174 "modules/skottie:fuzz",
kjlubick14f984b2016-10-03 11:49:45 -07002175 ]
kjlubick14f984b2016-10-03 11:49:45 -07002176 }
Mike Klein38312422016-10-05 15:41:01 -04002177
Mike Kleine6682eb2017-01-05 10:54:57 -05002178 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04002179 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04002180 rebase_path("tests/skia_test.cpp"),
2181 rebase_path("tests/Test.cpp"),
2182 ]
caryclark9feb6322016-10-25 08:58:26 -07002183 deps = [
2184 ":flags",
2185 ":gpu_tool_utils",
2186 ":skia",
2187 ":tool_utils",
2188 ]
caryclark9feb6322016-10-25 08:58:26 -07002189 }
2190
Mike Kleine6682eb2017-01-05 10:54:57 -05002191 test_app("dump_record") {
Mike Klein4a56f4c2020-08-18 16:02:52 -05002192 sources = [ "tools/dump_record.cpp" ]
Mike Klein38312422016-10-05 15:41:01 -04002193 deps = [
2194 ":flags",
2195 ":skia",
2196 ]
Mike Klein38312422016-10-05 15:41:01 -04002197 }
bungemanfe917272016-10-13 17:36:40 -04002198
Mike Kleine6682eb2017-01-05 10:54:57 -05002199 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04002200 sources = [
2201 "tools/skdiff/skdiff.cpp",
2202 "tools/skdiff/skdiff_html.cpp",
2203 "tools/skdiff/skdiff_main.cpp",
2204 "tools/skdiff/skdiff_utils.cpp",
2205 ]
2206 deps = [
2207 ":skia",
2208 ":tool_utils",
2209 ]
bungemanfe917272016-10-13 17:36:40 -04002210 }
halcanarya73d76a2016-10-17 13:19:02 -07002211
Mike Kleine6682eb2017-01-05 10:54:57 -05002212 test_app("skp_parser") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002213 sources = [ "tools/skp_parser.cpp" ]
halcanarya73d76a2016-10-17 13:19:02 -07002214 deps = [
2215 ":skia",
2216 ":tool_utils",
halcanarya73d76a2016-10-17 13:19:02 -07002217 ]
halcanarya73d76a2016-10-17 13:19:02 -07002218 }
Brian Osman16adfa32016-10-18 14:42:44 -04002219
Brian Osmanc9a42472018-05-31 13:17:12 -04002220 if (!is_win) {
Colin Cross654eb2a2019-11-08 13:08:36 -08002221 source_set("skqp_lib") {
2222 check_includes = false
2223 testonly = true
2224 if (!is_official_build) {
2225 configs -= [ "//gn:warnings" ]
2226 }
2227 public_configs = [ ":skia_private" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05002228 defines =
2229 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary75427132017-10-11 16:00:31 -04002230 sources = [
2231 "dm/DMGpuTestProcs.cpp",
Hal Canaryac7f23c2018-11-26 14:07:41 -05002232 "tools/skqp/src/skqp.cpp",
2233 "tools/skqp/src/skqp_model.cpp",
Hal Canary75427132017-10-11 16:00:31 -04002234 ]
2235 deps = [
2236 ":gm",
Hal Canary75427132017-10-11 16:00:31 -04002237 ":skia",
2238 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05002239 ":tool_utils",
2240 ]
2241 }
2242 test_app("skqp") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002243 sources = [ "tools/skqp/src/skqp_main.cpp" ]
John Rosasco24cbdab2019-09-25 14:14:35 -07002244 include_dirs = [ "//" ]
2245 lib_dirs = []
Mike Kleina01c6b02020-04-01 13:47:34 -05002246 deps = [ ":skqp_lib" ]
Hal Canaryac7f23c2018-11-26 14:07:41 -05002247 }
2248 test_app("jitter_gms") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002249 sources = [ "tools/skqp/jitter_gms.cpp" ]
Hal Canaryac7f23c2018-11-26 14:07:41 -05002250 deps = [
2251 ":gm",
2252 ":skia",
2253 ":skqp_lib",
Hal Canary75427132017-10-11 16:00:31 -04002254 ]
2255 }
2256 }
John Rosasco24cbdab2019-09-25 14:14:35 -07002257 if (is_fuchsia) {
2258 # Build a package repository for skqp on Fuchsia.
2259 group("skqp_repo") {
2260 testonly = true
Mike Kleina01c6b02020-04-01 13:47:34 -05002261 deps = [ "//build/fuchsia/skqp:skqp_repo" ]
John Rosasco24cbdab2019-09-25 14:14:35 -07002262 }
2263 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002264 if (is_android) {
Colin Cross654eb2a2019-11-08 13:08:36 -08002265 shared_library("libskqp_app") {
2266 configs += [ ":skia_private" ]
2267 if (!is_official_build) {
2268 configs -= [ "//gn:warnings" ]
2269 }
2270 testonly = true
Mike Kleina01c6b02020-04-01 13:47:34 -05002271 sources = [ "tools/skqp/src/jni_skqp.cpp" ]
Hal Canary28f89382017-12-12 09:42:14 -05002272 deps = [
2273 ":skia",
2274 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05002275 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05002276 ]
2277 libs = [ "android" ]
2278 }
2279 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002280 if (is_android && skia_use_gl) {
Stan Iliev93151722018-08-02 11:10:52 -04002281 test_app("skottie_android") {
2282 is_shared_library = true
2283
Jorge Betancourt1fcdcaa2020-06-22 14:14:32 +00002284 sources = [ "platform_tools/android/apps/skottie/skottielib/src/main/cpp/native-lib.cpp" ]
Stan Iliev93151722018-08-02 11:10:52 -04002285 libs = []
2286
Stan Iliev93151722018-08-02 11:10:52 -04002287 deps = [
2288 ":skia",
2289 "modules/skottie",
Stan Ilieva7a52b92018-10-01 15:36:32 -04002290 "modules/sksg:samples",
Jorge Betancourt646d6c52020-08-31 16:07:25 -04002291 "//third_party/oboe",
Stan Iliev93151722018-08-02 11:10:52 -04002292 ]
2293 }
2294 }
Hal Canary75427132017-10-11 16:00:31 -04002295
Hal Canarya9de7602018-01-19 13:08:23 -05002296 test_app("list_gms") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002297 sources = [ "tools/list_gms.cpp" ]
Hal Canarya9de7602018-01-19 13:08:23 -05002298 deps = [
2299 ":gm",
2300 ":skia",
2301 ]
2302 }
2303 test_app("list_gpu_unit_tests") {
2304 sources = [
2305 "dm/DMGpuTestProcs.cpp",
2306 "tools/list_gpu_unit_tests.cpp",
2307 ]
2308 deps = [
2309 ":skia",
2310 ":tests",
2311 ]
2312 }
2313
Brian Osmanc9a42472018-05-31 13:17:12 -04002314 test_lib("sk_app") {
Hal Canary378be8d2019-04-26 08:20:14 -04002315 public_deps = [
Hal Canary378be8d2019-04-26 08:20:14 -04002316 ":gpu_tool_utils",
Hal Canary05694472019-05-03 17:14:21 -04002317 ":skia",
Hal Canary378be8d2019-04-26 08:20:14 -04002318 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002319 sources = [
John Stilesab9578e2020-06-30 17:36:55 -04002320 "tools/sk_app/Application.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002321 "tools/sk_app/CommandSet.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002322 "tools/sk_app/CommandSet.h",
2323 "tools/sk_app/DisplayParams.h",
2324 "tools/sk_app/RasterWindowContext.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002325 "tools/sk_app/Window.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002326 "tools/sk_app/Window.h",
Robert Phillipsed653392020-07-10 13:55:21 -04002327 "tools/sk_app/WindowContext.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002328 "tools/sk_app/WindowContext.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002329 ]
2330 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04002331 frameworks = []
Brian Osmanc9a42472018-05-31 13:17:12 -04002332
2333 if (is_android) {
2334 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002335 "tools/sk_app/android/RasterWindowContext_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002336 "tools/sk_app/android/WindowContextFactory_android.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002337 "tools/sk_app/android/Window_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002338 "tools/sk_app/android/Window_android.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002339 "tools/sk_app/android/main_android.cpp",
2340 "tools/sk_app/android/surface_glue_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002341 "tools/sk_app/android/surface_glue_android.h",
Brian Osman16adfa32016-10-18 14:42:44 -04002342 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002343 libs += [ "android" ]
2344 } else if (is_linux) {
2345 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002346 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002347 "tools/sk_app/unix/WindowContextFactory_unix.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002348 "tools/sk_app/unix/Window_unix.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002349 "tools/sk_app/unix/Window_unix.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002350 "tools/sk_app/unix/keysym2ucs.c",
John Stilesab9578e2020-06-30 17:36:55 -04002351 "tools/sk_app/unix/keysym2ucs.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002352 "tools/sk_app/unix/main_unix.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002353 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002354 libs += [
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002355 "GL", # Used by raster window context, so cannot be behind skia_use_gl.
Brian Osmanc9a42472018-05-31 13:17:12 -04002356 "X11",
2357 ]
2358 } else if (is_win) {
2359 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002360 "tools/sk_app/win/RasterWindowContext_win.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002361 "tools/sk_app/win/WindowContextFactory_win.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002362 "tools/sk_app/win/Window_win.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002363 "tools/sk_app/win/Window_win.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002364 "tools/sk_app/win/main_win.cpp",
2365 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002366 } else if (is_mac) {
2367 sources += [
Jim Van Verth1f086ca2019-01-28 14:46:04 -05002368 "tools/sk_app/mac/RasterWindowContext_mac.mm",
John Stilesab9578e2020-06-30 17:36:55 -04002369 "tools/sk_app/mac/WindowContextFactory_mac.h",
2370 "tools/sk_app/mac/Window_mac.h",
Jim Van Verth1f086ca2019-01-28 14:46:04 -05002371 "tools/sk_app/mac/Window_mac.mm",
2372 "tools/sk_app/mac/main_mac.mm",
Brian Osmanc9a42472018-05-31 13:17:12 -04002373 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04002374 frameworks += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002375 "QuartzCore.framework",
2376 "Cocoa.framework",
2377 "Foundation.framework",
2378 ]
2379 } else if (is_ios) {
2380 sources += [
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002381 "tools/sk_app/ios/RasterWindowContext_ios.mm",
John Stilesab9578e2020-06-30 17:36:55 -04002382 "tools/sk_app/ios/WindowContextFactory_ios.h",
2383 "tools/sk_app/ios/Window_ios.h",
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002384 "tools/sk_app/ios/Window_ios.mm",
2385 "tools/sk_app/ios/main_ios.mm",
Brian Osmanc9a42472018-05-31 13:17:12 -04002386 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04002387 frameworks += [ "QuartzCore.framework" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002388 }
2389
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002390 if (skia_use_gl) {
2391 sources += [ "tools/sk_app/GLWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002392 sources += [ "tools/sk_app/GLWindowContext.h" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002393 if (is_android) {
2394 sources += [ "tools/sk_app/android/GLWindowContext_android.cpp" ]
2395 } else if (is_linux) {
2396 sources += [ "tools/sk_app/unix/GLWindowContext_unix.cpp" ]
2397 } else if (is_win) {
2398 sources += [ "tools/sk_app/win/GLWindowContext_win.cpp" ]
2399 if (skia_use_angle) {
2400 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
2401 }
2402 } else if (is_mac) {
2403 sources += [ "tools/sk_app/mac/GLWindowContext_mac.mm" ]
2404 } else if (is_ios) {
2405 sources += [ "tools/sk_app/ios/GLWindowContext_ios.mm" ]
2406 }
2407 }
2408
Brian Osmanc9a42472018-05-31 13:17:12 -04002409 if (skia_use_vulkan) {
2410 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002411 sources += [ "tools/sk_app/VulkanWindowContext.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002412 if (is_android) {
2413 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
2414 } else if (is_linux) {
2415 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
2416 libs += [ "X11-xcb" ]
2417 } else if (is_win) {
2418 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
2419 }
2420 }
2421
Jim Van Verthbe39f712019-02-08 15:36:14 -05002422 if (skia_use_metal) {
2423 sources += [ "tools/sk_app/MetalWindowContext.mm" ]
John Stilesab9578e2020-06-30 17:36:55 -04002424 sources += [ "tools/sk_app/MetalWindowContext.h" ]
Jim Van Verthbe39f712019-02-08 15:36:14 -05002425 if (is_mac) {
2426 sources += [ "tools/sk_app/mac/MetalWindowContext_mac.mm" ]
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002427 } else if (is_ios) {
Jim Van Verthe58d5322019-09-03 09:42:57 -04002428 sources += [ "tools/sk_app/ios/MetalWindowContext_ios.mm" ]
Jim Van Verthbe39f712019-02-08 15:36:14 -05002429 }
Jim Van Verthbe39f712019-02-08 15:36:14 -05002430 }
2431
Jim Van Verth682a2f42020-05-13 16:54:09 -04002432 if (skia_use_direct3d) {
2433 sources += [ "tools/sk_app/win/D3D12WindowContext_win.cpp" ]
2434 }
2435
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002436 if (skia_use_dawn) {
2437 sources += [ "tools/sk_app/DawnWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002438 sources += [ "tools/sk_app/DawnWindowContext.h" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002439 if (is_linux) {
2440 if (dawn_enable_vulkan) {
2441 sources += [ "tools/sk_app/unix/DawnVulkanWindowContext_unix.cpp" ]
2442 defines = [ "VK_USE_PLATFORM_XCB_KHR" ]
2443 libs += [ "X11-xcb" ]
2444 }
2445 } else if (is_win) {
2446 if (dawn_enable_d3d12) {
2447 sources += [ "tools/sk_app/win/DawnD3D12WindowContext_win.cpp" ]
2448 }
2449 } else if (is_mac) {
2450 if (dawn_enable_metal) {
2451 sources += [ "tools/sk_app/mac/DawnMTLWindowContext_mac.mm" ]
2452 }
2453 }
2454 }
2455
Mike Kleina01c6b02020-04-01 13:47:34 -05002456 deps = [ ":tool_utils" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002457 if (is_android) {
2458 deps += [ "//third_party/native_app_glue" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002459 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002460 if (skia_use_gl && skia_use_angle) {
Brian Osmanc9a42472018-05-31 13:17:12 -04002461 deps += [ "//third_party/angle2" ]
Mike Kleina92c3832016-12-08 09:49:39 -05002462 }
Brian Osman16adfa32016-10-18 14:42:44 -04002463 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002464
Hal Canary87515122019-03-15 14:22:51 -04002465 if (!skia_use_vulkan && (is_mac || is_linux || is_win)) {
2466 test_app("fiddle_examples") {
2467 sources = [
Brian Osmanc725e8f2019-04-10 14:08:44 -04002468 "tools/fiddle/all_examples.cpp",
Hal Canary87515122019-03-15 14:22:51 -04002469 "tools/fiddle/examples.cpp",
Brian Osman72ef2d52019-03-17 11:09:17 -04002470 "tools/fiddle/examples.h",
Hal Canary87515122019-03-15 14:22:51 -04002471 ]
Brian Osman72ef2d52019-03-17 11:09:17 -04002472 if (is_win) {
Hal Canary6c8422c2020-01-10 15:22:09 -05002473 cflags = [
2474 "/wd4756", # Overflow in constant arithmetic
2475 "/wd4305", # truncation from 'double' to 'float'
2476 ]
Brian Osman72ef2d52019-03-17 11:09:17 -04002477 }
Hal Canary87515122019-03-15 14:22:51 -04002478 deps = [
2479 ":skia",
2480 ":skia.h",
2481 "modules/skottie",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04002482 "modules/skshaper",
Hal Canary87515122019-03-15 14:22:51 -04002483 ]
2484 }
2485 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002486
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002487 # sk_app can work without GL but viewer always runs raster through a GL window context.
2488 if (skia_use_gl) {
2489 test_app("viewer") {
2490 is_shared_library = is_android
2491 sources = [
2492 "tools/viewer/AnimTimer.h",
2493 "tools/viewer/BisectSlide.cpp",
2494 "tools/viewer/GMSlide.cpp",
2495 "tools/viewer/ImGuiLayer.cpp",
2496 "tools/viewer/ImageSlide.cpp",
2497 "tools/viewer/ParticlesSlide.cpp",
2498 "tools/viewer/SKPSlide.cpp",
2499 "tools/viewer/SampleSlide.cpp",
Florin Malita45cd2002020-06-09 14:00:54 -04002500 "tools/viewer/SkRiveSlide.cpp",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002501 "tools/viewer/SkSLSlide.cpp",
2502 "tools/viewer/SkottieSlide.cpp",
2503 "tools/viewer/SlideDir.cpp",
2504 "tools/viewer/StatsLayer.cpp",
2505 "tools/viewer/SvgSlide.cpp",
2506 "tools/viewer/TouchGesture.cpp",
2507 "tools/viewer/TouchGesture.h",
2508 "tools/viewer/Viewer.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002509 "tools/viewer/Viewer.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002510 ]
2511 libs = []
2512
2513 deps = [
2514 ":common_flags_gpu",
2515 ":experimental_svg_model",
2516 ":flags",
2517 ":gm",
2518 ":gpu_tool_utils",
2519 ":samples",
2520 ":sk_app",
2521 ":skia",
2522 ":tool_utils",
2523 ":trace",
Florin Malita45cd2002020-06-09 14:00:54 -04002524 "experimental/skrive",
Florin Malitac9c4e2e2020-08-13 12:03:37 -04002525 "modules/audioplayer",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002526 "modules/particles",
2527 "modules/skottie",
2528 "modules/skottie:utils",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002529 "modules/sksg:samples",
2530 "//third_party/imgui",
2531 ]
2532 if (skia_use_experimental_xform) {
2533 deps += [ ":experimental_xform" ]
2534 sources += [ "gm/xform.cpp" ]
2535 }
Brian Osmanc85f1fa2020-06-16 15:11:34 -04002536 if (skia_use_vulkan) {
Brian Salomon3207fbe2020-06-30 11:09:25 -04002537 deps += [
2538 "//third_party/spirv-tools:spvtools",
2539
2540 #spvtools depends on this but doesn't deps it in. Looks like upstream bug
2541 #that we replicated in our third_party/spirv-tools/BUILD.gn
2542 "//third_party/spirv-tools:spvtools_val",
2543 ]
Brian Osmanc85f1fa2020-06-16 15:11:34 -04002544 }
Mike Reedd62d4062019-06-12 10:20:44 -04002545 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002546 }
2547
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002548 if (skia_use_gl && !skia_use_angle && (is_linux || is_win || is_mac)) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002549 test_app("HelloWorld") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002550 sources = [ "example/HelloWorld.cpp" ]
Brian Osmaneff04b52017-11-21 13:18:02 -05002551 libs = []
2552
Brian Osmaneff04b52017-11-21 13:18:02 -05002553 deps = [
2554 ":flags",
2555 ":gpu_tool_utils",
2556 ":sk_app",
2557 ":skia",
2558 ":tool_utils",
Brian Osmaneff04b52017-11-21 13:18:02 -05002559 ]
2560 }
2561 }
2562
Mike Klein9f6468f2020-05-19 13:14:40 -05002563 if (skia_use_gl && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002564 test_app("SkiaSDLExample") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002565 sources = [ "example/SkiaSDLExample.cpp" ]
Jim Van Verth4c70c752017-07-11 12:03:01 -04002566 libs = []
Jim Van Verth4c70c752017-07-11 12:03:01 -04002567 deps = [
2568 ":gpu_tool_utils",
2569 ":skia",
2570 "//third_party/libsdl",
2571 ]
2572 }
2573 }
2574
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002575 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2576 action_foreach("generate_mocs") {
2577 script = "gn/call.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05002578 sources = [ "tools/mdbviz/MainWindow.h" ]
2579 outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp" ]
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002580 args = [
2581 "$skia_qt_path" + "/bin/moc",
2582 "{{source}}",
2583 "-o",
2584 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2585 ]
2586 }
2587 action_foreach("generate_resources") {
2588 script = "gn/call.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05002589 sources = [ "tools/mdbviz/resources.qrc" ]
2590 outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp" ]
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002591 args = [
2592 "$skia_qt_path" + "/bin/rcc",
2593 "{{source}}",
2594 "-o",
2595 "gen/mdbviz/{{source_name_part}}_res.cpp",
2596 ]
2597 }
2598 test_app("mdbviz") {
2599 if (is_win) {
2600 # on Windows we need to disable some exception handling warnings due to the Qt headers
2601 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2602 }
2603 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002604 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002605 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05002606 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002607 "tools/debugger/DrawCommand.cpp",
2608 "tools/debugger/JsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002609 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002610 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002611 "tools/mdbviz/main.cpp",
2612
2613 # generated files
2614 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2615 "$target_gen_dir/mdbviz/resources_res.cpp",
2616 ]
2617 lib_dirs = [ "$skia_qt_path/lib" ]
2618 libs = [
2619 "Qt5Core.lib",
2620 "Qt5Gui.lib",
2621 "Qt5Widgets.lib",
2622 ]
2623 include_dirs = [
2624 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002625 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002626 "$skia_qt_path/include/QtWidgets",
2627 ]
2628 deps = [
2629 ":generate_mocs",
2630 ":generate_resources",
2631 ":skia",
2632 ]
2633 }
2634 }
2635
Mike Kleine459afd2017-03-03 09:21:30 -05002636 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002637 copy("gdbserver") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002638 sources = [ "$ndk/$ndk_gdbserver" ]
2639 outputs = [ "$root_out_dir/gdbserver" ]
Derek Sollenberger70120c72017-01-05 11:39:04 -05002640 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002641 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002642
2643 if (skia_use_opencl) {
2644 test_app("hello-opencl") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002645 sources = [ "tools/hello-opencl.cpp" ]
2646 deps = [ "//third_party/opencl" ]
Mike Kleinf9ae6702018-06-20 14:05:05 -04002647 }
2648 }
Hal Canaryb8f81af2019-04-24 13:56:16 -04002649
Brian Osmanf564f152019-07-23 15:14:30 -04002650 executable("cpu_modules") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002651 sources = [ "tools/cpu_modules.cpp" ]
Brian Osmanf564f152019-07-23 15:14:30 -04002652 deps = [
2653 ":skia",
2654 "modules/particles",
2655 ]
2656 }
2657
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002658 if (skia_use_gl && skia_use_icu && skia_use_harfbuzz) {
Hal Canary1f94d392019-07-30 09:27:56 -04002659 test_app("editor") {
2660 is_shared_library = is_android
Mike Kleina01c6b02020-04-01 13:47:34 -05002661 deps = [ "modules/skplaintexteditor:editor_app" ]
Hal Canary1f94d392019-07-30 09:27:56 -04002662 }
Hal Canaryb8f81af2019-04-24 13:56:16 -04002663 }
Hal Canarye5b65d22019-09-19 11:33:31 -04002664
2665 executable("image_diff_metric") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002666 sources = [ "tools/image_diff_metric.cpp" ]
2667 deps = [ ":skia" ]
Hal Canarye5b65d22019-09-19 11:33:31 -04002668 }
Chris Dalton2b598902020-03-25 10:50:35 -06002669
2670 group("modules_testonly") {
2671 testonly = true
2672 deps = []
2673 if (target_cpu == "wasm") {
2674 deps += [ "modules/canvaskit:viewer_wasm" ]
2675 }
2676 }
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002677
2678 if (skia_build_fuzzers) {
2679 template("libfuzzer_app") {
2680 output_dir = root_build_dir
2681 executable(target_name) {
2682 check_includes = false
2683 forward_variables_from(invoker, "*", [ "is_shared_library" ])
2684 configs += [ ":skia_private" ]
2685 sources += [
2686 "fuzz/Fuzz.cpp",
2687 "fuzz/FuzzCommon.cpp",
2688 ]
2689 deps += [
2690 ":flags",
2691 ":gpu_tool_utils",
2692 ":skia",
2693 ]
2694 defines = [ "SK_BUILD_FOR_LIBFUZZER" ]
2695 if (skia_use_libfuzzer_defaults) {
2696 cflags = [ "-fsanitize=fuzzer" ]
2697 ldflags = [ "-fsanitize=fuzzer" ]
2698 }
2699 testonly = true
2700 }
2701 }
2702
2703 libfuzzer_app("region_deserialize") {
2704 sources = [ "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp" ]
2705 deps = []
2706 }
2707
2708 libfuzzer_app("image_filter_deserialize") {
2709 include_dirs = [
2710 "tools",
2711 "tools/fonts",
2712 ]
2713 sources = [
2714 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
2715 "tools/Resources.cpp",
2716 "tools/fonts/TestFontMgr.cpp",
2717 "tools/fonts/TestSVGTypeface.cpp",
2718 "tools/fonts/TestTypeface.cpp",
2719 ]
2720 deps = [ ":experimental_svg_model" ]
2721 }
2722
2723 libfuzzer_app("region_set_path") {
2724 sources = [ "fuzz/oss_fuzz/FuzzRegionSetPath.cpp" ]
2725 deps = []
2726 }
2727
2728 libfuzzer_app("textblob_deserialize") {
2729 include_dirs = [
2730 "tools",
2731 "tools/fonts",
2732 ]
2733 sources = [
2734 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
2735 "tools/Resources.cpp",
2736 "tools/fonts/TestFontMgr.cpp",
2737 "tools/fonts/TestSVGTypeface.cpp",
2738 "tools/fonts/TestTypeface.cpp",
2739 ]
2740 deps = [ ":experimental_svg_model" ]
2741 }
2742
2743 libfuzzer_app("path_deserialize") {
2744 sources = [ "fuzz/oss_fuzz/FuzzPathDeserialize.cpp" ]
2745 deps = []
2746 }
2747
2748 libfuzzer_app("image_decode") {
2749 sources = [ "fuzz/oss_fuzz/FuzzImage.cpp" ]
2750 deps = []
2751 }
2752
2753 libfuzzer_app("animated_image_decode") {
2754 sources = [ "fuzz/oss_fuzz/FuzzAnimatedImage.cpp" ]
2755 deps = []
2756 }
2757
2758 libfuzzer_app("api_create_ddl") {
2759 include_dirs = [
2760 "include",
2761 "include/gpu",
2762 ]
2763 sources = [
2764 "fuzz/FuzzCreateDDL.cpp",
2765 "fuzz/oss_fuzz/FuzzAPICreateDDL.cpp",
2766 "tools/Resources.cpp",
2767 "tools/UrlDataManager.cpp",
2768 "tools/debugger/DebugCanvas.cpp",
2769 "tools/debugger/DebugLayerManager.cpp",
2770 "tools/debugger/DrawCommand.cpp",
2771 "tools/debugger/JsonWriteBuffer.cpp",
2772 "tools/fonts/TestFontMgr.cpp",
2773 "tools/fonts/TestSVGTypeface.cpp",
2774 "tools/fonts/TestTypeface.cpp",
2775 ]
2776 deps = [
2777 ":experimental_svg_model",
2778 "//third_party/libpng",
2779 ]
2780 }
2781
2782 libfuzzer_app("api_draw_functions") {
2783 sources = [
2784 "fuzz/FuzzDrawFunctions.cpp",
2785 "fuzz/oss_fuzz/FuzzDrawFunctions.cpp",
2786 ]
2787 deps = []
2788 }
2789
2790 libfuzzer_app("api_gradients") {
2791 sources = [
2792 "fuzz/FuzzGradients.cpp",
2793 "fuzz/oss_fuzz/FuzzGradients.cpp",
2794 ]
2795 deps = []
2796 }
2797
2798 libfuzzer_app("api_image_filter") {
2799 include_dirs = [
2800 "tools",
2801 "tools/debugger",
2802 ]
2803 sources = [
2804 "fuzz/FuzzCanvas.cpp",
2805 "fuzz/oss_fuzz/FuzzAPIImageFilter.cpp",
2806 "tools/UrlDataManager.cpp",
2807 "tools/debugger/DebugCanvas.cpp",
2808 "tools/debugger/DebugLayerManager.cpp",
2809 "tools/debugger/DrawCommand.cpp",
2810 "tools/debugger/JsonWriteBuffer.cpp",
2811 ]
2812 deps = [ "//third_party/libpng" ]
2813 }
2814
2815 libfuzzer_app("api_path_measure") {
2816 sources = [
2817 "fuzz/FuzzPathMeasure.cpp",
2818 "fuzz/oss_fuzz/FuzzPathMeasure.cpp",
2819 ]
2820 deps = []
2821 }
2822
2823 libfuzzer_app("api_pathop") {
2824 sources = [
2825 "fuzz/FuzzPathop.cpp",
2826 "fuzz/oss_fuzz/FuzzPathop.cpp",
2827 ]
2828 deps = []
2829 }
2830
2831 libfuzzer_app("api_raster_n32_canvas") {
2832 include_dirs = [
2833 "tools",
2834 "tools/debugger",
2835 "tools/fonts",
2836 ]
2837 sources = [
2838 "fuzz/FuzzCanvas.cpp",
2839 "fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp",
2840 "tools/Resources.cpp",
2841 "tools/UrlDataManager.cpp",
2842 "tools/debugger/DebugCanvas.cpp",
2843 "tools/debugger/DebugLayerManager.cpp",
2844 "tools/debugger/DrawCommand.cpp",
2845 "tools/debugger/JsonWriteBuffer.cpp",
2846 "tools/fonts/TestFontMgr.cpp",
2847 "tools/fonts/TestSVGTypeface.cpp",
2848 "tools/fonts/TestTypeface.cpp",
2849 ]
2850 deps = [
2851 ":experimental_svg_model",
2852 "//third_party/libpng",
2853 ]
2854 }
2855
2856 if (skia_use_gl) {
2857 libfuzzer_app("api_mock_gpu_canvas") {
2858 include_dirs = [
2859 "tools",
2860 "tools/debugger",
2861 "tools/fonts",
2862 ]
2863 sources = [
2864 "fuzz/FuzzCanvas.cpp",
2865 "fuzz/oss_fuzz/FuzzMockGPUCanvas.cpp",
2866 "tools/LsanSuppressions.cpp",
2867 "tools/Resources.cpp",
2868 "tools/UrlDataManager.cpp",
2869 "tools/debugger/DebugCanvas.cpp",
2870 "tools/debugger/DebugLayerManager.cpp",
2871 "tools/debugger/DrawCommand.cpp",
2872 "tools/debugger/JsonWriteBuffer.cpp",
2873 "tools/fonts/TestFontMgr.cpp",
2874 "tools/fonts/TestSVGTypeface.cpp",
2875 "tools/fonts/TestTypeface.cpp",
2876 ]
2877 deps = [
2878 ":experimental_svg_model",
2879 "//third_party/libpng",
2880 ]
2881 }
2882 }
2883
2884 libfuzzer_app("api_null_canvas") {
2885 include_dirs = [
2886 "tools",
2887 "tools/debugger",
2888 "tools/fonts",
2889 ]
2890 sources = [
2891 "fuzz/FuzzCanvas.cpp",
2892 "fuzz/oss_fuzz/FuzzNullCanvas.cpp",
2893 "tools/Resources.cpp",
2894 "tools/UrlDataManager.cpp",
2895 "tools/debugger/DebugCanvas.cpp",
2896 "tools/debugger/DebugLayerManager.cpp",
2897 "tools/debugger/DrawCommand.cpp",
2898 "tools/debugger/JsonWriteBuffer.cpp",
2899 "tools/fonts/TestFontMgr.cpp",
2900 "tools/fonts/TestSVGTypeface.cpp",
2901 "tools/fonts/TestTypeface.cpp",
2902 ]
2903 deps = [
2904 ":experimental_svg_model",
2905 "//third_party/libpng",
2906 ]
2907 }
2908
2909 libfuzzer_app("api_svg_canvas") {
2910 include_dirs = [
2911 "include",
2912 "include/svg",
2913 ]
2914 sources = [
2915 "fuzz/FuzzCanvas.cpp",
2916 "fuzz/oss_fuzz/FuzzAPISVGCanvas.cpp",
2917 "tools/Resources.cpp",
2918 "tools/UrlDataManager.cpp",
2919 "tools/debugger/DebugCanvas.cpp",
2920 "tools/debugger/DebugLayerManager.cpp",
2921 "tools/debugger/DrawCommand.cpp",
2922 "tools/debugger/JsonWriteBuffer.cpp",
2923 "tools/fonts/TestFontMgr.cpp",
2924 "tools/fonts/TestSVGTypeface.cpp",
2925 "tools/fonts/TestTypeface.cpp",
2926 ]
2927 deps = [
2928 ":experimental_svg_model",
2929 "//third_party/libpng",
2930 ]
2931 }
2932
2933 libfuzzer_app("png_encoder") {
2934 sources = [
2935 "fuzz/FuzzEncoders.cpp",
2936 "fuzz/oss_fuzz/FuzzPNGEncoder.cpp",
2937 ]
2938 deps = []
2939 }
2940
2941 libfuzzer_app("jpeg_encoder") {
2942 sources = [
2943 "fuzz/FuzzEncoders.cpp",
2944 "fuzz/oss_fuzz/FuzzJPEGEncoder.cpp",
2945 ]
2946 deps = []
2947 }
2948
2949 libfuzzer_app("webp_encoder") {
2950 sources = [
2951 "fuzz/FuzzEncoders.cpp",
2952 "fuzz/oss_fuzz/FuzzWEBPEncoder.cpp",
2953 ]
2954 deps = []
2955 }
2956
2957 libfuzzer_app("skottie_json") {
2958 sources = [
2959 "modules/skottie/fuzz/FuzzSkottieJSON.cpp",
2960 "tools/Resources.cpp",
2961 "tools/fonts/TestFontMgr.cpp",
2962 "tools/fonts/TestSVGTypeface.cpp",
2963 "tools/fonts/TestTypeface.cpp",
2964 ]
2965 deps = [
2966 ":experimental_svg_model",
2967 "modules/skottie:skottie",
2968 ]
2969 }
2970
2971 libfuzzer_app("skjson") {
2972 sources = [ "fuzz/oss_fuzz/FuzzJSON.cpp" ]
2973 deps = []
2974 }
2975
2976 libfuzzer_app("api_polyutils") {
2977 sources = [
2978 "fuzz/FuzzPolyUtils.cpp",
2979 "fuzz/oss_fuzz/FuzzPolyUtils.cpp",
2980 ]
2981 deps = [ ":skia" ]
2982 }
2983
2984 libfuzzer_app("android_codec") {
2985 sources = [ "fuzz/oss_fuzz/FuzzAndroidCodec.cpp" ]
2986 deps = []
2987 }
2988
2989 libfuzzer_app("image_decode_incremental") {
2990 sources = [ "fuzz/oss_fuzz/FuzzIncrementalImage.cpp" ]
2991 deps = []
2992 }
2993
2994 libfuzzer_app("sksl2glsl") {
2995 sources = [ "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp" ]
2996 deps = []
2997 }
2998
2999 libfuzzer_app("sksl2spirv") {
3000 sources = [ "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp" ]
3001 deps = []
3002 }
3003
3004 libfuzzer_app("sksl2metal") {
3005 sources = [ "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp" ]
3006 deps = []
3007 }
3008
3009 libfuzzer_app("sksl2pipeline") {
3010 sources = [ "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp" ]
3011 deps = []
3012 }
3013
3014 libfuzzer_app("skdescriptor_deserialize") {
3015 sources = [ "fuzz/oss_fuzz/FuzzSkDescriptorDeserialize.cpp" ]
3016 deps = []
3017 }
3018
3019 libfuzzer_app("svg_dom") {
3020 sources = [ "fuzz/oss_fuzz/FuzzSVG.cpp" ]
3021 deps = [ ":experimental_svg_model" ]
3022 }
3023
3024 libfuzzer_app("skruntimeeffect") {
3025 sources = [ "fuzz/oss_fuzz/FuzzSkRuntimeEffect.cpp" ]
3026 deps = []
3027 }
3028
3029 libfuzzer_app("skp") {
3030 sources = [ "fuzz/oss_fuzz/FuzzSKP.cpp" ]
3031 deps = []
3032 }
3033 }
mtklein25c81d42016-07-27 13:55:26 -07003034}
Hal Canary932a2c02019-09-17 10:43:18 -04003035
Chinmay Gardea1ea0a92019-10-01 16:37:10 -07003036if (is_ios && skia_use_metal && !skia_enable_flutter_defines) {
Hal Canary932a2c02019-09-17 10:43:18 -04003037 group("minimal_ios_mtl_skia_app") {
Mike Kleina01c6b02020-04-01 13:47:34 -05003038 deps = [ "experimental/minimal_ios_mtl_skia_app" ]
Hal Canary932a2c02019-09-17 10:43:18 -04003039 }
Hal Canary27483062019-12-06 15:01:08 -05003040}
3041
Hal Canary60ff6512020-01-21 12:39:20 -05003042if (is_ios && skia_enable_skottie && !skia_enable_flutter_defines) {
Hal Canary932a2c02019-09-17 10:43:18 -04003043 group("skottie_ios") {
Mike Kleina01c6b02020-04-01 13:47:34 -05003044 deps = [ "tools/skottie_ios_app" ]
Hal Canary932a2c02019-09-17 10:43:18 -04003045 }
3046}