blob: 1bdc96eb9f9728f2d2d3e6a65c37471d92c91df6 [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") {
Mike Klein4f4c0642021-01-15 07:20:33 -060072 visibility = [ "./*" ]
mtkleinc04ff472016-06-23 10:29:30 -070073
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 }
James Clarkeb8c0dab2021-02-09 06:22:41 -080095 if (skia_enable_winuwp) {
James Clarkeb2bfa9d2021-02-18 19:54:42 -080096 defines += [ "SK_WINUWP" ]
James Clarkeb8c0dab2021-02-09 06:22:41 -080097 }
98}
99
mtkleinc04ff472016-06-23 10:29:30 -0700100# Any code that's linked into Skia-the-library should use this config via += skia_library_configs.
101config("skia_library") {
Mike Klein4f4c0642021-01-15 07:20:33 -0600102 visibility = [ "./*" ]
Mike Kleinf5f4e812019-04-29 15:45:14 +0000103 defines = [ "SKIA_IMPLEMENTATION=1" ]
mtkleinc04ff472016-06-23 10:29:30 -0700104}
105
106skia_library_configs = [
107 ":skia_public",
108 ":skia_private",
109 ":skia_library",
110]
111
mtklein9b8583d2016-08-24 17:32:30 -0700112# Use for CPU-specific Skia code that needs particular compiler flags.
113template("opts") {
Mike Klein6d1df6d2018-11-07 15:03:58 -0500114 visibility = [ ":*" ]
mtklein9b8583d2016-08-24 17:32:30 -0700115 if (invoker.enabled) {
116 source_set(target_name) {
Hal Canaryc25f4e92019-02-26 11:54:25 -0500117 check_includes = false
mtklein9b8583d2016-08-24 17:32:30 -0700118 forward_variables_from(invoker, "*")
119 configs += skia_library_configs
120 }
121 } else {
122 # If not enabled, a phony empty target that swallows all otherwise unused variables.
123 source_set(target_name) {
Hal Canaryc25f4e92019-02-26 11:54:25 -0500124 check_includes = false
mtklein9b8583d2016-08-24 17:32:30 -0700125 forward_variables_from(invoker,
126 "*",
127 [
128 "sources",
129 "cflags",
130 ])
131 }
132 }
anmittala7eaf2e2016-08-17 13:57:26 -0700133}
134
mtklein422310d2016-08-16 18:28:43 -0700135is_x86 = current_cpu == "x64" || current_cpu == "x86"
mtkleinc04ff472016-06-23 10:29:30 -0700136
mtklein7d6fb2c2016-08-25 14:50:44 -0700137opts("none") {
138 enabled = !is_x86 && current_cpu != "arm" && current_cpu != "arm64"
brettwb9447282016-09-01 14:24:39 -0700139 sources = skia_opts.none_sources
anmittalb8b3f712016-08-25 04:55:19 -0700140 cflags = []
141}
142
mtklein7d6fb2c2016-08-25 14:50:44 -0700143opts("armv7") {
anmittalb8b3f712016-08-25 04:55:19 -0700144 enabled = current_cpu == "arm"
brettwb9447282016-09-01 14:24:39 -0700145 sources = skia_opts.armv7_sources + skia_opts.neon_sources
mtklein7d6fb2c2016-08-25 14:50:44 -0700146 cflags = []
anmittalb8b3f712016-08-25 04:55:19 -0700147}
148
149opts("arm64") {
150 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700151 sources = skia_opts.arm64_sources
anmittalb8b3f712016-08-25 04:55:19 -0700152 cflags = []
153}
154
155opts("crc32") {
156 enabled = current_cpu == "arm64"
brettwb9447282016-09-01 14:24:39 -0700157 sources = skia_opts.crc32_sources
anmittalb8b3f712016-08-25 04:55:19 -0700158 cflags = [ "-march=armv8-a+crc" ]
159}
160
mtklein9b8583d2016-08-24 17:32:30 -0700161opts("sse2") {
162 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700163 sources = skia_opts.sse2_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400164 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400165 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE2" ]
166 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400167 cflags = [ "-msse2" ]
168 }
mtklein9b8583d2016-08-24 17:32:30 -0700169}
mtkleinc04ff472016-06-23 10:29:30 -0700170
mtklein9b8583d2016-08-24 17:32:30 -0700171opts("ssse3") {
172 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700173 sources = skia_opts.ssse3_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400174 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400175 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSSE3" ]
176 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400177 cflags = [ "-mssse3" ]
178 }
mtklein9b8583d2016-08-24 17:32:30 -0700179}
mtkleinc04ff472016-06-23 10:29:30 -0700180
mtklein9b8583d2016-08-24 17:32:30 -0700181opts("sse41") {
182 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700183 sources = skia_opts.sse41_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400184 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400185 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE41" ]
186 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400187 cflags = [ "-msse4.1" ]
188 }
mtklein9b8583d2016-08-24 17:32:30 -0700189}
mtklein4e976072016-08-08 09:06:27 -0700190
mtklein9b8583d2016-08-24 17:32:30 -0700191opts("sse42") {
192 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700193 sources = skia_opts.sse42_sources
Mike Kleinc722f792017-07-31 11:57:21 -0400194 if (!is_clang && is_win) {
Mike Kleind8765e32016-10-19 13:39:13 -0400195 defines = [ "SK_CPU_SSE_LEVEL=SK_CPU_SSE_LEVEL_SSE42" ]
196 } else {
Mike Klein3eb71212016-10-11 17:08:53 -0400197 cflags = [ "-msse4.2" ]
198 }
mtklein9b8583d2016-08-24 17:32:30 -0700199}
200
201opts("avx") {
202 enabled = is_x86
brettwb9447282016-09-01 14:24:39 -0700203 sources = skia_opts.avx_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400204 if (is_win) {
Mike Klein17b6e482016-11-18 22:11:41 +0000205 cflags = [ "/arch:AVX" ]
Mike Klein3eb71212016-10-11 17:08:53 -0400206 } else {
207 cflags = [ "-mavx" ]
Mike Klein1cc767b2019-12-13 13:02:22 -0500208 if (is_mac && is_debug) {
Mike Kleinf800c1d2020-06-04 11:53:56 -0500209 cflags += [ "-fno-stack-check" ] # Work around skia:9709
Mike Klein1cc767b2019-12-13 13:02:22 -0500210 }
Mike Klein3eb71212016-10-11 17:08:53 -0400211 }
mtkleinc04ff472016-06-23 10:29:30 -0700212}
213
Mike Klein1b9b7d52018-02-27 10:37:40 -0500214opts("hsw") {
215 enabled = is_x86
216 sources = skia_opts.hsw_sources
Mike Klein4d4b3aa2018-03-21 13:07:35 -0400217 if (is_win) {
Mike Klein1b9b7d52018-02-27 10:37:40 -0500218 cflags = [ "/arch:AVX2" ]
219 } else {
Mike Kleine87c4862018-03-23 00:13:58 +0000220 cflags = [ "-march=haswell" ]
Mike Kleindb380222020-01-22 13:53:18 -0600221 if (is_mac && is_debug) {
Mike Kleinf800c1d2020-06-04 11:53:56 -0500222 cflags += [ "-fno-stack-check" ] # Work around skia:9709
Mike Kleindb380222020-01-22 13:53:18 -0600223 }
Mike Klein1b9b7d52018-02-27 10:37:40 -0500224 }
Mike Klein1b9b7d52018-02-27 10:37:40 -0500225}
226
Mike Kleinad56c4c2020-06-05 06:57:30 -0500227opts("skx") {
228 enabled = is_x86
229 sources = skia_opts.skx_sources
230 if (is_win) {
231 cflags = [ "/arch:AVX512" ]
232 } else {
233 cflags = [ "-march=skylake-avx512" ]
234 if (is_mac && is_debug) {
235 cflags += [ "-fno-stack-check" ] # Work around skia:9709
236 }
237 }
238}
239
mtkleinc095df52016-08-24 12:23:52 -0700240# Any feature of Skia that requires third-party code should be optional and use this template.
mtklein457b42a2016-08-23 13:56:37 -0700241template("optional") {
Mike Klein6d1df6d2018-11-07 15:03:58 -0500242 visibility = [ ":*" ]
mtklein457b42a2016-08-23 13:56:37 -0700243 if (invoker.enabled) {
244 config(target_name + "_public") {
mtkleincd01b032016-08-31 04:58:19 -0700245 if (defined(invoker.public_defines)) {
246 defines = invoker.public_defines
247 }
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600248 if (defined(invoker.public_configs)) {
249 configs = invoker.public_configs
250 }
Hal Canary2dad9902019-11-20 16:01:31 -0500251 if (defined(invoker.public_include_dirs)) {
252 include_dirs = invoker.public_include_dirs
253 }
mtklein457b42a2016-08-23 13:56:37 -0700254 }
255 source_set(target_name) {
Hal Canaryc25f4e92019-02-26 11:54:25 -0500256 check_includes = false
mtkleincd01b032016-08-31 04:58:19 -0700257 forward_variables_from(invoker,
258 "*",
259 [
260 "public_defines",
Ben Wagnere75021e2021-02-17 22:18:34 -0500261 "sources_for_tests",
mtkleincd01b032016-08-31 04:58:19 -0700262 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700263 "configs_to_remove",
mtkleincd01b032016-08-31 04:58:19 -0700264 ])
mtklein457b42a2016-08-23 13:56:37 -0700265 all_dependent_configs = [ ":" + target_name + "_public" ]
mtklein9b8583d2016-08-24 17:32:30 -0700266 configs += skia_library_configs
scroggof84ad642016-10-31 09:02:57 -0700267 if (defined(invoker.configs_to_remove)) {
268 configs -= invoker.configs_to_remove
269 }
mtklein457b42a2016-08-23 13:56:37 -0700270 }
Ben Wagnere75021e2021-02-17 22:18:34 -0500271 if (defined(invoker.sources_for_tests) && skia_enable_tools) {
272 source_set(target_name + "_tests") {
273 check_includes = false
274 forward_variables_from(invoker,
275 "*",
276 [
277 "public_defines",
278 "sources",
279 "sources_for_tests",
280 "sources_when_disabled",
281 "configs_to_remove",
282 ])
283 testonly = true
284 sources = invoker.sources_for_tests
285 if (!defined(deps)) {
286 deps = []
287 }
288 deps += [ ":test" ]
289 all_dependent_configs = [ ":" + target_name + "_public" ]
290 configs += skia_library_configs
291 if (defined(invoker.configs_to_remove)) {
292 configs -= invoker.configs_to_remove
293 }
294 }
295 }
mtklein457b42a2016-08-23 13:56:37 -0700296 } else {
mtklein457b42a2016-08-23 13:56:37 -0700297 source_set(target_name) {
298 forward_variables_from(invoker,
299 "*",
300 [
Ben Wagnerea765a32020-06-05 13:42:30 -0400301 "public",
mtklein457b42a2016-08-23 13:56:37 -0700302 "public_defines",
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400303 "public_deps",
mtklein457b42a2016-08-23 13:56:37 -0700304 "deps",
mtklein6ef69992016-09-14 06:12:09 -0700305 "libs",
Jim Van Verthef820be2020-08-12 10:45:00 -0400306 "frameworks",
mtklein457b42a2016-08-23 13:56:37 -0700307 "sources",
Ben Wagnere75021e2021-02-17 22:18:34 -0500308 "sources_for_tests",
mtkleincd01b032016-08-31 04:58:19 -0700309 "sources_when_disabled",
scroggof84ad642016-10-31 09:02:57 -0700310 "configs_to_remove",
mtklein457b42a2016-08-23 13:56:37 -0700311 ])
mtkleincd01b032016-08-31 04:58:19 -0700312 if (defined(invoker.sources_when_disabled)) {
313 sources = invoker.sources_when_disabled
314 }
315 configs += skia_library_configs
mtklein457b42a2016-08-23 13:56:37 -0700316 }
Ben Wagnere75021e2021-02-17 22:18:34 -0500317 if (defined(invoker.sources_for_tests)) {
318 source_set(target_name + "_tests") {
319 }
320 }
mtkleineb3c4252016-08-23 07:38:09 -0700321 }
mtklein457b42a2016-08-23 13:56:37 -0700322}
mtklein457b42a2016-08-23 13:56:37 -0700323
Leon Scroggins III63cfb362020-04-24 13:00:48 -0400324optional("android_utils") {
325 enabled = skia_enable_android_utils
326
Leon Scroggins III87caae62020-05-04 10:02:45 -0400327 public = [
328 "client_utils/android/BRDAllocator.h",
329 "client_utils/android/BitmapRegionDecoder.h",
330 "client_utils/android/FrontBufferedStream.h",
331 ]
Leon Scroggins III63cfb362020-04-24 13:00:48 -0400332 public_defines = [ "SK_ENABLE_ANDROID_UTILS" ]
Leon Scroggins III87caae62020-05-04 10:02:45 -0400333 sources = [
334 "client_utils/android/BitmapRegionDecoder.cpp",
335 "client_utils/android/FrontBufferedStream.cpp",
336 ]
Leon Scroggins III63cfb362020-04-24 13:00:48 -0400337}
338
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400339group("fontmgr_factory") {
340 public_deps = [ skia_fontmgr_factory ]
341}
342
343optional("fontmgr_empty_factory") {
344 enabled = true
345 sources = [ "src/ports/SkFontMgr_empty_factory.cpp" ]
Ben Wagner75626e42020-06-03 13:20:37 -0400346}
347
mtkleina45be612016-08-29 15:22:10 -0700348optional("fontmgr_android") {
Leon Scroggins IIIbe85c192018-11-13 13:50:12 -0500349 enabled = skia_enable_fontmgr_android
mtkleina45be612016-08-29 15:22:10 -0700350
351 deps = [
Ben Wagnerfc497342017-02-24 11:15:26 -0500352 ":typeface_freetype",
mtkleina45be612016-08-29 15:22:10 -0700353 "//third_party/expat",
mtkleina45be612016-08-29 15:22:10 -0700354 ]
Ben Wagner75626e42020-06-03 13:20:37 -0400355 public = [ "include/ports/SkFontMgr_android.h" ]
mtkleina45be612016-08-29 15:22:10 -0700356 sources = [
357 "src/ports/SkFontMgr_android.cpp",
mtkleina45be612016-08-29 15:22:10 -0700358 "src/ports/SkFontMgr_android_parser.cpp",
Ben Wagner75626e42020-06-03 13:20:37 -0400359 "src/ports/SkFontMgr_android_parser.h",
mtkleina45be612016-08-29 15:22:10 -0700360 ]
Ben Wagnere75021e2021-02-17 22:18:34 -0500361 sources_for_tests = [ "tests/FontMgrAndroidParserTest.cpp" ]
mtkleina45be612016-08-29 15:22:10 -0700362}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400363optional("fontmgr_android_factory") {
364 enabled = skia_enable_fontmgr_android
365 deps = [ ":fontmgr_android" ]
366 sources = [ "src/ports/SkFontMgr_android_factory.cpp" ]
367}
mtkleina45be612016-08-29 15:22:10 -0700368
mtkleind2e39db2016-09-07 07:52:55 -0700369optional("fontmgr_custom") {
Ben Wagner75626e42020-06-03 13:20:37 -0400370 enabled =
371 skia_enable_fontmgr_custom_directory ||
372 skia_enable_fontmgr_custom_embedded || skia_enable_fontmgr_custom_empty
mtkleind2e39db2016-09-07 07:52:55 -0700373
Mike Kleina01c6b02020-04-01 13:47:34 -0500374 deps = [ ":typeface_freetype" ]
Ben Wagner75626e42020-06-03 13:20:37 -0400375 public = [ "src/ports/SkFontMgr_custom.h" ]
376 sources = [ "src/ports/SkFontMgr_custom.cpp" ]
377}
378
379optional("fontmgr_custom_directory") {
380 enabled = skia_enable_fontmgr_custom_directory
381
382 deps = [
383 ":fontmgr_custom",
384 ":typeface_freetype",
mtkleind2e39db2016-09-07 07:52:55 -0700385 ]
Ben Wagner75626e42020-06-03 13:20:37 -0400386 public = [ "include/ports/SkFontMgr_directory.h" ]
387 sources = [ "src/ports/SkFontMgr_custom_directory.cpp" ]
388}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400389optional("fontmgr_custom_directory_factory") {
390 enabled = skia_enable_fontmgr_custom_directory
391 deps = [ ":fontmgr_custom_directory" ]
392 sources = [ "src/ports/SkFontMgr_custom_directory_factory.cpp" ]
393}
Ben Wagner75626e42020-06-03 13:20:37 -0400394
395optional("fontmgr_custom_embedded") {
396 enabled = skia_enable_fontmgr_custom_embedded
397
398 deps = [
399 ":fontmgr_custom",
400 ":typeface_freetype",
401 ]
402 sources = [ "src/ports/SkFontMgr_custom_embedded.cpp" ]
mtkleind2e39db2016-09-07 07:52:55 -0700403}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400404optional("fontmgr_custom_embedded_factory") {
405 enabled = skia_enable_fontmgr_custom_embedded
406 deps = [ ":fontmgr_custom_embedded" ]
407 sources = [ "src/ports/SkFontMgr_custom_embedded_factory.cpp" ]
408}
mtkleind2e39db2016-09-07 07:52:55 -0700409
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500410optional("fontmgr_custom_empty") {
411 enabled = skia_enable_fontmgr_custom_empty
Kevin Lubickddd0a332018-12-12 10:35:13 -0500412
Ben Wagner75626e42020-06-03 13:20:37 -0400413 deps = [
414 ":fontmgr_custom",
415 ":typeface_freetype",
Sergey Ulanovf3babcd2018-11-30 17:42:00 -0800416 ]
Ben Wagner75626e42020-06-03 13:20:37 -0400417 public = [ "include/ports/SkFontMgr_empty.h" ]
418 sources = [ "src/ports/SkFontMgr_custom_empty.cpp" ]
Hal Canaryff2742e2018-01-30 11:35:47 -0500419}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400420optional("fontmgr_custom_empty_factory") {
421 enabled = skia_enable_fontmgr_custom_empty
422 deps = [ ":fontmgr_custom_empty" ]
423 sources = [ "src/ports/SkFontMgr_custom_empty_factory.cpp" ]
424}
Hal Canaryff2742e2018-01-30 11:35:47 -0500425
mtklein3cc22182016-08-29 13:26:14 -0700426optional("fontmgr_fontconfig") {
Ben Wagner75626e42020-06-03 13:20:37 -0400427 enabled = skia_enable_fontmgr_fontconfig
mtklein3cc22182016-08-29 13:26:14 -0700428
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400429 # The public header includes fontconfig.h and uses FcConfig*
430 public_deps = [ "//third_party:fontconfig" ]
Ben Wagner75626e42020-06-03 13:20:37 -0400431 public = [ "include/ports/SkFontMgr_fontconfig.h" ]
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400432 deps = [ ":typeface_freetype" ]
Ben Wagner75626e42020-06-03 13:20:37 -0400433 sources = [ "src/ports/SkFontMgr_fontconfig.cpp" ]
Ben Wagnere75021e2021-02-17 22:18:34 -0500434 sources_for_tests = [ "tests/FontMgrFontConfigTest.cpp" ]
Ben Wagner75626e42020-06-03 13:20:37 -0400435}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400436optional("fontmgr_fontconfig_factory") {
437 enabled = skia_enable_fontmgr_fontconfig
438 deps = [ ":fontmgr_fontconfig" ]
439 sources = [ "src/ports/SkFontMgr_fontconfig_factory.cpp" ]
440}
Ben Wagner75626e42020-06-03 13:20:37 -0400441
442optional("fontmgr_FontConfigInterface") {
443 enabled = skia_enable_fontmgr_FontConfigInterface
444
445 deps = [
446 ":typeface_freetype",
447 "//third_party:fontconfig",
448 ]
449 public = [
450 "include/ports/SkFontConfigInterface.h",
451 "include/ports/SkFontMgr_FontConfigInterface.h",
452 ]
mtklein3cc22182016-08-29 13:26:14 -0700453 sources = [
bungeman1ae0e012016-09-19 12:13:16 -0700454 "src/ports/SkFontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700455 "src/ports/SkFontConfigInterface_direct.cpp",
456 "src/ports/SkFontConfigInterface_direct_factory.cpp",
Ben Wagner75626e42020-06-03 13:20:37 -0400457 "src/ports/SkFontConfigTypeface.h",
mtklein3cc22182016-08-29 13:26:14 -0700458 "src/ports/SkFontMgr_FontConfigInterface.cpp",
mtklein3cc22182016-08-29 13:26:14 -0700459 ]
460}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400461optional("fontmgr_FontConfigInterface_factory") {
462 enabled = skia_enable_fontmgr_FontConfigInterface
463 deps = [ ":fontmgr_FontConfigInterface" ]
464 sources = [ "src/ports/SkFontMgr_FontConfigInterface_factory.cpp" ]
465}
mtklein3cc22182016-08-29 13:26:14 -0700466
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500467optional("fontmgr_fuchsia") {
468 enabled = skia_enable_fontmgr_fuchsia
469
Chinmay Garde89820762019-05-06 16:44:06 -0700470 deps = []
471
472 if (is_fuchsia && using_fuchsia_sdk) {
John Rosasco24cbdab2019-09-25 14:14:35 -0700473 deps += [ "//build/fuchsia/fidl:fuchsia.fonts" ]
Chinmay Garde89820762019-05-06 16:44:06 -0700474 } else {
Mike Kleina01c6b02020-04-01 13:47:34 -0500475 deps = [ "//sdk/fidl/fuchsia.fonts" ]
Chinmay Garde89820762019-05-06 16:44:06 -0700476 }
Ben Wagner75626e42020-06-03 13:20:37 -0400477 public = [ "src/ports/SkFontMgr_fuchsia.h" ]
478 sources = [ "src/ports/SkFontMgr_fuchsia.cpp" ]
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500479}
480
Ben Wagner75626e42020-06-03 13:20:37 -0400481optional("fontmgr_mac_ct") {
Ben Wagnerd13487e2020-06-03 23:29:43 -0400482 enabled = skia_use_fonthost_mac
483
Ben Wagner75626e42020-06-03 13:20:37 -0400484 public = [
485 "include/ports/SkFontMgr_mac_ct.h",
486 "include/ports/SkTypeface_mac.h",
487 ]
Ben Wagner0ef90dd2020-06-05 11:25:42 -0400488 sources = [
Ben Wagner0ef90dd2020-06-05 11:25:42 -0400489 "src/ports/SkFontMgr_mac_ct.cpp",
Ben Wagner0ef90dd2020-06-05 11:25:42 -0400490 "src/ports/SkScalerContext_mac_ct.cpp",
491 "src/ports/SkScalerContext_mac_ct.h",
492 "src/ports/SkTypeface_mac_ct.cpp",
493 "src/ports/SkTypeface_mac_ct.h",
494 ]
Ben Wagnera3e5e552021-02-22 15:37:33 +0000495 sources_for_tests = [ "tests/TypefaceMacTest.cpp" ]
Ben Wagnerd13487e2020-06-03 23:29:43 -0400496
497 if (is_mac) {
Jim Van Verthef820be2020-08-12 10:45:00 -0400498 frameworks = [
Ben Wagnerd13487e2020-06-03 23:29:43 -0400499 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
500 "AppKit.framework",
501 "ApplicationServices.framework",
502 ]
503 }
504
505 if (is_ios) {
Jim Van Verthef820be2020-08-12 10:45:00 -0400506 frameworks = [
Ben Wagnerd13487e2020-06-03 23:29:43 -0400507 "CoreFoundation.framework",
508 "CoreGraphics.framework",
509 "CoreText.framework",
510
511 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
512 "UIKit.framework",
513 ]
514 }
515}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400516optional("fontmgr_mac_ct_factory") {
517 enabled = skia_use_fonthost_mac
518 deps = [ ":fontmgr_mac_ct" ]
519 sources = [ "src/ports/SkFontMgr_mac_ct_factory.cpp" ]
520}
Ben Wagnerd13487e2020-06-03 23:29:43 -0400521
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500522optional("fontmgr_win") {
523 enabled = skia_enable_fontmgr_win
524
Ben Wagner75626e42020-06-03 13:20:37 -0400525 public = [ "include/ports/SkTypeface_win.h" ]
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500526 sources = [
527 "src/fonts/SkFontMgr_indirect.cpp",
528 "src/ports/SkFontMgr_win_dw.cpp",
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500529 "src/ports/SkScalerContext_win_dw.cpp",
530 "src/ports/SkTypeface_win_dw.cpp",
531 ]
532}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400533optional("fontmgr_win_factory") {
534 enabled = skia_enable_fontmgr_win
535 deps = [ ":fontmgr_win" ]
536 sources = [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
537}
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500538
539optional("fontmgr_win_gdi") {
540 enabled = skia_enable_fontmgr_win_gdi
541
Ben Wagner75626e42020-06-03 13:20:37 -0400542 public = [ "include/ports/SkTypeface_win.h" ]
Mike Kleina01c6b02020-04-01 13:47:34 -0500543 sources = [ "src/ports/SkFontHost_win.cpp" ]
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500544 libs = [ "Gdi32.lib" ]
545}
546
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700547if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400548 executable("sksllex") {
549 sources = [
550 "src/sksl/lex/Main.cpp",
551 "src/sksl/lex/NFA.cpp",
552 "src/sksl/lex/RegexNode.cpp",
553 "src/sksl/lex/RegexParser.cpp",
554 ]
Mike Kleinc0bd9f92019-04-23 12:05:21 -0500555 include_dirs = [ "." ]
Ethan Nicholasca82a922017-09-07 09:39:50 -0400556 }
557
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700558 action("run_sksllex") {
559 script = "gn/run_sksllex.py"
Mike Kleina01c6b02020-04-01 13:47:34 -0500560 deps = [ ":sksllex(//gn/toolchain:$host_toolchain)" ]
561 sources = [ "src/sksl/lex/sksl.lex" ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700562
563 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
564 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
565 outputs = [
Brian Osman1e7d8aa2021-02-18 14:37:29 -0500566 "$target_out_dir/" + rebase_path("src/sksl/SkSLLexer.h", target_out_dir),
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700567 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
568 # confused due to the same file being named by two different paths
569 ]
570 sksllex_path = "$root_out_dir/"
571 sksllex_path += "sksllex"
572 if (host_os == "win") {
573 sksllex_path += ".exe"
574 }
575 args = [
576 rebase_path(sksllex_path),
577 rebase_path("bin/clang-format"),
John Stiles796e7022020-06-11 19:57:22 -0400578 rebase_path("bin/fetch-clang-format"),
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700579 rebase_path("src"),
580 ]
581 }
582} else {
583 group("run_sksllex") {
584 }
585}
586
John Stilesd836f842020-09-14 10:21:44 -0400587# `Compile Processors` and `Compile SkSL Tests` both rely on skslc.
588if (skia_compile_processors || skia_compile_sksl_tests) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400589 executable("skslc") {
Brian Osman8d09d4a2020-11-24 15:51:06 -0500590 defines = [
591 "SKSL_STANDALONE",
Brian Osmand010f652021-02-24 13:59:39 -0500592 "SK_DISABLE_TRACING",
Brian Osman8d09d4a2020-11-24 15:51:06 -0500593 "SK_ENABLE_SPIRV_VALIDATION",
594 ]
Brian Osmana6ca9752020-10-02 13:41:21 -0400595 sources = [
Brian Osman47726a12020-12-17 16:02:08 -0500596 "src/core/SkCpu.cpp",
597 "src/core/SkData.cpp",
598 "src/core/SkHalf.cpp",
Brian Osmana6ca9752020-10-02 13:41:21 -0400599 "src/core/SkMalloc.cpp",
600 "src/core/SkMath.cpp",
John Stiles060503e2020-10-22 15:02:26 -0400601 "src/core/SkSemaphore.cpp",
Brian Osman47726a12020-12-17 16:02:08 -0500602 "src/core/SkStream.cpp",
603 "src/core/SkString.cpp",
Brian Osmane9ad19b2020-12-23 13:31:13 -0500604 "src/core/SkStringUtils.cpp",
John Stiles060503e2020-10-22 15:02:26 -0400605 "src/core/SkThreadID.cpp",
Brian Osman47726a12020-12-17 16:02:08 -0500606 "src/core/SkUtils.cpp",
607 "src/core/SkVM.cpp",
John Stiles23e68662020-10-29 10:17:15 -0400608 "src/gpu/GrBlockAllocator.cpp",
609 "src/gpu/GrMemoryPool.cpp",
Brian Osman62b039b2021-02-08 13:49:53 -0500610 "src/gpu/GrShaderUtils.cpp",
Brian Osmana6ca9752020-10-02 13:41:21 -0400611 "src/ports/SkMemory_malloc.cpp",
Brian Osman47726a12020-12-17 16:02:08 -0500612 "src/ports/SkOSFile_stdio.cpp",
Brian Osmana6ca9752020-10-02 13:41:21 -0400613 "src/sksl/SkSLMain.cpp",
Brian Osman47726a12020-12-17 16:02:08 -0500614 "src/utils/SkUTF.cpp",
Brian Osmana6ca9752020-10-02 13:41:21 -0400615 ]
Brian Osman47726a12020-12-17 16:02:08 -0500616 if (is_win) {
617 sources += [ "src/ports/SkOSFile_win.cpp" ]
618 } else {
619 sources += [ "src/ports/SkOSFile_posix.cpp" ]
620 }
Ethan Nicholas762466e2017-06-29 10:03:38 -0400621 sources += skia_sksl_sources
Brian Osmanfb32ddf2019-06-18 10:14:20 -0400622 sources += skia_sksl_gpu_sources
Mike Kleinc0bd9f92019-04-23 12:05:21 -0500623 include_dirs = [ "." ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400624 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500625 ":run_sksllex",
Stephen White238fc242019-08-26 10:19:23 -0400626 "//third_party/spirv-tools:spvtools",
John Stilesdda1d312020-11-20 16:28:50 -0500627 "//third_party/spirv-tools:spvtools_val",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400628 ]
629 }
630
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400631 skslc_path = "$root_out_dir/"
632 if (host_toolchain != default_toolchain_name) {
633 skslc_path += "$host_toolchain/"
634 }
635 skslc_path += "skslc"
636 if (host_os == "win") {
637 skslc_path += ".exe"
638 }
639
Brian Osmandd496172020-08-08 08:17:18 -0400640 action("create_sksl_fp") {
641 script = "gn/create_sksl_fp.py"
642 sources = [
643 "include/private/GrSharedEnums.h",
644 "src/sksl/sksl_fp_raw.sksl",
645 ]
646 outputs = [ "$root_out_dir/sksl_fp.sksl" ]
647 args = [
648 rebase_path(sources[0]),
649 rebase_path(sources[1]),
650 rebase_path(outputs[0]),
651 ]
652 }
653
654 copy("sksl_pre_includes") {
655 sources = [
656 "src/sksl/sksl_frag.sksl",
657 "src/sksl/sksl_geom.sksl",
658 "src/sksl/sksl_gpu.sksl",
Brian Osmanb06301e2020-11-06 11:45:36 -0500659 "src/sksl/sksl_public.sksl",
Brian Osman91946752020-12-21 13:20:40 -0500660 "src/sksl/sksl_runtime.sksl",
Brian Osmandd496172020-08-08 08:17:18 -0400661 "src/sksl/sksl_vert.sksl",
662 ]
663 outputs = [ "$root_out_dir/{{source_file_part}}" ]
664 }
665
666 dehydrate_sksl_sources = get_target_outputs(":sksl_pre_includes")
667 dehydrate_sksl_sources += get_target_outputs(":create_sksl_fp")
668
669 dehydrate_sksl_outputs = []
670 foreach(src, dehydrate_sksl_sources) {
671 name = get_path_info(src, "name")
672
673 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
674 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
675 dehydrate_sksl_outputs += [ "$target_out_dir/" + rebase_path(
676 "src/sksl/generated/$name.dehydrated.sksl",
677 target_out_dir) ]
678 }
679
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400680 action("dehydrate_sksl") {
681 script = "gn/dehydrate_sksl.py"
Brian Osmandd496172020-08-08 08:17:18 -0400682 deps = [
683 ":create_sksl_fp",
684 ":sksl_pre_includes",
685 ":skslc(//gn/toolchain:$host_toolchain)",
686 ]
687 sources = dehydrate_sksl_sources
688 outputs = dehydrate_sksl_outputs
Brian Osmana5781382020-08-07 21:28:12 +0000689 args = [
690 rebase_path(skslc_path),
Brian Osmandd496172020-08-08 08:17:18 -0400691 rebase_path("src/sksl/generated"),
Brian Osmana5781382020-08-07 21:28:12 +0000692 ]
Brian Osmandd496172020-08-08 08:17:18 -0400693 args += rebase_path(dehydrate_sksl_sources)
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400694 }
John Stilesd836f842020-09-14 10:21:44 -0400695} else {
696 group("dehydrate_sksl") {
697 }
698}
699
700skia_gpu_processor_outputs = []
701if (skia_compile_processors) {
702 foreach(src, skia_gpu_processor_sources) {
703 dir = get_path_info(src, "dir")
704 name = get_path_info(src, "name")
705
706 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
707 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
708 skia_gpu_processor_outputs += [
709 "$target_out_dir/" +
710 rebase_path("$dir/generated/$name.h", target_out_dir),
711 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
712 # confused due to the same file being named by two different paths
713 ]
714 }
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400715
Ethan Nicholas762466e2017-06-29 10:03:38 -0400716 action("compile_processors") {
717 script = "gn/compile_processors.py"
718 deps = [
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400719 ":create_sksl_fp",
Brian Osmandd496172020-08-08 08:17:18 -0400720 ":sksl_pre_includes",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400721 ":skslc(//gn/toolchain:$host_toolchain)",
722 ]
723 sources = skia_gpu_processor_sources
724 outputs = skia_gpu_processor_outputs
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400725 args = [
726 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400727 rebase_path("bin/clang-format"),
John Stiles796e7022020-06-11 19:57:22 -0400728 rebase_path("bin/fetch-clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400729 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400730 args += rebase_path(skia_gpu_processor_sources)
731 }
732} else {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400733 group("compile_processors") {
734 }
John Stilesd836f842020-09-14 10:21:44 -0400735}
736
737if (skia_compile_sksl_tests) {
738 import("gn/sksl_tests.gni")
John Stilesd836f842020-09-14 10:21:44 -0400739
John Stiles7e248712020-09-24 16:42:09 -0400740 template("compile_sksl") {
741 # Compile the passed-in `sources` into `outputs` using skslc, with the given language/settings.
742 action("compile_sksl_${target_name}") {
743 script = "gn/compile_sksl_tests.py"
744 deps = [
745 ":create_sksl_fp",
746 ":sksl_pre_includes",
747 ":skslc(//gn/toolchain:$host_toolchain)",
748 ]
John Stilesda57fc02021-01-22 11:54:30 -0500749 sources = []
John Stiles7e248712020-09-24 16:42:09 -0400750 outputs = []
John Stilesb7f5e1b2021-01-27 14:05:15 -0500751 response_file_contents = []
John Stilesda57fc02021-01-22 11:54:30 -0500752 args = [
753 rebase_path(skslc_path),
754 invoker.lang,
755 invoker.settings,
John Stilesb7f5e1b2021-01-27 14:05:15 -0500756 "{{response_file_name}}",
John Stilesda57fc02021-01-22 11:54:30 -0500757 ]
758
John Stilesbfc9be02021-01-22 11:55:48 -0500759 testsDir = get_path_info("tests", "abspath")
760 resourcesDir = get_path_info("resources", "abspath")
761
762 foreach(partialPath, invoker.sources) {
763 dst = testsDir + partialPath
764 src = resourcesDir + partialPath
765
766 dir = get_path_info(dst, "dir")
767 name = get_path_info(dst, "name")
768 ext = get_path_info(dst, "extension")
John Stilesb7f5e1b2021-01-27 14:05:15 -0500769 response_file_contents += rebase_path([
770 src,
771 dir,
772 ])
John Stilesda57fc02021-01-22 11:54:30 -0500773 sources += [ src ]
John Stilesc3012182020-12-08 15:07:00 -0500774
John Stilesda57fc02021-01-22 11:54:30 -0500775 foreach(outExtension, invoker.outExtensions) {
John Stilesc3012182020-12-08 15:07:00 -0500776 # SPIR-V uses separate extensions for .vert and .geom shaders.
777 if (outExtension == ".asm.frag" && ext == "vert") {
778 outExtension = ".asm.vert"
779 } else if (outExtension == ".asm.frag" && ext == "geom") {
780 outExtension = ".asm.geom"
781 }
John Stilesbfc9be02021-01-22 11:55:48 -0500782 outputs +=
783 [ target_out_dir + "/" +
784 rebase_path(dir + "/" + name + outExtension, target_out_dir) ]
John Stiles7e248712020-09-24 16:42:09 -0400785 }
786 }
John Stiles7e248712020-09-24 16:42:09 -0400787 }
John Stilesd836f842020-09-14 10:21:44 -0400788 }
John Stiles7e248712020-09-24 16:42:09 -0400789 compile_sksl("fp_tests") {
790 sources = sksl_fp_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500791 outExtensions = [
792 ".cpp",
793 ".h",
John Stiles7e248712020-09-24 16:42:09 -0400794 ]
795 lang = "--fp"
796 settings = "--settings"
John Stiles0ed9f312020-09-16 17:46:37 -0400797 }
John Stiles7e248712020-09-24 16:42:09 -0400798 compile_sksl("glsl_tests") {
799 sources = sksl_glsl_tests_sources + sksl_glsl_settings_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500800 outExtensions = [ ".glsl" ]
John Stiles7e248712020-09-24 16:42:09 -0400801 lang = "--glsl"
802 settings = "--settings"
John Stiles0ed9f312020-09-16 17:46:37 -0400803 }
John Stiles7e248712020-09-24 16:42:09 -0400804 compile_sksl("glsl_nosettings_tests") {
John Stiles0ed9f312020-09-16 17:46:37 -0400805 sources = sksl_glsl_settings_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500806 outExtensions = [ "StandaloneSettings.glsl" ]
John Stiles7e248712020-09-24 16:42:09 -0400807 lang = "--glsl"
808 settings = "--nosettings"
John Stilesd836f842020-09-14 10:21:44 -0400809 }
John Stilesaeae3a52020-09-25 13:35:58 -0400810 compile_sksl("metal_tests") {
811 sources = sksl_metal_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500812 outExtensions = [ ".metal" ]
John Stilesaeae3a52020-09-25 13:35:58 -0400813 lang = "--metal"
814 settings = "--settings"
815 }
Brian Osman977feec2020-12-22 11:28:59 -0500816 compile_sksl("skvm_tests") {
817 sources = sksl_skvm_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500818 outExtensions = [ ".skvm" ]
Brian Osman977feec2020-12-22 11:28:59 -0500819 lang = "--skvm"
820 settings = "--settings"
821 }
Brian Osman62b039b2021-02-08 13:49:53 -0500822 compile_sksl("stage_tests") {
823 sources = sksl_stage_tests_sources
824 outExtensions = [ ".stage" ]
825 lang = "--stage"
826 settings = "--settings"
827 }
John Stilesdda1d312020-11-20 16:28:50 -0500828 compile_sksl("spirv_tests") {
829 sources = sksl_spirv_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500830 outExtensions = [ ".asm.frag" ]
John Stilesdda1d312020-11-20 16:28:50 -0500831 lang = "--spirv"
832 settings = "--settings"
833 }
John Stilesd836f842020-09-14 10:21:44 -0400834} else {
John Stiles7e248712020-09-24 16:42:09 -0400835 group("compile_sksl_fp_tests") {
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400836 }
John Stiles7e248712020-09-24 16:42:09 -0400837 group("compile_sksl_glsl_tests") {
838 }
839 group("compile_sksl_glsl_nosettings_tests") {
John Stiles0ed9f312020-09-16 17:46:37 -0400840 }
John Stilesaeae3a52020-09-25 13:35:58 -0400841 group("compile_sksl_metal_tests") {
842 }
Brian Osman977feec2020-12-22 11:28:59 -0500843 group("compile_sksl_skvm_tests") {
844 }
John Stilesdda1d312020-11-20 16:28:50 -0500845 group("compile_sksl_spirv_tests") {
846 }
Ethan Nicholas762466e2017-06-29 10:03:38 -0400847}
848
Ben Wagnere27ee6c2019-02-15 14:59:30 -0500849optional("gpu") {
mtklein06c35c02016-09-20 12:28:12 -0700850 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400851 deps = [
852 ":compile_processors",
John Stiles7e248712020-09-24 16:42:09 -0400853 ":compile_sksl_fp_tests",
854 ":compile_sksl_glsl_nosettings_tests",
855 ":compile_sksl_glsl_tests",
John Stilesaeae3a52020-09-25 13:35:58 -0400856 ":compile_sksl_metal_tests",
Brian Osman977feec2020-12-22 11:28:59 -0500857 ":compile_sksl_skvm_tests",
John Stilesdda1d312020-11-20 16:28:50 -0500858 ":compile_sksl_spirv_tests",
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400859 ":dehydrate_sksl",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700860 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400861 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700862 if (skia_generate_workarounds) {
863 deps += [ ":workaround_list" ]
864 }
John Rosascoa9b348f2019-11-08 13:18:15 -0800865 public_defines = []
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600866 public_configs = []
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400867 public_deps = []
mtkleine9fb3d52016-09-20 15:11:46 -0700868
Brian Osmanfb32ddf2019-06-18 10:14:20 -0400869 sources =
870 skia_gpu_sources + skia_sksl_gpu_sources + skia_gpu_processor_outputs
Kevin Lubick93faa672018-10-10 15:54:53 -0400871 if (!skia_enable_ccpr) {
872 sources -= skia_ccpr_sources
873 sources += [ "src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp" ]
874 }
Kevin Lubick4bf2c262018-10-15 09:35:54 -0400875 if (!skia_enable_nvpr) {
876 sources -= skia_nvpr_sources
877 sources += [ "src/gpu/GrPathRendering_none.cpp" ]
878 }
mtklein06c35c02016-09-20 12:28:12 -0700879
Mike Klein703cf5a2016-10-13 17:18:04 -0400880 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -0400881 frameworks = []
mtkleine9fb3d52016-09-20 15:11:46 -0700882
John Rosascoa9b348f2019-11-08 13:18:15 -0800883 if (skia_use_gl) {
884 public_defines += [ "SK_GL" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400885 if (is_android) {
Brian Salomonbe6de9b2021-02-18 16:23:41 -0500886 sources += [
887 "src/gpu/gl/egl/GrGLMakeEGLInterface.cpp",
888 "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp",
889 ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400890
891 # this lib is required to link against AHardwareBuffer
892 if (defined(ndk_api) && ndk_api >= 26) {
893 libs += [ "android" ]
894 }
895 } else if (skia_use_egl) {
Brian Salomonbe6de9b2021-02-18 16:23:41 -0500896 sources += [
897 "src/gpu/gl/egl/GrGLMakeEGLInterface.cpp",
898 "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp",
899 ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400900 libs += [ "EGL" ]
Kevin Lubick204c3be2020-08-19 14:30:58 -0400901 } else if (skia_use_webgl) {
902 sources += [ "src/gpu/gl/webgl/GrGLMakeNativeInterface_webgl.cpp" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400903 } else if (is_linux && skia_use_x11) {
Brian Salomonbe6de9b2021-02-18 16:23:41 -0500904 sources += [
905 "src/gpu/gl/glx/GrGLMakeGLXInterface.cpp",
906 "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp",
907 ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400908 libs += [ "GL" ]
909 } else if (is_mac) {
910 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
911 } else if (is_ios) {
912 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
James Clarkeb8c0dab2021-02-09 06:22:41 -0800913 } else if (is_win && !skia_enable_winuwp) {
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400914 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
915 if (target_cpu != "arm64") {
916 libs += [ "OpenGL32.lib" ]
917 }
918 } else {
919 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
920 }
John Rosascoa9b348f2019-11-08 13:18:15 -0800921 sources += skia_gl_gpu_sources
922 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400923
mtkleine9fb3d52016-09-20 15:11:46 -0700924 if (skia_use_vulkan) {
Greg Danielda16cce2018-08-01 09:23:57 -0400925 public_defines += [ "SK_VULKAN" ]
Greg Danielb16beb92020-04-27 14:26:21 +0000926 if (skia_use_vma) {
927 deps += [ "third_party/vulkanmemoryallocator" ]
928 }
mtkleine9fb3d52016-09-20 15:11:46 -0700929 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700930 if (skia_enable_vulkan_debug_layers) {
931 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
932 }
Craig Stoutcb6b4bd2018-12-13 10:20:07 -0800933 if (is_fuchsia) {
John Rosascoe57ca492019-11-13 14:30:45 -0800934 if (using_fuchsia_sdk) {
Chinmay Garde89820762019-05-06 16:44:06 -0700935 public_deps += [ "$fuchsia_sdk_root/pkg:vulkan" ]
936 } else {
Brian Osman489cf882019-07-09 10:48:28 -0400937 public_deps += [ "//src/graphics/lib/vulkan" ]
Chinmay Garde89820762019-05-06 16:44:06 -0700938 }
Craig Stoutcb6b4bd2018-12-13 10:20:07 -0800939 }
mtkleine9fb3d52016-09-20 15:11:46 -0700940 }
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400941
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400942 if (is_android && (skia_use_gl || skia_use_vulkan)) {
943 # this lib is required to link against AHardwareBuffer
944 if (defined(ndk_api) && ndk_api >= 26) {
945 libs += [ "android" ]
946 }
947 }
948
Stephen White0d70b712019-07-10 15:51:30 -0400949 if (skia_use_dawn) {
950 public_defines += [ "SK_DAWN" ]
Stephen White985741a2019-07-18 11:43:45 -0400951 sources += skia_dawn_sources
Zhenyao Mo4f17b602020-04-13 15:26:17 -0700952 public_deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen Whitefbffb992019-10-17 10:32:40 -0400953 deps += [
Zhenyao Mo4f17b602020-04-13 15:26:17 -0700954 "//third_party/externals/dawn/src/dawn:dawn_proc",
955 "//third_party/externals/dawn/src/dawn:dawncpp",
956 "//third_party/externals/dawn/src/dawn_native",
Stephen White0d70b712019-07-10 15:51:30 -0400957 ]
958 if (dawn_enable_d3d12) {
959 libs += [
960 "d3d12.lib",
961 "dxgi.lib",
962 "d3dcompiler.lib",
963 ]
964 } else if (dawn_enable_metal) {
Jim Van Verthef820be2020-08-12 10:45:00 -0400965 frameworks += [ "Metal.framework" ]
Stephen White0d70b712019-07-10 15:51:30 -0400966 }
967 }
968
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500969 if (skia_use_direct3d) {
970 public_defines += [ "SK_DIRECT3D" ]
Jim Van Verth1b89eb72020-09-23 16:29:51 -0400971 deps += [
972 "//third_party/d3d12allocator",
973 "//third_party/spirv-cross:spirv_cross",
974 ]
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500975 sources += skia_direct3d_sources
Jim Van Verth03b8ab22020-02-24 11:36:15 -0500976 if (skia_enable_direct3d_debug_layer) {
977 public_defines += [ "SK_ENABLE_D3D_DEBUG_LAYER" ]
978 }
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500979 libs += [
980 "d3d12.lib",
981 "dxgi.lib",
982 "d3dcompiler.lib",
983 ]
984 }
985
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400986 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400987 if (skia_use_metal) {
988 public_defines += [ "SK_METAL" ]
989 sources += skia_metal_sources
Jim Van Verthef820be2020-08-12 10:45:00 -0400990 frameworks += [ "Metal.framework" ]
Jim Van Verthef820be2020-08-12 10:45:00 -0400991 frameworks += [ "Foundation.framework" ]
Jim Van Verth36b86af2020-08-24 17:16:46 +0000992 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400993 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500994
Kevin Lubickf4def342018-10-04 12:52:50 -0400995 if (is_debug) {
996 public_defines += [ "SK_ENABLE_DUMP_GPU" ]
997 }
mtklein06c35c02016-09-20 12:28:12 -0700998}
999
Leon Scroggins III41169202019-01-29 09:29:57 -05001000optional("gif") {
Hal Canary2dad9902019-11-20 16:01:31 -05001001 enabled = !skia_use_wuffs && skia_use_libgifcodec
Hal Canary1ec9a282019-11-21 10:15:50 -05001002 _libgifcodec_gni_path = "third_party/externals/libgifcodec/libgifcodec.gni"
1003 if ("True" ==
1004 exec_script("gn/checkpath.py",
1005 [ rebase_path(_libgifcodec_gni_path, root_build_dir) ],
1006 "trim string")) {
1007 public_defines = [ "SK_USE_LIBGIFCODEC" ]
1008 public_include_dirs = [
1009 ".",
1010 skia_libgifcodec_path,
1011 ]
1012 include_dirs = public_include_dirs
1013 import(_libgifcodec_gni_path)
1014 sources = rebase_path(libgifcodec_sources + libgifcodec_public,
1015 ".",
1016 skia_libgifcodec_path)
1017 }
Leon Scroggins III41169202019-01-29 09:29:57 -05001018}
1019
Leon Scroggins III04be2b52017-08-17 15:13:20 -04001020optional("heif") {
1021 enabled = skia_use_libheif
1022 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
1023
1024 deps = []
1025
Mike Kleina01c6b02020-04-01 13:47:34 -05001026 sources = [ "src/codec/SkHeifCodec.cpp" ]
Leon Scroggins III04be2b52017-08-17 15:13:20 -04001027}
1028
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001029optional("jpeg_decode") {
1030 enabled = skia_use_libjpeg_turbo_decode
1031 public_defines = [ "SK_CODEC_DECODES_JPEG" ]
1032
Mike Kleina01c6b02020-04-01 13:47:34 -05001033 deps = [ "//third_party/libjpeg-turbo:libjpeg" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001034 sources = [
1035 "src/codec/SkJpegCodec.cpp",
1036 "src/codec/SkJpegDecoderMgr.cpp",
1037 "src/codec/SkJpegUtility.cpp",
1038 ]
1039}
1040
1041optional("jpeg_encode") {
1042 enabled = skia_use_libjpeg_turbo_encode
1043 public_defines = [ "SK_ENCODE_JPEG" ]
mtklein63213812016-08-24 09:55:56 -07001044
Mike Kleina01c6b02020-04-01 13:47:34 -05001045 deps = [ "//third_party/libjpeg-turbo:libjpeg" ]
1046 public = [ "include/encode/SkJpegEncoder.h" ]
mtklein63213812016-08-24 09:55:56 -07001047 sources = [
mtklein63213812016-08-24 09:55:56 -07001048 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -04001049 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -07001050 ]
1051}
1052
Leon Scroggins III326b9892020-08-05 16:51:10 -04001053optional("ndk_images") {
1054 enabled = skia_use_ndk_images
1055 public_defines = [ "SK_ENABLE_NDK_IMAGES" ]
1056 sources = [
1057 "src/ports/SkImageEncoder_NDK.cpp",
1058 "src/ports/SkImageGeneratorNDK.cpp",
1059 "src/ports/SkNDKConversions.cpp",
1060 ]
Leon Scroggins IIIf21d6b92020-08-05 10:44:17 -04001061 libs = [ "jnigraphics" ]
1062}
1063
mtklein63213812016-08-24 09:55:56 -07001064optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -05001065 enabled = skia_use_zlib && skia_enable_pdf
1066 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -07001067
Mike Kleina01c6b02020-04-01 13:47:34 -05001068 deps = [ "//third_party/zlib" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001069 if (skia_use_libjpeg_turbo_decode) {
1070 deps += [ ":jpeg_decode" ]
1071 }
1072 if (skia_use_libjpeg_turbo_encode) {
1073 deps += [ ":jpeg_encode" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -04001074 }
Robert Phillips9b00f1f2020-03-24 12:29:44 -04001075 public = skia_pdf_public
brettwb9447282016-09-01 14:24:39 -07001076 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -07001077 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
Hal Canary2a3093c2019-02-20 11:25:45 -05001078 if (skia_use_icu && skia_use_harfbuzz && skia_pdf_subset_harfbuzz) {
1079 deps += [ "//third_party/harfbuzz" ]
1080 defines = [ "SK_PDF_USE_HARFBUZZ_SUBSET" ]
1081 } else if (skia_use_icu && skia_use_sfntly) {
mtklein63213812016-08-24 09:55:56 -07001082 deps += [ "//third_party/sfntly" ]
Hal Canary32498f02019-02-04 15:36:31 -05001083 defines = [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -07001084 }
1085}
1086
Robert Phillips9b00f1f2020-03-24 12:29:44 -04001087optional("xps") {
1088 enabled = skia_use_xps && is_win
1089 public_defines = [ "SK_SUPPORT_XPS" ]
1090 public = skia_xps_public
1091 sources = skia_xps_sources
1092}
1093
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001094optional("png_decode") {
1095 enabled = skia_use_libpng_decode
1096 public_defines = [ "SK_CODEC_DECODES_PNG" ]
mtklein63213812016-08-24 09:55:56 -07001097
Mike Kleina01c6b02020-04-01 13:47:34 -05001098 deps = [ "//third_party/libpng" ]
mtklein63213812016-08-24 09:55:56 -07001099 sources = [
1100 "src/codec/SkIcoCodec.cpp",
1101 "src/codec/SkPngCodec.cpp",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001102 ]
1103}
1104
1105optional("png_encode") {
1106 enabled = skia_use_libpng_encode
1107 public_defines = [ "SK_ENCODE_PNG" ]
1108
Mike Kleina01c6b02020-04-01 13:47:34 -05001109 deps = [ "//third_party/libpng" ]
1110 sources = [ "src/images/SkPngEncoder.cpp" ]
mtklein63213812016-08-24 09:55:56 -07001111}
1112
scroggof84ad642016-10-31 09:02:57 -07001113optional("raw") {
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001114 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo_decode && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -07001115 public_defines = [ "SK_CODEC_DECODES_RAW" ]
1116
1117 deps = [
1118 "//third_party/dng_sdk",
1119 "//third_party/libjpeg-turbo:libjpeg",
1120 "//third_party/piex",
1121 ]
1122
1123 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
1124 # Skia.
1125 configs_to_remove = [ "//gn:no_exceptions" ]
1126
Mike Kleina01c6b02020-04-01 13:47:34 -05001127 sources = [ "src/codec/SkRawCodec.cpp" ]
scroggof84ad642016-10-31 09:02:57 -07001128}
1129
Mike Klein852a8cb2018-05-15 10:46:58 -04001130import("third_party/skcms/skcms.gni")
Brian Osman8dc68c62018-05-30 12:57:45 -04001131source_set("skcms") {
Mike Klein852a8cb2018-05-15 10:46:58 -04001132 cflags = []
1133 if (!is_win || is_clang) {
1134 cflags += [
1135 "-w",
1136 "-std=c11",
1137 ]
1138 }
1139
Mike Kleina01c6b02020-04-01 13:47:34 -05001140 public = [ "include/third_party/skcms/skcms.h" ]
Brian Osmanea236bf2019-04-29 10:28:22 -04001141 include_dirs = [ "include/third_party/skcms" ]
Mike Klein852a8cb2018-05-15 10:46:58 -04001142 sources = rebase_path(skcms_sources, ".", "third_party/skcms")
1143}
1144
mtklein3cc22182016-08-29 13:26:14 -07001145optional("typeface_freetype") {
1146 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -07001147
Mike Kleina01c6b02020-04-01 13:47:34 -05001148 deps = [ "//third_party/freetype2" ]
mtklein3cc22182016-08-29 13:26:14 -07001149 sources = [
1150 "src/ports/SkFontHost_FreeType.cpp",
1151 "src/ports/SkFontHost_FreeType_common.cpp",
Ben Wagner9d5c55c2020-06-27 12:52:14 -04001152 "src/ports/SkFontHost_FreeType_common.h",
mtklein3cc22182016-08-29 13:26:14 -07001153 ]
1154}
1155
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001156optional("webp_decode") {
1157 enabled = skia_use_libwebp_decode
1158 public_defines = [ "SK_CODEC_DECODES_WEBP" ]
mtklein457b42a2016-08-23 13:56:37 -07001159
Mike Kleina01c6b02020-04-01 13:47:34 -05001160 deps = [ "//third_party/libwebp" ]
1161 sources = [ "src/codec/SkWebpCodec.cpp" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001162}
1163
1164optional("webp_encode") {
1165 enabled = skia_use_libwebp_encode
1166 public_defines = [ "SK_ENCODE_WEBP" ]
1167
Mike Kleina01c6b02020-04-01 13:47:34 -05001168 deps = [ "//third_party/libwebp" ]
1169 sources = [ "src/images/SkWebpEncoder.cpp" ]
mtkleineb3c4252016-08-23 07:38:09 -07001170}
1171
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001172optional("wuffs") {
1173 enabled = skia_use_wuffs
Nigel Tao5cfa7192020-08-17 21:14:13 +10001174 public_defines = [ "SK_HAS_WUFFS_LIBRARY" ]
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001175
Mike Kleina01c6b02020-04-01 13:47:34 -05001176 deps = [ "//third_party/wuffs" ]
1177 sources = [ "src/codec/SkWuffsCodec.cpp" ]
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001178}
1179
mtklein63213812016-08-24 09:55:56 -07001180optional("xml") {
1181 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +00001182 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -07001183
Mike Kleina01c6b02020-04-01 13:47:34 -05001184 deps = [ "//third_party/expat" ]
mtklein63213812016-08-24 09:55:56 -07001185 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -05001186 "src/svg/SkSVGCanvas.cpp",
1187 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -07001188 "src/xml/SkDOM.cpp",
1189 "src/xml/SkXMLParser.cpp",
1190 "src/xml/SkXMLWriter.cpp",
1191 ]
1192}
1193
Mike Klein613ad382019-06-06 11:42:02 -05001194optional("skvm_jit") {
Mike Klein13ec5442020-08-14 07:36:54 -05001195 enabled = skia_enable_skvm_jit_when_possible
1196 public_defines = [ "SKVM_JIT_WHEN_POSSIBLE" ]
Mike Klein2b54e832020-07-10 12:56:07 -05001197 if (skia_vtune_path != "") {
1198 public_defines += [ "SKVM_JIT_VTUNE" ]
1199 public_include_dirs = [ "$skia_vtune_path/include" ]
1200 libs = [ "$skia_vtune_path/lib64/jitprofiling.lib" ]
1201 }
Mike Klein613ad382019-06-06 11:42:02 -05001202}
1203
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001204if (skia_enable_gpu && skia_generate_workarounds) {
1205 action("workaround_list") {
1206 script = "tools/build_workaround_header.py"
1207
Mike Kleina01c6b02020-04-01 13:47:34 -05001208 inputs = [ "src/gpu/gpu_workaround_list.txt" ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001209
1210 # see comments in skia_compile_processors about out dir path shenanigans.
1211 output_file =
Adrienne Walkerab7181d2018-05-14 14:02:03 -07001212 rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001213
Mike Kleina01c6b02020-04-01 13:47:34 -05001214 outputs = [ "$root_out_dir/$output_file" ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001215 args = [
1216 "--output-file",
1217 "$output_file",
1218 ]
1219
1220 foreach(file, inputs) {
1221 args += [ rebase_path(file, root_build_dir) ]
1222 }
1223 }
1224}
1225
mtkleinc04ff472016-06-23 10:29:30 -07001226component("skia") {
1227 public_configs = [ ":skia_public" ]
1228 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -07001229
Mike Klein607b0a72018-11-07 16:17:34 -05001230 public_deps = [
Ben Wagner32d5cfa2020-06-11 14:41:47 -04001231 ":fontmgr_FontConfigInterface",
1232 ":fontmgr_android",
1233 ":fontmgr_custom_directory",
1234 ":fontmgr_custom_embedded",
1235 ":fontmgr_custom_empty",
1236 ":fontmgr_fontconfig",
1237 ":fontmgr_fuchsia",
1238 ":fontmgr_mac_ct",
1239 ":fontmgr_win",
1240 ":fontmgr_win_gdi",
Ben Wagnere27ee6c2019-02-15 14:59:30 -05001241 ":gpu",
Mike Klein607b0a72018-11-07 16:17:34 -05001242 ":pdf",
1243 ":skcms",
Robert Phillips9b00f1f2020-03-24 12:29:44 -04001244 ":xps",
Mike Klein607b0a72018-11-07 16:17:34 -05001245 ]
1246
mtkleinc04ff472016-06-23 10:29:30 -07001247 deps = [
Leon Scroggins III63cfb362020-04-24 13:00:48 -04001248 ":android_utils",
anmittalb8b3f712016-08-25 04:55:19 -07001249 ":arm64",
1250 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -07001251 ":avx",
Mike Klein54378232018-11-08 12:08:05 +00001252 ":compile_processors",
anmittalb8b3f712016-08-25 04:55:19 -07001253 ":crc32",
Ethan Nicholasc18bb512020-07-28 14:46:53 -04001254 ":dehydrate_sksl",
Ben Wagner75626e42020-06-03 13:20:37 -04001255 ":fontmgr_factory",
Leon Scroggins III41169202019-01-29 09:29:57 -05001256 ":gif",
Leon Scroggins III04be2b52017-08-17 15:13:20 -04001257 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -05001258 ":hsw",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001259 ":jpeg_decode",
1260 ":jpeg_encode",
Leon Scroggins III326b9892020-08-05 16:51:10 -04001261 ":ndk_images",
mtklein9b8583d2016-08-24 17:32:30 -07001262 ":none",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001263 ":png_decode",
1264 ":png_encode",
scroggof84ad642016-10-31 09:02:57 -07001265 ":raw",
Mike Klein613ad382019-06-06 11:42:02 -05001266 ":skvm_jit",
Mike Kleina9026da2020-06-05 08:57:05 -05001267 ":skx",
mtklein9b8583d2016-08-24 17:32:30 -07001268 ":sse2",
1269 ":sse41",
1270 ":sse42",
1271 ":ssse3",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001272 ":webp_decode",
1273 ":webp_encode",
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001274 ":wuffs",
mtklein63213812016-08-24 09:55:56 -07001275 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -07001276 ]
1277
Hal Canaryc25f4e92019-02-26 11:54:25 -05001278 public = skia_core_public
1279 public += skia_utils_public
1280 public += skia_effects_public
1281 public += skia_effects_imagefilter_public
Hal Canaryc25f4e92019-02-26 11:54:25 -05001282
mtkleinc04ff472016-06-23 10:29:30 -07001283 sources = []
brettwb9447282016-09-01 14:24:39 -07001284 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -07001285 sources += skia_utils_sources
Mike Klein54378232018-11-08 12:08:05 +00001286 sources += skia_effects_sources
1287 sources += skia_effects_imagefilter_sources
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001288 sources += skia_sksl_sources
mtkleinc04ff472016-06-23 10:29:30 -07001289 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -04001290 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -05001291 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -07001292 "src/codec/SkAndroidCodec.cpp",
Nigel Tao612a65d2018-11-09 10:10:31 +11001293 "src/codec/SkAndroidCodecAdapter.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -04001294 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001295 "src/codec/SkBmpCodec.cpp",
1296 "src/codec/SkBmpMaskCodec.cpp",
1297 "src/codec/SkBmpRLECodec.cpp",
1298 "src/codec/SkBmpStandardCodec.cpp",
1299 "src/codec/SkCodec.cpp",
1300 "src/codec/SkCodecImageGenerator.cpp",
Leon Scroggins III22f673d2018-05-30 15:33:46 -04001301 "src/codec/SkColorTable.cpp",
Leon Scroggins III36f7e322018-08-27 11:55:46 -04001302 "src/codec/SkEncodedInfo.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001303 "src/codec/SkMaskSwizzler.cpp",
1304 "src/codec/SkMasks.cpp",
Leon Scroggins IIIba458302019-09-24 12:40:11 -04001305 "src/codec/SkParseEncodedOrigin.cpp",
mtklein25c81d42016-07-27 13:55:26 -07001306 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001307 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -07001308 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001309 "src/codec/SkSwizzler.cpp",
1310 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001311 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001312 "src/ports/SkDiscardableMemory_none.cpp",
Mike Klein54378232018-11-08 12:08:05 +00001313 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001314 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001315 "src/ports/SkMemory_malloc.cpp",
1316 "src/ports/SkOSFile_stdio.cpp",
1317 "src/sfnt/SkOTTable_name.cpp",
1318 "src/sfnt/SkOTUtils.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001319 ]
brettwb9447282016-09-01 14:24:39 -07001320
Leon Scroggins1340dbd2020-11-09 14:18:12 -05001321 defines = [ "SK_HAS_ANDROID_CODEC" ]
mtklein7d6fb2c2016-08-25 14:50:44 -07001322 libs = []
1323
mtkleinc04ff472016-06-23 10:29:30 -07001324 if (is_win) {
1325 sources += [
1326 "src/ports/SkDebug_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001327 "src/ports/SkImageEncoder_WIC.cpp",
1328 "src/ports/SkImageGeneratorWIC.cpp",
1329 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -07001330 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001331 ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001332 libs += [
Mike Klein4b167fc2016-10-11 18:13:53 -04001333 "Ole32.lib",
1334 "OleAut32.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -04001335 ]
James Clarkeb8c0dab2021-02-09 06:22:41 -08001336
1337 if (!skia_enable_winuwp) {
1338 libs += [
1339 "FontSub.lib",
1340 "User32.lib",
1341 "Usp10.lib",
1342 ]
1343 }
mtkleinc04ff472016-06-23 10:29:30 -07001344 } else {
1345 sources += [
mtkleinc04ff472016-06-23 10:29:30 -07001346 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -07001347 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001348 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -04001349 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -07001350 }
1351
mtklein7d6fb2c2016-08-25 14:50:44 -07001352 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -05001353 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -05001354 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -05001355 deps += [ "//third_party/cpu-features" ]
1356 }
mtklein06c35c02016-09-20 12:28:12 -07001357 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -07001358 libs += [
1359 "EGL",
1360 "GLESv2",
1361 "log",
1362 ]
1363 }
1364
Kevin Lubick217056c2018-09-20 17:39:31 -04001365 if (is_linux || target_cpu == "wasm") {
mtklein06c35c02016-09-20 12:28:12 -07001366 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -04001367 if (skia_use_egl) {
1368 libs += [ "GLESv2" ]
1369 }
mtkleinc04ff472016-06-23 10:29:30 -07001370 }
1371
1372 if (is_mac) {
1373 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -07001374 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001375 "src/ports/SkImageEncoder_CG.cpp",
1376 "src/ports/SkImageGeneratorCG.cpp",
1377 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001378 frameworks = [
mtklein09e61f72016-08-23 13:35:28 -07001379 "ApplicationServices.framework",
1380 "OpenGL.framework",
1381 ]
mtkleinc04ff472016-06-23 10:29:30 -07001382 }
abarth6fc8ff02016-07-15 15:15:15 -07001383
Mike Klein7d302882016-11-03 14:06:31 -04001384 if (is_ios) {
1385 sources += [
1386 "src/ports/SkDebug_stdio.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001387 "src/ports/SkImageEncoder_CG.cpp",
1388 "src/ports/SkImageGeneratorCG.cpp",
1389 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001390 frameworks = [
Mike Klein7d302882016-11-03 14:06:31 -04001391 "CoreFoundation.framework",
Mike Klein7d302882016-11-03 14:06:31 -04001392 "ImageIO.framework",
1393 "MobileCoreServices.framework",
1394 ]
1395 }
1396
abarth6fc8ff02016-07-15 15:15:15 -07001397 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -07001398 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -07001399 }
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001400
1401 if (skia_enable_spirv_validation) {
Stephen White238fc242019-08-26 10:19:23 -04001402 deps += [ "//third_party/spirv-tools:spvtools_val" ]
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001403 defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
1404 }
Nathaniel Nifong0c4fbf12019-06-25 15:48:47 -04001405
1406 if (skia_include_multiframe_procs) {
1407 sources += [ "tools/SkSharingProc.cpp" ]
1408 }
mtkleinc04ff472016-06-23 10:29:30 -07001409}
1410
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001411# DebugCanvas used in experimental/wasm-skp-debugger
1412if (target_cpu == "wasm") {
1413 static_library("debugcanvas") {
1414 public_configs = [ ":skia_public" ]
1415
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001416 sources = [
Nathaniel Nifong0426c382019-06-21 11:09:19 -04001417 "tools/SkSharingProc.cpp",
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001418 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05001419 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05001420 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05001421 "tools/debugger/DrawCommand.cpp",
1422 "tools/debugger/JsonWriteBuffer.cpp",
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001423 ]
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001424 }
1425}
1426
Kevin Lubickcbcff382018-10-02 09:02:18 -04001427static_library("pathkit") {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001428 check_includes = false
Kevin Lubickcbcff382018-10-02 09:02:18 -04001429 public_configs = [ ":skia_public" ]
1430 configs += skia_library_configs
1431
1432 deps = [
1433 ":arm64",
1434 ":armv7",
1435 ":avx",
1436 ":crc32",
1437 ":hsw",
1438 ":none",
1439 ":sse2",
1440 ":sse41",
1441 ":sse42",
1442 ":ssse3",
1443 ]
1444
Kevin Lubickcbcff382018-10-02 09:02:18 -04001445 sources = []
1446 sources += skia_pathops_sources
Hal Canaryc25f4e92019-02-26 11:54:25 -05001447 sources += skia_pathops_public
Kevin Lubickcbcff382018-10-02 09:02:18 -04001448 sources += [
1449 "src/core/SkAnalyticEdge.cpp",
1450 "src/core/SkArenaAlloc.cpp",
Mike Reedcc88f3a2019-02-06 11:40:27 -05001451 "src/core/SkContourMeasure.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001452 "src/core/SkCubicMap.cpp",
1453 "src/core/SkEdge.cpp",
1454 "src/core/SkEdgeBuilder.cpp",
1455 "src/core/SkEdgeClipper.cpp",
1456 "src/core/SkGeometry.cpp",
Brian Salomon71fe9452020-03-02 16:59:40 -05001457 "src/core/SkIDChangeListener.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001458 "src/core/SkLineClipper.cpp",
Hal Canary7823aeb2019-10-30 17:26:45 -04001459 "src/core/SkMalloc.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001460 "src/core/SkMallocPixelRef.cpp",
1461 "src/core/SkMath.cpp",
1462 "src/core/SkMatrix.cpp",
1463 "src/core/SkOpts.cpp",
1464 "src/core/SkPaint.cpp",
1465 "src/core/SkPath.cpp",
Mike Reed06d7c9d2020-08-26 12:56:51 -04001466 "src/core/SkPathBuilder.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001467 "src/core/SkPathEffect.cpp",
1468 "src/core/SkPathMeasure.cpp",
1469 "src/core/SkPathRef.cpp",
1470 "src/core/SkPoint.cpp",
1471 "src/core/SkRRect.cpp",
Mike Klein45f36b52020-06-08 14:10:29 -05001472 "src/core/SkReadBuffer.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001473 "src/core/SkRect.cpp",
1474 "src/core/SkSemaphore.cpp",
1475 "src/core/SkStream.cpp",
1476 "src/core/SkString.cpp",
1477 "src/core/SkStringUtils.cpp",
1478 "src/core/SkStroke.cpp",
1479 "src/core/SkStrokeRec.cpp",
1480 "src/core/SkStrokerPriv.cpp",
1481 "src/core/SkThreadID.cpp",
1482 "src/core/SkUtils.cpp",
1483 "src/effects/SkDashPathEffect.cpp",
1484 "src/effects/SkTrimPathEffect.cpp",
1485 "src/ports/SkDebug_stdio.cpp",
1486 "src/ports/SkMemory_malloc.cpp",
1487 "src/utils/SkDashPath.cpp",
1488 "src/utils/SkParse.cpp",
1489 "src/utils/SkParsePath.cpp",
1490 "src/utils/SkUTF.cpp",
1491 ]
1492}
1493
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001494group("modules") {
1495 deps = [
Kevin Lubick96634842019-03-05 14:09:24 -05001496 "modules/particles",
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001497 "modules/skottie",
Mike Reed63559a52020-06-02 11:34:24 -04001498 "modules/skparagraph",
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001499 "modules/skshaper",
1500 ]
1501}
1502
Brian Osmancd28fa62020-07-07 16:01:26 -04001503config("our_vulkan_headers") {
1504 include_dirs = [ "include/third_party/vulkan" ]
1505}
1506
mtkleinc095df52016-08-24 12:23:52 -07001507# Targets guarded by skia_enable_tools may use //third_party freely.
1508if (skia_enable_tools) {
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001509 skia_public_includes = [
Leon Scroggins III63cfb362020-04-24 13:00:48 -04001510 "client_utils/android",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001511 "include/android",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001512 "include/c",
1513 "include/codec",
1514 "include/config",
1515 "include/core",
1516 "include/docs",
1517 "include/effects",
1518 "include/encode",
1519 "include/gpu",
1520 "include/pathops",
1521 "include/ports",
1522 "include/svg",
1523 "include/utils",
1524 "include/utils/mac",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001525 "modules/particles/include",
1526 "modules/skottie/include",
Julia Lavrova70258c72020-07-15 11:28:57 -04001527 "modules/skparagraph/include",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001528 "modules/skshaper/include",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001529 "modules/svg/include",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001530 ]
1531
Mike Klein308b5ac2016-12-06 16:03:52 -05001532 # Used by gn_to_bp.py to list our public include dirs.
1533 source_set("public") {
1534 configs += [ ":skia_public" ]
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001535 include_dirs = skia_public_includes
Mike Klein308b5ac2016-12-06 16:03:52 -05001536 }
1537
Mike Kleinc36dedf2016-11-18 09:35:28 -05001538 config("skia.h_config") {
1539 include_dirs = [ "$target_gen_dir" ]
1540 }
1541 action("skia.h") {
1542 public_configs = [ ":skia.h_config" ]
1543 skia_h = "$target_gen_dir/skia.h"
1544 script = "gn/find_headers.py"
Florin Malita6e4d95f2018-05-30 09:27:32 -04001545
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001546 args = [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
1547 [ rebase_path(skia_h, root_build_dir) ] +
1548 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001549 depfile = "$skia_h.deps"
Mike Kleina01c6b02020-04-01 13:47:34 -05001550 outputs = [ skia_h ]
Mike Kleinc36dedf2016-11-18 09:35:28 -05001551 }
1552
Brian Osmanc9a42472018-05-31 13:17:12 -04001553 if (target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001554 executable("fiddle") {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001555 check_includes = false
Mike Kleinc36dedf2016-11-18 09:35:28 -05001556 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001557 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001558 "tools/fiddle/draw.cpp",
1559 "tools/fiddle/fiddle_main.cpp",
1560 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001561
1562 if (skia_use_egl) {
1563 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001564 } else {
1565 sources += [ "tools/fiddle/null_context.cpp" ]
1566 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001567 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001568 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001569 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001570 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001571 ":skia",
1572 ":skia.h",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001573 "modules/particles",
Florin Malita6e4d95f2018-05-30 09:27:32 -04001574 "modules/skottie",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001575 "modules/skparagraph",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04001576 "modules/skshaper",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001577 "modules/svg",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001578 ]
1579 }
1580 }
1581
Mike Kleine5463e62020-06-11 13:53:53 -05001582 config("cpp14") {
1583 if (is_win) {
1584 cflags_cc = [ "/std:c++14" ]
1585 } else {
1586 cflags_cc = [ "-std=c++14" ]
1587 }
1588 }
1589
Brian Osmanc9a42472018-05-31 13:17:12 -04001590 source_set("public_headers_warnings_check") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001591 sources = [ "tools/public_headers_warnings_check.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001592 configs -= [ "//gn:warnings_except_public_headers" ]
Mike Kleine5463e62020-06-11 13:53:53 -05001593 configs += [
1594 ":our_vulkan_headers",
1595 ":cpp14",
1596 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001597 deps = [
1598 ":skia",
1599 ":skia.h",
1600 "modules/skottie",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04001601 "modules/skshaper",
Brian Osmanc9a42472018-05-31 13:17:12 -04001602 ]
Stephen White0d70b712019-07-10 15:51:30 -04001603
1604 if (skia_use_dawn) {
Zhenyao Mo4f17b602020-04-13 15:26:17 -07001605 deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen White0d70b712019-07-10 15:51:30 -04001606 }
Mike Kleinc36dedf2016-11-18 09:35:28 -05001607 }
1608
mtkleinc095df52016-08-24 12:23:52 -07001609 template("test_lib") {
1610 config(target_name + "_config") {
mtkleina627b5c2016-09-20 13:36:47 -07001611 if (defined(invoker.public_defines)) {
1612 defines = invoker.public_defines
1613 }
mtklein25c81d42016-07-27 13:55:26 -07001614 }
mtkleinc095df52016-08-24 12:23:52 -07001615 source_set(target_name) {
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001616 forward_variables_from(invoker, "*", [])
Hal Canaryc25f4e92019-02-26 11:54:25 -05001617 check_includes = false
mtkleinc095df52016-08-24 12:23:52 -07001618 public_configs = [
1619 ":" + target_name + "_config",
1620 ":skia_private",
1621 ]
1622
1623 if (!defined(deps)) {
1624 deps = []
1625 }
1626 deps += [ ":skia" ]
1627 testonly = true
1628 }
mtklein25c81d42016-07-27 13:55:26 -07001629 }
mtklein25c81d42016-07-27 13:55:26 -07001630
Mike Kleine6682eb2017-01-05 10:54:57 -05001631 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001632 if (is_ios) {
Hal Canary3388c1a2019-09-16 12:53:17 -04001633 ios_app_bundle(target_name) {
Jim Van Verth443a9132017-11-28 09:45:26 -05001634 forward_variables_from(invoker,
1635 "*",
1636 [
1637 "output_name",
1638 "visibility",
1639 "is_shared_library",
1640 ])
Mike Kleine6682eb2017-01-05 10:54:57 -05001641 testonly = true
Hal Canary3388c1a2019-09-16 12:53:17 -04001642 extra_configs = [ ":skia_private" ]
1643 launchscreen = "platform_tools/ios/app/LaunchScreen.storyboard"
1644 data_sources = [ "resources" ]
1645 if ("True" == exec_script("//gn/checkdir.py",
1646 [ rebase_path("skps", root_build_dir) ],
1647 "trim string")) {
1648 data_sources += [ "skps" ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001649 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001650 }
1651 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001652 # !is_ios
1653
Jim Van Verth92411c72020-04-03 15:18:31 -04001654 output_dir = root_build_dir
Jim Van Verth443a9132017-11-28 09:45:26 -05001655 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1656 shared_library("lib" + target_name) {
1657 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1658 configs += [ ":skia_private" ]
1659 testonly = true
1660 }
1661 } else {
1662 _executable = target_name
1663 executable(_executable) {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001664 check_includes = false
Jim Van Verth443a9132017-11-28 09:45:26 -05001665 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1666 configs += [ ":skia_private" ]
1667 testonly = true
1668 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001669 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001670 if (is_android && skia_android_serial != "" && defined(_executable)) {
1671 action("push_" + target_name) {
1672 script = "gn/push_to_android.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05001673 deps = [ ":" + _executable ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001674 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
Mike Kleina01c6b02020-04-01 13:47:34 -05001675 outputs = [ _stamp ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001676 args = [
1677 rebase_path("$root_build_dir/$_executable"),
1678 skia_android_serial,
1679 rebase_path(_stamp),
1680 ]
1681 testonly = true
1682 }
Mike Klein7d921032017-01-05 12:20:41 -05001683 }
1684 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001685 }
1686
mtkleinc095df52016-08-24 12:23:52 -07001687 test_lib("gpu_tool_utils") {
Brian Osmanc9a42472018-05-31 13:17:12 -04001688 public_defines = []
mtkleind68f9b02016-09-23 13:18:41 -07001689
Mike Klein9e25bb92019-04-29 09:46:36 -05001690 # Bots and even devs may not have Vulkan headers, so put
1691 # include/third_party/vulkan on our path so they're always available.
1692 all_dependent_configs = [ ":our_vulkan_headers" ]
1693
Mike Klein333fb452019-04-24 08:48:11 -05001694 defines = []
1695 if (skia_enable_discrete_gpu) {
1696 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
1697 }
1698
Brian Osmanc9a42472018-05-31 13:17:12 -04001699 deps = []
Greg Danielda16cce2018-08-01 09:23:57 -04001700 public_deps = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001701 sources = [
Brian Salomon72c7b982020-10-06 10:07:38 -04001702 "tools/gpu/BackendSurfaceFactory.cpp",
1703 "tools/gpu/BackendSurfaceFactory.h",
Brian Salomon63a0a752020-06-26 13:32:09 -04001704 "tools/gpu/BackendTextureImageFactory.cpp",
1705 "tools/gpu/BackendTextureImageFactory.h",
Robert Phillips00f78de2020-07-01 16:09:43 -04001706 "tools/gpu/FlushFinishTracker.cpp",
1707 "tools/gpu/FlushFinishTracker.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001708 "tools/gpu/GrContextFactory.cpp",
1709 "tools/gpu/GrTest.cpp",
Brian Salomonf9b00422020-10-08 16:00:14 -04001710 "tools/gpu/ManagedBackendTexture.cpp",
1711 "tools/gpu/ManagedBackendTexture.h",
Brian Salomon00a5eb82018-07-11 15:32:05 -04001712 "tools/gpu/MemoryCache.cpp",
1713 "tools/gpu/MemoryCache.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001714 "tools/gpu/ProxyUtils.cpp",
1715 "tools/gpu/TestContext.cpp",
Brian Salomone21af502019-11-22 16:56:36 -05001716 "tools/gpu/TestOps.cpp",
1717 "tools/gpu/TestOps.h",
Michael Ludwigd9958f82019-03-21 13:08:36 -04001718 "tools/gpu/YUVUtils.cpp",
1719 "tools/gpu/YUVUtils.h",
Mike Kleina01c6b02020-04-01 13:47:34 -05001720 "tools/gpu/gl/GLTestContext.cpp", # See comment below about
1721 # GrContextFactory workaround.
Brian Osmanc9a42472018-05-31 13:17:12 -04001722 "tools/gpu/mock/MockTestContext.cpp",
1723 ]
Brian Salomon1171d312020-03-19 08:47:44 -04001724
1725 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04001726 frameworks = []
Brian Salomon1171d312020-03-19 08:47:44 -04001727
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001728 if (skia_use_gl) {
Herb Derby64aa5132020-06-03 12:14:55 -04001729 sources +=
1730 [ "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001731 if (is_ios) {
1732 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001733 frameworks += [ "OpenGLES.framework" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001734 } else if (is_mac) {
1735 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Brian Osman0c757272018-12-10 10:27:26 -05001736 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001737 if (skia_use_angle) {
1738 deps += [ "//third_party/angle2" ]
1739 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1740 }
Brian Salomon1171d312020-03-19 08:47:44 -04001741 }
1742
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001743 # We need the GLTestContext on Vulkan-only builds for the persistent GL context workaround in
1744 # in GrContextFactory. This only matters for OSes that can run Vulkan.
Chris Dalton2b598902020-03-25 10:50:35 -06001745 if ((skia_use_gl || skia_use_vulkan) && target_cpu != "wasm") {
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001746 if (is_android || skia_use_egl) {
1747 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
1748 libs += [ "EGL" ]
1749 } else if (is_linux) {
1750 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
1751 libs += [
1752 "GLU",
1753 "GL",
1754 "X11",
1755 ]
1756 } else if (is_win) {
1757 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1758 libs += [ "Gdi32.lib" ]
1759 if (target_cpu != "arm64") {
1760 libs += [ "OpenGL32.lib" ]
1761 }
1762 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001763 }
Greg Daniel54200e42018-12-11 17:03:39 -05001764
Brian Osmanc9a42472018-05-31 13:17:12 -04001765 if (skia_use_vulkan) {
Robert Phillipsae413d82020-06-10 11:04:51 -04001766 sources += [ "tools/gpu/vk/VkTestContext.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001767 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Robert Phillips0d6ce7c2020-06-11 08:51:50 -04001768 sources += [ "tools/gpu/vk/VkTestHelper.h" ]
1769 sources += [ "tools/gpu/vk/VkTestHelper.cpp" ]
Robert Phillipsae413d82020-06-10 11:04:51 -04001770 sources += [ "tools/gpu/vk/VkTestUtils.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001771 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
Robert Phillipsae413d82020-06-10 11:04:51 -04001772 sources += [ "tools/gpu/vk/VkYcbcrSamplerHelper.h" ]
1773 sources += [ "tools/gpu/vk/VkYcbcrSamplerHelper.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001774 }
1775 if (skia_use_metal) {
1776 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
mtkleina627b5c2016-09-20 13:36:47 -07001777 }
Jim Van Verthb01e12b2020-02-18 14:34:38 -05001778 if (skia_use_direct3d) {
1779 sources += [ "tools/gpu/d3d/D3DTestContext.cpp" ]
Jim Van Verth03b8ab22020-02-24 11:36:15 -05001780 sources += [ "tools/gpu/d3d/D3DTestUtils.cpp" ]
Jim Van Verthb01e12b2020-02-18 14:34:38 -05001781 }
Stephen White985741a2019-07-18 11:43:45 -04001782 if (skia_use_dawn) {
Zhenyao Mo4f17b602020-04-13 15:26:17 -07001783 public_deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen White985741a2019-07-18 11:43:45 -04001784 sources += [ "tools/gpu/dawn/DawnTestContext.cpp" ]
Stephen White3ae5b292020-06-01 15:45:56 -04001785 if (is_clang) {
1786 cflags_cc = [ "-Wno-microsoft-cast" ]
1787 }
Stephen White985741a2019-07-18 11:43:45 -04001788 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001789
1790 if (is_fuchsia && using_fuchsia_sdk) {
1791 libs +=
1792 [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ]
1793 }
John Rosasco24cbdab2019-09-25 14:14:35 -07001794 } # test_lib("gpu_tool_utils")
mtklein25c81d42016-07-27 13:55:26 -07001795
mtkleinc095df52016-08-24 12:23:52 -07001796 test_lib("flags") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001797 sources = [ "tools/flags/CommandLineFlags.cpp" ]
mtklein046cb562016-09-16 10:23:12 -07001798 }
Mike Kleinc6142d82019-03-25 10:54:59 -05001799
1800 test_lib("common_flags_config") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001801 sources = [ "tools/flags/CommonFlagsConfig.cpp" ]
1802 deps = [ ":flags" ]
1803 public_deps = [ ":gpu_tool_utils" ]
mtkleinc095df52016-08-24 12:23:52 -07001804 }
Mike Kleinc6142d82019-03-25 10:54:59 -05001805 test_lib("common_flags_gpu") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001806 sources = [ "tools/flags/CommonFlagsGpu.cpp" ]
1807 deps = [ ":flags" ]
1808 public_deps = [ ":gpu_tool_utils" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001809 }
1810 test_lib("common_flags_images") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001811 sources = [ "tools/flags/CommonFlagsImages.cpp" ]
1812 deps = [ ":flags" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001813 }
1814 test_lib("common_flags_aa") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001815 sources = [ "tools/flags/CommonFlagsAA.cpp" ]
1816 deps = [ ":flags" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001817 }
mtklein25c81d42016-07-27 13:55:26 -07001818
Mike Klein499f0ac2019-03-25 13:00:12 -05001819 test_lib("trace") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001820 deps = [ ":flags" ]
Mike Klein499f0ac2019-03-25 13:00:12 -05001821 sources = [
1822 "tools/trace/ChromeTracingTracer.cpp",
1823 "tools/trace/ChromeTracingTracer.h",
1824 "tools/trace/EventTracingPriv.cpp",
1825 "tools/trace/EventTracingPriv.h",
1826 "tools/trace/SkDebugfTracer.cpp",
1827 "tools/trace/SkDebugfTracer.h",
1828 ]
1829 }
1830
mtkleinc095df52016-08-24 12:23:52 -07001831 test_lib("tool_utils") {
mtkleinc095df52016-08-24 12:23:52 -07001832 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001833 "tools/AndroidSkDebugToStdOut.cpp",
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001834 "tools/AutoreleasePool.h",
Robert Phillips96601082018-05-29 16:13:26 -04001835 "tools/DDLPromiseImageHelper.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001836 "tools/DDLPromiseImageHelper.h",
Robert Phillips96601082018-05-29 16:13:26 -04001837 "tools/DDLTileHelper.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001838 "tools/DDLTileHelper.h",
mtklein0590fa52016-09-01 07:06:54 -07001839 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001840 "tools/ProcStats.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001841 "tools/ProcStats.h",
mtkleinc095df52016-08-24 12:23:52 -07001842 "tools/Resources.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001843 "tools/Resources.h",
Hal Canarye574f1e2019-07-15 14:01:37 -04001844 "tools/SkMetaData.cpp",
1845 "tools/SkMetaData.h",
Nathaniel Nifong0426c382019-06-21 11:09:19 -04001846 "tools/SkSharingProc.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001847 "tools/SkSharingProc.h",
1848 "tools/Stats.h",
Mike Kleinea3f0142019-03-20 11:12:10 -05001849 "tools/ToolUtils.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001850 "tools/ToolUtils.h",
mtkleinc095df52016-08-24 12:23:52 -07001851 "tools/UrlDataManager.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001852 "tools/UrlDataManager.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001853 "tools/debugger/DebugCanvas.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001854 "tools/debugger/DebugCanvas.h",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05001855 "tools/debugger/DebugLayerManager.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001856 "tools/debugger/DebugLayerManager.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001857 "tools/debugger/DrawCommand.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001858 "tools/debugger/DrawCommand.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001859 "tools/debugger/JsonWriteBuffer.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001860 "tools/debugger/JsonWriteBuffer.h",
Mike Klein0cffcbf92019-03-20 11:08:46 -05001861 "tools/fonts/RandomScalerContext.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001862 "tools/fonts/RandomScalerContext.h",
Mike Klein0cffcbf92019-03-20 11:08:46 -05001863 "tools/fonts/TestEmptyTypeface.h",
1864 "tools/fonts/TestFontMgr.cpp",
1865 "tools/fonts/TestFontMgr.h",
1866 "tools/fonts/TestSVGTypeface.cpp",
1867 "tools/fonts/TestSVGTypeface.h",
1868 "tools/fonts/TestTypeface.cpp",
1869 "tools/fonts/TestTypeface.h",
Mike Kleinea3f0142019-03-20 11:12:10 -05001870 "tools/fonts/ToolUtilsFont.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001871 "tools/random_parse_path.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001872 "tools/random_parse_path.h",
Hal Canary41248072019-07-11 16:32:53 -04001873 "tools/timer/TimeUtils.h",
mtkleinc095df52016-08-24 12:23:52 -07001874 "tools/timer/Timer.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001875 "tools/timer/Timer.h",
mtkleinc095df52016-08-24 12:23:52 -07001876 ]
Chris Dalton2b598902020-03-25 10:50:35 -06001877 if (target_cpu != "wasm") {
1878 sources += [ "tools/CrashHandler.cpp" ]
1879 }
Mike Kleinadacaef2017-02-06 09:26:14 -05001880 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04001881 frameworks = []
Mike Kleinadacaef2017-02-06 09:26:14 -05001882 if (is_ios) {
1883 sources += [ "tools/ios_utils.m" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001884 sources += [ "tools/ios_utils.h" ]
1885 if (skia_use_metal) {
1886 sources += [ "tools/AutoreleasePool.mm" ]
1887 }
Jim Van Verthef820be2020-08-12 10:45:00 -04001888 frameworks += [ "Foundation.framework" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001889 } else if (is_mac) {
1890 if (skia_use_metal) {
1891 sources += [ "tools/AutoreleasePool.mm" ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001892 frameworks += [ "Foundation.framework" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001893 }
James Clarkeb8c0dab2021-02-09 06:22:41 -08001894 } else if (is_win && !skia_enable_winuwp) {
Mike Kleinbf15b662019-04-15 11:32:16 -05001895 libs += [ "DbgHelp.lib" ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001896 }
Mike Kleinbf15b662019-04-15 11:32:16 -05001897
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001898 defines = []
1899 if (skia_tools_require_resources) {
1900 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1901 }
mtkleinc095df52016-08-24 12:23:52 -07001902 deps = [
1903 ":flags",
Florin Malitab3418102020-10-15 18:10:29 -04001904 "modules/svg",
Mike Kleine4ad58a2019-03-26 09:05:52 -05001905 ]
Mike Kleina01c6b02020-04-01 13:47:34 -05001906 public_deps = [ ":gpu_tool_utils" ]
mtkleinc095df52016-08-24 12:23:52 -07001907 }
mtklein25c81d42016-07-27 13:55:26 -07001908
Mike Kleine11e5c12019-04-24 12:46:06 -05001909 test_lib("etc1") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001910 sources = [ "third_party/etc1/etc1.cpp" ]
Mike Kleine11e5c12019-04-24 12:46:06 -05001911 }
1912
Mike Klein6e744122016-10-27 12:21:40 -04001913 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001914 test_lib("gm") {
mtkleinc095df52016-08-24 12:23:52 -07001915 sources = gm_sources
John Rosasco24cbdab2019-09-25 14:14:35 -07001916 if (skia_use_gl) {
1917 sources += gl_gm_sources
1918 }
mtkleinc095df52016-08-24 12:23:52 -07001919 deps = [
Mike Kleine11e5c12019-04-24 12:46:06 -05001920 ":etc1",
scroggo19b91532016-10-24 09:03:26 -07001921 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001922 ":skia",
1923 ":tool_utils",
Brian Osman84d884a2021-01-29 16:35:45 -05001924 "modules/particles",
Mike Reed2f0edd52018-05-31 14:22:30 -04001925 "modules/skottie",
Florin Malita26870722018-09-20 14:35:30 -04001926 "modules/skottie:gm",
Mike Reed63559a52020-06-02 11:34:24 -04001927 "modules/skparagraph",
1928 "modules/skparagraph:gm",
Brian Osmanc725e8f2019-04-10 14:08:44 -04001929 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07001930 ]
Mike Kleinc4abade2019-08-09 10:11:35 -04001931 if (is_skia_dev_build) {
1932 sources += [ "gm/fiddle.cpp" ]
1933 deps += [ ":skia.h" ]
1934 }
Mike Kleina01c6b02020-04-01 13:47:34 -05001935 public_deps = [ ":gpu_tool_utils" ]
Mike Reed7bf160e2019-05-17 16:50:51 -04001936
1937 if (skia_use_ffmpeg) {
Florin Malita123e3b82020-04-24 11:10:27 -04001938 deps += [ "experimental/ffmpeg:video_decoder" ]
Mike Reed7bf160e2019-05-17 16:50:51 -04001939 sources += [ "gm/video_decoder.cpp" ]
1940 }
mtkleinc095df52016-08-24 12:23:52 -07001941 }
mtklein25c81d42016-07-27 13:55:26 -07001942
Ben Wagnerbded42a2021-02-17 22:14:34 -05001943 test_lib("test") {
1944 sources = [
1945 "tests/Test.cpp",
1946 "tests/Test.h",
1947 "tests/TestUtils.cpp",
1948 "tests/TestUtils.h",
1949 ]
1950 deps = [
1951 ":flags",
1952 ":skia",
1953 ":tool_utils",
1954 ]
1955 public_deps = [
1956 ":gpu_tool_utils", # Test.h #includes headers from this target.
1957 ]
1958 }
1959
Mike Klein6e744122016-10-27 12:21:40 -04001960 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001961 test_lib("tests") {
Mike Klein6e744122016-10-27 12:21:40 -04001962 sources = tests_sources + pathops_tests_sources
Chinmay Garde3ee25e92020-09-01 15:10:14 -07001963 frameworks = []
Robert Phillips0c6daf02019-05-16 12:43:11 -04001964 if (skia_use_metal) {
1965 sources += metal_tests_sources
Jim Van Verth36b86af2020-08-24 17:16:46 +00001966 cflags_objcc = [ "-fobjc-arc" ]
Chinmay Garde3ee25e92020-09-01 15:10:14 -07001967 frameworks += [ "MetalKit.framework" ]
Robert Phillips0c6daf02019-05-16 12:43:11 -04001968 }
John Rosasco24cbdab2019-09-25 14:14:35 -07001969 if (skia_use_gl) {
1970 sources += gl_tests_sources
1971 }
mtkleinc095df52016-08-24 12:23:52 -07001972 deps = [
1973 ":flags",
Ben Wagnere75021e2021-02-17 22:18:34 -05001974 ":fontmgr_android_tests",
1975 ":fontmgr_fontconfig_tests",
Ben Wagnera3e5e552021-02-22 15:37:33 +00001976 ":fontmgr_mac_ct_tests",
mtkleinc095df52016-08-24 12:23:52 -07001977 ":skia",
Ben Wagnerbded42a2021-02-17 22:14:34 -05001978 ":test",
mtkleinc095df52016-08-24 12:23:52 -07001979 ":tool_utils",
Florin Malita26ae40f2020-06-08 12:03:48 -04001980 "experimental/skrive:tests",
Florin Malita94d4d3e2018-06-18 13:10:51 -04001981 "modules/skottie:tests",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04001982 "modules/skparagraph:tests",
Brian Osmanccb87522018-06-01 19:20:00 +00001983 "modules/sksg:tests",
Brian Osmanc725e8f2019-04-10 14:08:44 -04001984 "modules/skshaper",
Florin Malitadec78022020-12-17 16:36:54 -05001985 "modules/svg:tests",
mtkleinc095df52016-08-24 12:23:52 -07001986 "//third_party/libpng",
Leon Scroggins III194580d2019-02-22 12:32:16 -05001987 "//third_party/libwebp",
mtkleinc095df52016-08-24 12:23:52 -07001988 "//third_party/zlib",
1989 ]
1990 }
mtklein2f3416d2016-08-02 16:02:05 -07001991
Mike Klein6e744122016-10-27 12:21:40 -04001992 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001993 test_lib("bench") {
mtkleinc095df52016-08-24 12:23:52 -07001994 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001995 deps = [
1996 ":flags",
1997 ":gm",
1998 ":gpu_tool_utils",
1999 ":skia",
2000 ":tool_utils",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04002001 "modules/skparagraph:bench",
Mike Reedd62d4062019-06-12 10:20:44 -04002002 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07002003 ]
2004 }
mtklein2b6870c2016-07-28 14:17:33 -07002005
Mike Reedd62d4062019-06-12 10:20:44 -04002006 test_lib("experimental_xform") {
2007 sources = [
2008 "experimental/xform/SkShape.cpp",
2009 "experimental/xform/SkXform.cpp",
2010 "experimental/xform/XContext.cpp",
2011 ]
Mike Kleina01c6b02020-04-01 13:47:34 -05002012 deps = [ ":skia" ]
Mike Reedd62d4062019-06-12 10:20:44 -04002013 }
2014
Florin Malitabfe876a2018-09-02 12:33:59 -04002015 if (is_linux || is_mac) {
Florin Malita79725d32018-06-05 16:16:57 -04002016 test_app("skottie_tool") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002017 deps = [ "modules/skottie:tool" ]
Florin Malita79725d32018-06-05 16:16:57 -04002018 }
Florin Malitab3418102020-10-15 18:10:29 -04002019 test_app("svg_tool") {
2020 deps = [ "modules/svg:tool" ]
2021 }
Florin Malita79725d32018-06-05 16:16:57 -04002022 }
2023
Hal Canary5b39dc82019-04-17 13:29:46 -04002024 test_app("make_skqp_model") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002025 sources = [ "tools/skqp/make_skqp_model.cpp" ]
2026 deps = [ ":skia" ]
Hal Canary5b39dc82019-04-17 13:29:46 -04002027 }
2028
Chris Dalton2b598902020-03-25 10:50:35 -06002029 import("gn/samples.gni")
2030 test_lib("samples") {
2031 sources = samples_sources
2032 if (skia_enable_ccpr) {
2033 sources += samples_sources_ccpr
Kevin Lubickebf648e2017-09-21 13:45:16 -04002034 }
Mike Kleina01c6b02020-04-01 13:47:34 -05002035 public_deps = [ ":tool_utils" ]
Chris Dalton2b598902020-03-25 10:50:35 -06002036 deps = [
Chris Dalton2b598902020-03-25 10:50:35 -06002037 ":flags",
2038 ":gpu_tool_utils",
2039 ":xml",
Jorge Betancourtb8621312020-09-10 15:16:35 -04002040 "modules/audioplayer",
Chris Dalton2b598902020-03-25 10:50:35 -06002041 "modules/skparagraph:samples",
2042 "modules/skshaper",
Florin Malitab3418102020-10-15 18:10:29 -04002043 "modules/svg",
Tyler Denniston189ecd42020-10-22 15:40:49 -04002044 "//third_party/imgui",
Chris Dalton2b598902020-03-25 10:50:35 -06002045 ]
Chris Dalton2b598902020-03-25 10:50:35 -06002046 }
Kevin Lubick00398742020-10-08 10:05:07 -04002047 test_lib("hash_and_encode") {
2048 sources = [
2049 "tools/HashAndEncode.cpp",
2050 "tools/HashAndEncode.h",
2051 ]
2052 deps = [
2053 ":flags",
2054 ":skia",
2055 "//third_party/libpng",
2056 ]
2057 }
Chris Dalton2b598902020-03-25 10:50:35 -06002058 if (target_cpu != "wasm") {
Nigel Tao3ab9b1f2020-05-28 13:29:13 +10002059 test_app("convert-to-nia") {
2060 sources = [ "tools/convert-to-nia.cpp" ]
2061 deps = [ ":skia" ]
2062 }
Mike Klein7af351a2018-07-27 09:54:43 -04002063 test_app("imgcvt") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002064 sources = [ "tools/imgcvt.cpp" ]
Mike Klein7af351a2018-07-27 09:54:43 -04002065 deps = [
2066 ":skcms",
2067 ":skia",
2068 ]
2069 }
Mike Klein735c7ba2019-03-25 12:57:58 -05002070 test_app("fm") {
2071 sources = [
Mike Kleinfee00792019-11-21 16:18:47 -06002072 "dm/DMGpuTestProcs.cpp", # blech
Mike Klein735c7ba2019-03-25 12:57:58 -05002073 "tools/fm/fm.cpp",
2074 ]
2075 deps = [
2076 ":common_flags_aa",
2077 ":common_flags_gpu",
2078 ":flags",
2079 ":gm",
2080 ":gpu_tool_utils",
2081 ":hash_and_encode",
2082 ":skia",
Mike Kleinfee00792019-11-21 16:18:47 -06002083 ":tests",
Mike Klein735c7ba2019-03-25 12:57:58 -05002084 ":tool_utils",
2085 ":trace",
Mike Klein22924262019-04-02 14:14:56 -04002086 "modules/skottie",
2087 "modules/skottie:utils",
Florin Malitab3418102020-10-15 18:10:29 -04002088 "modules/svg",
Mike Klein735c7ba2019-03-25 12:57:58 -05002089 ]
2090 }
Kevin Lubickebf648e2017-09-21 13:45:16 -04002091 test_app("dm") {
2092 sources = [
2093 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04002094 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04002095 "dm/DMJsonWriter.cpp",
2096 "dm/DMSrcSink.cpp",
2097 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04002098 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05002099 ":common_flags_aa",
2100 ":common_flags_config",
2101 ":common_flags_gpu",
2102 ":common_flags_images",
Kevin Lubickebf648e2017-09-21 13:45:16 -04002103 ":flags",
2104 ":gm",
2105 ":gpu_tool_utils",
Mike Klein735c7ba2019-03-25 12:57:58 -05002106 ":hash_and_encode",
Kevin Lubickebf648e2017-09-21 13:45:16 -04002107 ":skia",
2108 ":tests",
2109 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05002110 ":trace",
Florin Malita02616ea2020-06-25 13:33:17 -04002111 "experimental/skrive",
Florin Malita3d856bd2018-05-26 09:49:28 -04002112 "modules/skottie",
Florin Malitaa8316552018-11-09 16:19:44 -05002113 "modules/skottie:utils",
Florin Malitab3418102020-10-15 18:10:29 -04002114 "modules/svg",
Mike Klein38af9432016-11-11 11:39:44 -05002115 ]
2116 }
Robert Phillipscd1e3972021-02-22 17:24:22 -05002117 test_app("ddlbench") {
2118 sources = [ "experimental/ddlbench/ddlbench.cpp" ]
2119 deps = [
2120 ":flags",
2121 ":skia",
2122 ":tool_utils",
2123 ]
2124 }
Michael Ludwig30217952020-12-04 12:58:35 -05002125
2126 # optional separate library to dlopen when running CanvasStateTests.
2127 shared_library("canvas_state_lib") {
2128 sources = [
2129 "tests/CanvasStateHelpers.cpp",
2130 "tests/CanvasStateHelpers.h",
2131 ]
2132 deps = [ ":skia" ]
2133 }
Brian Osman16adfa32016-10-18 14:42:44 -04002134 }
2135
Mike Kleina8a51ce2018-01-09 12:34:11 -05002136 if (!is_win) {
2137 test_app("remote_demo") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002138 sources = [ "tools/remote_demo.cpp" ]
2139 deps = [ ":skia" ]
Mike Kleina8a51ce2018-01-09 12:34:11 -05002140 }
2141 }
2142
Hal Canarye107faa2019-10-23 12:52:33 -04002143 if (!is_win) {
2144 test_app("blob_cache_sim") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002145 sources = [ "tools/blob_cache_sim.cpp" ]
2146 deps = [ ":skia" ]
Hal Canarye107faa2019-10-23 12:52:33 -04002147 }
2148 }
2149
Mike Kleine6682eb2017-01-05 10:54:57 -05002150 test_app("nanobench") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002151 sources = [ "bench/nanobench.cpp" ]
mtklein2b6870c2016-07-28 14:17:33 -07002152 deps = [
2153 ":bench",
Mike Kleinc6142d82019-03-25 10:54:59 -05002154 ":common_flags_aa",
2155 ":common_flags_config",
2156 ":common_flags_gpu",
2157 ":common_flags_images",
mtklein2b6870c2016-07-28 14:17:33 -07002158 ":flags",
2159 ":gm",
2160 ":gpu_tool_utils",
2161 ":skia",
2162 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05002163 ":trace",
Mike Reed63559a52020-06-02 11:34:24 -04002164 "modules/skparagraph",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04002165 "modules/skshaper",
Florin Malitab3418102020-10-15 18:10:29 -04002166 "modules/svg",
mtklein2b6870c2016-07-28 14:17:33 -07002167 ]
mtklein2b6870c2016-07-28 14:17:33 -07002168 }
halcanary19a97202016-08-03 15:08:04 -07002169
Ravi Mistry10d36c52017-01-31 09:49:18 -05002170 test_app("skpinfo") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002171 sources = [ "tools/skpinfo.cpp" ]
Ravi Mistry10d36c52017-01-31 09:49:18 -05002172 deps = [
2173 ":flags",
2174 ":skia",
2175 ]
2176 }
2177
Mike Reedc0ee21f2019-05-28 16:11:03 -04002178 if (skia_use_ffmpeg) {
2179 test_app("skottie2movie") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002180 sources = [ "tools/skottie2movie.cpp" ]
Mike Reedc0ee21f2019-05-28 16:11:03 -04002181 deps = [
2182 ":flags",
Mike Reed5f12eaa2019-09-24 12:01:58 -04002183 ":gpu_tool_utils",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002184 ":skia",
Florin Malitaec403602020-04-24 12:14:03 -04002185 "experimental/ffmpeg:video_encoder",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002186 "modules/skottie",
Mike Reed5093e232019-05-30 10:10:50 -04002187 "modules/skottie:utils",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002188 ]
2189 }
2190 }
2191
Brian Osmanc9a42472018-05-31 13:17:12 -04002192 test_app("skpbench") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002193 sources = [ "tools/skpbench/skpbench.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002194 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05002195 ":common_flags_config",
2196 ":common_flags_gpu",
Brian Osmanc9a42472018-05-31 13:17:12 -04002197 ":flags",
2198 ":gpu_tool_utils",
2199 ":skia",
2200 ":tool_utils",
2201 ]
csmartdalton4b5179b2016-09-19 11:03:58 -07002202 }
2203
Mike Kleine6682eb2017-01-05 10:54:57 -05002204 test_app("sktexttopdf") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002205 sources = [ "tools/using_skia_and_harfbuzz.cpp" ]
halcanary3eee9d92016-09-10 07:01:53 -07002206 deps = [
2207 ":skia",
Herb Derby264182c2018-05-29 15:53:40 -04002208 "modules/skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07002209 ]
halcanary3eee9d92016-09-10 07:01:53 -07002210 }
mtklein046cb562016-09-16 10:23:12 -07002211
Ben Wagner219f3622017-07-17 15:32:25 -04002212 test_app("create_test_font") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002213 sources = [ "tools/fonts/create_test_font.cpp" ]
2214 deps = [ ":skia" ]
Ben Wagner219f3622017-07-17 15:32:25 -04002215 assert_no_deps = [
2216 # tool_utils requires the output of this app.
2217 ":tool_utils",
2218 ]
2219 }
2220
Florin Malita5d3ff432018-07-31 16:38:43 -04002221 if (skia_use_expat) {
2222 test_app("create_test_font_color") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002223 sources = [ "tools/fonts/create_test_font_color.cpp" ]
Florin Malita5d3ff432018-07-31 16:38:43 -04002224 deps = [
2225 ":flags",
2226 ":skia",
2227 ":tool_utils",
2228 ]
2229 }
Ben Wagner97182cc2018-02-15 10:20:04 -05002230 }
2231
Mike Kleine6682eb2017-01-05 10:54:57 -05002232 test_app("get_images_from_skps") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002233 sources = [ "tools/get_images_from_skps.cpp" ]
mtklein046cb562016-09-16 10:23:12 -07002234 deps = [
2235 ":flags",
2236 ":skia",
mtklein046cb562016-09-16 10:23:12 -07002237 ]
mtklein046cb562016-09-16 10:23:12 -07002238 }
mtkleinecbc5262016-09-22 11:51:24 -07002239
Brian Osman6788a542018-12-10 11:56:01 -05002240 if (!is_ios && target_cpu != "wasm" && !(is_win && target_cpu == "arm64")) {
Mike Kleine6682eb2017-01-05 10:54:57 -05002241 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04002242 sources = [
2243 "tools/skiaserve/Request.cpp",
2244 "tools/skiaserve/Response.cpp",
2245 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04002246 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
2247 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
2248 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
2249 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
2250 "tools/skiaserve/urlhandlers/DataHandler.cpp",
2251 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
2252 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
2253 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
2254 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05002255 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
2256 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04002257 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
2258 "tools/skiaserve/urlhandlers/PostHandler.cpp",
2259 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
2260 "tools/skiaserve/urlhandlers/RootHandler.cpp",
2261 ]
2262 deps = [
2263 ":flags",
2264 ":gpu_tool_utils",
2265 ":skia",
2266 ":tool_utils",
Mike Klein7d302882016-11-03 14:06:31 -04002267 "//third_party/libmicrohttpd",
Mike Klein7d302882016-11-03 14:06:31 -04002268 ]
Mike Klein7d302882016-11-03 14:06:31 -04002269 }
mtkleinecbc5262016-09-22 11:51:24 -07002270 }
kjlubick14f984b2016-10-03 11:49:45 -07002271
Mike Kleine6682eb2017-01-05 10:54:57 -05002272 test_app("fuzz") {
kjlubick14f984b2016-10-03 11:49:45 -07002273 sources = [
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04002274 "fuzz/Fuzz.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002275 "fuzz/Fuzz.h",
Hal Canary24ac42b2017-02-14 13:35:14 -05002276 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05002277 "fuzz/FuzzCommon.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002278 "fuzz/FuzzCommon.h",
Zepeng Hu94007012020-07-22 14:37:46 +00002279 "fuzz/FuzzCreateDDL.cpp",
Adlai Hollerea8d1972021-02-23 13:05:32 -05002280 "fuzz/FuzzDDLThreading.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05002281 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04002282 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002283 "fuzz/FuzzGradients.cpp",
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04002284 "fuzz/FuzzMain.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002285 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05002286 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002287 "fuzz/FuzzPathop.cpp",
Jim Van Verth061cc212018-07-11 14:09:09 -04002288 "fuzz/FuzzPolyUtils.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04002289 "fuzz/FuzzRegionOp.cpp",
Weston Tracey6d4577b2020-12-30 13:29:00 -05002290 "fuzz/FuzzSkParagraph.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04002291 "fuzz/oss_fuzz/FuzzAndroidCodec.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05002292 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
2293 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002294 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04002295 "fuzz/oss_fuzz/FuzzIncrementalImage.cpp",
Florin Malita80452be2018-06-19 11:27:20 -04002296 "fuzz/oss_fuzz/FuzzJSON.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002297 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05002298 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
2299 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Zepeng Hufcb7ba02020-07-31 17:21:29 +00002300 "fuzz/oss_fuzz/FuzzSKP.cpp",
Kevin Lubicke9c1ce82019-03-11 11:09:40 -04002301 "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp",
2302 "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp",
Kevin Lubick0f0a7102019-03-18 16:20:55 -04002303 "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp",
Kevin Lubicke9c1ce82019-03-11 11:09:40 -04002304 "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp",
Zepeng Huedaf3022020-06-12 12:20:59 +00002305 "fuzz/oss_fuzz/FuzzSVG.cpp",
Kevin Lubick2be14d32019-10-21 13:44:48 -04002306 "fuzz/oss_fuzz/FuzzSkDescriptorDeserialize.cpp",
Weston Tracey1a771fe2021-02-04 11:09:59 -05002307 "fuzz/oss_fuzz/FuzzSkParagraph.cpp",
Zepeng Hua5783f32020-07-10 13:36:20 +00002308 "fuzz/oss_fuzz/FuzzSkRuntimeEffect.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002309 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05002310 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002311 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05002312 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002313 "tools/debugger/DrawCommand.cpp",
2314 "tools/debugger/JsonWriteBuffer.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002315 ]
2316 deps = [
2317 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04002318 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07002319 ":skia",
Florin Malita3d856bd2018-05-26 09:49:28 -04002320 "modules/skottie:fuzz",
Weston Tracey6d4577b2020-12-30 13:29:00 -05002321 "modules/skparagraph",
kjlubick14f984b2016-10-03 11:49:45 -07002322 ]
kjlubick14f984b2016-10-03 11:49:45 -07002323 }
Mike Klein38312422016-10-05 15:41:01 -04002324
Mike Kleine6682eb2017-01-05 10:54:57 -05002325 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04002326 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04002327 rebase_path("tests/skia_test.cpp"),
2328 rebase_path("tests/Test.cpp"),
2329 ]
caryclark9feb6322016-10-25 08:58:26 -07002330 deps = [
2331 ":flags",
2332 ":gpu_tool_utils",
2333 ":skia",
2334 ":tool_utils",
2335 ]
caryclark9feb6322016-10-25 08:58:26 -07002336 }
2337
Mike Kleine6682eb2017-01-05 10:54:57 -05002338 test_app("dump_record") {
Mike Klein4a56f4c2020-08-18 16:02:52 -05002339 sources = [ "tools/dump_record.cpp" ]
Mike Klein38312422016-10-05 15:41:01 -04002340 deps = [
2341 ":flags",
2342 ":skia",
2343 ]
Mike Klein38312422016-10-05 15:41:01 -04002344 }
bungemanfe917272016-10-13 17:36:40 -04002345
Mike Kleine6682eb2017-01-05 10:54:57 -05002346 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04002347 sources = [
2348 "tools/skdiff/skdiff.cpp",
2349 "tools/skdiff/skdiff_html.cpp",
2350 "tools/skdiff/skdiff_main.cpp",
2351 "tools/skdiff/skdiff_utils.cpp",
2352 ]
2353 deps = [
2354 ":skia",
2355 ":tool_utils",
2356 ]
bungemanfe917272016-10-13 17:36:40 -04002357 }
halcanarya73d76a2016-10-17 13:19:02 -07002358
Mike Kleine6682eb2017-01-05 10:54:57 -05002359 test_app("skp_parser") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002360 sources = [ "tools/skp_parser.cpp" ]
halcanarya73d76a2016-10-17 13:19:02 -07002361 deps = [
2362 ":skia",
2363 ":tool_utils",
halcanarya73d76a2016-10-17 13:19:02 -07002364 ]
halcanarya73d76a2016-10-17 13:19:02 -07002365 }
Brian Osman16adfa32016-10-18 14:42:44 -04002366
Brian Osmanc9a42472018-05-31 13:17:12 -04002367 if (!is_win) {
Colin Cross654eb2a2019-11-08 13:08:36 -08002368 source_set("skqp_lib") {
2369 check_includes = false
2370 testonly = true
2371 if (!is_official_build) {
2372 configs -= [ "//gn:warnings" ]
2373 }
2374 public_configs = [ ":skia_private" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05002375 defines =
2376 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary75427132017-10-11 16:00:31 -04002377 sources = [
2378 "dm/DMGpuTestProcs.cpp",
Hal Canaryac7f23c2018-11-26 14:07:41 -05002379 "tools/skqp/src/skqp.cpp",
2380 "tools/skqp/src/skqp_model.cpp",
Hal Canary75427132017-10-11 16:00:31 -04002381 ]
2382 deps = [
2383 ":gm",
Hal Canary75427132017-10-11 16:00:31 -04002384 ":skia",
2385 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05002386 ":tool_utils",
2387 ]
2388 }
2389 test_app("skqp") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002390 sources = [ "tools/skqp/src/skqp_main.cpp" ]
John Rosasco24cbdab2019-09-25 14:14:35 -07002391 include_dirs = [ "//" ]
2392 lib_dirs = []
Mike Kleina01c6b02020-04-01 13:47:34 -05002393 deps = [ ":skqp_lib" ]
Hal Canaryac7f23c2018-11-26 14:07:41 -05002394 }
2395 test_app("jitter_gms") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002396 sources = [ "tools/skqp/jitter_gms.cpp" ]
Hal Canaryac7f23c2018-11-26 14:07:41 -05002397 deps = [
2398 ":gm",
2399 ":skia",
2400 ":skqp_lib",
Hal Canary75427132017-10-11 16:00:31 -04002401 ]
2402 }
2403 }
John Rosasco24cbdab2019-09-25 14:14:35 -07002404 if (is_fuchsia) {
2405 # Build a package repository for skqp on Fuchsia.
2406 group("skqp_repo") {
2407 testonly = true
Mike Kleina01c6b02020-04-01 13:47:34 -05002408 deps = [ "//build/fuchsia/skqp:skqp_repo" ]
John Rosasco24cbdab2019-09-25 14:14:35 -07002409 }
2410 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002411 if (is_android) {
Colin Cross654eb2a2019-11-08 13:08:36 -08002412 shared_library("libskqp_app") {
2413 configs += [ ":skia_private" ]
2414 if (!is_official_build) {
2415 configs -= [ "//gn:warnings" ]
2416 }
2417 testonly = true
Mike Kleina01c6b02020-04-01 13:47:34 -05002418 sources = [ "tools/skqp/src/jni_skqp.cpp" ]
Hal Canary28f89382017-12-12 09:42:14 -05002419 deps = [
2420 ":skia",
2421 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05002422 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05002423 ]
2424 libs = [ "android" ]
2425 }
2426 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002427 if (is_android && skia_use_gl) {
Stan Iliev93151722018-08-02 11:10:52 -04002428 test_app("skottie_android") {
2429 is_shared_library = true
2430
Jorge Betancourt1fcdcaa2020-06-22 14:14:32 +00002431 sources = [ "platform_tools/android/apps/skottie/skottielib/src/main/cpp/native-lib.cpp" ]
Stan Iliev93151722018-08-02 11:10:52 -04002432 libs = []
2433
Stan Iliev93151722018-08-02 11:10:52 -04002434 deps = [
2435 ":skia",
2436 "modules/skottie",
Stan Ilieva7a52b92018-10-01 15:36:32 -04002437 "modules/sksg:samples",
Stan Iliev93151722018-08-02 11:10:52 -04002438 ]
2439 }
2440 }
Hal Canary75427132017-10-11 16:00:31 -04002441
Hal Canarya9de7602018-01-19 13:08:23 -05002442 test_app("list_gms") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002443 sources = [ "tools/list_gms.cpp" ]
Hal Canarya9de7602018-01-19 13:08:23 -05002444 deps = [
2445 ":gm",
2446 ":skia",
2447 ]
2448 }
2449 test_app("list_gpu_unit_tests") {
2450 sources = [
2451 "dm/DMGpuTestProcs.cpp",
2452 "tools/list_gpu_unit_tests.cpp",
2453 ]
2454 deps = [
2455 ":skia",
2456 ":tests",
2457 ]
2458 }
2459
Brian Osmanc9a42472018-05-31 13:17:12 -04002460 test_lib("sk_app") {
Hal Canary378be8d2019-04-26 08:20:14 -04002461 public_deps = [
Hal Canary378be8d2019-04-26 08:20:14 -04002462 ":gpu_tool_utils",
Hal Canary05694472019-05-03 17:14:21 -04002463 ":skia",
Hal Canary378be8d2019-04-26 08:20:14 -04002464 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002465 sources = [
John Stilesab9578e2020-06-30 17:36:55 -04002466 "tools/sk_app/Application.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002467 "tools/sk_app/CommandSet.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002468 "tools/sk_app/CommandSet.h",
2469 "tools/sk_app/DisplayParams.h",
2470 "tools/sk_app/RasterWindowContext.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002471 "tools/sk_app/Window.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002472 "tools/sk_app/Window.h",
Robert Phillipsed653392020-07-10 13:55:21 -04002473 "tools/sk_app/WindowContext.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002474 "tools/sk_app/WindowContext.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002475 ]
2476 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04002477 frameworks = []
Brian Osmanc9a42472018-05-31 13:17:12 -04002478
2479 if (is_android) {
2480 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002481 "tools/sk_app/android/RasterWindowContext_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002482 "tools/sk_app/android/WindowContextFactory_android.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002483 "tools/sk_app/android/Window_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002484 "tools/sk_app/android/Window_android.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002485 "tools/sk_app/android/main_android.cpp",
2486 "tools/sk_app/android/surface_glue_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002487 "tools/sk_app/android/surface_glue_android.h",
Brian Osman16adfa32016-10-18 14:42:44 -04002488 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002489 libs += [ "android" ]
2490 } else if (is_linux) {
2491 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002492 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002493 "tools/sk_app/unix/WindowContextFactory_unix.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002494 "tools/sk_app/unix/Window_unix.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002495 "tools/sk_app/unix/Window_unix.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002496 "tools/sk_app/unix/keysym2ucs.c",
John Stilesab9578e2020-06-30 17:36:55 -04002497 "tools/sk_app/unix/keysym2ucs.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002498 "tools/sk_app/unix/main_unix.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002499 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002500 libs += [
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002501 "GL", # Used by raster window context, so cannot be behind skia_use_gl.
Brian Osmanc9a42472018-05-31 13:17:12 -04002502 "X11",
2503 ]
2504 } else if (is_win) {
2505 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002506 "tools/sk_app/win/RasterWindowContext_win.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002507 "tools/sk_app/win/WindowContextFactory_win.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002508 "tools/sk_app/win/Window_win.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002509 "tools/sk_app/win/Window_win.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002510 "tools/sk_app/win/main_win.cpp",
2511 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002512 } else if (is_mac) {
2513 sources += [
Jim Van Verth1f086ca2019-01-28 14:46:04 -05002514 "tools/sk_app/mac/RasterWindowContext_mac.mm",
John Stilesab9578e2020-06-30 17:36:55 -04002515 "tools/sk_app/mac/WindowContextFactory_mac.h",
2516 "tools/sk_app/mac/Window_mac.h",
Jim Van Verth1f086ca2019-01-28 14:46:04 -05002517 "tools/sk_app/mac/Window_mac.mm",
2518 "tools/sk_app/mac/main_mac.mm",
Brian Osmanc9a42472018-05-31 13:17:12 -04002519 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04002520 frameworks += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002521 "QuartzCore.framework",
2522 "Cocoa.framework",
2523 "Foundation.framework",
2524 ]
2525 } else if (is_ios) {
2526 sources += [
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002527 "tools/sk_app/ios/RasterWindowContext_ios.mm",
John Stilesab9578e2020-06-30 17:36:55 -04002528 "tools/sk_app/ios/WindowContextFactory_ios.h",
2529 "tools/sk_app/ios/Window_ios.h",
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002530 "tools/sk_app/ios/Window_ios.mm",
2531 "tools/sk_app/ios/main_ios.mm",
Brian Osmanc9a42472018-05-31 13:17:12 -04002532 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04002533 frameworks += [ "QuartzCore.framework" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002534 }
2535
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002536 if (skia_use_gl) {
2537 sources += [ "tools/sk_app/GLWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002538 sources += [ "tools/sk_app/GLWindowContext.h" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002539 if (is_android) {
2540 sources += [ "tools/sk_app/android/GLWindowContext_android.cpp" ]
2541 } else if (is_linux) {
2542 sources += [ "tools/sk_app/unix/GLWindowContext_unix.cpp" ]
2543 } else if (is_win) {
2544 sources += [ "tools/sk_app/win/GLWindowContext_win.cpp" ]
2545 if (skia_use_angle) {
2546 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
2547 }
2548 } else if (is_mac) {
2549 sources += [ "tools/sk_app/mac/GLWindowContext_mac.mm" ]
2550 } else if (is_ios) {
2551 sources += [ "tools/sk_app/ios/GLWindowContext_ios.mm" ]
2552 }
2553 }
2554
Brian Osmanc9a42472018-05-31 13:17:12 -04002555 if (skia_use_vulkan) {
2556 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002557 sources += [ "tools/sk_app/VulkanWindowContext.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002558 if (is_android) {
2559 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
2560 } else if (is_linux) {
2561 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
2562 libs += [ "X11-xcb" ]
2563 } else if (is_win) {
2564 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
2565 }
2566 }
2567
Jim Van Verthbe39f712019-02-08 15:36:14 -05002568 if (skia_use_metal) {
2569 sources += [ "tools/sk_app/MetalWindowContext.mm" ]
John Stilesab9578e2020-06-30 17:36:55 -04002570 sources += [ "tools/sk_app/MetalWindowContext.h" ]
Jim Van Verthbe39f712019-02-08 15:36:14 -05002571 if (is_mac) {
2572 sources += [ "tools/sk_app/mac/MetalWindowContext_mac.mm" ]
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002573 } else if (is_ios) {
Jim Van Verthe58d5322019-09-03 09:42:57 -04002574 sources += [ "tools/sk_app/ios/MetalWindowContext_ios.mm" ]
Jim Van Verthbe39f712019-02-08 15:36:14 -05002575 }
Jim Van Verthbe39f712019-02-08 15:36:14 -05002576 }
2577
Jim Van Verth682a2f42020-05-13 16:54:09 -04002578 if (skia_use_direct3d) {
2579 sources += [ "tools/sk_app/win/D3D12WindowContext_win.cpp" ]
2580 }
2581
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002582 if (skia_use_dawn) {
2583 sources += [ "tools/sk_app/DawnWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002584 sources += [ "tools/sk_app/DawnWindowContext.h" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002585 if (is_linux) {
2586 if (dawn_enable_vulkan) {
2587 sources += [ "tools/sk_app/unix/DawnVulkanWindowContext_unix.cpp" ]
2588 defines = [ "VK_USE_PLATFORM_XCB_KHR" ]
2589 libs += [ "X11-xcb" ]
2590 }
2591 } else if (is_win) {
2592 if (dawn_enable_d3d12) {
2593 sources += [ "tools/sk_app/win/DawnD3D12WindowContext_win.cpp" ]
2594 }
2595 } else if (is_mac) {
2596 if (dawn_enable_metal) {
2597 sources += [ "tools/sk_app/mac/DawnMTLWindowContext_mac.mm" ]
2598 }
2599 }
2600 }
2601
Mike Kleina01c6b02020-04-01 13:47:34 -05002602 deps = [ ":tool_utils" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002603 if (is_android) {
2604 deps += [ "//third_party/native_app_glue" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002605 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002606 if (skia_use_gl && skia_use_angle) {
Brian Osmanc9a42472018-05-31 13:17:12 -04002607 deps += [ "//third_party/angle2" ]
Mike Kleina92c3832016-12-08 09:49:39 -05002608 }
Brian Osman16adfa32016-10-18 14:42:44 -04002609 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002610
Hal Canary87515122019-03-15 14:22:51 -04002611 if (!skia_use_vulkan && (is_mac || is_linux || is_win)) {
2612 test_app("fiddle_examples") {
2613 sources = [
Brian Osmanc725e8f2019-04-10 14:08:44 -04002614 "tools/fiddle/all_examples.cpp",
Hal Canary87515122019-03-15 14:22:51 -04002615 "tools/fiddle/examples.cpp",
Brian Osman72ef2d52019-03-17 11:09:17 -04002616 "tools/fiddle/examples.h",
Hal Canary87515122019-03-15 14:22:51 -04002617 ]
Brian Osman72ef2d52019-03-17 11:09:17 -04002618 if (is_win) {
Hal Canary6c8422c2020-01-10 15:22:09 -05002619 cflags = [
2620 "/wd4756", # Overflow in constant arithmetic
2621 "/wd4305", # truncation from 'double' to 'float'
2622 ]
Brian Osman72ef2d52019-03-17 11:09:17 -04002623 }
Hal Canary87515122019-03-15 14:22:51 -04002624 deps = [
2625 ":skia",
2626 ":skia.h",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05002627 "modules/particles",
Hal Canary87515122019-03-15 14:22:51 -04002628 "modules/skottie",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05002629 "modules/skparagraph",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04002630 "modules/skshaper",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05002631 "modules/svg",
Hal Canary87515122019-03-15 14:22:51 -04002632 ]
2633 }
2634 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002635
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002636 # sk_app can work without GL but viewer always runs raster through a GL window context.
2637 if (skia_use_gl) {
2638 test_app("viewer") {
2639 is_shared_library = is_android
2640 sources = [
2641 "tools/viewer/AnimTimer.h",
2642 "tools/viewer/BisectSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002643 "tools/viewer/BisectSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002644 "tools/viewer/GMSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002645 "tools/viewer/GMSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002646 "tools/viewer/ImGuiLayer.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002647 "tools/viewer/ImGuiLayer.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002648 "tools/viewer/ImageSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002649 "tools/viewer/ImageSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002650 "tools/viewer/ParticlesSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002651 "tools/viewer/ParticlesSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002652 "tools/viewer/SKPSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002653 "tools/viewer/SKPSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002654 "tools/viewer/SampleSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002655 "tools/viewer/SampleSlide.h",
Florin Malita45cd2002020-06-09 14:00:54 -04002656 "tools/viewer/SkRiveSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002657 "tools/viewer/SkRiveSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002658 "tools/viewer/SkSLSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002659 "tools/viewer/SkSLSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002660 "tools/viewer/SkottieSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002661 "tools/viewer/SkottieSlide.h",
2662 "tools/viewer/Slide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002663 "tools/viewer/SlideDir.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002664 "tools/viewer/SlideDir.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002665 "tools/viewer/StatsLayer.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002666 "tools/viewer/StatsLayer.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002667 "tools/viewer/SvgSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002668 "tools/viewer/SvgSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002669 "tools/viewer/TouchGesture.cpp",
2670 "tools/viewer/TouchGesture.h",
2671 "tools/viewer/Viewer.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002672 "tools/viewer/Viewer.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002673 ]
2674 libs = []
2675
2676 deps = [
2677 ":common_flags_gpu",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002678 ":flags",
2679 ":gm",
2680 ":gpu_tool_utils",
2681 ":samples",
2682 ":sk_app",
2683 ":skia",
2684 ":tool_utils",
2685 ":trace",
Florin Malita45cd2002020-06-09 14:00:54 -04002686 "experimental/skrive",
Florin Malitac9c4e2e2020-08-13 12:03:37 -04002687 "modules/audioplayer",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002688 "modules/particles",
2689 "modules/skottie",
2690 "modules/skottie:utils",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002691 "modules/sksg:samples",
Florin Malitab3418102020-10-15 18:10:29 -04002692 "modules/svg",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002693 "//third_party/imgui",
2694 ]
2695 if (skia_use_experimental_xform) {
2696 deps += [ ":experimental_xform" ]
2697 sources += [ "gm/xform.cpp" ]
2698 }
Brian Osmanc85f1fa2020-06-16 15:11:34 -04002699 if (skia_use_vulkan) {
Brian Salomon3207fbe2020-06-30 11:09:25 -04002700 deps += [
2701 "//third_party/spirv-tools:spvtools",
2702
2703 #spvtools depends on this but doesn't deps it in. Looks like upstream bug
2704 #that we replicated in our third_party/spirv-tools/BUILD.gn
2705 "//third_party/spirv-tools:spvtools_val",
2706 ]
Brian Osmanc85f1fa2020-06-16 15:11:34 -04002707 }
Mike Reedd62d4062019-06-12 10:20:44 -04002708 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002709 }
2710
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002711 if (skia_use_gl && !skia_use_angle && (is_linux || is_win || is_mac)) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002712 test_app("HelloWorld") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002713 sources = [ "example/HelloWorld.cpp" ]
Brian Osmaneff04b52017-11-21 13:18:02 -05002714 libs = []
2715
Brian Osmaneff04b52017-11-21 13:18:02 -05002716 deps = [
2717 ":flags",
2718 ":gpu_tool_utils",
2719 ":sk_app",
2720 ":skia",
2721 ":tool_utils",
Brian Osmaneff04b52017-11-21 13:18:02 -05002722 ]
2723 }
2724 }
2725
Mike Klein9f6468f2020-05-19 13:14:40 -05002726 if (skia_use_gl && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002727 test_app("SkiaSDLExample") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002728 sources = [ "example/SkiaSDLExample.cpp" ]
Jim Van Verth4c70c752017-07-11 12:03:01 -04002729 libs = []
Jim Van Verth4c70c752017-07-11 12:03:01 -04002730 deps = [
2731 ":gpu_tool_utils",
2732 ":skia",
2733 "//third_party/libsdl",
2734 ]
2735 }
2736 }
2737
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002738 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2739 action_foreach("generate_mocs") {
2740 script = "gn/call.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05002741 sources = [ "tools/mdbviz/MainWindow.h" ]
2742 outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp" ]
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002743 args = [
2744 "$skia_qt_path" + "/bin/moc",
2745 "{{source}}",
2746 "-o",
2747 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2748 ]
2749 }
2750 action_foreach("generate_resources") {
2751 script = "gn/call.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05002752 sources = [ "tools/mdbviz/resources.qrc" ]
2753 outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp" ]
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002754 args = [
2755 "$skia_qt_path" + "/bin/rcc",
2756 "{{source}}",
2757 "-o",
2758 "gen/mdbviz/{{source_name_part}}_res.cpp",
2759 ]
2760 }
2761 test_app("mdbviz") {
2762 if (is_win) {
2763 # on Windows we need to disable some exception handling warnings due to the Qt headers
2764 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2765 }
2766 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002767 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002768 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05002769 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002770 "tools/debugger/DrawCommand.cpp",
2771 "tools/debugger/JsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002772 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002773 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002774 "tools/mdbviz/main.cpp",
2775
2776 # generated files
2777 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2778 "$target_gen_dir/mdbviz/resources_res.cpp",
2779 ]
2780 lib_dirs = [ "$skia_qt_path/lib" ]
2781 libs = [
2782 "Qt5Core.lib",
2783 "Qt5Gui.lib",
2784 "Qt5Widgets.lib",
2785 ]
2786 include_dirs = [
2787 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002788 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002789 "$skia_qt_path/include/QtWidgets",
2790 ]
2791 deps = [
2792 ":generate_mocs",
2793 ":generate_resources",
2794 ":skia",
2795 ]
2796 }
2797 }
2798
Mike Kleine459afd2017-03-03 09:21:30 -05002799 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002800 copy("gdbserver") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002801 sources = [ "$ndk/$ndk_gdbserver" ]
2802 outputs = [ "$root_out_dir/gdbserver" ]
Derek Sollenberger70120c72017-01-05 11:39:04 -05002803 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002804 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002805
2806 if (skia_use_opencl) {
2807 test_app("hello-opencl") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002808 sources = [ "tools/hello-opencl.cpp" ]
2809 deps = [ "//third_party/opencl" ]
Mike Kleinf9ae6702018-06-20 14:05:05 -04002810 }
2811 }
Hal Canaryb8f81af2019-04-24 13:56:16 -04002812
Brian Osmanf564f152019-07-23 15:14:30 -04002813 executable("cpu_modules") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002814 sources = [ "tools/cpu_modules.cpp" ]
Brian Osmanf564f152019-07-23 15:14:30 -04002815 deps = [
2816 ":skia",
2817 "modules/particles",
2818 ]
2819 }
2820
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002821 if (skia_use_gl && skia_use_icu && skia_use_harfbuzz) {
Hal Canary1f94d392019-07-30 09:27:56 -04002822 test_app("editor") {
2823 is_shared_library = is_android
Mike Kleina01c6b02020-04-01 13:47:34 -05002824 deps = [ "modules/skplaintexteditor:editor_app" ]
Hal Canary1f94d392019-07-30 09:27:56 -04002825 }
Hal Canaryb8f81af2019-04-24 13:56:16 -04002826 }
Hal Canarye5b65d22019-09-19 11:33:31 -04002827
2828 executable("image_diff_metric") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002829 sources = [ "tools/image_diff_metric.cpp" ]
2830 deps = [ ":skia" ]
Hal Canarye5b65d22019-09-19 11:33:31 -04002831 }
Chris Dalton2b598902020-03-25 10:50:35 -06002832
2833 group("modules_testonly") {
2834 testonly = true
2835 deps = []
2836 if (target_cpu == "wasm") {
2837 deps += [ "modules/canvaskit:viewer_wasm" ]
2838 }
2839 }
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002840
2841 if (skia_build_fuzzers) {
2842 template("libfuzzer_app") {
2843 output_dir = root_build_dir
2844 executable(target_name) {
2845 check_includes = false
2846 forward_variables_from(invoker, "*", [ "is_shared_library" ])
2847 configs += [ ":skia_private" ]
2848 sources += [
2849 "fuzz/Fuzz.cpp",
2850 "fuzz/FuzzCommon.cpp",
2851 ]
2852 deps += [
2853 ":flags",
2854 ":gpu_tool_utils",
2855 ":skia",
2856 ]
2857 defines = [ "SK_BUILD_FOR_LIBFUZZER" ]
2858 if (skia_use_libfuzzer_defaults) {
2859 cflags = [ "-fsanitize=fuzzer" ]
2860 ldflags = [ "-fsanitize=fuzzer" ]
2861 }
2862 testonly = true
2863 }
2864 }
2865
2866 libfuzzer_app("region_deserialize") {
2867 sources = [ "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp" ]
2868 deps = []
2869 }
2870
2871 libfuzzer_app("image_filter_deserialize") {
2872 include_dirs = [
2873 "tools",
2874 "tools/fonts",
2875 ]
2876 sources = [
2877 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
2878 "tools/Resources.cpp",
2879 "tools/fonts/TestFontMgr.cpp",
2880 "tools/fonts/TestSVGTypeface.cpp",
2881 "tools/fonts/TestTypeface.cpp",
2882 ]
Florin Malitab3418102020-10-15 18:10:29 -04002883 deps = [ "modules/svg" ]
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002884 }
2885
2886 libfuzzer_app("region_set_path") {
2887 sources = [ "fuzz/oss_fuzz/FuzzRegionSetPath.cpp" ]
2888 deps = []
2889 }
2890
2891 libfuzzer_app("textblob_deserialize") {
2892 include_dirs = [
2893 "tools",
2894 "tools/fonts",
2895 ]
2896 sources = [
2897 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
2898 "tools/Resources.cpp",
2899 "tools/fonts/TestFontMgr.cpp",
2900 "tools/fonts/TestSVGTypeface.cpp",
2901 "tools/fonts/TestTypeface.cpp",
2902 ]
Florin Malitab3418102020-10-15 18:10:29 -04002903 deps = [ "modules/svg" ]
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002904 }
2905
2906 libfuzzer_app("path_deserialize") {
2907 sources = [ "fuzz/oss_fuzz/FuzzPathDeserialize.cpp" ]
2908 deps = []
2909 }
2910
2911 libfuzzer_app("image_decode") {
2912 sources = [ "fuzz/oss_fuzz/FuzzImage.cpp" ]
2913 deps = []
2914 }
2915
2916 libfuzzer_app("animated_image_decode") {
2917 sources = [ "fuzz/oss_fuzz/FuzzAnimatedImage.cpp" ]
2918 deps = []
2919 }
2920
2921 libfuzzer_app("api_create_ddl") {
2922 include_dirs = [
2923 "include",
2924 "include/gpu",
2925 ]
2926 sources = [
2927 "fuzz/FuzzCreateDDL.cpp",
2928 "fuzz/oss_fuzz/FuzzAPICreateDDL.cpp",
2929 "tools/Resources.cpp",
2930 "tools/UrlDataManager.cpp",
2931 "tools/debugger/DebugCanvas.cpp",
2932 "tools/debugger/DebugLayerManager.cpp",
2933 "tools/debugger/DrawCommand.cpp",
2934 "tools/debugger/JsonWriteBuffer.cpp",
2935 "tools/fonts/TestFontMgr.cpp",
2936 "tools/fonts/TestSVGTypeface.cpp",
2937 "tools/fonts/TestTypeface.cpp",
2938 ]
2939 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04002940 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002941 "//third_party/libpng",
2942 ]
2943 }
2944
2945 libfuzzer_app("api_draw_functions") {
2946 sources = [
2947 "fuzz/FuzzDrawFunctions.cpp",
2948 "fuzz/oss_fuzz/FuzzDrawFunctions.cpp",
2949 ]
2950 deps = []
2951 }
2952
Adlai Hollerccb68662021-02-25 10:28:44 -05002953 libfuzzer_app("api_ddl_threading") {
2954 sources = [
2955 "fuzz/FuzzDDLThreading.cpp",
2956 "fuzz/oss_fuzz/FuzzDDLThreading.cpp",
2957 ]
2958 deps = []
2959 }
2960
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002961 libfuzzer_app("api_gradients") {
2962 sources = [
2963 "fuzz/FuzzGradients.cpp",
2964 "fuzz/oss_fuzz/FuzzGradients.cpp",
2965 ]
2966 deps = []
2967 }
2968
2969 libfuzzer_app("api_image_filter") {
2970 include_dirs = [
2971 "tools",
2972 "tools/debugger",
2973 ]
2974 sources = [
2975 "fuzz/FuzzCanvas.cpp",
2976 "fuzz/oss_fuzz/FuzzAPIImageFilter.cpp",
2977 "tools/UrlDataManager.cpp",
2978 "tools/debugger/DebugCanvas.cpp",
2979 "tools/debugger/DebugLayerManager.cpp",
2980 "tools/debugger/DrawCommand.cpp",
2981 "tools/debugger/JsonWriteBuffer.cpp",
2982 ]
2983 deps = [ "//third_party/libpng" ]
2984 }
2985
2986 libfuzzer_app("api_path_measure") {
2987 sources = [
2988 "fuzz/FuzzPathMeasure.cpp",
2989 "fuzz/oss_fuzz/FuzzPathMeasure.cpp",
2990 ]
2991 deps = []
2992 }
2993
2994 libfuzzer_app("api_pathop") {
2995 sources = [
2996 "fuzz/FuzzPathop.cpp",
2997 "fuzz/oss_fuzz/FuzzPathop.cpp",
2998 ]
2999 deps = []
3000 }
3001
3002 libfuzzer_app("api_raster_n32_canvas") {
3003 include_dirs = [
3004 "tools",
3005 "tools/debugger",
3006 "tools/fonts",
3007 ]
3008 sources = [
3009 "fuzz/FuzzCanvas.cpp",
3010 "fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp",
3011 "tools/Resources.cpp",
3012 "tools/UrlDataManager.cpp",
3013 "tools/debugger/DebugCanvas.cpp",
3014 "tools/debugger/DebugLayerManager.cpp",
3015 "tools/debugger/DrawCommand.cpp",
3016 "tools/debugger/JsonWriteBuffer.cpp",
3017 "tools/fonts/TestFontMgr.cpp",
3018 "tools/fonts/TestSVGTypeface.cpp",
3019 "tools/fonts/TestTypeface.cpp",
3020 ]
3021 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003022 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003023 "//third_party/libpng",
3024 ]
3025 }
3026
3027 if (skia_use_gl) {
3028 libfuzzer_app("api_mock_gpu_canvas") {
3029 include_dirs = [
3030 "tools",
3031 "tools/debugger",
3032 "tools/fonts",
3033 ]
3034 sources = [
3035 "fuzz/FuzzCanvas.cpp",
3036 "fuzz/oss_fuzz/FuzzMockGPUCanvas.cpp",
3037 "tools/LsanSuppressions.cpp",
3038 "tools/Resources.cpp",
3039 "tools/UrlDataManager.cpp",
3040 "tools/debugger/DebugCanvas.cpp",
3041 "tools/debugger/DebugLayerManager.cpp",
3042 "tools/debugger/DrawCommand.cpp",
3043 "tools/debugger/JsonWriteBuffer.cpp",
3044 "tools/fonts/TestFontMgr.cpp",
3045 "tools/fonts/TestSVGTypeface.cpp",
3046 "tools/fonts/TestTypeface.cpp",
3047 ]
3048 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003049 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003050 "//third_party/libpng",
3051 ]
3052 }
3053 }
3054
3055 libfuzzer_app("api_null_canvas") {
3056 include_dirs = [
3057 "tools",
3058 "tools/debugger",
3059 "tools/fonts",
3060 ]
3061 sources = [
3062 "fuzz/FuzzCanvas.cpp",
3063 "fuzz/oss_fuzz/FuzzNullCanvas.cpp",
3064 "tools/Resources.cpp",
3065 "tools/UrlDataManager.cpp",
3066 "tools/debugger/DebugCanvas.cpp",
3067 "tools/debugger/DebugLayerManager.cpp",
3068 "tools/debugger/DrawCommand.cpp",
3069 "tools/debugger/JsonWriteBuffer.cpp",
3070 "tools/fonts/TestFontMgr.cpp",
3071 "tools/fonts/TestSVGTypeface.cpp",
3072 "tools/fonts/TestTypeface.cpp",
3073 ]
3074 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003075 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003076 "//third_party/libpng",
3077 ]
3078 }
3079
Weston Tracey1a771fe2021-02-04 11:09:59 -05003080 libfuzzer_app("api_skparagraph") {
3081 sources = [
3082 "fuzz/FuzzSkParagraph.cpp",
3083 "fuzz/oss_fuzz/FuzzSkParagraph.cpp",
3084 "tools/Resources.cpp",
3085 ]
3086 deps = [ "modules/skparagraph" ]
3087 }
3088
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003089 libfuzzer_app("api_svg_canvas") {
3090 include_dirs = [
3091 "include",
3092 "include/svg",
3093 ]
3094 sources = [
3095 "fuzz/FuzzCanvas.cpp",
3096 "fuzz/oss_fuzz/FuzzAPISVGCanvas.cpp",
3097 "tools/Resources.cpp",
3098 "tools/UrlDataManager.cpp",
3099 "tools/debugger/DebugCanvas.cpp",
3100 "tools/debugger/DebugLayerManager.cpp",
3101 "tools/debugger/DrawCommand.cpp",
3102 "tools/debugger/JsonWriteBuffer.cpp",
3103 "tools/fonts/TestFontMgr.cpp",
3104 "tools/fonts/TestSVGTypeface.cpp",
3105 "tools/fonts/TestTypeface.cpp",
3106 ]
3107 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003108 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003109 "//third_party/libpng",
3110 ]
3111 }
3112
3113 libfuzzer_app("png_encoder") {
3114 sources = [
3115 "fuzz/FuzzEncoders.cpp",
3116 "fuzz/oss_fuzz/FuzzPNGEncoder.cpp",
3117 ]
3118 deps = []
3119 }
3120
3121 libfuzzer_app("jpeg_encoder") {
3122 sources = [
3123 "fuzz/FuzzEncoders.cpp",
3124 "fuzz/oss_fuzz/FuzzJPEGEncoder.cpp",
3125 ]
3126 deps = []
3127 }
3128
3129 libfuzzer_app("webp_encoder") {
3130 sources = [
3131 "fuzz/FuzzEncoders.cpp",
3132 "fuzz/oss_fuzz/FuzzWEBPEncoder.cpp",
3133 ]
3134 deps = []
3135 }
3136
3137 libfuzzer_app("skottie_json") {
3138 sources = [
3139 "modules/skottie/fuzz/FuzzSkottieJSON.cpp",
3140 "tools/Resources.cpp",
3141 "tools/fonts/TestFontMgr.cpp",
3142 "tools/fonts/TestSVGTypeface.cpp",
3143 "tools/fonts/TestTypeface.cpp",
3144 ]
3145 deps = [
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003146 "modules/skottie:skottie",
Florin Malitab3418102020-10-15 18:10:29 -04003147 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003148 ]
3149 }
3150
3151 libfuzzer_app("skjson") {
3152 sources = [ "fuzz/oss_fuzz/FuzzJSON.cpp" ]
3153 deps = []
3154 }
3155
3156 libfuzzer_app("api_polyutils") {
3157 sources = [
3158 "fuzz/FuzzPolyUtils.cpp",
3159 "fuzz/oss_fuzz/FuzzPolyUtils.cpp",
3160 ]
3161 deps = [ ":skia" ]
3162 }
3163
3164 libfuzzer_app("android_codec") {
3165 sources = [ "fuzz/oss_fuzz/FuzzAndroidCodec.cpp" ]
3166 deps = []
3167 }
3168
3169 libfuzzer_app("image_decode_incremental") {
3170 sources = [ "fuzz/oss_fuzz/FuzzIncrementalImage.cpp" ]
3171 deps = []
3172 }
3173
3174 libfuzzer_app("sksl2glsl") {
3175 sources = [ "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp" ]
3176 deps = []
3177 }
3178
3179 libfuzzer_app("sksl2spirv") {
3180 sources = [ "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp" ]
3181 deps = []
3182 }
3183
3184 libfuzzer_app("sksl2metal") {
3185 sources = [ "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp" ]
3186 deps = []
3187 }
3188
3189 libfuzzer_app("sksl2pipeline") {
3190 sources = [ "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp" ]
3191 deps = []
3192 }
3193
3194 libfuzzer_app("skdescriptor_deserialize") {
3195 sources = [ "fuzz/oss_fuzz/FuzzSkDescriptorDeserialize.cpp" ]
3196 deps = []
3197 }
3198
3199 libfuzzer_app("svg_dom") {
3200 sources = [ "fuzz/oss_fuzz/FuzzSVG.cpp" ]
Florin Malitab3418102020-10-15 18:10:29 -04003201 deps = [ "modules/svg" ]
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003202 }
3203
3204 libfuzzer_app("skruntimeeffect") {
3205 sources = [ "fuzz/oss_fuzz/FuzzSkRuntimeEffect.cpp" ]
3206 deps = []
3207 }
3208
3209 libfuzzer_app("skp") {
3210 sources = [ "fuzz/oss_fuzz/FuzzSKP.cpp" ]
3211 deps = []
3212 }
3213 }
mtklein25c81d42016-07-27 13:55:26 -07003214}
Hal Canary932a2c02019-09-17 10:43:18 -04003215
Chinmay Gardea1ea0a92019-10-01 16:37:10 -07003216if (is_ios && skia_use_metal && !skia_enable_flutter_defines) {
Hal Canary932a2c02019-09-17 10:43:18 -04003217 group("minimal_ios_mtl_skia_app") {
Mike Kleina01c6b02020-04-01 13:47:34 -05003218 deps = [ "experimental/minimal_ios_mtl_skia_app" ]
Hal Canary932a2c02019-09-17 10:43:18 -04003219 }
Hal Canary27483062019-12-06 15:01:08 -05003220}
3221
Hal Canary60ff6512020-01-21 12:39:20 -05003222if (is_ios && skia_enable_skottie && !skia_enable_flutter_defines) {
Hal Canary932a2c02019-09-17 10:43:18 -04003223 group("skottie_ios") {
Mike Kleina01c6b02020-04-01 13:47:34 -05003224 deps = [ "tools/skottie_ios_app" ]
Hal Canary932a2c02019-09-17 10:43:18 -04003225 }
3226}
Martin Kustermannb65d2992020-12-15 16:15:13 +01003227
3228executable("skia_c_api_example") {
3229 sources = [ "experimental/c-api-example/skia-c-example.c" ]
3230 include_dirs = [ "." ]
3231 deps = [ ":skia" ]
3232}