blob: cf4f3500cefa0dab77ff4c43bc30b7a93ca0d30b [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 Wagnerd13487e2020-06-03 23:29:43 -0400495
496 if (is_mac) {
Jim Van Verthef820be2020-08-12 10:45:00 -0400497 frameworks = [
Ben Wagnerd13487e2020-06-03 23:29:43 -0400498 # AppKit symbols NSFontWeightXXX may be dlsym'ed.
499 "AppKit.framework",
500 "ApplicationServices.framework",
501 ]
502 }
503
504 if (is_ios) {
Jim Van Verthef820be2020-08-12 10:45:00 -0400505 frameworks = [
Ben Wagnerd13487e2020-06-03 23:29:43 -0400506 "CoreFoundation.framework",
507 "CoreGraphics.framework",
508 "CoreText.framework",
509
510 # UIKit symbols UIFontWeightXXX may be dlsym'ed.
511 "UIKit.framework",
512 ]
513 }
514}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400515optional("fontmgr_mac_ct_factory") {
516 enabled = skia_use_fonthost_mac
517 deps = [ ":fontmgr_mac_ct" ]
518 sources = [ "src/ports/SkFontMgr_mac_ct_factory.cpp" ]
519}
Ben Wagnerd13487e2020-06-03 23:29:43 -0400520
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500521optional("fontmgr_win") {
522 enabled = skia_enable_fontmgr_win
523
Ben Wagner75626e42020-06-03 13:20:37 -0400524 public = [ "include/ports/SkTypeface_win.h" ]
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500525 sources = [
526 "src/fonts/SkFontMgr_indirect.cpp",
527 "src/ports/SkFontMgr_win_dw.cpp",
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500528 "src/ports/SkScalerContext_win_dw.cpp",
529 "src/ports/SkTypeface_win_dw.cpp",
530 ]
531}
Ben Wagner8c3daeb2020-06-29 11:59:10 -0400532optional("fontmgr_win_factory") {
533 enabled = skia_enable_fontmgr_win
534 deps = [ ":fontmgr_win" ]
535 sources = [ "src/ports/SkFontMgr_win_dw_factory.cpp" ]
536}
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500537
538optional("fontmgr_win_gdi") {
539 enabled = skia_enable_fontmgr_win_gdi
540
Ben Wagner75626e42020-06-03 13:20:37 -0400541 public = [ "include/ports/SkTypeface_win.h" ]
Mike Kleina01c6b02020-04-01 13:47:34 -0500542 sources = [ "src/ports/SkFontHost_win.cpp" ]
Leon Scroggins III631dbc82019-03-04 13:54:02 -0500543 libs = [ "Gdi32.lib" ]
544}
545
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700546if (skia_lex) {
Ethan Nicholasca82a922017-09-07 09:39:50 -0400547 executable("sksllex") {
548 sources = [
549 "src/sksl/lex/Main.cpp",
550 "src/sksl/lex/NFA.cpp",
551 "src/sksl/lex/RegexNode.cpp",
552 "src/sksl/lex/RegexParser.cpp",
553 ]
Mike Kleinc0bd9f92019-04-23 12:05:21 -0500554 include_dirs = [ "." ]
Ethan Nicholasca82a922017-09-07 09:39:50 -0400555 }
556
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700557 action("run_sksllex") {
558 script = "gn/run_sksllex.py"
Mike Kleina01c6b02020-04-01 13:47:34 -0500559 deps = [ ":sksllex(//gn/toolchain:$host_toolchain)" ]
560 sources = [ "src/sksl/lex/sksl.lex" ]
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700561
562 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
563 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
564 outputs = [
Brian Osman1e7d8aa2021-02-18 14:37:29 -0500565 "$target_out_dir/" + rebase_path("src/sksl/SkSLLexer.h", target_out_dir),
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700566 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
567 # confused due to the same file being named by two different paths
568 ]
569 sksllex_path = "$root_out_dir/"
570 sksllex_path += "sksllex"
571 if (host_os == "win") {
572 sksllex_path += ".exe"
573 }
574 args = [
575 rebase_path(sksllex_path),
576 rebase_path("bin/clang-format"),
John Stiles796e7022020-06-11 19:57:22 -0400577 rebase_path("bin/fetch-clang-format"),
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700578 rebase_path("src"),
579 ]
580 }
581} else {
582 group("run_sksllex") {
583 }
584}
585
John Stilesd836f842020-09-14 10:21:44 -0400586# `Compile Processors` and `Compile SkSL Tests` both rely on skslc.
587if (skia_compile_processors || skia_compile_sksl_tests) {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400588 executable("skslc") {
Brian Osman8d09d4a2020-11-24 15:51:06 -0500589 defines = [
590 "SKSL_STANDALONE",
591 "SK_ENABLE_SPIRV_VALIDATION",
592 ]
Brian Osmana6ca9752020-10-02 13:41:21 -0400593 sources = [
Brian Osman47726a12020-12-17 16:02:08 -0500594 "src/core/SkCpu.cpp",
595 "src/core/SkData.cpp",
596 "src/core/SkHalf.cpp",
Brian Osmana6ca9752020-10-02 13:41:21 -0400597 "src/core/SkMalloc.cpp",
598 "src/core/SkMath.cpp",
John Stiles060503e2020-10-22 15:02:26 -0400599 "src/core/SkSemaphore.cpp",
Brian Osman47726a12020-12-17 16:02:08 -0500600 "src/core/SkStream.cpp",
601 "src/core/SkString.cpp",
Brian Osmane9ad19b2020-12-23 13:31:13 -0500602 "src/core/SkStringUtils.cpp",
John Stiles060503e2020-10-22 15:02:26 -0400603 "src/core/SkThreadID.cpp",
Brian Osman47726a12020-12-17 16:02:08 -0500604 "src/core/SkUtils.cpp",
605 "src/core/SkVM.cpp",
John Stiles23e68662020-10-29 10:17:15 -0400606 "src/gpu/GrBlockAllocator.cpp",
607 "src/gpu/GrMemoryPool.cpp",
Brian Osman62b039b2021-02-08 13:49:53 -0500608 "src/gpu/GrShaderUtils.cpp",
Brian Osmana6ca9752020-10-02 13:41:21 -0400609 "src/ports/SkMemory_malloc.cpp",
Brian Osman47726a12020-12-17 16:02:08 -0500610 "src/ports/SkOSFile_stdio.cpp",
Brian Osmana6ca9752020-10-02 13:41:21 -0400611 "src/sksl/SkSLMain.cpp",
Brian Osman47726a12020-12-17 16:02:08 -0500612 "src/utils/SkUTF.cpp",
Brian Osmana6ca9752020-10-02 13:41:21 -0400613 ]
Brian Osman47726a12020-12-17 16:02:08 -0500614 if (is_win) {
615 sources += [ "src/ports/SkOSFile_win.cpp" ]
616 } else {
617 sources += [ "src/ports/SkOSFile_posix.cpp" ]
618 }
Ethan Nicholas762466e2017-06-29 10:03:38 -0400619 sources += skia_sksl_sources
Brian Osmanfb32ddf2019-06-18 10:14:20 -0400620 sources += skia_sksl_gpu_sources
Mike Kleinc0bd9f92019-04-23 12:05:21 -0500621 include_dirs = [ "." ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400622 deps = [
Ethan Nicholasaae47c82017-11-10 15:34:03 -0500623 ":run_sksllex",
Stephen White238fc242019-08-26 10:19:23 -0400624 "//third_party/spirv-tools:spvtools",
John Stilesdda1d312020-11-20 16:28:50 -0500625 "//third_party/spirv-tools:spvtools_val",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400626 ]
627 }
628
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400629 skslc_path = "$root_out_dir/"
630 if (host_toolchain != default_toolchain_name) {
631 skslc_path += "$host_toolchain/"
632 }
633 skslc_path += "skslc"
634 if (host_os == "win") {
635 skslc_path += ".exe"
636 }
637
Brian Osmandd496172020-08-08 08:17:18 -0400638 action("create_sksl_fp") {
639 script = "gn/create_sksl_fp.py"
640 sources = [
641 "include/private/GrSharedEnums.h",
642 "src/sksl/sksl_fp_raw.sksl",
643 ]
644 outputs = [ "$root_out_dir/sksl_fp.sksl" ]
645 args = [
646 rebase_path(sources[0]),
647 rebase_path(sources[1]),
648 rebase_path(outputs[0]),
649 ]
650 }
651
652 copy("sksl_pre_includes") {
653 sources = [
654 "src/sksl/sksl_frag.sksl",
655 "src/sksl/sksl_geom.sksl",
656 "src/sksl/sksl_gpu.sksl",
Brian Osmanb06301e2020-11-06 11:45:36 -0500657 "src/sksl/sksl_public.sksl",
Brian Osman91946752020-12-21 13:20:40 -0500658 "src/sksl/sksl_runtime.sksl",
Brian Osmandd496172020-08-08 08:17:18 -0400659 "src/sksl/sksl_vert.sksl",
660 ]
661 outputs = [ "$root_out_dir/{{source_file_part}}" ]
662 }
663
664 dehydrate_sksl_sources = get_target_outputs(":sksl_pre_includes")
665 dehydrate_sksl_sources += get_target_outputs(":create_sksl_fp")
666
667 dehydrate_sksl_outputs = []
668 foreach(src, dehydrate_sksl_sources) {
669 name = get_path_info(src, "name")
670
671 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
672 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
673 dehydrate_sksl_outputs += [ "$target_out_dir/" + rebase_path(
674 "src/sksl/generated/$name.dehydrated.sksl",
675 target_out_dir) ]
676 }
677
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400678 action("dehydrate_sksl") {
679 script = "gn/dehydrate_sksl.py"
Brian Osmandd496172020-08-08 08:17:18 -0400680 deps = [
681 ":create_sksl_fp",
682 ":sksl_pre_includes",
683 ":skslc(//gn/toolchain:$host_toolchain)",
684 ]
685 sources = dehydrate_sksl_sources
686 outputs = dehydrate_sksl_outputs
Brian Osmana5781382020-08-07 21:28:12 +0000687 args = [
688 rebase_path(skslc_path),
Brian Osmandd496172020-08-08 08:17:18 -0400689 rebase_path("src/sksl/generated"),
Brian Osmana5781382020-08-07 21:28:12 +0000690 ]
Brian Osmandd496172020-08-08 08:17:18 -0400691 args += rebase_path(dehydrate_sksl_sources)
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400692 }
John Stilesd836f842020-09-14 10:21:44 -0400693} else {
694 group("dehydrate_sksl") {
695 }
696}
697
698skia_gpu_processor_outputs = []
699if (skia_compile_processors) {
700 foreach(src, skia_gpu_processor_sources) {
701 dir = get_path_info(src, "dir")
702 name = get_path_info(src, "name")
703
704 # GN insists its outputs should go somewhere underneath target_out_dir, so we trick it with a
705 # path that starts with target_out_dir and then uses ".." to back up into the src dir.
706 skia_gpu_processor_outputs += [
707 "$target_out_dir/" +
708 rebase_path("$dir/generated/$name.h", target_out_dir),
709 # the script also modifies the corresponding .cpp file, but if we tell GN that it gets
710 # confused due to the same file being named by two different paths
711 ]
712 }
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400713
Ethan Nicholas762466e2017-06-29 10:03:38 -0400714 action("compile_processors") {
715 script = "gn/compile_processors.py"
716 deps = [
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400717 ":create_sksl_fp",
Brian Osmandd496172020-08-08 08:17:18 -0400718 ":sksl_pre_includes",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400719 ":skslc(//gn/toolchain:$host_toolchain)",
720 ]
721 sources = skia_gpu_processor_sources
722 outputs = skia_gpu_processor_outputs
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400723 args = [
724 rebase_path(skslc_path),
Eric Borenb121be72017-07-28 10:00:51 -0400725 rebase_path("bin/clang-format"),
John Stiles796e7022020-06-11 19:57:22 -0400726 rebase_path("bin/fetch-clang-format"),
Ethan Nicholasb9f6afb2017-07-27 16:02:37 -0400727 ]
Ethan Nicholas762466e2017-06-29 10:03:38 -0400728 args += rebase_path(skia_gpu_processor_sources)
729 }
730} else {
Ethan Nicholas762466e2017-06-29 10:03:38 -0400731 group("compile_processors") {
732 }
John Stilesd836f842020-09-14 10:21:44 -0400733}
734
735if (skia_compile_sksl_tests) {
736 import("gn/sksl_tests.gni")
John Stilesd836f842020-09-14 10:21:44 -0400737
John Stiles7e248712020-09-24 16:42:09 -0400738 template("compile_sksl") {
739 # Compile the passed-in `sources` into `outputs` using skslc, with the given language/settings.
740 action("compile_sksl_${target_name}") {
741 script = "gn/compile_sksl_tests.py"
742 deps = [
743 ":create_sksl_fp",
744 ":sksl_pre_includes",
745 ":skslc(//gn/toolchain:$host_toolchain)",
746 ]
John Stilesda57fc02021-01-22 11:54:30 -0500747 sources = []
John Stiles7e248712020-09-24 16:42:09 -0400748 outputs = []
John Stilesb7f5e1b2021-01-27 14:05:15 -0500749 response_file_contents = []
John Stilesda57fc02021-01-22 11:54:30 -0500750 args = [
751 rebase_path(skslc_path),
752 invoker.lang,
753 invoker.settings,
John Stilesb7f5e1b2021-01-27 14:05:15 -0500754 "{{response_file_name}}",
John Stilesda57fc02021-01-22 11:54:30 -0500755 ]
756
John Stilesbfc9be02021-01-22 11:55:48 -0500757 testsDir = get_path_info("tests", "abspath")
758 resourcesDir = get_path_info("resources", "abspath")
759
760 foreach(partialPath, invoker.sources) {
761 dst = testsDir + partialPath
762 src = resourcesDir + partialPath
763
764 dir = get_path_info(dst, "dir")
765 name = get_path_info(dst, "name")
766 ext = get_path_info(dst, "extension")
John Stilesb7f5e1b2021-01-27 14:05:15 -0500767 response_file_contents += rebase_path([
768 src,
769 dir,
770 ])
John Stilesda57fc02021-01-22 11:54:30 -0500771 sources += [ src ]
John Stilesc3012182020-12-08 15:07:00 -0500772
John Stilesda57fc02021-01-22 11:54:30 -0500773 foreach(outExtension, invoker.outExtensions) {
John Stilesc3012182020-12-08 15:07:00 -0500774 # SPIR-V uses separate extensions for .vert and .geom shaders.
775 if (outExtension == ".asm.frag" && ext == "vert") {
776 outExtension = ".asm.vert"
777 } else if (outExtension == ".asm.frag" && ext == "geom") {
778 outExtension = ".asm.geom"
779 }
John Stilesbfc9be02021-01-22 11:55:48 -0500780 outputs +=
781 [ target_out_dir + "/" +
782 rebase_path(dir + "/" + name + outExtension, target_out_dir) ]
John Stiles7e248712020-09-24 16:42:09 -0400783 }
784 }
John Stiles7e248712020-09-24 16:42:09 -0400785 }
John Stilesd836f842020-09-14 10:21:44 -0400786 }
John Stiles7e248712020-09-24 16:42:09 -0400787 compile_sksl("fp_tests") {
788 sources = sksl_fp_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500789 outExtensions = [
790 ".cpp",
791 ".h",
John Stiles7e248712020-09-24 16:42:09 -0400792 ]
793 lang = "--fp"
794 settings = "--settings"
John Stiles0ed9f312020-09-16 17:46:37 -0400795 }
John Stiles7e248712020-09-24 16:42:09 -0400796 compile_sksl("glsl_tests") {
797 sources = sksl_glsl_tests_sources + sksl_glsl_settings_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500798 outExtensions = [ ".glsl" ]
John Stiles7e248712020-09-24 16:42:09 -0400799 lang = "--glsl"
800 settings = "--settings"
John Stiles0ed9f312020-09-16 17:46:37 -0400801 }
John Stiles7e248712020-09-24 16:42:09 -0400802 compile_sksl("glsl_nosettings_tests") {
John Stiles0ed9f312020-09-16 17:46:37 -0400803 sources = sksl_glsl_settings_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500804 outExtensions = [ "StandaloneSettings.glsl" ]
John Stiles7e248712020-09-24 16:42:09 -0400805 lang = "--glsl"
806 settings = "--nosettings"
John Stilesd836f842020-09-14 10:21:44 -0400807 }
John Stilesaeae3a52020-09-25 13:35:58 -0400808 compile_sksl("metal_tests") {
809 sources = sksl_metal_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500810 outExtensions = [ ".metal" ]
John Stilesaeae3a52020-09-25 13:35:58 -0400811 lang = "--metal"
812 settings = "--settings"
813 }
Brian Osman977feec2020-12-22 11:28:59 -0500814 compile_sksl("skvm_tests") {
815 sources = sksl_skvm_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500816 outExtensions = [ ".skvm" ]
Brian Osman977feec2020-12-22 11:28:59 -0500817 lang = "--skvm"
818 settings = "--settings"
819 }
Brian Osman62b039b2021-02-08 13:49:53 -0500820 compile_sksl("stage_tests") {
821 sources = sksl_stage_tests_sources
822 outExtensions = [ ".stage" ]
823 lang = "--stage"
824 settings = "--settings"
825 }
John Stilesdda1d312020-11-20 16:28:50 -0500826 compile_sksl("spirv_tests") {
827 sources = sksl_spirv_tests_sources
John Stilesda57fc02021-01-22 11:54:30 -0500828 outExtensions = [ ".asm.frag" ]
John Stilesdda1d312020-11-20 16:28:50 -0500829 lang = "--spirv"
830 settings = "--settings"
831 }
John Stilesd836f842020-09-14 10:21:44 -0400832} else {
John Stiles7e248712020-09-24 16:42:09 -0400833 group("compile_sksl_fp_tests") {
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400834 }
John Stiles7e248712020-09-24 16:42:09 -0400835 group("compile_sksl_glsl_tests") {
836 }
837 group("compile_sksl_glsl_nosettings_tests") {
John Stiles0ed9f312020-09-16 17:46:37 -0400838 }
John Stilesaeae3a52020-09-25 13:35:58 -0400839 group("compile_sksl_metal_tests") {
840 }
Brian Osman977feec2020-12-22 11:28:59 -0500841 group("compile_sksl_skvm_tests") {
842 }
John Stilesdda1d312020-11-20 16:28:50 -0500843 group("compile_sksl_spirv_tests") {
844 }
Ethan Nicholas762466e2017-06-29 10:03:38 -0400845}
846
Ben Wagnere27ee6c2019-02-15 14:59:30 -0500847optional("gpu") {
mtklein06c35c02016-09-20 12:28:12 -0700848 enabled = skia_enable_gpu
Ethan Nicholas762466e2017-06-29 10:03:38 -0400849 deps = [
850 ":compile_processors",
John Stiles7e248712020-09-24 16:42:09 -0400851 ":compile_sksl_fp_tests",
852 ":compile_sksl_glsl_nosettings_tests",
853 ":compile_sksl_glsl_tests",
John Stilesaeae3a52020-09-25 13:35:58 -0400854 ":compile_sksl_metal_tests",
Brian Osman977feec2020-12-22 11:28:59 -0500855 ":compile_sksl_skvm_tests",
John Stilesdda1d312020-11-20 16:28:50 -0500856 ":compile_sksl_spirv_tests",
Ethan Nicholasc18bb512020-07-28 14:46:53 -0400857 ":dehydrate_sksl",
Ethan Nicholas5b5f0962017-09-11 13:50:14 -0700858 ":run_sksllex",
Ethan Nicholas762466e2017-06-29 10:03:38 -0400859 ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -0700860 if (skia_generate_workarounds) {
861 deps += [ ":workaround_list" ]
862 }
John Rosascoa9b348f2019-11-08 13:18:15 -0800863 public_defines = []
Chris Dalton3a67b8e2018-05-03 09:30:29 -0600864 public_configs = []
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400865 public_deps = []
mtkleine9fb3d52016-09-20 15:11:46 -0700866
Brian Osmanfb32ddf2019-06-18 10:14:20 -0400867 sources =
868 skia_gpu_sources + skia_sksl_gpu_sources + skia_gpu_processor_outputs
Kevin Lubick93faa672018-10-10 15:54:53 -0400869 if (!skia_enable_ccpr) {
870 sources -= skia_ccpr_sources
871 sources += [ "src/gpu/ccpr/GrCoverageCountingPathRenderer_none.cpp" ]
872 }
Kevin Lubick4bf2c262018-10-15 09:35:54 -0400873 if (!skia_enable_nvpr) {
874 sources -= skia_nvpr_sources
875 sources += [ "src/gpu/GrPathRendering_none.cpp" ]
876 }
mtklein06c35c02016-09-20 12:28:12 -0700877
Mike Klein703cf5a2016-10-13 17:18:04 -0400878 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -0400879 frameworks = []
mtkleine9fb3d52016-09-20 15:11:46 -0700880
John Rosascoa9b348f2019-11-08 13:18:15 -0800881 if (skia_use_gl) {
882 public_defines += [ "SK_GL" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400883 if (is_android) {
884 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
885
886 # this lib is required to link against AHardwareBuffer
887 if (defined(ndk_api) && ndk_api >= 26) {
888 libs += [ "android" ]
889 }
890 } else if (skia_use_egl) {
891 sources += [ "src/gpu/gl/egl/GrGLMakeNativeInterface_egl.cpp" ]
892 libs += [ "EGL" ]
Kevin Lubick204c3be2020-08-19 14:30:58 -0400893 } else if (skia_use_webgl) {
894 sources += [ "src/gpu/gl/webgl/GrGLMakeNativeInterface_webgl.cpp" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400895 } else if (is_linux && skia_use_x11) {
896 sources += [ "src/gpu/gl/glx/GrGLMakeNativeInterface_glx.cpp" ]
897 libs += [ "GL" ]
898 } else if (is_mac) {
899 sources += [ "src/gpu/gl/mac/GrGLMakeNativeInterface_mac.cpp" ]
900 } else if (is_ios) {
901 sources += [ "src/gpu/gl/iOS/GrGLMakeNativeInterface_iOS.cpp" ]
James Clarkeb8c0dab2021-02-09 06:22:41 -0800902 } else if (is_win && !skia_enable_winuwp) {
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400903 sources += [ "src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp" ]
904 if (target_cpu != "arm64") {
905 libs += [ "OpenGL32.lib" ]
906 }
907 } else {
908 sources += [ "src/gpu/gl/GrGLMakeNativeInterface_none.cpp" ]
909 }
John Rosascoa9b348f2019-11-08 13:18:15 -0800910 sources += skia_gl_gpu_sources
911 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400912
mtkleine9fb3d52016-09-20 15:11:46 -0700913 if (skia_use_vulkan) {
Greg Danielda16cce2018-08-01 09:23:57 -0400914 public_defines += [ "SK_VULKAN" ]
Greg Danielb16beb92020-04-27 14:26:21 +0000915 if (skia_use_vma) {
916 deps += [ "third_party/vulkanmemoryallocator" ]
917 }
mtkleine9fb3d52016-09-20 15:11:46 -0700918 sources += skia_vk_sources
egdaniele4a9bd72016-09-21 07:36:14 -0700919 if (skia_enable_vulkan_debug_layers) {
920 public_defines += [ "SK_ENABLE_VK_LAYERS" ]
921 }
Craig Stoutcb6b4bd2018-12-13 10:20:07 -0800922 if (is_fuchsia) {
John Rosascoe57ca492019-11-13 14:30:45 -0800923 if (using_fuchsia_sdk) {
Chinmay Garde89820762019-05-06 16:44:06 -0700924 public_deps += [ "$fuchsia_sdk_root/pkg:vulkan" ]
925 } else {
Brian Osman489cf882019-07-09 10:48:28 -0400926 public_deps += [ "//src/graphics/lib/vulkan" ]
Chinmay Garde89820762019-05-06 16:44:06 -0700927 }
Craig Stoutcb6b4bd2018-12-13 10:20:07 -0800928 }
mtkleine9fb3d52016-09-20 15:11:46 -0700929 }
Greg Daniel91dfa3b2018-05-22 13:25:15 -0400930
Brian Salomonf4ba4ec2020-03-19 15:54:28 -0400931 if (is_android && (skia_use_gl || skia_use_vulkan)) {
932 # this lib is required to link against AHardwareBuffer
933 if (defined(ndk_api) && ndk_api >= 26) {
934 libs += [ "android" ]
935 }
936 }
937
Stephen White0d70b712019-07-10 15:51:30 -0400938 if (skia_use_dawn) {
939 public_defines += [ "SK_DAWN" ]
Stephen White985741a2019-07-18 11:43:45 -0400940 sources += skia_dawn_sources
Zhenyao Mo4f17b602020-04-13 15:26:17 -0700941 public_deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen Whitefbffb992019-10-17 10:32:40 -0400942 deps += [
Zhenyao Mo4f17b602020-04-13 15:26:17 -0700943 "//third_party/externals/dawn/src/dawn:dawn_proc",
944 "//third_party/externals/dawn/src/dawn:dawncpp",
945 "//third_party/externals/dawn/src/dawn_native",
Stephen White0d70b712019-07-10 15:51:30 -0400946 ]
947 if (dawn_enable_d3d12) {
948 libs += [
949 "d3d12.lib",
950 "dxgi.lib",
951 "d3dcompiler.lib",
952 ]
953 } else if (dawn_enable_metal) {
Jim Van Verthef820be2020-08-12 10:45:00 -0400954 frameworks += [ "Metal.framework" ]
Stephen White0d70b712019-07-10 15:51:30 -0400955 }
956 }
957
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500958 if (skia_use_direct3d) {
959 public_defines += [ "SK_DIRECT3D" ]
Jim Van Verth1b89eb72020-09-23 16:29:51 -0400960 deps += [
961 "//third_party/d3d12allocator",
962 "//third_party/spirv-cross:spirv_cross",
963 ]
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500964 sources += skia_direct3d_sources
Jim Van Verth03b8ab22020-02-24 11:36:15 -0500965 if (skia_enable_direct3d_debug_layer) {
966 public_defines += [ "SK_ENABLE_D3D_DEBUG_LAYER" ]
967 }
Jim Van Verthb01e12b2020-02-18 14:34:38 -0500968 libs += [
969 "d3d12.lib",
970 "dxgi.lib",
971 "d3dcompiler.lib",
972 ]
973 }
974
Greg Daniel6b7e0e22017-07-12 16:21:09 -0400975 cflags_objcc = []
Greg Daniele5ddff52017-07-05 16:49:36 -0400976 if (skia_use_metal) {
977 public_defines += [ "SK_METAL" ]
978 sources += skia_metal_sources
Jim Van Verthef820be2020-08-12 10:45:00 -0400979 frameworks += [ "Metal.framework" ]
Jim Van Verthef820be2020-08-12 10:45:00 -0400980 frameworks += [ "Foundation.framework" ]
Jim Van Verth36b86af2020-08-24 17:16:46 +0000981 cflags_objcc += [ "-fobjc-arc" ]
Greg Daniele5ddff52017-07-05 16:49:36 -0400982 }
Brian Salomoncbcb0a12017-11-19 13:20:13 -0500983
Kevin Lubickf4def342018-10-04 12:52:50 -0400984 if (is_debug) {
985 public_defines += [ "SK_ENABLE_DUMP_GPU" ]
986 }
mtklein06c35c02016-09-20 12:28:12 -0700987}
988
Leon Scroggins III41169202019-01-29 09:29:57 -0500989optional("gif") {
Hal Canary2dad9902019-11-20 16:01:31 -0500990 enabled = !skia_use_wuffs && skia_use_libgifcodec
Hal Canary1ec9a282019-11-21 10:15:50 -0500991 _libgifcodec_gni_path = "third_party/externals/libgifcodec/libgifcodec.gni"
992 if ("True" ==
993 exec_script("gn/checkpath.py",
994 [ rebase_path(_libgifcodec_gni_path, root_build_dir) ],
995 "trim string")) {
996 public_defines = [ "SK_USE_LIBGIFCODEC" ]
997 public_include_dirs = [
998 ".",
999 skia_libgifcodec_path,
1000 ]
1001 include_dirs = public_include_dirs
1002 import(_libgifcodec_gni_path)
1003 sources = rebase_path(libgifcodec_sources + libgifcodec_public,
1004 ".",
1005 skia_libgifcodec_path)
1006 }
Leon Scroggins III41169202019-01-29 09:29:57 -05001007}
1008
Leon Scroggins III04be2b52017-08-17 15:13:20 -04001009optional("heif") {
1010 enabled = skia_use_libheif
1011 public_defines = [ "SK_HAS_HEIF_LIBRARY" ]
1012
1013 deps = []
1014
Mike Kleina01c6b02020-04-01 13:47:34 -05001015 sources = [ "src/codec/SkHeifCodec.cpp" ]
Leon Scroggins III04be2b52017-08-17 15:13:20 -04001016}
1017
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001018optional("jpeg_decode") {
1019 enabled = skia_use_libjpeg_turbo_decode
1020 public_defines = [ "SK_CODEC_DECODES_JPEG" ]
1021
Mike Kleina01c6b02020-04-01 13:47:34 -05001022 deps = [ "//third_party/libjpeg-turbo:libjpeg" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001023 sources = [
1024 "src/codec/SkJpegCodec.cpp",
1025 "src/codec/SkJpegDecoderMgr.cpp",
1026 "src/codec/SkJpegUtility.cpp",
1027 ]
1028}
1029
1030optional("jpeg_encode") {
1031 enabled = skia_use_libjpeg_turbo_encode
1032 public_defines = [ "SK_ENCODE_JPEG" ]
mtklein63213812016-08-24 09:55:56 -07001033
Mike Kleina01c6b02020-04-01 13:47:34 -05001034 deps = [ "//third_party/libjpeg-turbo:libjpeg" ]
1035 public = [ "include/encode/SkJpegEncoder.h" ]
mtklein63213812016-08-24 09:55:56 -07001036 sources = [
mtklein63213812016-08-24 09:55:56 -07001037 "src/images/SkJPEGWriteUtility.cpp",
Matt Sarett04c37312017-05-05 14:02:13 -04001038 "src/images/SkJpegEncoder.cpp",
mtklein63213812016-08-24 09:55:56 -07001039 ]
1040}
1041
Leon Scroggins III326b9892020-08-05 16:51:10 -04001042optional("ndk_images") {
1043 enabled = skia_use_ndk_images
1044 public_defines = [ "SK_ENABLE_NDK_IMAGES" ]
1045 sources = [
1046 "src/ports/SkImageEncoder_NDK.cpp",
1047 "src/ports/SkImageGeneratorNDK.cpp",
1048 "src/ports/SkNDKConversions.cpp",
1049 ]
Leon Scroggins IIIf21d6b92020-08-05 10:44:17 -04001050 libs = [ "jnigraphics" ]
1051}
1052
mtklein63213812016-08-24 09:55:56 -07001053optional("pdf") {
Hal Canary43fb7a02016-12-30 13:09:03 -05001054 enabled = skia_use_zlib && skia_enable_pdf
1055 public_defines = [ "SK_SUPPORT_PDF" ]
mtklein63213812016-08-24 09:55:56 -07001056
Mike Kleina01c6b02020-04-01 13:47:34 -05001057 deps = [ "//third_party/zlib" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001058 if (skia_use_libjpeg_turbo_decode) {
1059 deps += [ ":jpeg_decode" ]
1060 }
1061 if (skia_use_libjpeg_turbo_encode) {
1062 deps += [ ":jpeg_encode" ]
Hal Canary83e0f1b2018-04-05 16:58:41 -04001063 }
Robert Phillips9b00f1f2020-03-24 12:29:44 -04001064 public = skia_pdf_public
brettwb9447282016-09-01 14:24:39 -07001065 sources = skia_pdf_sources
mtkleincd01b032016-08-31 04:58:19 -07001066 sources_when_disabled = [ "src/pdf/SkDocument_PDF_None.cpp" ]
Hal Canary2a3093c2019-02-20 11:25:45 -05001067 if (skia_use_icu && skia_use_harfbuzz && skia_pdf_subset_harfbuzz) {
1068 deps += [ "//third_party/harfbuzz" ]
1069 defines = [ "SK_PDF_USE_HARFBUZZ_SUBSET" ]
1070 } else if (skia_use_icu && skia_use_sfntly) {
mtklein63213812016-08-24 09:55:56 -07001071 deps += [ "//third_party/sfntly" ]
Hal Canary32498f02019-02-04 15:36:31 -05001072 defines = [ "SK_PDF_USE_SFNTLY" ]
mtklein63213812016-08-24 09:55:56 -07001073 }
1074}
1075
Robert Phillips9b00f1f2020-03-24 12:29:44 -04001076optional("xps") {
1077 enabled = skia_use_xps && is_win
1078 public_defines = [ "SK_SUPPORT_XPS" ]
1079 public = skia_xps_public
1080 sources = skia_xps_sources
1081}
1082
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001083optional("png_decode") {
1084 enabled = skia_use_libpng_decode
1085 public_defines = [ "SK_CODEC_DECODES_PNG" ]
mtklein63213812016-08-24 09:55:56 -07001086
Mike Kleina01c6b02020-04-01 13:47:34 -05001087 deps = [ "//third_party/libpng" ]
mtklein63213812016-08-24 09:55:56 -07001088 sources = [
1089 "src/codec/SkIcoCodec.cpp",
1090 "src/codec/SkPngCodec.cpp",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001091 ]
1092}
1093
1094optional("png_encode") {
1095 enabled = skia_use_libpng_encode
1096 public_defines = [ "SK_ENCODE_PNG" ]
1097
Mike Kleina01c6b02020-04-01 13:47:34 -05001098 deps = [ "//third_party/libpng" ]
1099 sources = [ "src/images/SkPngEncoder.cpp" ]
mtklein63213812016-08-24 09:55:56 -07001100}
1101
scroggof84ad642016-10-31 09:02:57 -07001102optional("raw") {
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001103 enabled = skia_use_dng_sdk && skia_use_libjpeg_turbo_decode && skia_use_piex
scroggof84ad642016-10-31 09:02:57 -07001104 public_defines = [ "SK_CODEC_DECODES_RAW" ]
1105
1106 deps = [
1107 "//third_party/dng_sdk",
1108 "//third_party/libjpeg-turbo:libjpeg",
1109 "//third_party/piex",
1110 ]
1111
1112 # SkRawCodec catches any exceptions thrown by dng_sdk, insulating the rest of
1113 # Skia.
1114 configs_to_remove = [ "//gn:no_exceptions" ]
1115
Mike Kleina01c6b02020-04-01 13:47:34 -05001116 sources = [ "src/codec/SkRawCodec.cpp" ]
scroggof84ad642016-10-31 09:02:57 -07001117}
1118
Mike Klein852a8cb2018-05-15 10:46:58 -04001119import("third_party/skcms/skcms.gni")
Brian Osman8dc68c62018-05-30 12:57:45 -04001120source_set("skcms") {
Mike Klein852a8cb2018-05-15 10:46:58 -04001121 cflags = []
1122 if (!is_win || is_clang) {
1123 cflags += [
1124 "-w",
1125 "-std=c11",
1126 ]
1127 }
1128
Mike Kleina01c6b02020-04-01 13:47:34 -05001129 public = [ "include/third_party/skcms/skcms.h" ]
Brian Osmanea236bf2019-04-29 10:28:22 -04001130 include_dirs = [ "include/third_party/skcms" ]
Mike Klein852a8cb2018-05-15 10:46:58 -04001131 sources = rebase_path(skcms_sources, ".", "third_party/skcms")
1132}
1133
mtklein3cc22182016-08-29 13:26:14 -07001134optional("typeface_freetype") {
1135 enabled = skia_use_freetype
mtklein3cc22182016-08-29 13:26:14 -07001136
Mike Kleina01c6b02020-04-01 13:47:34 -05001137 deps = [ "//third_party/freetype2" ]
mtklein3cc22182016-08-29 13:26:14 -07001138 sources = [
1139 "src/ports/SkFontHost_FreeType.cpp",
1140 "src/ports/SkFontHost_FreeType_common.cpp",
Ben Wagner9d5c55c2020-06-27 12:52:14 -04001141 "src/ports/SkFontHost_FreeType_common.h",
mtklein3cc22182016-08-29 13:26:14 -07001142 ]
1143}
1144
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001145optional("webp_decode") {
1146 enabled = skia_use_libwebp_decode
1147 public_defines = [ "SK_CODEC_DECODES_WEBP" ]
mtklein457b42a2016-08-23 13:56:37 -07001148
Mike Kleina01c6b02020-04-01 13:47:34 -05001149 deps = [ "//third_party/libwebp" ]
1150 sources = [ "src/codec/SkWebpCodec.cpp" ]
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001151}
1152
1153optional("webp_encode") {
1154 enabled = skia_use_libwebp_encode
1155 public_defines = [ "SK_ENCODE_WEBP" ]
1156
Mike Kleina01c6b02020-04-01 13:47:34 -05001157 deps = [ "//third_party/libwebp" ]
1158 sources = [ "src/images/SkWebpEncoder.cpp" ]
mtkleineb3c4252016-08-23 07:38:09 -07001159}
1160
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001161optional("wuffs") {
1162 enabled = skia_use_wuffs
Nigel Tao5cfa7192020-08-17 21:14:13 +10001163 public_defines = [ "SK_HAS_WUFFS_LIBRARY" ]
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001164
Mike Kleina01c6b02020-04-01 13:47:34 -05001165 deps = [ "//third_party/wuffs" ]
1166 sources = [ "src/codec/SkWuffsCodec.cpp" ]
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001167}
1168
mtklein63213812016-08-24 09:55:56 -07001169optional("xml") {
1170 enabled = skia_use_expat
Florin Malita442fff92016-11-08 16:07:52 +00001171 public_defines = [ "SK_XML" ]
mtklein63213812016-08-24 09:55:56 -07001172
Mike Kleina01c6b02020-04-01 13:47:34 -05001173 deps = [ "//third_party/expat" ]
mtklein63213812016-08-24 09:55:56 -07001174 sources = [
Mike Kleinbd41bcc2017-02-09 16:38:15 -05001175 "src/svg/SkSVGCanvas.cpp",
1176 "src/svg/SkSVGDevice.cpp",
mtklein63213812016-08-24 09:55:56 -07001177 "src/xml/SkDOM.cpp",
1178 "src/xml/SkXMLParser.cpp",
1179 "src/xml/SkXMLWriter.cpp",
1180 ]
1181}
1182
Mike Klein613ad382019-06-06 11:42:02 -05001183optional("skvm_jit") {
Mike Klein13ec5442020-08-14 07:36:54 -05001184 enabled = skia_enable_skvm_jit_when_possible
1185 public_defines = [ "SKVM_JIT_WHEN_POSSIBLE" ]
Mike Klein2b54e832020-07-10 12:56:07 -05001186 if (skia_vtune_path != "") {
1187 public_defines += [ "SKVM_JIT_VTUNE" ]
1188 public_include_dirs = [ "$skia_vtune_path/include" ]
1189 libs = [ "$skia_vtune_path/lib64/jitprofiling.lib" ]
1190 }
Mike Klein613ad382019-06-06 11:42:02 -05001191}
1192
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001193if (skia_enable_gpu && skia_generate_workarounds) {
1194 action("workaround_list") {
1195 script = "tools/build_workaround_header.py"
1196
Mike Kleina01c6b02020-04-01 13:47:34 -05001197 inputs = [ "src/gpu/gpu_workaround_list.txt" ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001198
1199 # see comments in skia_compile_processors about out dir path shenanigans.
1200 output_file =
Adrienne Walkerab7181d2018-05-14 14:02:03 -07001201 rebase_path("include/gpu/GrDriverBugWorkaroundsAutogen.h", root_out_dir)
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001202
Mike Kleina01c6b02020-04-01 13:47:34 -05001203 outputs = [ "$root_out_dir/$output_file" ]
Adrienne Walker1df7cd82018-04-18 13:46:25 -07001204 args = [
1205 "--output-file",
1206 "$output_file",
1207 ]
1208
1209 foreach(file, inputs) {
1210 args += [ rebase_path(file, root_build_dir) ]
1211 }
1212 }
1213}
1214
mtkleinc04ff472016-06-23 10:29:30 -07001215component("skia") {
1216 public_configs = [ ":skia_public" ]
1217 configs += skia_library_configs
mtkleinc04ff472016-06-23 10:29:30 -07001218
Mike Klein607b0a72018-11-07 16:17:34 -05001219 public_deps = [
Ben Wagner32d5cfa2020-06-11 14:41:47 -04001220 ":fontmgr_FontConfigInterface",
1221 ":fontmgr_android",
1222 ":fontmgr_custom_directory",
1223 ":fontmgr_custom_embedded",
1224 ":fontmgr_custom_empty",
1225 ":fontmgr_fontconfig",
1226 ":fontmgr_fuchsia",
1227 ":fontmgr_mac_ct",
1228 ":fontmgr_win",
1229 ":fontmgr_win_gdi",
Ben Wagnere27ee6c2019-02-15 14:59:30 -05001230 ":gpu",
Mike Klein607b0a72018-11-07 16:17:34 -05001231 ":pdf",
1232 ":skcms",
Robert Phillips9b00f1f2020-03-24 12:29:44 -04001233 ":xps",
Mike Klein607b0a72018-11-07 16:17:34 -05001234 ]
1235
mtkleinc04ff472016-06-23 10:29:30 -07001236 deps = [
Leon Scroggins III63cfb362020-04-24 13:00:48 -04001237 ":android_utils",
anmittalb8b3f712016-08-25 04:55:19 -07001238 ":arm64",
1239 ":armv7",
mtklein9b8583d2016-08-24 17:32:30 -07001240 ":avx",
Mike Klein54378232018-11-08 12:08:05 +00001241 ":compile_processors",
anmittalb8b3f712016-08-25 04:55:19 -07001242 ":crc32",
Ethan Nicholasc18bb512020-07-28 14:46:53 -04001243 ":dehydrate_sksl",
Ben Wagner75626e42020-06-03 13:20:37 -04001244 ":fontmgr_factory",
Leon Scroggins III41169202019-01-29 09:29:57 -05001245 ":gif",
Leon Scroggins III04be2b52017-08-17 15:13:20 -04001246 ":heif",
Mike Klein1b9b7d52018-02-27 10:37:40 -05001247 ":hsw",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001248 ":jpeg_decode",
1249 ":jpeg_encode",
Leon Scroggins III326b9892020-08-05 16:51:10 -04001250 ":ndk_images",
mtklein9b8583d2016-08-24 17:32:30 -07001251 ":none",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001252 ":png_decode",
1253 ":png_encode",
scroggof84ad642016-10-31 09:02:57 -07001254 ":raw",
Mike Klein613ad382019-06-06 11:42:02 -05001255 ":skvm_jit",
Mike Kleina9026da2020-06-05 08:57:05 -05001256 ":skx",
mtklein9b8583d2016-08-24 17:32:30 -07001257 ":sse2",
1258 ":sse41",
1259 ":sse42",
1260 ":ssse3",
Leon Scroggins IIIa77f30c2020-03-09 14:23:30 -04001261 ":webp_decode",
1262 ":webp_encode",
Leon Scroggins IIIe93ec682018-10-26 09:25:51 -04001263 ":wuffs",
mtklein63213812016-08-24 09:55:56 -07001264 ":xml",
mtkleinc04ff472016-06-23 10:29:30 -07001265 ]
1266
Hal Canaryc25f4e92019-02-26 11:54:25 -05001267 public = skia_core_public
1268 public += skia_utils_public
1269 public += skia_effects_public
1270 public += skia_effects_imagefilter_public
Hal Canaryc25f4e92019-02-26 11:54:25 -05001271
mtkleinc04ff472016-06-23 10:29:30 -07001272 sources = []
brettwb9447282016-09-01 14:24:39 -07001273 sources += skia_core_sources
brettwb9447282016-09-01 14:24:39 -07001274 sources += skia_utils_sources
Mike Klein54378232018-11-08 12:08:05 +00001275 sources += skia_effects_sources
1276 sources += skia_effects_imagefilter_sources
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001277 sources += skia_sksl_sources
mtkleinc04ff472016-06-23 10:29:30 -07001278 sources += [
Stan Iliev73d8fd92017-08-02 15:36:24 -04001279 "src/android/SkAndroidFrameworkUtils.cpp",
Leon Scroggins III42ee2842018-01-14 14:46:51 -05001280 "src/android/SkAnimatedImage.cpp",
mtklein25c81d42016-07-27 13:55:26 -07001281 "src/codec/SkAndroidCodec.cpp",
Nigel Tao612a65d2018-11-09 10:10:31 +11001282 "src/codec/SkAndroidCodecAdapter.cpp",
Leon Scroggins IIId81fed92017-06-01 13:42:28 -04001283 "src/codec/SkBmpBaseCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001284 "src/codec/SkBmpCodec.cpp",
1285 "src/codec/SkBmpMaskCodec.cpp",
1286 "src/codec/SkBmpRLECodec.cpp",
1287 "src/codec/SkBmpStandardCodec.cpp",
1288 "src/codec/SkCodec.cpp",
1289 "src/codec/SkCodecImageGenerator.cpp",
Leon Scroggins III22f673d2018-05-30 15:33:46 -04001290 "src/codec/SkColorTable.cpp",
Leon Scroggins III36f7e322018-08-27 11:55:46 -04001291 "src/codec/SkEncodedInfo.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001292 "src/codec/SkMaskSwizzler.cpp",
1293 "src/codec/SkMasks.cpp",
Leon Scroggins IIIba458302019-09-24 12:40:11 -04001294 "src/codec/SkParseEncodedOrigin.cpp",
mtklein25c81d42016-07-27 13:55:26 -07001295 "src/codec/SkSampledCodec.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001296 "src/codec/SkSampler.cpp",
scroggo19b91532016-10-24 09:03:26 -07001297 "src/codec/SkStreamBuffer.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001298 "src/codec/SkSwizzler.cpp",
1299 "src/codec/SkWbmpCodec.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001300 "src/images/SkImageEncoder.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001301 "src/ports/SkDiscardableMemory_none.cpp",
Mike Klein54378232018-11-08 12:08:05 +00001302 "src/ports/SkGlobalInitialization_default.cpp",
mtklein1211e0c2016-07-26 13:55:45 -07001303 "src/ports/SkImageGenerator_skia.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001304 "src/ports/SkMemory_malloc.cpp",
1305 "src/ports/SkOSFile_stdio.cpp",
1306 "src/sfnt/SkOTTable_name.cpp",
1307 "src/sfnt/SkOTUtils.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001308 ]
brettwb9447282016-09-01 14:24:39 -07001309
Leon Scroggins1340dbd2020-11-09 14:18:12 -05001310 defines = [ "SK_HAS_ANDROID_CODEC" ]
mtklein7d6fb2c2016-08-25 14:50:44 -07001311 libs = []
1312
mtkleinc04ff472016-06-23 10:29:30 -07001313 if (is_win) {
1314 sources += [
1315 "src/ports/SkDebug_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001316 "src/ports/SkImageEncoder_WIC.cpp",
1317 "src/ports/SkImageGeneratorWIC.cpp",
1318 "src/ports/SkOSFile_win.cpp",
mtklein605d9522016-09-21 14:01:32 -07001319 "src/ports/SkOSLibrary_win.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001320 ]
Mike Klein4b167fc2016-10-11 18:13:53 -04001321 libs += [
Mike Klein4b167fc2016-10-11 18:13:53 -04001322 "Ole32.lib",
1323 "OleAut32.lib",
Mike Klein4b167fc2016-10-11 18:13:53 -04001324 ]
James Clarkeb8c0dab2021-02-09 06:22:41 -08001325
1326 if (!skia_enable_winuwp) {
1327 libs += [
1328 "FontSub.lib",
1329 "User32.lib",
1330 "Usp10.lib",
1331 ]
1332 }
mtkleinc04ff472016-06-23 10:29:30 -07001333 } else {
1334 sources += [
mtkleinc04ff472016-06-23 10:29:30 -07001335 "src/ports/SkOSFile_posix.cpp",
mtklein605d9522016-09-21 14:01:32 -07001336 "src/ports/SkOSLibrary_posix.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001337 ]
Ben Wagnerbe6ae5b2017-08-31 16:45:23 -04001338 libs += [ "dl" ]
mtkleinc04ff472016-06-23 10:29:30 -07001339 }
1340
mtklein7d6fb2c2016-08-25 14:50:44 -07001341 if (is_android) {
Mike Klein1c471872017-01-13 15:27:45 -05001342 deps += [ "//third_party/expat" ]
Mike Kleine459afd2017-03-03 09:21:30 -05001343 if (defined(ndk) && ndk != "") {
Mike Klein1c471872017-01-13 15:27:45 -05001344 deps += [ "//third_party/cpu-features" ]
1345 }
mtklein06c35c02016-09-20 12:28:12 -07001346 sources += [ "src/ports/SkDebug_android.cpp" ]
mtklein7d6fb2c2016-08-25 14:50:44 -07001347 libs += [
1348 "EGL",
1349 "GLESv2",
1350 "log",
1351 ]
1352 }
1353
Kevin Lubick217056c2018-09-20 17:39:31 -04001354 if (is_linux || target_cpu == "wasm") {
mtklein06c35c02016-09-20 12:28:12 -07001355 sources += [ "src/ports/SkDebug_stdio.cpp" ]
Hal Canary25375e82018-03-14 15:16:56 -04001356 if (skia_use_egl) {
1357 libs += [ "GLESv2" ]
1358 }
mtkleinc04ff472016-06-23 10:29:30 -07001359 }
1360
1361 if (is_mac) {
1362 sources += [
mtklein7d6fb2c2016-08-25 14:50:44 -07001363 "src/ports/SkDebug_stdio.cpp",
mtkleinc04ff472016-06-23 10:29:30 -07001364 "src/ports/SkImageEncoder_CG.cpp",
1365 "src/ports/SkImageGeneratorCG.cpp",
1366 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001367 frameworks = [
mtklein09e61f72016-08-23 13:35:28 -07001368 "ApplicationServices.framework",
1369 "OpenGL.framework",
1370 ]
mtkleinc04ff472016-06-23 10:29:30 -07001371 }
abarth6fc8ff02016-07-15 15:15:15 -07001372
Mike Klein7d302882016-11-03 14:06:31 -04001373 if (is_ios) {
1374 sources += [
1375 "src/ports/SkDebug_stdio.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04001376 "src/ports/SkImageEncoder_CG.cpp",
1377 "src/ports/SkImageGeneratorCG.cpp",
1378 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001379 frameworks = [
Mike Klein7d302882016-11-03 14:06:31 -04001380 "CoreFoundation.framework",
Mike Klein7d302882016-11-03 14:06:31 -04001381 "ImageIO.framework",
1382 "MobileCoreServices.framework",
1383 ]
1384 }
1385
abarth6fc8ff02016-07-15 15:15:15 -07001386 if (is_fuchsia) {
mtklein06c35c02016-09-20 12:28:12 -07001387 sources += [ "src/ports/SkDebug_stdio.cpp" ]
abarth6fc8ff02016-07-15 15:15:15 -07001388 }
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001389
1390 if (skia_enable_spirv_validation) {
Stephen White238fc242019-08-26 10:19:23 -04001391 deps += [ "//third_party/spirv-tools:spvtools_val" ]
Brian Osmanfb32ddf2019-06-18 10:14:20 -04001392 defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
1393 }
Nathaniel Nifong0c4fbf12019-06-25 15:48:47 -04001394
1395 if (skia_include_multiframe_procs) {
1396 sources += [ "tools/SkSharingProc.cpp" ]
1397 }
mtkleinc04ff472016-06-23 10:29:30 -07001398}
1399
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001400# DebugCanvas used in experimental/wasm-skp-debugger
1401if (target_cpu == "wasm") {
1402 static_library("debugcanvas") {
1403 public_configs = [ ":skia_public" ]
1404
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001405 sources = [
Nathaniel Nifong0426c382019-06-21 11:09:19 -04001406 "tools/SkSharingProc.cpp",
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001407 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05001408 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05001409 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05001410 "tools/debugger/DrawCommand.cpp",
1411 "tools/debugger/JsonWriteBuffer.cpp",
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001412 ]
Nathaniel Nifongad5f6cd2019-03-05 10:45:40 -05001413 }
1414}
1415
Kevin Lubickcbcff382018-10-02 09:02:18 -04001416static_library("pathkit") {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001417 check_includes = false
Kevin Lubickcbcff382018-10-02 09:02:18 -04001418 public_configs = [ ":skia_public" ]
1419 configs += skia_library_configs
1420
1421 deps = [
1422 ":arm64",
1423 ":armv7",
1424 ":avx",
1425 ":crc32",
1426 ":hsw",
1427 ":none",
1428 ":sse2",
1429 ":sse41",
1430 ":sse42",
1431 ":ssse3",
1432 ]
1433
Kevin Lubickcbcff382018-10-02 09:02:18 -04001434 sources = []
1435 sources += skia_pathops_sources
Hal Canaryc25f4e92019-02-26 11:54:25 -05001436 sources += skia_pathops_public
Kevin Lubickcbcff382018-10-02 09:02:18 -04001437 sources += [
1438 "src/core/SkAnalyticEdge.cpp",
1439 "src/core/SkArenaAlloc.cpp",
Mike Reedcc88f3a2019-02-06 11:40:27 -05001440 "src/core/SkContourMeasure.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001441 "src/core/SkCubicMap.cpp",
1442 "src/core/SkEdge.cpp",
1443 "src/core/SkEdgeBuilder.cpp",
1444 "src/core/SkEdgeClipper.cpp",
1445 "src/core/SkGeometry.cpp",
Brian Salomon71fe9452020-03-02 16:59:40 -05001446 "src/core/SkIDChangeListener.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001447 "src/core/SkLineClipper.cpp",
Hal Canary7823aeb2019-10-30 17:26:45 -04001448 "src/core/SkMalloc.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001449 "src/core/SkMallocPixelRef.cpp",
1450 "src/core/SkMath.cpp",
1451 "src/core/SkMatrix.cpp",
1452 "src/core/SkOpts.cpp",
1453 "src/core/SkPaint.cpp",
1454 "src/core/SkPath.cpp",
Mike Reed06d7c9d2020-08-26 12:56:51 -04001455 "src/core/SkPathBuilder.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001456 "src/core/SkPathEffect.cpp",
1457 "src/core/SkPathMeasure.cpp",
1458 "src/core/SkPathRef.cpp",
1459 "src/core/SkPoint.cpp",
1460 "src/core/SkRRect.cpp",
Mike Klein45f36b52020-06-08 14:10:29 -05001461 "src/core/SkReadBuffer.cpp",
Kevin Lubickcbcff382018-10-02 09:02:18 -04001462 "src/core/SkRect.cpp",
1463 "src/core/SkSemaphore.cpp",
1464 "src/core/SkStream.cpp",
1465 "src/core/SkString.cpp",
1466 "src/core/SkStringUtils.cpp",
1467 "src/core/SkStroke.cpp",
1468 "src/core/SkStrokeRec.cpp",
1469 "src/core/SkStrokerPriv.cpp",
1470 "src/core/SkThreadID.cpp",
1471 "src/core/SkUtils.cpp",
1472 "src/effects/SkDashPathEffect.cpp",
1473 "src/effects/SkTrimPathEffect.cpp",
1474 "src/ports/SkDebug_stdio.cpp",
1475 "src/ports/SkMemory_malloc.cpp",
1476 "src/utils/SkDashPath.cpp",
1477 "src/utils/SkParse.cpp",
1478 "src/utils/SkParsePath.cpp",
1479 "src/utils/SkUTF.cpp",
1480 ]
1481}
1482
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001483group("modules") {
1484 deps = [
Kevin Lubick96634842019-03-05 14:09:24 -05001485 "modules/particles",
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001486 "modules/skottie",
Mike Reed63559a52020-06-02 11:34:24 -04001487 "modules/skparagraph",
Kevin Lubick1ba9c4d2019-02-22 10:04:06 -05001488 "modules/skshaper",
1489 ]
1490}
1491
Brian Osmancd28fa62020-07-07 16:01:26 -04001492config("our_vulkan_headers") {
1493 include_dirs = [ "include/third_party/vulkan" ]
1494}
1495
mtkleinc095df52016-08-24 12:23:52 -07001496# Targets guarded by skia_enable_tools may use //third_party freely.
1497if (skia_enable_tools) {
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001498 skia_public_includes = [
Leon Scroggins III63cfb362020-04-24 13:00:48 -04001499 "client_utils/android",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001500 "include/android",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001501 "include/c",
1502 "include/codec",
1503 "include/config",
1504 "include/core",
1505 "include/docs",
1506 "include/effects",
1507 "include/encode",
1508 "include/gpu",
1509 "include/pathops",
1510 "include/ports",
1511 "include/svg",
1512 "include/utils",
1513 "include/utils/mac",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001514 "modules/particles/include",
1515 "modules/skottie/include",
Julia Lavrova70258c72020-07-15 11:28:57 -04001516 "modules/skparagraph/include",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001517 "modules/skshaper/include",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001518 "modules/svg/include",
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001519 ]
1520
Mike Klein308b5ac2016-12-06 16:03:52 -05001521 # Used by gn_to_bp.py to list our public include dirs.
1522 source_set("public") {
1523 configs += [ ":skia_public" ]
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001524 include_dirs = skia_public_includes
Mike Klein308b5ac2016-12-06 16:03:52 -05001525 }
1526
Mike Kleinc36dedf2016-11-18 09:35:28 -05001527 config("skia.h_config") {
1528 include_dirs = [ "$target_gen_dir" ]
1529 }
1530 action("skia.h") {
1531 public_configs = [ ":skia.h_config" ]
1532 skia_h = "$target_gen_dir/skia.h"
1533 script = "gn/find_headers.py"
Florin Malita6e4d95f2018-05-30 09:27:32 -04001534
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001535 args = [ rebase_path("//bin/gn") ] + [ rebase_path("//") ] +
1536 [ rebase_path(skia_h, root_build_dir) ] +
1537 rebase_path(skia_public_includes)
Mike Kleinc36dedf2016-11-18 09:35:28 -05001538 depfile = "$skia_h.deps"
Mike Kleina01c6b02020-04-01 13:47:34 -05001539 outputs = [ skia_h ]
Mike Kleinc36dedf2016-11-18 09:35:28 -05001540 }
1541
Brian Osmanc9a42472018-05-31 13:17:12 -04001542 if (target_cpu == "x64") {
Mike Kleinc36dedf2016-11-18 09:35:28 -05001543 executable("fiddle") {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001544 check_includes = false
Mike Kleinc36dedf2016-11-18 09:35:28 -05001545 libs = []
Mike Kleinc36dedf2016-11-18 09:35:28 -05001546 sources = [
Mike Kleinc36dedf2016-11-18 09:35:28 -05001547 "tools/fiddle/draw.cpp",
1548 "tools/fiddle/fiddle_main.cpp",
1549 ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001550
1551 if (skia_use_egl) {
1552 sources += [ "tools/fiddle/egl_context.cpp" ]
Joe Gregorioa8fabd32017-05-31 09:45:19 -04001553 } else {
1554 sources += [ "tools/fiddle/null_context.cpp" ]
1555 }
Joe Gregorio1e735c02017-04-19 14:05:14 -04001556 testonly = true
Mike Kleinc36dedf2016-11-18 09:35:28 -05001557 deps = [
Joe Gregorio1e735c02017-04-19 14:05:14 -04001558 ":flags",
Robert Phillips57e08282017-11-16 14:59:48 -05001559 ":gpu_tool_utils",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001560 ":skia",
1561 ":skia.h",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001562 "modules/particles",
Florin Malita6e4d95f2018-05-30 09:27:32 -04001563 "modules/skottie",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001564 "modules/skparagraph",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04001565 "modules/skshaper",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05001566 "modules/svg",
Mike Kleinc36dedf2016-11-18 09:35:28 -05001567 ]
1568 }
1569 }
1570
Mike Kleine5463e62020-06-11 13:53:53 -05001571 config("cpp14") {
1572 if (is_win) {
1573 cflags_cc = [ "/std:c++14" ]
1574 } else {
1575 cflags_cc = [ "-std=c++14" ]
1576 }
1577 }
1578
Brian Osmanc9a42472018-05-31 13:17:12 -04001579 source_set("public_headers_warnings_check") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001580 sources = [ "tools/public_headers_warnings_check.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001581 configs -= [ "//gn:warnings_except_public_headers" ]
Mike Kleine5463e62020-06-11 13:53:53 -05001582 configs += [
1583 ":our_vulkan_headers",
1584 ":cpp14",
1585 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001586 deps = [
1587 ":skia",
1588 ":skia.h",
1589 "modules/skottie",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04001590 "modules/skshaper",
Brian Osmanc9a42472018-05-31 13:17:12 -04001591 ]
Stephen White0d70b712019-07-10 15:51:30 -04001592
1593 if (skia_use_dawn) {
Zhenyao Mo4f17b602020-04-13 15:26:17 -07001594 deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen White0d70b712019-07-10 15:51:30 -04001595 }
Mike Kleinc36dedf2016-11-18 09:35:28 -05001596 }
1597
mtkleinc095df52016-08-24 12:23:52 -07001598 template("test_lib") {
1599 config(target_name + "_config") {
mtkleina627b5c2016-09-20 13:36:47 -07001600 if (defined(invoker.public_defines)) {
1601 defines = invoker.public_defines
1602 }
mtklein25c81d42016-07-27 13:55:26 -07001603 }
mtkleinc095df52016-08-24 12:23:52 -07001604 source_set(target_name) {
Mike Kleinc0bd9f92019-04-23 12:05:21 -05001605 forward_variables_from(invoker, "*", [])
Hal Canaryc25f4e92019-02-26 11:54:25 -05001606 check_includes = false
mtkleinc095df52016-08-24 12:23:52 -07001607 public_configs = [
1608 ":" + target_name + "_config",
1609 ":skia_private",
1610 ]
1611
1612 if (!defined(deps)) {
1613 deps = []
1614 }
1615 deps += [ ":skia" ]
1616 testonly = true
1617 }
mtklein25c81d42016-07-27 13:55:26 -07001618 }
mtklein25c81d42016-07-27 13:55:26 -07001619
Mike Kleine6682eb2017-01-05 10:54:57 -05001620 template("test_app") {
Jim Van Verth443a9132017-11-28 09:45:26 -05001621 if (is_ios) {
Hal Canary3388c1a2019-09-16 12:53:17 -04001622 ios_app_bundle(target_name) {
Jim Van Verth443a9132017-11-28 09:45:26 -05001623 forward_variables_from(invoker,
1624 "*",
1625 [
1626 "output_name",
1627 "visibility",
1628 "is_shared_library",
1629 ])
Mike Kleine6682eb2017-01-05 10:54:57 -05001630 testonly = true
Hal Canary3388c1a2019-09-16 12:53:17 -04001631 extra_configs = [ ":skia_private" ]
1632 launchscreen = "platform_tools/ios/app/LaunchScreen.storyboard"
1633 data_sources = [ "resources" ]
1634 if ("True" == exec_script("//gn/checkdir.py",
1635 [ rebase_path("skps", root_build_dir) ],
1636 "trim string")) {
1637 data_sources += [ "skps" ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001638 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001639 }
1640 } else {
Jim Van Verth443a9132017-11-28 09:45:26 -05001641 # !is_ios
1642
Jim Van Verth92411c72020-04-03 15:18:31 -04001643 output_dir = root_build_dir
Jim Van Verth443a9132017-11-28 09:45:26 -05001644 if (defined(invoker.is_shared_library) && invoker.is_shared_library) {
1645 shared_library("lib" + target_name) {
1646 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1647 configs += [ ":skia_private" ]
1648 testonly = true
1649 }
1650 } else {
1651 _executable = target_name
1652 executable(_executable) {
Hal Canaryc25f4e92019-02-26 11:54:25 -05001653 check_includes = false
Jim Van Verth443a9132017-11-28 09:45:26 -05001654 forward_variables_from(invoker, "*", [ "is_shared_library" ])
1655 configs += [ ":skia_private" ]
1656 testonly = true
1657 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001658 }
Jim Van Verth443a9132017-11-28 09:45:26 -05001659 if (is_android && skia_android_serial != "" && defined(_executable)) {
1660 action("push_" + target_name) {
1661 script = "gn/push_to_android.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05001662 deps = [ ":" + _executable ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001663 _stamp = "$target_gen_dir/$_executable.pushed_$skia_android_serial"
Mike Kleina01c6b02020-04-01 13:47:34 -05001664 outputs = [ _stamp ]
Jim Van Verth443a9132017-11-28 09:45:26 -05001665 args = [
1666 rebase_path("$root_build_dir/$_executable"),
1667 skia_android_serial,
1668 rebase_path(_stamp),
1669 ]
1670 testonly = true
1671 }
Mike Klein7d921032017-01-05 12:20:41 -05001672 }
1673 }
Mike Kleine6682eb2017-01-05 10:54:57 -05001674 }
1675
mtkleinc095df52016-08-24 12:23:52 -07001676 test_lib("gpu_tool_utils") {
Brian Osmanc9a42472018-05-31 13:17:12 -04001677 public_defines = []
mtkleind68f9b02016-09-23 13:18:41 -07001678
Mike Klein9e25bb92019-04-29 09:46:36 -05001679 # Bots and even devs may not have Vulkan headers, so put
1680 # include/third_party/vulkan on our path so they're always available.
1681 all_dependent_configs = [ ":our_vulkan_headers" ]
1682
Mike Klein333fb452019-04-24 08:48:11 -05001683 defines = []
1684 if (skia_enable_discrete_gpu) {
1685 defines += [ "SK_ENABLE_DISCRETE_GPU" ]
1686 }
1687
Brian Osmanc9a42472018-05-31 13:17:12 -04001688 deps = []
Greg Danielda16cce2018-08-01 09:23:57 -04001689 public_deps = []
Brian Osmanc9a42472018-05-31 13:17:12 -04001690 sources = [
Brian Salomon72c7b982020-10-06 10:07:38 -04001691 "tools/gpu/BackendSurfaceFactory.cpp",
1692 "tools/gpu/BackendSurfaceFactory.h",
Brian Salomon63a0a752020-06-26 13:32:09 -04001693 "tools/gpu/BackendTextureImageFactory.cpp",
1694 "tools/gpu/BackendTextureImageFactory.h",
Robert Phillips00f78de2020-07-01 16:09:43 -04001695 "tools/gpu/FlushFinishTracker.cpp",
1696 "tools/gpu/FlushFinishTracker.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001697 "tools/gpu/GrContextFactory.cpp",
1698 "tools/gpu/GrTest.cpp",
Brian Salomonf9b00422020-10-08 16:00:14 -04001699 "tools/gpu/ManagedBackendTexture.cpp",
1700 "tools/gpu/ManagedBackendTexture.h",
Brian Salomon00a5eb82018-07-11 15:32:05 -04001701 "tools/gpu/MemoryCache.cpp",
1702 "tools/gpu/MemoryCache.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04001703 "tools/gpu/ProxyUtils.cpp",
1704 "tools/gpu/TestContext.cpp",
Brian Salomone21af502019-11-22 16:56:36 -05001705 "tools/gpu/TestOps.cpp",
1706 "tools/gpu/TestOps.h",
Michael Ludwigd9958f82019-03-21 13:08:36 -04001707 "tools/gpu/YUVUtils.cpp",
1708 "tools/gpu/YUVUtils.h",
Mike Kleina01c6b02020-04-01 13:47:34 -05001709 "tools/gpu/gl/GLTestContext.cpp", # See comment below about
1710 # GrContextFactory workaround.
Brian Osmanc9a42472018-05-31 13:17:12 -04001711 "tools/gpu/mock/MockTestContext.cpp",
1712 ]
Brian Salomon1171d312020-03-19 08:47:44 -04001713
1714 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04001715 frameworks = []
Brian Salomon1171d312020-03-19 08:47:44 -04001716
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001717 if (skia_use_gl) {
Herb Derby64aa5132020-06-03 12:14:55 -04001718 sources +=
1719 [ "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.cpp" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001720 if (is_ios) {
1721 sources += [ "tools/gpu/gl/iOS/CreatePlatformGLTestContext_iOS.mm" ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001722 frameworks += [ "OpenGLES.framework" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001723 } else if (is_mac) {
1724 sources += [ "tools/gpu/gl/mac/CreatePlatformGLTestContext_mac.cpp" ]
Brian Osman0c757272018-12-10 10:27:26 -05001725 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001726 if (skia_use_angle) {
1727 deps += [ "//third_party/angle2" ]
1728 sources += [ "tools/gpu/gl/angle/GLTestContext_angle.cpp" ]
1729 }
Brian Salomon1171d312020-03-19 08:47:44 -04001730 }
1731
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001732 # We need the GLTestContext on Vulkan-only builds for the persistent GL context workaround in
1733 # in GrContextFactory. This only matters for OSes that can run Vulkan.
Chris Dalton2b598902020-03-25 10:50:35 -06001734 if ((skia_use_gl || skia_use_vulkan) && target_cpu != "wasm") {
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001735 if (is_android || skia_use_egl) {
1736 sources += [ "tools/gpu/gl/egl/CreatePlatformGLTestContext_egl.cpp" ]
1737 libs += [ "EGL" ]
1738 } else if (is_linux) {
1739 sources += [ "tools/gpu/gl/glx/CreatePlatformGLTestContext_glx.cpp" ]
1740 libs += [
1741 "GLU",
1742 "GL",
1743 "X11",
1744 ]
1745 } else if (is_win) {
1746 sources += [ "tools/gpu/gl/win/CreatePlatformGLTestContext_win.cpp" ]
1747 libs += [ "Gdi32.lib" ]
1748 if (target_cpu != "arm64") {
1749 libs += [ "OpenGL32.lib" ]
1750 }
1751 }
Brian Osmanc9a42472018-05-31 13:17:12 -04001752 }
Greg Daniel54200e42018-12-11 17:03:39 -05001753
Brian Osmanc9a42472018-05-31 13:17:12 -04001754 if (skia_use_vulkan) {
Robert Phillipsae413d82020-06-10 11:04:51 -04001755 sources += [ "tools/gpu/vk/VkTestContext.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001756 sources += [ "tools/gpu/vk/VkTestContext.cpp" ]
Robert Phillips0d6ce7c2020-06-11 08:51:50 -04001757 sources += [ "tools/gpu/vk/VkTestHelper.h" ]
1758 sources += [ "tools/gpu/vk/VkTestHelper.cpp" ]
Robert Phillipsae413d82020-06-10 11:04:51 -04001759 sources += [ "tools/gpu/vk/VkTestUtils.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001760 sources += [ "tools/gpu/vk/VkTestUtils.cpp" ]
Robert Phillipsae413d82020-06-10 11:04:51 -04001761 sources += [ "tools/gpu/vk/VkYcbcrSamplerHelper.h" ]
1762 sources += [ "tools/gpu/vk/VkYcbcrSamplerHelper.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04001763 }
1764 if (skia_use_metal) {
1765 sources += [ "tools/gpu/mtl/MtlTestContext.mm" ]
mtkleina627b5c2016-09-20 13:36:47 -07001766 }
Jim Van Verthb01e12b2020-02-18 14:34:38 -05001767 if (skia_use_direct3d) {
1768 sources += [ "tools/gpu/d3d/D3DTestContext.cpp" ]
Jim Van Verth03b8ab22020-02-24 11:36:15 -05001769 sources += [ "tools/gpu/d3d/D3DTestUtils.cpp" ]
Jim Van Verthb01e12b2020-02-18 14:34:38 -05001770 }
Stephen White985741a2019-07-18 11:43:45 -04001771 if (skia_use_dawn) {
Zhenyao Mo4f17b602020-04-13 15:26:17 -07001772 public_deps += [ "//third_party/externals/dawn/src/dawn:dawn_headers" ]
Stephen White985741a2019-07-18 11:43:45 -04001773 sources += [ "tools/gpu/dawn/DawnTestContext.cpp" ]
Stephen White3ae5b292020-06-01 15:45:56 -04001774 if (is_clang) {
1775 cflags_cc = [ "-Wno-microsoft-cast" ]
1776 }
Stephen White985741a2019-07-18 11:43:45 -04001777 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04001778
1779 if (is_fuchsia && using_fuchsia_sdk) {
1780 libs +=
1781 [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ]
1782 }
Jim Van Verth36b86af2020-08-24 17:16:46 +00001783
1784 cflags_objcc = [ "-fobjc-arc" ]
John Rosasco24cbdab2019-09-25 14:14:35 -07001785 } # test_lib("gpu_tool_utils")
mtklein25c81d42016-07-27 13:55:26 -07001786
mtkleinc095df52016-08-24 12:23:52 -07001787 test_lib("flags") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001788 sources = [ "tools/flags/CommandLineFlags.cpp" ]
mtklein046cb562016-09-16 10:23:12 -07001789 }
Mike Kleinc6142d82019-03-25 10:54:59 -05001790
1791 test_lib("common_flags_config") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001792 sources = [ "tools/flags/CommonFlagsConfig.cpp" ]
1793 deps = [ ":flags" ]
1794 public_deps = [ ":gpu_tool_utils" ]
mtkleinc095df52016-08-24 12:23:52 -07001795 }
Mike Kleinc6142d82019-03-25 10:54:59 -05001796 test_lib("common_flags_gpu") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001797 sources = [ "tools/flags/CommonFlagsGpu.cpp" ]
1798 deps = [ ":flags" ]
1799 public_deps = [ ":gpu_tool_utils" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001800 }
1801 test_lib("common_flags_images") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001802 sources = [ "tools/flags/CommonFlagsImages.cpp" ]
1803 deps = [ ":flags" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001804 }
1805 test_lib("common_flags_aa") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001806 sources = [ "tools/flags/CommonFlagsAA.cpp" ]
1807 deps = [ ":flags" ]
Mike Kleinc6142d82019-03-25 10:54:59 -05001808 }
mtklein25c81d42016-07-27 13:55:26 -07001809
Mike Klein499f0ac2019-03-25 13:00:12 -05001810 test_lib("trace") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001811 deps = [ ":flags" ]
Mike Klein499f0ac2019-03-25 13:00:12 -05001812 sources = [
1813 "tools/trace/ChromeTracingTracer.cpp",
1814 "tools/trace/ChromeTracingTracer.h",
1815 "tools/trace/EventTracingPriv.cpp",
1816 "tools/trace/EventTracingPriv.h",
1817 "tools/trace/SkDebugfTracer.cpp",
1818 "tools/trace/SkDebugfTracer.h",
1819 ]
1820 }
1821
mtkleinc095df52016-08-24 12:23:52 -07001822 test_lib("tool_utils") {
mtkleinc095df52016-08-24 12:23:52 -07001823 sources = [
mtkleinb37c0342016-09-09 11:07:45 -07001824 "tools/AndroidSkDebugToStdOut.cpp",
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001825 "tools/AutoreleasePool.h",
Robert Phillips96601082018-05-29 16:13:26 -04001826 "tools/DDLPromiseImageHelper.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001827 "tools/DDLPromiseImageHelper.h",
Robert Phillips96601082018-05-29 16:13:26 -04001828 "tools/DDLTileHelper.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001829 "tools/DDLTileHelper.h",
mtklein0590fa52016-09-01 07:06:54 -07001830 "tools/LsanSuppressions.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001831 "tools/ProcStats.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001832 "tools/ProcStats.h",
mtkleinc095df52016-08-24 12:23:52 -07001833 "tools/Resources.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001834 "tools/Resources.h",
Hal Canarye574f1e2019-07-15 14:01:37 -04001835 "tools/SkMetaData.cpp",
1836 "tools/SkMetaData.h",
Nathaniel Nifong0426c382019-06-21 11:09:19 -04001837 "tools/SkSharingProc.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001838 "tools/SkSharingProc.h",
1839 "tools/Stats.h",
Mike Kleinea3f0142019-03-20 11:12:10 -05001840 "tools/ToolUtils.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001841 "tools/ToolUtils.h",
mtkleinc095df52016-08-24 12:23:52 -07001842 "tools/UrlDataManager.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001843 "tools/UrlDataManager.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001844 "tools/debugger/DebugCanvas.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001845 "tools/debugger/DebugCanvas.h",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05001846 "tools/debugger/DebugLayerManager.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001847 "tools/debugger/DebugLayerManager.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001848 "tools/debugger/DrawCommand.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001849 "tools/debugger/DrawCommand.h",
Mike Klein8f4e2242019-03-20 11:59:00 -05001850 "tools/debugger/JsonWriteBuffer.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001851 "tools/debugger/JsonWriteBuffer.h",
Mike Klein0cffcbf92019-03-20 11:08:46 -05001852 "tools/fonts/RandomScalerContext.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001853 "tools/fonts/RandomScalerContext.h",
Mike Klein0cffcbf92019-03-20 11:08:46 -05001854 "tools/fonts/TestEmptyTypeface.h",
1855 "tools/fonts/TestFontMgr.cpp",
1856 "tools/fonts/TestFontMgr.h",
1857 "tools/fonts/TestSVGTypeface.cpp",
1858 "tools/fonts/TestSVGTypeface.h",
1859 "tools/fonts/TestTypeface.cpp",
1860 "tools/fonts/TestTypeface.h",
Mike Kleinea3f0142019-03-20 11:12:10 -05001861 "tools/fonts/ToolUtilsFont.cpp",
mtkleinc095df52016-08-24 12:23:52 -07001862 "tools/random_parse_path.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001863 "tools/random_parse_path.h",
Hal Canary41248072019-07-11 16:32:53 -04001864 "tools/timer/TimeUtils.h",
mtkleinc095df52016-08-24 12:23:52 -07001865 "tools/timer/Timer.cpp",
John Stilesaffae532020-07-13 18:06:53 -04001866 "tools/timer/Timer.h",
mtkleinc095df52016-08-24 12:23:52 -07001867 ]
Chris Dalton2b598902020-03-25 10:50:35 -06001868 if (target_cpu != "wasm") {
1869 sources += [ "tools/CrashHandler.cpp" ]
1870 }
Mike Kleinadacaef2017-02-06 09:26:14 -05001871 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04001872 frameworks = []
Mike Kleinadacaef2017-02-06 09:26:14 -05001873 if (is_ios) {
1874 sources += [ "tools/ios_utils.m" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001875 sources += [ "tools/ios_utils.h" ]
1876 if (skia_use_metal) {
1877 sources += [ "tools/AutoreleasePool.mm" ]
1878 }
Jim Van Verthef820be2020-08-12 10:45:00 -04001879 frameworks += [ "Foundation.framework" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001880 } else if (is_mac) {
1881 if (skia_use_metal) {
1882 sources += [ "tools/AutoreleasePool.mm" ]
Jim Van Verthef820be2020-08-12 10:45:00 -04001883 frameworks += [ "Foundation.framework" ]
Jim Van Verth8a9a3712019-05-31 10:49:12 -04001884 }
James Clarkeb8c0dab2021-02-09 06:22:41 -08001885 } else if (is_win && !skia_enable_winuwp) {
Mike Kleinbf15b662019-04-15 11:32:16 -05001886 libs += [ "DbgHelp.lib" ]
Mike Kleinadacaef2017-02-06 09:26:14 -05001887 }
Mike Kleinbf15b662019-04-15 11:32:16 -05001888
Hal Canaryfd9bcab2018-04-24 11:47:23 -04001889 defines = []
1890 if (skia_tools_require_resources) {
1891 defines += [ "SK_TOOLS_REQUIRE_RESOURCES" ]
1892 }
mtkleinc095df52016-08-24 12:23:52 -07001893 deps = [
1894 ":flags",
Florin Malitab3418102020-10-15 18:10:29 -04001895 "modules/svg",
Mike Kleine4ad58a2019-03-26 09:05:52 -05001896 ]
Mike Kleina01c6b02020-04-01 13:47:34 -05001897 public_deps = [ ":gpu_tool_utils" ]
mtkleinc095df52016-08-24 12:23:52 -07001898 }
mtklein25c81d42016-07-27 13:55:26 -07001899
Mike Kleine11e5c12019-04-24 12:46:06 -05001900 test_lib("etc1") {
Mike Kleina01c6b02020-04-01 13:47:34 -05001901 sources = [ "third_party/etc1/etc1.cpp" ]
Mike Kleine11e5c12019-04-24 12:46:06 -05001902 }
1903
Mike Klein6e744122016-10-27 12:21:40 -04001904 import("gn/gm.gni")
mtkleinc095df52016-08-24 12:23:52 -07001905 test_lib("gm") {
mtkleinc095df52016-08-24 12:23:52 -07001906 sources = gm_sources
John Rosasco24cbdab2019-09-25 14:14:35 -07001907 if (skia_use_gl) {
1908 sources += gl_gm_sources
1909 }
mtkleinc095df52016-08-24 12:23:52 -07001910 deps = [
Mike Kleine11e5c12019-04-24 12:46:06 -05001911 ":etc1",
scroggo19b91532016-10-24 09:03:26 -07001912 ":flags",
mtkleinc095df52016-08-24 12:23:52 -07001913 ":skia",
1914 ":tool_utils",
Brian Osman84d884a2021-01-29 16:35:45 -05001915 "modules/particles",
Mike Reed2f0edd52018-05-31 14:22:30 -04001916 "modules/skottie",
Florin Malita26870722018-09-20 14:35:30 -04001917 "modules/skottie:gm",
Mike Reed63559a52020-06-02 11:34:24 -04001918 "modules/skparagraph",
1919 "modules/skparagraph:gm",
Brian Osmanc725e8f2019-04-10 14:08:44 -04001920 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07001921 ]
Mike Kleinc4abade2019-08-09 10:11:35 -04001922 if (is_skia_dev_build) {
1923 sources += [ "gm/fiddle.cpp" ]
1924 deps += [ ":skia.h" ]
1925 }
Mike Kleina01c6b02020-04-01 13:47:34 -05001926 public_deps = [ ":gpu_tool_utils" ]
Mike Reed7bf160e2019-05-17 16:50:51 -04001927
1928 if (skia_use_ffmpeg) {
Florin Malita123e3b82020-04-24 11:10:27 -04001929 deps += [ "experimental/ffmpeg:video_decoder" ]
Mike Reed7bf160e2019-05-17 16:50:51 -04001930 sources += [ "gm/video_decoder.cpp" ]
1931 }
mtkleinc095df52016-08-24 12:23:52 -07001932 }
mtklein25c81d42016-07-27 13:55:26 -07001933
Ben Wagnerbded42a2021-02-17 22:14:34 -05001934 test_lib("test") {
1935 sources = [
1936 "tests/Test.cpp",
1937 "tests/Test.h",
1938 "tests/TestUtils.cpp",
1939 "tests/TestUtils.h",
1940 ]
1941 deps = [
1942 ":flags",
1943 ":skia",
1944 ":tool_utils",
1945 ]
1946 public_deps = [
1947 ":gpu_tool_utils", # Test.h #includes headers from this target.
1948 ]
1949 }
1950
Mike Klein6e744122016-10-27 12:21:40 -04001951 import("gn/tests.gni")
mtkleinc095df52016-08-24 12:23:52 -07001952 test_lib("tests") {
Mike Klein6e744122016-10-27 12:21:40 -04001953 sources = tests_sources + pathops_tests_sources
Chinmay Garde3ee25e92020-09-01 15:10:14 -07001954 frameworks = []
Robert Phillips0c6daf02019-05-16 12:43:11 -04001955 if (skia_use_metal) {
1956 sources += metal_tests_sources
Jim Van Verth36b86af2020-08-24 17:16:46 +00001957 cflags_objcc = [ "-fobjc-arc" ]
Chinmay Garde3ee25e92020-09-01 15:10:14 -07001958 frameworks += [ "MetalKit.framework" ]
Robert Phillips0c6daf02019-05-16 12:43:11 -04001959 }
John Rosasco24cbdab2019-09-25 14:14:35 -07001960 if (skia_use_gl) {
1961 sources += gl_tests_sources
1962 }
mtkleinc095df52016-08-24 12:23:52 -07001963 deps = [
1964 ":flags",
Ben Wagnere75021e2021-02-17 22:18:34 -05001965 ":fontmgr_android_tests",
1966 ":fontmgr_fontconfig_tests",
mtkleinc095df52016-08-24 12:23:52 -07001967 ":skia",
Ben Wagnerbded42a2021-02-17 22:14:34 -05001968 ":test",
mtkleinc095df52016-08-24 12:23:52 -07001969 ":tool_utils",
Florin Malita26ae40f2020-06-08 12:03:48 -04001970 "experimental/skrive:tests",
Florin Malita94d4d3e2018-06-18 13:10:51 -04001971 "modules/skottie:tests",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04001972 "modules/skparagraph:tests",
Brian Osmanccb87522018-06-01 19:20:00 +00001973 "modules/sksg:tests",
Brian Osmanc725e8f2019-04-10 14:08:44 -04001974 "modules/skshaper",
Florin Malitadec78022020-12-17 16:36:54 -05001975 "modules/svg:tests",
mtkleinc095df52016-08-24 12:23:52 -07001976 "//third_party/libpng",
Leon Scroggins III194580d2019-02-22 12:32:16 -05001977 "//third_party/libwebp",
mtkleinc095df52016-08-24 12:23:52 -07001978 "//third_party/zlib",
1979 ]
1980 }
mtklein2f3416d2016-08-02 16:02:05 -07001981
Mike Klein6e744122016-10-27 12:21:40 -04001982 import("gn/bench.gni")
mtkleinc095df52016-08-24 12:23:52 -07001983 test_lib("bench") {
mtkleinc095df52016-08-24 12:23:52 -07001984 sources = bench_sources
mtkleinc095df52016-08-24 12:23:52 -07001985 deps = [
1986 ":flags",
1987 ":gm",
1988 ":gpu_tool_utils",
1989 ":skia",
1990 ":tool_utils",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04001991 "modules/skparagraph:bench",
Mike Reedd62d4062019-06-12 10:20:44 -04001992 "modules/skshaper",
mtkleinc095df52016-08-24 12:23:52 -07001993 ]
1994 }
mtklein2b6870c2016-07-28 14:17:33 -07001995
Mike Reedd62d4062019-06-12 10:20:44 -04001996 test_lib("experimental_xform") {
1997 sources = [
1998 "experimental/xform/SkShape.cpp",
1999 "experimental/xform/SkXform.cpp",
2000 "experimental/xform/XContext.cpp",
2001 ]
Mike Kleina01c6b02020-04-01 13:47:34 -05002002 deps = [ ":skia" ]
Mike Reedd62d4062019-06-12 10:20:44 -04002003 }
2004
Florin Malitabfe876a2018-09-02 12:33:59 -04002005 if (is_linux || is_mac) {
Florin Malita79725d32018-06-05 16:16:57 -04002006 test_app("skottie_tool") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002007 deps = [ "modules/skottie:tool" ]
Florin Malita79725d32018-06-05 16:16:57 -04002008 }
Florin Malitab3418102020-10-15 18:10:29 -04002009 test_app("svg_tool") {
2010 deps = [ "modules/svg:tool" ]
2011 }
Florin Malita79725d32018-06-05 16:16:57 -04002012 }
2013
Hal Canary5b39dc82019-04-17 13:29:46 -04002014 test_app("make_skqp_model") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002015 sources = [ "tools/skqp/make_skqp_model.cpp" ]
2016 deps = [ ":skia" ]
Hal Canary5b39dc82019-04-17 13:29:46 -04002017 }
2018
Chris Dalton2b598902020-03-25 10:50:35 -06002019 import("gn/samples.gni")
2020 test_lib("samples") {
2021 sources = samples_sources
2022 if (skia_enable_ccpr) {
2023 sources += samples_sources_ccpr
Kevin Lubickebf648e2017-09-21 13:45:16 -04002024 }
Mike Kleina01c6b02020-04-01 13:47:34 -05002025 public_deps = [ ":tool_utils" ]
Chris Dalton2b598902020-03-25 10:50:35 -06002026 deps = [
Chris Dalton2b598902020-03-25 10:50:35 -06002027 ":flags",
2028 ":gpu_tool_utils",
2029 ":xml",
Jorge Betancourtb8621312020-09-10 15:16:35 -04002030 "modules/audioplayer",
Chris Dalton2b598902020-03-25 10:50:35 -06002031 "modules/skparagraph:samples",
2032 "modules/skshaper",
Florin Malitab3418102020-10-15 18:10:29 -04002033 "modules/svg",
Tyler Denniston189ecd42020-10-22 15:40:49 -04002034 "//third_party/imgui",
Chris Dalton2b598902020-03-25 10:50:35 -06002035 ]
Chris Dalton2b598902020-03-25 10:50:35 -06002036 }
Kevin Lubick00398742020-10-08 10:05:07 -04002037 test_lib("hash_and_encode") {
2038 sources = [
2039 "tools/HashAndEncode.cpp",
2040 "tools/HashAndEncode.h",
2041 ]
2042 deps = [
2043 ":flags",
2044 ":skia",
2045 "//third_party/libpng",
2046 ]
2047 }
Chris Dalton2b598902020-03-25 10:50:35 -06002048 if (target_cpu != "wasm") {
Nigel Tao3ab9b1f2020-05-28 13:29:13 +10002049 test_app("convert-to-nia") {
2050 sources = [ "tools/convert-to-nia.cpp" ]
2051 deps = [ ":skia" ]
2052 }
Mike Klein7af351a2018-07-27 09:54:43 -04002053 test_app("imgcvt") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002054 sources = [ "tools/imgcvt.cpp" ]
Mike Klein7af351a2018-07-27 09:54:43 -04002055 deps = [
2056 ":skcms",
2057 ":skia",
2058 ]
2059 }
Mike Klein735c7ba2019-03-25 12:57:58 -05002060 test_app("fm") {
2061 sources = [
Mike Kleinfee00792019-11-21 16:18:47 -06002062 "dm/DMGpuTestProcs.cpp", # blech
Mike Klein735c7ba2019-03-25 12:57:58 -05002063 "tools/fm/fm.cpp",
2064 ]
2065 deps = [
2066 ":common_flags_aa",
2067 ":common_flags_gpu",
2068 ":flags",
2069 ":gm",
2070 ":gpu_tool_utils",
2071 ":hash_and_encode",
2072 ":skia",
Mike Kleinfee00792019-11-21 16:18:47 -06002073 ":tests",
Mike Klein735c7ba2019-03-25 12:57:58 -05002074 ":tool_utils",
2075 ":trace",
Mike Klein22924262019-04-02 14:14:56 -04002076 "modules/skottie",
2077 "modules/skottie:utils",
Florin Malitab3418102020-10-15 18:10:29 -04002078 "modules/svg",
Mike Klein735c7ba2019-03-25 12:57:58 -05002079 ]
2080 }
Kevin Lubickebf648e2017-09-21 13:45:16 -04002081 test_app("dm") {
2082 sources = [
2083 "dm/DM.cpp",
Hal Canaryb6c5e5b2017-10-09 16:13:02 -04002084 "dm/DMGpuTestProcs.cpp",
Kevin Lubickebf648e2017-09-21 13:45:16 -04002085 "dm/DMJsonWriter.cpp",
2086 "dm/DMSrcSink.cpp",
2087 ]
Kevin Lubickebf648e2017-09-21 13:45:16 -04002088 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05002089 ":common_flags_aa",
2090 ":common_flags_config",
2091 ":common_flags_gpu",
2092 ":common_flags_images",
Kevin Lubickebf648e2017-09-21 13:45:16 -04002093 ":flags",
2094 ":gm",
2095 ":gpu_tool_utils",
Mike Klein735c7ba2019-03-25 12:57:58 -05002096 ":hash_and_encode",
Kevin Lubickebf648e2017-09-21 13:45:16 -04002097 ":skia",
2098 ":tests",
2099 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05002100 ":trace",
Florin Malita02616ea2020-06-25 13:33:17 -04002101 "experimental/skrive",
Florin Malita3d856bd2018-05-26 09:49:28 -04002102 "modules/skottie",
Florin Malitaa8316552018-11-09 16:19:44 -05002103 "modules/skottie:utils",
Florin Malitab3418102020-10-15 18:10:29 -04002104 "modules/svg",
Mike Klein38af9432016-11-11 11:39:44 -05002105 ]
2106 }
Michael Ludwig30217952020-12-04 12:58:35 -05002107
2108 # optional separate library to dlopen when running CanvasStateTests.
2109 shared_library("canvas_state_lib") {
2110 sources = [
2111 "tests/CanvasStateHelpers.cpp",
2112 "tests/CanvasStateHelpers.h",
2113 ]
2114 deps = [ ":skia" ]
2115 }
Brian Osman16adfa32016-10-18 14:42:44 -04002116 }
2117
Mike Kleina8a51ce2018-01-09 12:34:11 -05002118 if (!is_win) {
2119 test_app("remote_demo") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002120 sources = [ "tools/remote_demo.cpp" ]
2121 deps = [ ":skia" ]
Mike Kleina8a51ce2018-01-09 12:34:11 -05002122 }
2123 }
2124
Hal Canarye107faa2019-10-23 12:52:33 -04002125 if (!is_win) {
2126 test_app("blob_cache_sim") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002127 sources = [ "tools/blob_cache_sim.cpp" ]
2128 deps = [ ":skia" ]
Hal Canarye107faa2019-10-23 12:52:33 -04002129 }
2130 }
2131
Mike Kleine6682eb2017-01-05 10:54:57 -05002132 test_app("nanobench") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002133 sources = [ "bench/nanobench.cpp" ]
mtklein2b6870c2016-07-28 14:17:33 -07002134 deps = [
2135 ":bench",
Mike Kleinc6142d82019-03-25 10:54:59 -05002136 ":common_flags_aa",
2137 ":common_flags_config",
2138 ":common_flags_gpu",
2139 ":common_flags_images",
mtklein2b6870c2016-07-28 14:17:33 -07002140 ":flags",
2141 ":gm",
2142 ":gpu_tool_utils",
2143 ":skia",
2144 ":tool_utils",
Mike Klein499f0ac2019-03-25 13:00:12 -05002145 ":trace",
Mike Reed63559a52020-06-02 11:34:24 -04002146 "modules/skparagraph",
Julia Lavrovaa3552c52019-05-30 16:12:56 -04002147 "modules/skshaper",
Florin Malitab3418102020-10-15 18:10:29 -04002148 "modules/svg",
mtklein2b6870c2016-07-28 14:17:33 -07002149 ]
mtklein2b6870c2016-07-28 14:17:33 -07002150 }
halcanary19a97202016-08-03 15:08:04 -07002151
Ravi Mistry10d36c52017-01-31 09:49:18 -05002152 test_app("skpinfo") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002153 sources = [ "tools/skpinfo.cpp" ]
Ravi Mistry10d36c52017-01-31 09:49:18 -05002154 deps = [
2155 ":flags",
2156 ":skia",
2157 ]
2158 }
2159
Mike Reedc0ee21f2019-05-28 16:11:03 -04002160 if (skia_use_ffmpeg) {
2161 test_app("skottie2movie") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002162 sources = [ "tools/skottie2movie.cpp" ]
Mike Reedc0ee21f2019-05-28 16:11:03 -04002163 deps = [
2164 ":flags",
Mike Reed5f12eaa2019-09-24 12:01:58 -04002165 ":gpu_tool_utils",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002166 ":skia",
Florin Malitaec403602020-04-24 12:14:03 -04002167 "experimental/ffmpeg:video_encoder",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002168 "modules/skottie",
Mike Reed5093e232019-05-30 10:10:50 -04002169 "modules/skottie:utils",
Mike Reedc0ee21f2019-05-28 16:11:03 -04002170 ]
2171 }
2172 }
2173
Brian Osmanc9a42472018-05-31 13:17:12 -04002174 test_app("skpbench") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002175 sources = [ "tools/skpbench/skpbench.cpp" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002176 deps = [
Mike Kleinc6142d82019-03-25 10:54:59 -05002177 ":common_flags_config",
2178 ":common_flags_gpu",
Brian Osmanc9a42472018-05-31 13:17:12 -04002179 ":flags",
2180 ":gpu_tool_utils",
2181 ":skia",
2182 ":tool_utils",
2183 ]
csmartdalton4b5179b2016-09-19 11:03:58 -07002184 }
2185
Mike Kleine6682eb2017-01-05 10:54:57 -05002186 test_app("sktexttopdf") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002187 sources = [ "tools/using_skia_and_harfbuzz.cpp" ]
halcanary3eee9d92016-09-10 07:01:53 -07002188 deps = [
2189 ":skia",
Herb Derby264182c2018-05-29 15:53:40 -04002190 "modules/skshaper",
halcanary3eee9d92016-09-10 07:01:53 -07002191 ]
halcanary3eee9d92016-09-10 07:01:53 -07002192 }
mtklein046cb562016-09-16 10:23:12 -07002193
Ben Wagner219f3622017-07-17 15:32:25 -04002194 test_app("create_test_font") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002195 sources = [ "tools/fonts/create_test_font.cpp" ]
2196 deps = [ ":skia" ]
Ben Wagner219f3622017-07-17 15:32:25 -04002197 assert_no_deps = [
2198 # tool_utils requires the output of this app.
2199 ":tool_utils",
2200 ]
2201 }
2202
Florin Malita5d3ff432018-07-31 16:38:43 -04002203 if (skia_use_expat) {
2204 test_app("create_test_font_color") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002205 sources = [ "tools/fonts/create_test_font_color.cpp" ]
Florin Malita5d3ff432018-07-31 16:38:43 -04002206 deps = [
2207 ":flags",
2208 ":skia",
2209 ":tool_utils",
2210 ]
2211 }
Ben Wagner97182cc2018-02-15 10:20:04 -05002212 }
2213
Mike Kleine6682eb2017-01-05 10:54:57 -05002214 test_app("get_images_from_skps") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002215 sources = [ "tools/get_images_from_skps.cpp" ]
mtklein046cb562016-09-16 10:23:12 -07002216 deps = [
2217 ":flags",
2218 ":skia",
mtklein046cb562016-09-16 10:23:12 -07002219 ]
mtklein046cb562016-09-16 10:23:12 -07002220 }
mtkleinecbc5262016-09-22 11:51:24 -07002221
Brian Osman6788a542018-12-10 11:56:01 -05002222 if (!is_ios && target_cpu != "wasm" && !(is_win && target_cpu == "arm64")) {
Mike Kleine6682eb2017-01-05 10:54:57 -05002223 test_app("skiaserve") {
Mike Klein7d302882016-11-03 14:06:31 -04002224 sources = [
2225 "tools/skiaserve/Request.cpp",
2226 "tools/skiaserve/Response.cpp",
2227 "tools/skiaserve/skiaserve.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04002228 "tools/skiaserve/urlhandlers/BreakHandler.cpp",
2229 "tools/skiaserve/urlhandlers/ClipAlphaHandler.cpp",
2230 "tools/skiaserve/urlhandlers/CmdHandler.cpp",
2231 "tools/skiaserve/urlhandlers/ColorModeHandler.cpp",
2232 "tools/skiaserve/urlhandlers/DataHandler.cpp",
2233 "tools/skiaserve/urlhandlers/DownloadHandler.cpp",
2234 "tools/skiaserve/urlhandlers/EnableGPUHandler.cpp",
2235 "tools/skiaserve/urlhandlers/ImgHandler.cpp",
2236 "tools/skiaserve/urlhandlers/InfoHandler.cpp",
Brian Salomon144a5c52016-12-20 16:48:59 -05002237 "tools/skiaserve/urlhandlers/OpBoundsHandler.cpp",
2238 "tools/skiaserve/urlhandlers/OpsHandler.cpp",
Mike Klein7d302882016-11-03 14:06:31 -04002239 "tools/skiaserve/urlhandlers/OverdrawHandler.cpp",
2240 "tools/skiaserve/urlhandlers/PostHandler.cpp",
2241 "tools/skiaserve/urlhandlers/QuitHandler.cpp",
2242 "tools/skiaserve/urlhandlers/RootHandler.cpp",
2243 ]
2244 deps = [
2245 ":flags",
2246 ":gpu_tool_utils",
2247 ":skia",
2248 ":tool_utils",
Mike Klein7d302882016-11-03 14:06:31 -04002249 "//third_party/libmicrohttpd",
Mike Klein7d302882016-11-03 14:06:31 -04002250 ]
Mike Klein7d302882016-11-03 14:06:31 -04002251 }
mtkleinecbc5262016-09-22 11:51:24 -07002252 }
kjlubick14f984b2016-10-03 11:49:45 -07002253
Mike Kleine6682eb2017-01-05 10:54:57 -05002254 test_app("fuzz") {
kjlubick14f984b2016-10-03 11:49:45 -07002255 sources = [
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04002256 "fuzz/Fuzz.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002257 "fuzz/Fuzz.h",
Hal Canary24ac42b2017-02-14 13:35:14 -05002258 "fuzz/FuzzCanvas.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05002259 "fuzz/FuzzCommon.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002260 "fuzz/FuzzCommon.h",
Zepeng Hu94007012020-07-22 14:37:46 +00002261 "fuzz/FuzzCreateDDL.cpp",
Kevin Lubickfec1dea2016-11-22 13:57:18 -05002262 "fuzz/FuzzDrawFunctions.cpp",
Kevin Lubicke4be55d2018-03-30 15:05:13 -04002263 "fuzz/FuzzEncoders.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002264 "fuzz/FuzzGradients.cpp",
Kevin Lubickbc9a1a82018-09-17 14:46:57 -04002265 "fuzz/FuzzMain.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002266 "fuzz/FuzzParsePath.cpp",
Cary Clark91390c82018-03-09 14:02:46 -05002267 "fuzz/FuzzPathMeasure.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002268 "fuzz/FuzzPathop.cpp",
Jim Van Verth061cc212018-07-11 14:09:09 -04002269 "fuzz/FuzzPolyUtils.cpp",
Hal Canary13872dd2018-04-06 10:25:12 -04002270 "fuzz/FuzzRegionOp.cpp",
Weston Tracey6d4577b2020-12-30 13:29:00 -05002271 "fuzz/FuzzSkParagraph.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04002272 "fuzz/oss_fuzz/FuzzAndroidCodec.cpp",
Kevin Lubick2416f962018-02-12 08:26:39 -05002273 "fuzz/oss_fuzz/FuzzAnimatedImage.cpp",
2274 "fuzz/oss_fuzz/FuzzImage.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002275 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
Leon Scroggins III0b8fcbc2018-10-16 15:52:17 -04002276 "fuzz/oss_fuzz/FuzzIncrementalImage.cpp",
Florin Malita80452be2018-06-19 11:27:20 -04002277 "fuzz/oss_fuzz/FuzzJSON.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002278 "fuzz/oss_fuzz/FuzzPathDeserialize.cpp",
Kevin Lubick2541edf2018-01-11 10:27:14 -05002279 "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp",
2280 "fuzz/oss_fuzz/FuzzRegionSetPath.cpp",
Zepeng Hufcb7ba02020-07-31 17:21:29 +00002281 "fuzz/oss_fuzz/FuzzSKP.cpp",
Kevin Lubicke9c1ce82019-03-11 11:09:40 -04002282 "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp",
2283 "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp",
Kevin Lubick0f0a7102019-03-18 16:20:55 -04002284 "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp",
Kevin Lubicke9c1ce82019-03-11 11:09:40 -04002285 "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp",
Zepeng Huedaf3022020-06-12 12:20:59 +00002286 "fuzz/oss_fuzz/FuzzSVG.cpp",
Kevin Lubick2be14d32019-10-21 13:44:48 -04002287 "fuzz/oss_fuzz/FuzzSkDescriptorDeserialize.cpp",
Weston Tracey1a771fe2021-02-04 11:09:59 -05002288 "fuzz/oss_fuzz/FuzzSkParagraph.cpp",
Zepeng Hua5783f32020-07-10 13:36:20 +00002289 "fuzz/oss_fuzz/FuzzSkRuntimeEffect.cpp",
Kevin Lubickf034d112018-02-08 14:31:24 -05002290 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
Kevin Lubick9ff5dc92018-01-09 12:47:33 -05002291 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002292 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05002293 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002294 "tools/debugger/DrawCommand.cpp",
2295 "tools/debugger/JsonWriteBuffer.cpp",
kjlubick14f984b2016-10-03 11:49:45 -07002296 ]
2297 deps = [
2298 ":flags",
Hal Canary44801ca2017-03-15 11:39:06 -04002299 ":gpu_tool_utils",
kjlubick14f984b2016-10-03 11:49:45 -07002300 ":skia",
Florin Malita3d856bd2018-05-26 09:49:28 -04002301 "modules/skottie:fuzz",
Weston Tracey6d4577b2020-12-30 13:29:00 -05002302 "modules/skparagraph",
kjlubick14f984b2016-10-03 11:49:45 -07002303 ]
kjlubick14f984b2016-10-03 11:49:45 -07002304 }
Mike Klein38312422016-10-05 15:41:01 -04002305
Mike Kleine6682eb2017-01-05 10:54:57 -05002306 test_app("pathops_unittest") {
Mike Klein6e744122016-10-27 12:21:40 -04002307 sources = pathops_tests_sources + [
Mike Klein6e55fef2016-10-26 11:41:47 -04002308 rebase_path("tests/skia_test.cpp"),
2309 rebase_path("tests/Test.cpp"),
2310 ]
caryclark9feb6322016-10-25 08:58:26 -07002311 deps = [
2312 ":flags",
2313 ":gpu_tool_utils",
2314 ":skia",
2315 ":tool_utils",
2316 ]
caryclark9feb6322016-10-25 08:58:26 -07002317 }
2318
Mike Kleine6682eb2017-01-05 10:54:57 -05002319 test_app("dump_record") {
Mike Klein4a56f4c2020-08-18 16:02:52 -05002320 sources = [ "tools/dump_record.cpp" ]
Mike Klein38312422016-10-05 15:41:01 -04002321 deps = [
2322 ":flags",
2323 ":skia",
2324 ]
Mike Klein38312422016-10-05 15:41:01 -04002325 }
bungemanfe917272016-10-13 17:36:40 -04002326
Mike Kleine6682eb2017-01-05 10:54:57 -05002327 test_app("skdiff") {
bungemanfe917272016-10-13 17:36:40 -04002328 sources = [
2329 "tools/skdiff/skdiff.cpp",
2330 "tools/skdiff/skdiff_html.cpp",
2331 "tools/skdiff/skdiff_main.cpp",
2332 "tools/skdiff/skdiff_utils.cpp",
2333 ]
2334 deps = [
2335 ":skia",
2336 ":tool_utils",
2337 ]
bungemanfe917272016-10-13 17:36:40 -04002338 }
halcanarya73d76a2016-10-17 13:19:02 -07002339
Mike Kleine6682eb2017-01-05 10:54:57 -05002340 test_app("skp_parser") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002341 sources = [ "tools/skp_parser.cpp" ]
halcanarya73d76a2016-10-17 13:19:02 -07002342 deps = [
2343 ":skia",
2344 ":tool_utils",
halcanarya73d76a2016-10-17 13:19:02 -07002345 ]
halcanarya73d76a2016-10-17 13:19:02 -07002346 }
Brian Osman16adfa32016-10-18 14:42:44 -04002347
Brian Osmanc9a42472018-05-31 13:17:12 -04002348 if (!is_win) {
Colin Cross654eb2a2019-11-08 13:08:36 -08002349 source_set("skqp_lib") {
2350 check_includes = false
2351 testonly = true
2352 if (!is_official_build) {
2353 configs -= [ "//gn:warnings" ]
2354 }
2355 public_configs = [ ":skia_private" ]
Hal Canary0e07ad72018-02-08 13:06:56 -05002356 defines =
2357 [ "SK_SKQP_GLOBAL_ERROR_TOLERANCE=$skia_skqp_global_error_tolerance" ]
Hal Canary75427132017-10-11 16:00:31 -04002358 sources = [
2359 "dm/DMGpuTestProcs.cpp",
Hal Canaryac7f23c2018-11-26 14:07:41 -05002360 "tools/skqp/src/skqp.cpp",
2361 "tools/skqp/src/skqp_model.cpp",
Hal Canary75427132017-10-11 16:00:31 -04002362 ]
2363 deps = [
2364 ":gm",
Hal Canary75427132017-10-11 16:00:31 -04002365 ":skia",
2366 ":tests",
Hal Canaryd7b38452017-12-11 17:46:26 -05002367 ":tool_utils",
2368 ]
2369 }
2370 test_app("skqp") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002371 sources = [ "tools/skqp/src/skqp_main.cpp" ]
John Rosasco24cbdab2019-09-25 14:14:35 -07002372 include_dirs = [ "//" ]
2373 lib_dirs = []
Mike Kleina01c6b02020-04-01 13:47:34 -05002374 deps = [ ":skqp_lib" ]
Hal Canaryac7f23c2018-11-26 14:07:41 -05002375 }
2376 test_app("jitter_gms") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002377 sources = [ "tools/skqp/jitter_gms.cpp" ]
Hal Canaryac7f23c2018-11-26 14:07:41 -05002378 deps = [
2379 ":gm",
2380 ":skia",
2381 ":skqp_lib",
Hal Canary75427132017-10-11 16:00:31 -04002382 ]
2383 }
2384 }
John Rosasco24cbdab2019-09-25 14:14:35 -07002385 if (is_fuchsia) {
2386 # Build a package repository for skqp on Fuchsia.
2387 group("skqp_repo") {
2388 testonly = true
Mike Kleina01c6b02020-04-01 13:47:34 -05002389 deps = [ "//build/fuchsia/skqp:skqp_repo" ]
John Rosasco24cbdab2019-09-25 14:14:35 -07002390 }
2391 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002392 if (is_android) {
Colin Cross654eb2a2019-11-08 13:08:36 -08002393 shared_library("libskqp_app") {
2394 configs += [ ":skia_private" ]
2395 if (!is_official_build) {
2396 configs -= [ "//gn:warnings" ]
2397 }
2398 testonly = true
Mike Kleina01c6b02020-04-01 13:47:34 -05002399 sources = [ "tools/skqp/src/jni_skqp.cpp" ]
Hal Canary28f89382017-12-12 09:42:14 -05002400 deps = [
2401 ":skia",
2402 ":skqp_lib",
Hal Canaryb4d01a92018-01-29 13:10:08 -05002403 ":tool_utils",
Hal Canary28f89382017-12-12 09:42:14 -05002404 ]
2405 libs = [ "android" ]
2406 }
2407 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002408 if (is_android && skia_use_gl) {
Stan Iliev93151722018-08-02 11:10:52 -04002409 test_app("skottie_android") {
2410 is_shared_library = true
2411
Jorge Betancourt1fcdcaa2020-06-22 14:14:32 +00002412 sources = [ "platform_tools/android/apps/skottie/skottielib/src/main/cpp/native-lib.cpp" ]
Stan Iliev93151722018-08-02 11:10:52 -04002413 libs = []
2414
Stan Iliev93151722018-08-02 11:10:52 -04002415 deps = [
2416 ":skia",
2417 "modules/skottie",
Stan Ilieva7a52b92018-10-01 15:36:32 -04002418 "modules/sksg:samples",
Stan Iliev93151722018-08-02 11:10:52 -04002419 ]
2420 }
2421 }
Hal Canary75427132017-10-11 16:00:31 -04002422
Hal Canarya9de7602018-01-19 13:08:23 -05002423 test_app("list_gms") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002424 sources = [ "tools/list_gms.cpp" ]
Hal Canarya9de7602018-01-19 13:08:23 -05002425 deps = [
2426 ":gm",
2427 ":skia",
2428 ]
2429 }
2430 test_app("list_gpu_unit_tests") {
2431 sources = [
2432 "dm/DMGpuTestProcs.cpp",
2433 "tools/list_gpu_unit_tests.cpp",
2434 ]
2435 deps = [
2436 ":skia",
2437 ":tests",
2438 ]
2439 }
2440
Brian Osmanc9a42472018-05-31 13:17:12 -04002441 test_lib("sk_app") {
Hal Canary378be8d2019-04-26 08:20:14 -04002442 public_deps = [
Hal Canary378be8d2019-04-26 08:20:14 -04002443 ":gpu_tool_utils",
Hal Canary05694472019-05-03 17:14:21 -04002444 ":skia",
Hal Canary378be8d2019-04-26 08:20:14 -04002445 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002446 sources = [
John Stilesab9578e2020-06-30 17:36:55 -04002447 "tools/sk_app/Application.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002448 "tools/sk_app/CommandSet.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002449 "tools/sk_app/CommandSet.h",
2450 "tools/sk_app/DisplayParams.h",
2451 "tools/sk_app/RasterWindowContext.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002452 "tools/sk_app/Window.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002453 "tools/sk_app/Window.h",
Robert Phillipsed653392020-07-10 13:55:21 -04002454 "tools/sk_app/WindowContext.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002455 "tools/sk_app/WindowContext.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002456 ]
2457 libs = []
Jim Van Verthef820be2020-08-12 10:45:00 -04002458 frameworks = []
Brian Osmanc9a42472018-05-31 13:17:12 -04002459
2460 if (is_android) {
2461 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002462 "tools/sk_app/android/RasterWindowContext_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002463 "tools/sk_app/android/WindowContextFactory_android.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002464 "tools/sk_app/android/Window_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002465 "tools/sk_app/android/Window_android.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002466 "tools/sk_app/android/main_android.cpp",
2467 "tools/sk_app/android/surface_glue_android.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002468 "tools/sk_app/android/surface_glue_android.h",
Brian Osman16adfa32016-10-18 14:42:44 -04002469 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002470 libs += [ "android" ]
2471 } else if (is_linux) {
2472 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002473 "tools/sk_app/unix/RasterWindowContext_unix.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002474 "tools/sk_app/unix/WindowContextFactory_unix.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002475 "tools/sk_app/unix/Window_unix.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002476 "tools/sk_app/unix/Window_unix.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002477 "tools/sk_app/unix/keysym2ucs.c",
John Stilesab9578e2020-06-30 17:36:55 -04002478 "tools/sk_app/unix/keysym2ucs.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002479 "tools/sk_app/unix/main_unix.cpp",
Brian Osman16adfa32016-10-18 14:42:44 -04002480 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002481 libs += [
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002482 "GL", # Used by raster window context, so cannot be behind skia_use_gl.
Brian Osmanc9a42472018-05-31 13:17:12 -04002483 "X11",
2484 ]
2485 } else if (is_win) {
2486 sources += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002487 "tools/sk_app/win/RasterWindowContext_win.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002488 "tools/sk_app/win/WindowContextFactory_win.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002489 "tools/sk_app/win/Window_win.cpp",
John Stilesab9578e2020-06-30 17:36:55 -04002490 "tools/sk_app/win/Window_win.h",
Brian Osmanc9a42472018-05-31 13:17:12 -04002491 "tools/sk_app/win/main_win.cpp",
2492 ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002493 } else if (is_mac) {
2494 sources += [
Jim Van Verth1f086ca2019-01-28 14:46:04 -05002495 "tools/sk_app/mac/RasterWindowContext_mac.mm",
John Stilesab9578e2020-06-30 17:36:55 -04002496 "tools/sk_app/mac/WindowContextFactory_mac.h",
2497 "tools/sk_app/mac/Window_mac.h",
Jim Van Verth1f086ca2019-01-28 14:46:04 -05002498 "tools/sk_app/mac/Window_mac.mm",
2499 "tools/sk_app/mac/main_mac.mm",
Brian Osmanc9a42472018-05-31 13:17:12 -04002500 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04002501 frameworks += [
Brian Osmanc9a42472018-05-31 13:17:12 -04002502 "QuartzCore.framework",
2503 "Cocoa.framework",
2504 "Foundation.framework",
2505 ]
2506 } else if (is_ios) {
2507 sources += [
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002508 "tools/sk_app/ios/RasterWindowContext_ios.mm",
John Stilesab9578e2020-06-30 17:36:55 -04002509 "tools/sk_app/ios/WindowContextFactory_ios.h",
2510 "tools/sk_app/ios/Window_ios.h",
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002511 "tools/sk_app/ios/Window_ios.mm",
2512 "tools/sk_app/ios/main_ios.mm",
Brian Osmanc9a42472018-05-31 13:17:12 -04002513 ]
Jim Van Verthef820be2020-08-12 10:45:00 -04002514 frameworks += [ "QuartzCore.framework" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002515 }
2516
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002517 if (skia_use_gl) {
2518 sources += [ "tools/sk_app/GLWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002519 sources += [ "tools/sk_app/GLWindowContext.h" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002520 if (is_android) {
2521 sources += [ "tools/sk_app/android/GLWindowContext_android.cpp" ]
2522 } else if (is_linux) {
2523 sources += [ "tools/sk_app/unix/GLWindowContext_unix.cpp" ]
2524 } else if (is_win) {
2525 sources += [ "tools/sk_app/win/GLWindowContext_win.cpp" ]
2526 if (skia_use_angle) {
2527 sources += [ "tools/sk_app/win/ANGLEWindowContext_win.cpp" ]
2528 }
2529 } else if (is_mac) {
2530 sources += [ "tools/sk_app/mac/GLWindowContext_mac.mm" ]
2531 } else if (is_ios) {
2532 sources += [ "tools/sk_app/ios/GLWindowContext_ios.mm" ]
2533 }
2534 }
2535
Brian Osmanc9a42472018-05-31 13:17:12 -04002536 if (skia_use_vulkan) {
2537 sources += [ "tools/sk_app/VulkanWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002538 sources += [ "tools/sk_app/VulkanWindowContext.h" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002539 if (is_android) {
2540 sources += [ "tools/sk_app/android/VulkanWindowContext_android.cpp" ]
2541 } else if (is_linux) {
2542 sources += [ "tools/sk_app/unix/VulkanWindowContext_unix.cpp" ]
2543 libs += [ "X11-xcb" ]
2544 } else if (is_win) {
2545 sources += [ "tools/sk_app/win/VulkanWindowContext_win.cpp" ]
2546 }
2547 }
2548
Jim Van Verthbe39f712019-02-08 15:36:14 -05002549 if (skia_use_metal) {
2550 sources += [ "tools/sk_app/MetalWindowContext.mm" ]
John Stilesab9578e2020-06-30 17:36:55 -04002551 sources += [ "tools/sk_app/MetalWindowContext.h" ]
Jim Van Verthbe39f712019-02-08 15:36:14 -05002552 if (is_mac) {
2553 sources += [ "tools/sk_app/mac/MetalWindowContext_mac.mm" ]
Jim Van Verth68cb8b02019-08-29 14:59:17 -04002554 } else if (is_ios) {
Jim Van Verthe58d5322019-09-03 09:42:57 -04002555 sources += [ "tools/sk_app/ios/MetalWindowContext_ios.mm" ]
Jim Van Verthbe39f712019-02-08 15:36:14 -05002556 }
Jim Van Verthbe39f712019-02-08 15:36:14 -05002557 }
2558
Jim Van Verth682a2f42020-05-13 16:54:09 -04002559 if (skia_use_direct3d) {
2560 sources += [ "tools/sk_app/win/D3D12WindowContext_win.cpp" ]
2561 }
2562
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002563 if (skia_use_dawn) {
2564 sources += [ "tools/sk_app/DawnWindowContext.cpp" ]
John Stilesab9578e2020-06-30 17:36:55 -04002565 sources += [ "tools/sk_app/DawnWindowContext.h" ]
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002566 if (is_linux) {
2567 if (dawn_enable_vulkan) {
2568 sources += [ "tools/sk_app/unix/DawnVulkanWindowContext_unix.cpp" ]
2569 defines = [ "VK_USE_PLATFORM_XCB_KHR" ]
2570 libs += [ "X11-xcb" ]
2571 }
2572 } else if (is_win) {
2573 if (dawn_enable_d3d12) {
2574 sources += [ "tools/sk_app/win/DawnD3D12WindowContext_win.cpp" ]
2575 }
2576 } else if (is_mac) {
2577 if (dawn_enable_metal) {
2578 sources += [ "tools/sk_app/mac/DawnMTLWindowContext_mac.mm" ]
2579 }
2580 }
2581 }
2582
Mike Kleina01c6b02020-04-01 13:47:34 -05002583 deps = [ ":tool_utils" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002584 if (is_android) {
2585 deps += [ "//third_party/native_app_glue" ]
Brian Osmanc9a42472018-05-31 13:17:12 -04002586 }
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002587 if (skia_use_gl && skia_use_angle) {
Brian Osmanc9a42472018-05-31 13:17:12 -04002588 deps += [ "//third_party/angle2" ]
Mike Kleina92c3832016-12-08 09:49:39 -05002589 }
Brian Osman16adfa32016-10-18 14:42:44 -04002590 }
Ethan Nicholas4f3985c2016-11-14 11:16:37 -05002591
Hal Canary87515122019-03-15 14:22:51 -04002592 if (!skia_use_vulkan && (is_mac || is_linux || is_win)) {
2593 test_app("fiddle_examples") {
2594 sources = [
Brian Osmanc725e8f2019-04-10 14:08:44 -04002595 "tools/fiddle/all_examples.cpp",
Hal Canary87515122019-03-15 14:22:51 -04002596 "tools/fiddle/examples.cpp",
Brian Osman72ef2d52019-03-17 11:09:17 -04002597 "tools/fiddle/examples.h",
Hal Canary87515122019-03-15 14:22:51 -04002598 ]
Brian Osman72ef2d52019-03-17 11:09:17 -04002599 if (is_win) {
Hal Canary6c8422c2020-01-10 15:22:09 -05002600 cflags = [
2601 "/wd4756", # Overflow in constant arithmetic
2602 "/wd4305", # truncation from 'double' to 'float'
2603 ]
Brian Osman72ef2d52019-03-17 11:09:17 -04002604 }
Hal Canary87515122019-03-15 14:22:51 -04002605 deps = [
2606 ":skia",
2607 ":skia.h",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05002608 "modules/particles",
Hal Canary87515122019-03-15 14:22:51 -04002609 "modules/skottie",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05002610 "modules/skparagraph",
Florin Malitaa1dcaae2019-03-25 17:38:43 -04002611 "modules/skshaper",
Joe Gregorio7ae1b4c2020-12-28 14:37:39 -05002612 "modules/svg",
Hal Canary87515122019-03-15 14:22:51 -04002613 ]
2614 }
2615 }
Brian Osmanc9a42472018-05-31 13:17:12 -04002616
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002617 # sk_app can work without GL but viewer always runs raster through a GL window context.
2618 if (skia_use_gl) {
2619 test_app("viewer") {
2620 is_shared_library = is_android
2621 sources = [
2622 "tools/viewer/AnimTimer.h",
2623 "tools/viewer/BisectSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002624 "tools/viewer/BisectSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002625 "tools/viewer/GMSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002626 "tools/viewer/GMSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002627 "tools/viewer/ImGuiLayer.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002628 "tools/viewer/ImGuiLayer.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002629 "tools/viewer/ImageSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002630 "tools/viewer/ImageSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002631 "tools/viewer/ParticlesSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002632 "tools/viewer/ParticlesSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002633 "tools/viewer/SKPSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002634 "tools/viewer/SKPSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002635 "tools/viewer/SampleSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002636 "tools/viewer/SampleSlide.h",
Florin Malita45cd2002020-06-09 14:00:54 -04002637 "tools/viewer/SkRiveSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002638 "tools/viewer/SkRiveSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002639 "tools/viewer/SkSLSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002640 "tools/viewer/SkSLSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002641 "tools/viewer/SkottieSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002642 "tools/viewer/SkottieSlide.h",
2643 "tools/viewer/Slide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002644 "tools/viewer/SlideDir.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002645 "tools/viewer/SlideDir.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002646 "tools/viewer/StatsLayer.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002647 "tools/viewer/StatsLayer.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002648 "tools/viewer/SvgSlide.cpp",
Ben Wagnerfa8b5e42021-01-28 14:30:59 -05002649 "tools/viewer/SvgSlide.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002650 "tools/viewer/TouchGesture.cpp",
2651 "tools/viewer/TouchGesture.h",
2652 "tools/viewer/Viewer.cpp",
John Stiles6d3996c2020-07-31 12:33:31 -04002653 "tools/viewer/Viewer.h",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002654 ]
2655 libs = []
2656
2657 deps = [
2658 ":common_flags_gpu",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002659 ":flags",
2660 ":gm",
2661 ":gpu_tool_utils",
2662 ":samples",
2663 ":sk_app",
2664 ":skia",
2665 ":tool_utils",
2666 ":trace",
Florin Malita45cd2002020-06-09 14:00:54 -04002667 "experimental/skrive",
Florin Malitac9c4e2e2020-08-13 12:03:37 -04002668 "modules/audioplayer",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002669 "modules/particles",
2670 "modules/skottie",
2671 "modules/skottie:utils",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002672 "modules/sksg:samples",
Florin Malitab3418102020-10-15 18:10:29 -04002673 "modules/svg",
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002674 "//third_party/imgui",
2675 ]
2676 if (skia_use_experimental_xform) {
2677 deps += [ ":experimental_xform" ]
2678 sources += [ "gm/xform.cpp" ]
2679 }
Brian Osmanc85f1fa2020-06-16 15:11:34 -04002680 if (skia_use_vulkan) {
Brian Salomon3207fbe2020-06-30 11:09:25 -04002681 deps += [
2682 "//third_party/spirv-tools:spvtools",
2683
2684 #spvtools depends on this but doesn't deps it in. Looks like upstream bug
2685 #that we replicated in our third_party/spirv-tools/BUILD.gn
2686 "//third_party/spirv-tools:spvtools_val",
2687 ]
Brian Osmanc85f1fa2020-06-16 15:11:34 -04002688 }
Mike Reedd62d4062019-06-12 10:20:44 -04002689 }
Brian Osmaneff04b52017-11-21 13:18:02 -05002690 }
2691
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002692 if (skia_use_gl && !skia_use_angle && (is_linux || is_win || is_mac)) {
Brian Osmaneff04b52017-11-21 13:18:02 -05002693 test_app("HelloWorld") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002694 sources = [ "example/HelloWorld.cpp" ]
Brian Osmaneff04b52017-11-21 13:18:02 -05002695 libs = []
2696
Brian Osmaneff04b52017-11-21 13:18:02 -05002697 deps = [
2698 ":flags",
2699 ":gpu_tool_utils",
2700 ":sk_app",
2701 ":skia",
2702 ":tool_utils",
Brian Osmaneff04b52017-11-21 13:18:02 -05002703 ]
2704 }
2705 }
2706
Mike Klein9f6468f2020-05-19 13:14:40 -05002707 if (skia_use_gl && (is_linux || is_mac || is_ios)) {
Jim Van Verth4c70c752017-07-11 12:03:01 -04002708 test_app("SkiaSDLExample") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002709 sources = [ "example/SkiaSDLExample.cpp" ]
Jim Van Verth4c70c752017-07-11 12:03:01 -04002710 libs = []
Jim Van Verth4c70c752017-07-11 12:03:01 -04002711 deps = [
2712 ":gpu_tool_utils",
2713 ":skia",
2714 "//third_party/libsdl",
2715 ]
2716 }
2717 }
2718
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002719 if (skia_qt_path != "" && (is_win || is_linux || is_mac)) {
2720 action_foreach("generate_mocs") {
2721 script = "gn/call.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05002722 sources = [ "tools/mdbviz/MainWindow.h" ]
2723 outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_moc.cpp" ]
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002724 args = [
2725 "$skia_qt_path" + "/bin/moc",
2726 "{{source}}",
2727 "-o",
2728 "gen/mdbviz/{{source_name_part}}_moc.cpp",
2729 ]
2730 }
2731 action_foreach("generate_resources") {
2732 script = "gn/call.py"
Mike Kleina01c6b02020-04-01 13:47:34 -05002733 sources = [ "tools/mdbviz/resources.qrc" ]
2734 outputs = [ "$target_gen_dir/mdbviz/{{source_name_part}}_res.cpp" ]
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002735 args = [
2736 "$skia_qt_path" + "/bin/rcc",
2737 "{{source}}",
2738 "-o",
2739 "gen/mdbviz/{{source_name_part}}_res.cpp",
2740 ]
2741 }
2742 test_app("mdbviz") {
2743 if (is_win) {
2744 # on Windows we need to disable some exception handling warnings due to the Qt headers
2745 cflags = [ "/Wv:18" ] # 18 -> VS2013, 19 -> VS2015, 1910 -> VS2017
2746 }
2747 sources = [
Robert Phillips5fccf9d2017-09-05 15:10:12 -04002748 "tools/UrlDataManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002749 "tools/debugger/DebugCanvas.cpp",
Nathaniel Nifong20b177a2019-12-12 11:05:10 -05002750 "tools/debugger/DebugLayerManager.cpp",
Mike Klein8f4e2242019-03-20 11:59:00 -05002751 "tools/debugger/DrawCommand.cpp",
2752 "tools/debugger/JsonWriteBuffer.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002753 "tools/mdbviz/MainWindow.cpp",
Robert Phillipsdeaf5682017-09-06 13:07:21 -04002754 "tools/mdbviz/Model.cpp",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002755 "tools/mdbviz/main.cpp",
2756
2757 # generated files
2758 "$target_gen_dir/mdbviz/MainWindow_moc.cpp",
2759 "$target_gen_dir/mdbviz/resources_res.cpp",
2760 ]
2761 lib_dirs = [ "$skia_qt_path/lib" ]
2762 libs = [
2763 "Qt5Core.lib",
2764 "Qt5Gui.lib",
2765 "Qt5Widgets.lib",
2766 ]
2767 include_dirs = [
2768 "$skia_qt_path/include",
Robert Phillips276066b2017-09-06 17:17:44 -04002769 "$skia_qt_path/include/QtCore",
Robert Phillipsa6d2d702017-09-01 12:17:03 -04002770 "$skia_qt_path/include/QtWidgets",
2771 ]
2772 deps = [
2773 ":generate_mocs",
2774 ":generate_resources",
2775 ":skia",
2776 ]
2777 }
2778 }
2779
Mike Kleine459afd2017-03-03 09:21:30 -05002780 if (is_android && defined(ndk) && ndk != "") {
Derek Sollenberger70120c72017-01-05 11:39:04 -05002781 copy("gdbserver") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002782 sources = [ "$ndk/$ndk_gdbserver" ]
2783 outputs = [ "$root_out_dir/gdbserver" ]
Derek Sollenberger70120c72017-01-05 11:39:04 -05002784 }
Derek Sollenberger70120c72017-01-05 11:39:04 -05002785 }
Mike Kleinf9ae6702018-06-20 14:05:05 -04002786
2787 if (skia_use_opencl) {
2788 test_app("hello-opencl") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002789 sources = [ "tools/hello-opencl.cpp" ]
2790 deps = [ "//third_party/opencl" ]
Mike Kleinf9ae6702018-06-20 14:05:05 -04002791 }
2792 }
Hal Canaryb8f81af2019-04-24 13:56:16 -04002793
Brian Osmanf564f152019-07-23 15:14:30 -04002794 executable("cpu_modules") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002795 sources = [ "tools/cpu_modules.cpp" ]
Brian Osmanf564f152019-07-23 15:14:30 -04002796 deps = [
2797 ":skia",
2798 "modules/particles",
2799 ]
2800 }
2801
Brian Salomonf4ba4ec2020-03-19 15:54:28 -04002802 if (skia_use_gl && skia_use_icu && skia_use_harfbuzz) {
Hal Canary1f94d392019-07-30 09:27:56 -04002803 test_app("editor") {
2804 is_shared_library = is_android
Mike Kleina01c6b02020-04-01 13:47:34 -05002805 deps = [ "modules/skplaintexteditor:editor_app" ]
Hal Canary1f94d392019-07-30 09:27:56 -04002806 }
Hal Canaryb8f81af2019-04-24 13:56:16 -04002807 }
Hal Canarye5b65d22019-09-19 11:33:31 -04002808
2809 executable("image_diff_metric") {
Mike Kleina01c6b02020-04-01 13:47:34 -05002810 sources = [ "tools/image_diff_metric.cpp" ]
2811 deps = [ ":skia" ]
Hal Canarye5b65d22019-09-19 11:33:31 -04002812 }
Chris Dalton2b598902020-03-25 10:50:35 -06002813
2814 group("modules_testonly") {
2815 testonly = true
2816 deps = []
2817 if (target_cpu == "wasm") {
2818 deps += [ "modules/canvaskit:viewer_wasm" ]
2819 }
2820 }
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002821
2822 if (skia_build_fuzzers) {
2823 template("libfuzzer_app") {
2824 output_dir = root_build_dir
2825 executable(target_name) {
2826 check_includes = false
2827 forward_variables_from(invoker, "*", [ "is_shared_library" ])
2828 configs += [ ":skia_private" ]
2829 sources += [
2830 "fuzz/Fuzz.cpp",
2831 "fuzz/FuzzCommon.cpp",
2832 ]
2833 deps += [
2834 ":flags",
2835 ":gpu_tool_utils",
2836 ":skia",
2837 ]
2838 defines = [ "SK_BUILD_FOR_LIBFUZZER" ]
2839 if (skia_use_libfuzzer_defaults) {
2840 cflags = [ "-fsanitize=fuzzer" ]
2841 ldflags = [ "-fsanitize=fuzzer" ]
2842 }
2843 testonly = true
2844 }
2845 }
2846
2847 libfuzzer_app("region_deserialize") {
2848 sources = [ "fuzz/oss_fuzz/FuzzRegionDeserialize.cpp" ]
2849 deps = []
2850 }
2851
2852 libfuzzer_app("image_filter_deserialize") {
2853 include_dirs = [
2854 "tools",
2855 "tools/fonts",
2856 ]
2857 sources = [
2858 "fuzz/oss_fuzz/FuzzImageFilterDeserialize.cpp",
2859 "tools/Resources.cpp",
2860 "tools/fonts/TestFontMgr.cpp",
2861 "tools/fonts/TestSVGTypeface.cpp",
2862 "tools/fonts/TestTypeface.cpp",
2863 ]
Florin Malitab3418102020-10-15 18:10:29 -04002864 deps = [ "modules/svg" ]
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002865 }
2866
2867 libfuzzer_app("region_set_path") {
2868 sources = [ "fuzz/oss_fuzz/FuzzRegionSetPath.cpp" ]
2869 deps = []
2870 }
2871
2872 libfuzzer_app("textblob_deserialize") {
2873 include_dirs = [
2874 "tools",
2875 "tools/fonts",
2876 ]
2877 sources = [
2878 "fuzz/oss_fuzz/FuzzTextBlobDeserialize.cpp",
2879 "tools/Resources.cpp",
2880 "tools/fonts/TestFontMgr.cpp",
2881 "tools/fonts/TestSVGTypeface.cpp",
2882 "tools/fonts/TestTypeface.cpp",
2883 ]
Florin Malitab3418102020-10-15 18:10:29 -04002884 deps = [ "modules/svg" ]
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002885 }
2886
2887 libfuzzer_app("path_deserialize") {
2888 sources = [ "fuzz/oss_fuzz/FuzzPathDeserialize.cpp" ]
2889 deps = []
2890 }
2891
2892 libfuzzer_app("image_decode") {
2893 sources = [ "fuzz/oss_fuzz/FuzzImage.cpp" ]
2894 deps = []
2895 }
2896
2897 libfuzzer_app("animated_image_decode") {
2898 sources = [ "fuzz/oss_fuzz/FuzzAnimatedImage.cpp" ]
2899 deps = []
2900 }
2901
2902 libfuzzer_app("api_create_ddl") {
2903 include_dirs = [
2904 "include",
2905 "include/gpu",
2906 ]
2907 sources = [
2908 "fuzz/FuzzCreateDDL.cpp",
2909 "fuzz/oss_fuzz/FuzzAPICreateDDL.cpp",
2910 "tools/Resources.cpp",
2911 "tools/UrlDataManager.cpp",
2912 "tools/debugger/DebugCanvas.cpp",
2913 "tools/debugger/DebugLayerManager.cpp",
2914 "tools/debugger/DrawCommand.cpp",
2915 "tools/debugger/JsonWriteBuffer.cpp",
2916 "tools/fonts/TestFontMgr.cpp",
2917 "tools/fonts/TestSVGTypeface.cpp",
2918 "tools/fonts/TestTypeface.cpp",
2919 ]
2920 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04002921 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002922 "//third_party/libpng",
2923 ]
2924 }
2925
2926 libfuzzer_app("api_draw_functions") {
2927 sources = [
2928 "fuzz/FuzzDrawFunctions.cpp",
2929 "fuzz/oss_fuzz/FuzzDrawFunctions.cpp",
2930 ]
2931 deps = []
2932 }
2933
2934 libfuzzer_app("api_gradients") {
2935 sources = [
2936 "fuzz/FuzzGradients.cpp",
2937 "fuzz/oss_fuzz/FuzzGradients.cpp",
2938 ]
2939 deps = []
2940 }
2941
2942 libfuzzer_app("api_image_filter") {
2943 include_dirs = [
2944 "tools",
2945 "tools/debugger",
2946 ]
2947 sources = [
2948 "fuzz/FuzzCanvas.cpp",
2949 "fuzz/oss_fuzz/FuzzAPIImageFilter.cpp",
2950 "tools/UrlDataManager.cpp",
2951 "tools/debugger/DebugCanvas.cpp",
2952 "tools/debugger/DebugLayerManager.cpp",
2953 "tools/debugger/DrawCommand.cpp",
2954 "tools/debugger/JsonWriteBuffer.cpp",
2955 ]
2956 deps = [ "//third_party/libpng" ]
2957 }
2958
2959 libfuzzer_app("api_path_measure") {
2960 sources = [
2961 "fuzz/FuzzPathMeasure.cpp",
2962 "fuzz/oss_fuzz/FuzzPathMeasure.cpp",
2963 ]
2964 deps = []
2965 }
2966
2967 libfuzzer_app("api_pathop") {
2968 sources = [
2969 "fuzz/FuzzPathop.cpp",
2970 "fuzz/oss_fuzz/FuzzPathop.cpp",
2971 ]
2972 deps = []
2973 }
2974
2975 libfuzzer_app("api_raster_n32_canvas") {
2976 include_dirs = [
2977 "tools",
2978 "tools/debugger",
2979 "tools/fonts",
2980 ]
2981 sources = [
2982 "fuzz/FuzzCanvas.cpp",
2983 "fuzz/oss_fuzz/FuzzRasterN32Canvas.cpp",
2984 "tools/Resources.cpp",
2985 "tools/UrlDataManager.cpp",
2986 "tools/debugger/DebugCanvas.cpp",
2987 "tools/debugger/DebugLayerManager.cpp",
2988 "tools/debugger/DrawCommand.cpp",
2989 "tools/debugger/JsonWriteBuffer.cpp",
2990 "tools/fonts/TestFontMgr.cpp",
2991 "tools/fonts/TestSVGTypeface.cpp",
2992 "tools/fonts/TestTypeface.cpp",
2993 ]
2994 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04002995 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04002996 "//third_party/libpng",
2997 ]
2998 }
2999
3000 if (skia_use_gl) {
3001 libfuzzer_app("api_mock_gpu_canvas") {
3002 include_dirs = [
3003 "tools",
3004 "tools/debugger",
3005 "tools/fonts",
3006 ]
3007 sources = [
3008 "fuzz/FuzzCanvas.cpp",
3009 "fuzz/oss_fuzz/FuzzMockGPUCanvas.cpp",
3010 "tools/LsanSuppressions.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
3028 libfuzzer_app("api_null_canvas") {
3029 include_dirs = [
3030 "tools",
3031 "tools/debugger",
3032 "tools/fonts",
3033 ]
3034 sources = [
3035 "fuzz/FuzzCanvas.cpp",
3036 "fuzz/oss_fuzz/FuzzNullCanvas.cpp",
3037 "tools/Resources.cpp",
3038 "tools/UrlDataManager.cpp",
3039 "tools/debugger/DebugCanvas.cpp",
3040 "tools/debugger/DebugLayerManager.cpp",
3041 "tools/debugger/DrawCommand.cpp",
3042 "tools/debugger/JsonWriteBuffer.cpp",
3043 "tools/fonts/TestFontMgr.cpp",
3044 "tools/fonts/TestSVGTypeface.cpp",
3045 "tools/fonts/TestTypeface.cpp",
3046 ]
3047 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003048 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003049 "//third_party/libpng",
3050 ]
3051 }
3052
Weston Tracey1a771fe2021-02-04 11:09:59 -05003053 libfuzzer_app("api_skparagraph") {
3054 sources = [
3055 "fuzz/FuzzSkParagraph.cpp",
3056 "fuzz/oss_fuzz/FuzzSkParagraph.cpp",
3057 "tools/Resources.cpp",
3058 ]
3059 deps = [ "modules/skparagraph" ]
3060 }
3061
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003062 libfuzzer_app("api_svg_canvas") {
3063 include_dirs = [
3064 "include",
3065 "include/svg",
3066 ]
3067 sources = [
3068 "fuzz/FuzzCanvas.cpp",
3069 "fuzz/oss_fuzz/FuzzAPISVGCanvas.cpp",
3070 "tools/Resources.cpp",
3071 "tools/UrlDataManager.cpp",
3072 "tools/debugger/DebugCanvas.cpp",
3073 "tools/debugger/DebugLayerManager.cpp",
3074 "tools/debugger/DrawCommand.cpp",
3075 "tools/debugger/JsonWriteBuffer.cpp",
3076 "tools/fonts/TestFontMgr.cpp",
3077 "tools/fonts/TestSVGTypeface.cpp",
3078 "tools/fonts/TestTypeface.cpp",
3079 ]
3080 deps = [
Florin Malitab3418102020-10-15 18:10:29 -04003081 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003082 "//third_party/libpng",
3083 ]
3084 }
3085
3086 libfuzzer_app("png_encoder") {
3087 sources = [
3088 "fuzz/FuzzEncoders.cpp",
3089 "fuzz/oss_fuzz/FuzzPNGEncoder.cpp",
3090 ]
3091 deps = []
3092 }
3093
3094 libfuzzer_app("jpeg_encoder") {
3095 sources = [
3096 "fuzz/FuzzEncoders.cpp",
3097 "fuzz/oss_fuzz/FuzzJPEGEncoder.cpp",
3098 ]
3099 deps = []
3100 }
3101
3102 libfuzzer_app("webp_encoder") {
3103 sources = [
3104 "fuzz/FuzzEncoders.cpp",
3105 "fuzz/oss_fuzz/FuzzWEBPEncoder.cpp",
3106 ]
3107 deps = []
3108 }
3109
3110 libfuzzer_app("skottie_json") {
3111 sources = [
3112 "modules/skottie/fuzz/FuzzSkottieJSON.cpp",
3113 "tools/Resources.cpp",
3114 "tools/fonts/TestFontMgr.cpp",
3115 "tools/fonts/TestSVGTypeface.cpp",
3116 "tools/fonts/TestTypeface.cpp",
3117 ]
3118 deps = [
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003119 "modules/skottie:skottie",
Florin Malitab3418102020-10-15 18:10:29 -04003120 "modules/svg",
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003121 ]
3122 }
3123
3124 libfuzzer_app("skjson") {
3125 sources = [ "fuzz/oss_fuzz/FuzzJSON.cpp" ]
3126 deps = []
3127 }
3128
3129 libfuzzer_app("api_polyutils") {
3130 sources = [
3131 "fuzz/FuzzPolyUtils.cpp",
3132 "fuzz/oss_fuzz/FuzzPolyUtils.cpp",
3133 ]
3134 deps = [ ":skia" ]
3135 }
3136
3137 libfuzzer_app("android_codec") {
3138 sources = [ "fuzz/oss_fuzz/FuzzAndroidCodec.cpp" ]
3139 deps = []
3140 }
3141
3142 libfuzzer_app("image_decode_incremental") {
3143 sources = [ "fuzz/oss_fuzz/FuzzIncrementalImage.cpp" ]
3144 deps = []
3145 }
3146
3147 libfuzzer_app("sksl2glsl") {
3148 sources = [ "fuzz/oss_fuzz/FuzzSKSL2GLSL.cpp" ]
3149 deps = []
3150 }
3151
3152 libfuzzer_app("sksl2spirv") {
3153 sources = [ "fuzz/oss_fuzz/FuzzSKSL2SPIRV.cpp" ]
3154 deps = []
3155 }
3156
3157 libfuzzer_app("sksl2metal") {
3158 sources = [ "fuzz/oss_fuzz/FuzzSKSL2Metal.cpp" ]
3159 deps = []
3160 }
3161
3162 libfuzzer_app("sksl2pipeline") {
3163 sources = [ "fuzz/oss_fuzz/FuzzSKSL2Pipeline.cpp" ]
3164 deps = []
3165 }
3166
3167 libfuzzer_app("skdescriptor_deserialize") {
3168 sources = [ "fuzz/oss_fuzz/FuzzSkDescriptorDeserialize.cpp" ]
3169 deps = []
3170 }
3171
3172 libfuzzer_app("svg_dom") {
3173 sources = [ "fuzz/oss_fuzz/FuzzSVG.cpp" ]
Florin Malitab3418102020-10-15 18:10:29 -04003174 deps = [ "modules/svg" ]
Kevin Lubick272e8bc2020-09-15 10:05:41 -04003175 }
3176
3177 libfuzzer_app("skruntimeeffect") {
3178 sources = [ "fuzz/oss_fuzz/FuzzSkRuntimeEffect.cpp" ]
3179 deps = []
3180 }
3181
3182 libfuzzer_app("skp") {
3183 sources = [ "fuzz/oss_fuzz/FuzzSKP.cpp" ]
3184 deps = []
3185 }
3186 }
mtklein25c81d42016-07-27 13:55:26 -07003187}
Hal Canary932a2c02019-09-17 10:43:18 -04003188
Chinmay Gardea1ea0a92019-10-01 16:37:10 -07003189if (is_ios && skia_use_metal && !skia_enable_flutter_defines) {
Hal Canary932a2c02019-09-17 10:43:18 -04003190 group("minimal_ios_mtl_skia_app") {
Mike Kleina01c6b02020-04-01 13:47:34 -05003191 deps = [ "experimental/minimal_ios_mtl_skia_app" ]
Hal Canary932a2c02019-09-17 10:43:18 -04003192 }
Hal Canary27483062019-12-06 15:01:08 -05003193}
3194
Hal Canary60ff6512020-01-21 12:39:20 -05003195if (is_ios && skia_enable_skottie && !skia_enable_flutter_defines) {
Hal Canary932a2c02019-09-17 10:43:18 -04003196 group("skottie_ios") {
Mike Kleina01c6b02020-04-01 13:47:34 -05003197 deps = [ "tools/skottie_ios_app" ]
Hal Canary932a2c02019-09-17 10:43:18 -04003198 }
3199}
Martin Kustermannb65d2992020-12-15 16:15:13 +01003200
3201executable("skia_c_api_example") {
3202 sources = [ "experimental/c-api-example/skia-c-example.c" ]
3203 include_dirs = [ "." ]
3204 deps = [ ":skia" ]
3205}