• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright 2020 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5package gen_tasks_logic
6
7import (
8	"fmt"
9	"log"
10	"sort"
11	"strconv"
12	"strings"
13
14	"github.com/golang/glog"
15	"go.skia.org/infra/task_scheduler/go/specs"
16)
17
18// keyParams generates the key used by DM for Gold results.
19func keyParams(parts map[string]string) []string {
20	// Don't bother to include role, which is always Test.
21	ignored := []string{"role", "test_filter"}
22	keys := make([]string, 0, len(parts))
23	for key := range parts {
24		found := false
25		for _, b := range ignored {
26			if key == b {
27				found = true
28				break
29			}
30		}
31		if !found {
32			keys = append(keys, key)
33		}
34	}
35	sort.Strings(keys)
36	rv := make([]string, 0, 2*len(keys))
37	for _, key := range keys {
38		rv = append(rv, key, parts[key])
39	}
40	return rv
41}
42
43// dmFlags generates flags to DM based on the given task properties.
44func (b *taskBuilder) dmFlags(internalHardwareLabel string) {
45	properties := map[string]string{
46		"gitHash":              specs.PLACEHOLDER_REVISION,
47		"builder":              b.Name,
48		"buildbucket_build_id": specs.PLACEHOLDER_BUILDBUCKET_BUILD_ID,
49		"task_id":              specs.PLACEHOLDER_TASK_ID,
50		"issue":                specs.PLACEHOLDER_ISSUE,
51		"patchset":             specs.PLACEHOLDER_PATCHSET,
52		"patch_storage":        specs.PLACEHOLDER_PATCH_STORAGE,
53		"swarming_bot_id":      "${SWARMING_BOT_ID}",
54		"swarming_task_id":     "${SWARMING_TASK_ID}",
55	}
56
57	args := []string{
58		"dm",
59		"--nameByHash",
60	}
61
62	configs := []string{}
63	skipped := []string{}
64
65	hasConfig := func(cfg string) bool {
66		for _, c := range configs {
67			if c == cfg {
68				return true
69			}
70		}
71		return false
72	}
73	filter := func(slice []string, elems ...string) []string {
74		m := make(map[string]bool, len(elems))
75		for _, e := range elems {
76			m[e] = true
77		}
78		rv := make([]string, 0, len(slice))
79		for _, e := range slice {
80			if m[e] {
81				rv = append(rv, e)
82			}
83		}
84		return rv
85	}
86	remove := func(slice []string, elem string) []string {
87		rv := make([]string, 0, len(slice))
88		for _, e := range slice {
89			if e != elem {
90				rv = append(rv, e)
91			}
92		}
93		return rv
94	}
95	removeContains := func(slice []string, elem string) []string {
96		rv := make([]string, 0, len(slice))
97		for _, e := range slice {
98			if !strings.Contains(e, elem) {
99				rv = append(rv, e)
100			}
101		}
102		return rv
103	}
104	suffix := func(slice []string, sfx string) []string {
105		rv := make([]string, 0, len(slice))
106		for _, e := range slice {
107			rv = append(rv, e+sfx)
108		}
109		return rv
110	}
111
112	skip := func(quad ...string) {
113		if len(quad) == 1 {
114			quad = strings.Fields(quad[0])
115		}
116		if len(quad) != 4 {
117			log.Fatalf("Invalid value for --skip: %+v", quad)
118		}
119		config := quad[0]
120		src := quad[1]
121		options := quad[2]
122		name := quad[3]
123		if config == "_" ||
124			hasConfig(config) ||
125			(config[0] == '~' && hasConfig(config[1:])) {
126			skipped = append(skipped, config, src, options, name)
127		}
128	}
129
130	// Keys.
131	keys := keyParams(b.parts)
132	if b.extraConfig("Lottie") {
133		keys = append(keys, "renderer", "skottie")
134	}
135	if b.matchExtraConfig("DDL") {
136		// 'DDL' style means "--skpViewportSize 2048"
137		keys = append(keys, "style", "DDL")
138	} else {
139		keys = append(keys, "style", "default")
140	}
141	args = append(args, "--key")
142	args = append(args, keys...)
143
144	// This enables non-deterministic random seeding of the GPU FP optimization
145	// test.
146	// Not Android due to:
147	//  - https://skia.googlesource.com/skia/+/5910ed347a638ded8cd4c06dbfda086695df1112/BUILD.gn#160
148	//  - https://skia.googlesource.com/skia/+/ce06e261e68848ae21cac1052abc16bc07b961bf/tests/ProcessorTest.cpp#307
149	// Not MSAN due to:
150	//  - https://skia.googlesource.com/skia/+/0ac06e47269a40c177747310a613d213c95d1d6d/infra/bots/recipe_modules/flavor/gn_flavor.py#80
151	if !b.os("Android") && !b.extraConfig("MSAN") {
152		args = append(args, "--randomProcessorTest")
153	}
154
155	threadLimit := -1
156	const MAIN_THREAD_ONLY = 0
157
158	// 32-bit desktop bots tend to run out of memory, because they have relatively
159	// far more cores than RAM (e.g. 32 cores, 3G RAM).  Hold them back a bit.
160	if b.arch("x86") {
161		threadLimit = 4
162	}
163
164	// These bots run out of memory easily.
165	if b.model("MotoG4", "Nexus7") {
166		threadLimit = MAIN_THREAD_ONLY
167	}
168
169	// Avoid issues with dynamically exceeding resource cache limits.
170	if b.matchExtraConfig("DISCARDABLE") {
171		threadLimit = MAIN_THREAD_ONLY
172	}
173
174	if threadLimit >= 0 {
175		args = append(args, "--threads", strconv.Itoa(threadLimit))
176	}
177
178	sampleCount := 0
179	glPrefix := ""
180	if b.extraConfig("SwiftShader") {
181		configs = append(configs, "gles", "glesdft", "glesdmsaa")
182	} else if b.cpu() {
183		args = append(args, "--nogpu")
184
185		configs = append(configs, "8888")
186
187		if b.extraConfig("SkVM") {
188			args = append(args, "--skvm")
189		}
190
191		if b.extraConfig("BonusConfigs") {
192			configs = []string{
193				"g8", "565",
194				"pic-8888", "serialize-8888",
195				"linear-f16", "srgb-rgba", "srgb-f16", "narrow-rgba", "narrow-f16",
196				"p3-rgba", "p3-f16", "rec2020-rgba", "rec2020-f16"}
197		}
198
199		if b.extraConfig("PDF") {
200			configs = []string{"pdf"}
201			args = append(args, "--rasterize_pdf") // Works only on Mac.
202			// Take ~forever to rasterize:
203			skip("pdf gm _ lattice2")
204			skip("pdf gm _ hairmodes")
205			skip("pdf gm _ longpathdash")
206		}
207
208	} else if b.gpu() {
209		args = append(args, "--nocpu")
210
211		// Add in either gles or gl configs to the canonical set based on OS
212		glPrefix = "gl"
213		// Use 4x MSAA for all our testing. It's more consistent and 8x MSAA is nondeterministic (by
214		// design) on NVIDIA hardware. The problem is especially bad on ANGLE.  skia:6813 skia:6545
215		sampleCount = 4
216		if b.os("Android", "iOS") {
217			glPrefix = "gles"
218			// MSAA is disabled on Pixel3a (https://b.corp.google.com/issues/143074513).
219			// MSAA is disabled on Pixel5 (https://skbug.com/11152).
220			if b.model("Pixel3a", "Pixel5") {
221				sampleCount = 0
222			}
223		} else if b.matchGpu("Intel") {
224			// MSAA doesn't work well on Intel GPUs chromium:527565, chromium:983926
225			sampleCount = 0
226		} else if b.os("ChromeOS") {
227			glPrefix = "gles"
228		}
229
230		if b.extraConfig("NativeFonts") {
231			configs = append(configs, glPrefix)
232		} else {
233			configs = append(configs, glPrefix, glPrefix+"dft", "srgb-"+glPrefix)
234			if sampleCount > 0 {
235				configs = append(configs, fmt.Sprintf("%smsaa%d", glPrefix, sampleCount))
236				// Temporarily limit the bots we test dynamic MSAA on.
237				if b.gpu("QuadroP400", "MaliG77") || b.matchOs("Mac") {
238					configs = append(configs, fmt.Sprintf("%sdmsaa", glPrefix))
239				}
240			}
241		}
242
243		// The Tegra3 doesn't support MSAA
244		if b.gpu("Tegra3") ||
245			// We aren't interested in fixing msaa bugs on current iOS devices.
246			b.model("iPad4", "iPadPro", "iPhone6", "iPhone7") ||
247			// skia:5792
248			b.gpu("IntelHD530", "IntelIris540") {
249			configs = removeContains(configs, "msaa")
250		}
251
252		// We want to test both the OpenGL config and the GLES config on Linux Intel:
253		// GL is used by Chrome, GLES is used by ChromeOS.
254		// Also do the Ganesh threading verification test (render with and without
255		// worker threads, using only the SW path renderer, and compare the results).
256		if b.matchGpu("Intel") && b.isLinux() {
257			configs = append(configs, "gles", "glesdft", "srgb-gles", "gltestthreading")
258			// skbug.com/6333, skbug.com/6419, skbug.com/6702
259			skip("gltestthreading gm _ lcdblendmodes")
260			skip("gltestthreading gm _ lcdoverlap")
261			skip("gltestthreading gm _ textbloblooper")
262			// All of these GMs are flaky, too:
263			skip("gltestthreading gm _ savelayer_with_backdrop")
264			skip("gltestthreading gm _ persp_shaders_bw")
265			skip("gltestthreading gm _ dftext_blob_persp")
266			skip("gltestthreading gm _ dftext")
267			skip("gltestthreading gm _ gpu_blur_utils")
268			skip("gltestthreading gm _ gpu_blur_utils_ref")
269			skip("gltestthreading gm _ gpu_blur_utils_subset_rect")
270			skip("gltestthreading gm _ gpu_blur_utils_subset_rect_ref")
271			// skbug.com/7523 - Flaky on various GPUs
272			skip("gltestthreading gm _ orientation")
273			// These GMs only differ in the low bits
274			skip("gltestthreading gm _ stroketext")
275			skip("gltestthreading gm _ draw_image_set")
276		}
277
278		// CommandBuffer bot *only* runs the cmdbuffer_es2 configs.
279		if b.extraConfig("CommandBuffer") {
280			configs = []string{"cmdbuffer_es2"}
281			if sampleCount > 0 {
282				configs = append(configs, "cmdbuffer_es2_dmsaa")
283			}
284		}
285
286		// Dawn bot *only* runs the dawn config
287		if b.extraConfig("Dawn") {
288			// tint:1045: Tint doesn't implement MatrixInverse yet.
289			skip("_", "gm", "_", "runtime_intrinsics_matrix")
290			configs = []string{"dawn"}
291		}
292
293		// Graphite bot *only* runs the grmtl config
294		if b.extraConfig("Graphite") {
295			args = append(args, "--nogpu") // disable non-Graphite tests
296
297			// TODO: re-enable - currently fails with "Failed to make lazy image"
298			skip("_", "gm", "_", "image_subset")
299
300			if b.extraConfig("ASAN") {
301				// skbug.com/12507 (Neon UB during JPEG compression on M1 ASAN Graphite bot)
302				skip("_", "gm", "_", "yuv420_odd_dim") // Oddly enough yuv420_odd_dim_repeat doesn't crash
303				skip("_", "gm", "_", "encode-alpha-jpeg")
304				skip("_", "gm", "_", "encode")
305				skip("_", "gm", "_", "jpg-color-cube")
306			}
307			configs = []string{"grmtl"}
308		}
309
310		// ANGLE bot *only* runs the angle configs
311		if b.extraConfig("ANGLE") {
312			configs = []string{"angle_d3d11_es2",
313				"angle_gl_es2",
314				"angle_d3d11_es3"}
315			if sampleCount > 0 {
316				configs = append(configs, fmt.Sprintf("angle_d3d11_es2_msaa%d", sampleCount))
317				configs = append(configs, fmt.Sprintf("angle_d3d11_es2_dmsaa"))
318				configs = append(configs, fmt.Sprintf("angle_gl_es2_dmsaa"))
319				configs = append(configs, fmt.Sprintf("angle_d3d11_es3_msaa%d", sampleCount))
320				configs = append(configs, fmt.Sprintf("angle_d3d11_es3_dmsaa"))
321				configs = append(configs, fmt.Sprintf("angle_gl_es3_dmsaa"))
322			}
323			if b.matchGpu("GTX", "Quadro") {
324				// See skia:7823 and chromium:693090.
325				configs = append(configs, "angle_gl_es3")
326				if sampleCount > 0 {
327					configs = append(configs, fmt.Sprintf("angle_gl_es2_msaa%d", sampleCount))
328					configs = append(configs, fmt.Sprintf("angle_gl_es2_dmsaa"))
329					configs = append(configs, fmt.Sprintf("angle_gl_es3_msaa%d", sampleCount))
330					configs = append(configs, fmt.Sprintf("angle_gl_es3_dmsaa"))
331				}
332			}
333			if !b.matchGpu("GTX", "Quadro", "GT610") {
334				// See skia:10149
335				configs = append(configs, "angle_d3d9_es2")
336			}
337			if b.model("NUC5i7RYH") {
338				// skbug.com/7376
339				skip("_ test _ ProcessorCloneTest")
340			}
341		}
342
343		if b.model("AndroidOne", "Nexus5", "Nexus7") {
344			// skbug.com/9019
345			skip("_ test _ ProcessorCloneTest")
346			skip("_ test _ Programs")
347			skip("_ test _ ProcessorOptimizationValidationTest")
348		}
349
350		if b.model("GalaxyS20") {
351			// skbug.com/10595
352			skip("_ test _ ProcessorCloneTest")
353		}
354
355		if b.extraConfig("CommandBuffer") && b.model("MacBook10.1") {
356			// skbug.com/9235
357			skip("_ test _ Programs")
358		}
359
360		if b.model("Spin513") {
361			// skbug.com/11876
362			skip("_ test _ Programs")
363			// skbug.com/12486
364			skip("_ test _ TestMockContext")
365			skip("_ test _ TestGpuRenderingContexts")
366			skip("_ test _ TestGpuAllContexts")
367			skip("_ test _ OverdrawSurface_Gpu")
368			skip("_ test _ ReplaceSurfaceBackendTexture")
369			skip("_ test _ SurfaceAttachStencil_Gpu")
370			skip("_ test _ SurfaceWrappedWithRelease_Gpu")
371		}
372
373		if b.extraConfig("CommandBuffer") {
374			// skbug.com/10412
375			skip("_ test _ GLBackendAllocationTest")
376			skip("_ test _ InitialTextureClear")
377			// skbug.com/12437
378			skip("_ test _ GrDDLImage_MakeSubset")
379			skip("_ test _ GrContext_oomed")
380		}
381
382		// skbug.com/9043 - these devices render this test incorrectly
383		// when opList splitting reduction is enabled
384		if b.gpu() && b.extraConfig("Vulkan") && (b.gpu("RadeonR9M470X", "RadeonHD7770")) {
385			skip("_", "tests", "_", "VkDrawableImportTest")
386		}
387		if b.extraConfig("Vulkan") {
388			configs = []string{"vk"}
389			// MSAA doesn't work well on Intel GPUs chromium:527565, chromium:983926, skia:9023
390			if !b.matchGpu("Intel") {
391				configs = append(configs, "vkmsaa4")
392			}
393			// Temporarily limit the bots we test dynamic MSAA on.
394			if b.gpu("QuadroP400", "MaliG77") && !b.extraConfig("TSAN") {
395				configs = append(configs, "vkdmsaa")
396			}
397		}
398		if b.extraConfig("Metal") {
399			configs = []string{"mtl"}
400			// MSAA doesn't work well on Intel GPUs chromium:527565, chromium:983926
401			if !b.matchGpu("Intel") {
402				configs = append(configs, "mtlmsaa4")
403			}
404		}
405		if b.extraConfig("Direct3D") {
406			configs = []string{"d3d"}
407		}
408
409		// Test 1010102 on our Linux/NVIDIA bots and the persistent cache config
410		// on the GL bots.
411		if b.gpu("QuadroP400") && !b.extraConfig("PreAbandonGpuContext") && !b.extraConfig("TSAN") && b.isLinux() {
412			if b.extraConfig("Vulkan") {
413				configs = append(configs, "vk1010102")
414				// Decoding transparent images to 1010102 just looks bad
415				skip("vk1010102 image _ _")
416			} else {
417				configs = append(configs, "gl1010102", "gltestpersistentcache", "gltestglslcache", "gltestprecompile")
418				// Decoding transparent images to 1010102 just looks bad
419				skip("gl1010102 image _ _")
420				// These tests produce slightly different pixels run to run on NV.
421				skip("gltestpersistentcache gm _ atlastext")
422				skip("gltestpersistentcache gm _ dftext")
423				skip("gltestpersistentcache gm _ glyph_pos_h_b")
424				skip("gltestpersistentcache gm _ glyph_pos_h_f")
425				skip("gltestpersistentcache gm _ glyph_pos_n_f")
426				skip("gltestglslcache gm _ atlastext")
427				skip("gltestglslcache gm _ dftext")
428				skip("gltestglslcache gm _ glyph_pos_h_b")
429				skip("gltestglslcache gm _ glyph_pos_h_f")
430				skip("gltestglslcache gm _ glyph_pos_n_f")
431				skip("gltestprecompile gm _ atlastext")
432				skip("gltestprecompile gm _ dftext")
433				skip("gltestprecompile gm _ glyph_pos_h_b")
434				skip("gltestprecompile gm _ glyph_pos_h_f")
435				skip("gltestprecompile gm _ glyph_pos_n_f")
436				// Tessellation shaders do not yet participate in the persistent cache.
437				skip("gltestpersistentcache gm _ tessellation")
438				skip("gltestglslcache gm _ tessellation")
439				skip("gltestprecompile gm _ tessellation")
440			}
441		}
442
443		// We also test the SkSL precompile config on Pixel2XL as a representative
444		// Android device - this feature is primarily used by Flutter.
445		if b.model("Pixel2XL") && !b.extraConfig("Vulkan") {
446			configs = append(configs, "glestestprecompile")
447		}
448
449		// Test SkSL precompile on iPhone 8 as representative iOS device
450		if b.model("iPhone8") && b.extraConfig("Metal") {
451			configs = append(configs, "mtltestprecompile")
452			// avoid tests that can generate slightly different pixels per run
453			skip("mtltestprecompile gm _ atlastext")
454			skip("mtltestprecompile gm _ circular_arcs_hairline")
455			skip("mtltestprecompile gm _ dashcircle")
456			skip("mtltestprecompile gm _ dftext")
457			skip("mtltestprecompile gm _ fontmgr_bounds")
458			skip("mtltestprecompile gm _ fontmgr_bounds_1_-0.25")
459			skip("mtltestprecompile gm _ glyph_pos_h_b")
460			skip("mtltestprecompile gm _ glyph_pos_h_f")
461			skip("mtltestprecompile gm _ glyph_pos_n_f")
462			skip("mtltestprecompile gm _ persp_images")
463			skip("mtltestprecompile gm _ ovals")
464			skip("mtltestprecompile gm _ roundrects")
465			skip("mtltestprecompile gm _ shadow_utils_occl")
466			skip("mtltestprecompile gm _ strokedlines")
467			skip("mtltestprecompile gm _ strokerect")
468			skip("mtltestprecompile gm _ strokes3")
469			skip("mtltestprecompile gm _ texel_subset_linear_mipmap_nearest_down")
470			skip("mtltestprecompile gm _ texel_subset_linear_mipmap_linear_down")
471			skip("mtltestprecompile gm _ textblobmixedsizes_df")
472			skip("mtltestprecompile gm _ yuv420_odd_dim_repeat")
473			skip("mtltestprecompile svg _ A_large_blank_world_map_with_oceans_marked_in_blue.svg")
474			skip("mtltestprecompile svg _ Chalkboard.svg")
475			skip("mtltestprecompile svg _ Ghostscript_Tiger.svg")
476			skip("mtltestprecompile svg _ Seal_of_American_Samoa.svg")
477			skip("mtltestprecompile svg _ Seal_of_Illinois.svg")
478			skip("mtltestprecompile svg _ desk_motionmark_paths.svg")
479			skip("mtltestprecompile svg _ rg1024_green_grapes.svg")
480			skip("mtltestprecompile svg _ shapes-intro-02-f.svg")
481			skip("mtltestprecompile svg _ tiger-8.svg")
482		}
483		// Test reduced shader mode on iPhone 11 as representative iOS device
484		if b.model("iPhone11") && b.extraConfig("Metal") {
485			configs = append(configs, "mtlreducedshaders")
486		}
487
488		if b.gpu("AppleM1") && !b.extraConfig("Metal") {
489			skip("_ test _ TransferPixelsFromTextureTest") // skia:11814
490		}
491
492		if b.model(DONT_REDUCE_OPS_TASK_SPLITTING_MODELS...) {
493			args = append(args, "--dontReduceOpsTaskSplitting", "true")
494		}
495
496		// Test reduceOpsTaskSplitting fallback when over budget.
497		if b.model("NUC7i5BNK") && b.extraConfig("ASAN") {
498			args = append(args, "--gpuResourceCacheLimit", "16777216")
499		}
500
501		// Test rendering to wrapped dsts on a few bots
502		// Also test "narrow-glf16", which hits F16 surfaces and F16 vertex colors.
503		if b.extraConfig("BonusConfigs") {
504			configs = []string{"glbetex", "glbert", "narrow-glf16", "glreducedshaders"}
505		}
506
507		if b.os("ChromeOS") {
508			// Just run GLES for now - maybe add gles_msaa4 in the future
509			configs = []string{"gles"}
510		}
511
512		// Test GPU tessellation path renderer.
513		if b.extraConfig("GpuTess") {
514			configs = []string{glPrefix + "msaa4"}
515			// Use hardware tessellation as much as possible for testing. Use 16 segments max to
516			// verify the chopping logic.
517			args = append(args,
518				"--pr", "atlas", "tess", "--hwtess", "--alwaysHwTess",
519				"--maxTessellationSegments", "16")
520		}
521
522		// DDL is a GPU-only feature
523		if b.extraConfig("DDL1") {
524			// This bot generates comparison images for the large skps and the gms
525			configs = filter(configs, "gl", "vk", "mtl")
526			args = append(args, "--skpViewportSize", "2048")
527		}
528		if b.extraConfig("DDL3") {
529			// This bot generates the real ddl images for the large skps and the gms
530			configs = suffix(filter(configs, "gl", "vk", "mtl"), "ddl")
531			args = append(args, "--skpViewportSize", "2048")
532			args = append(args, "--gpuThreads", "0")
533		}
534		if b.extraConfig("OOPRDDL") {
535			// This bot generates the real oopr/DDL images for the large skps and the GMs
536			configs = suffix(filter(configs, "gl", "vk", "mtl"), "ooprddl")
537			args = append(args, "--skpViewportSize", "2048")
538			args = append(args, "--gpuThreads", "0")
539		}
540	}
541
542	// Sharding.
543	tf := b.parts["test_filter"]
544	if tf != "" && tf != "All" {
545		// Expected format: shard_XX_YY
546		split := strings.Split(tf, "_")
547		if len(split) == 3 {
548			args = append(args, "--shard", split[1])
549			args = append(args, "--shards", split[2])
550		} else {
551			glog.Fatalf("Invalid task name - bad shards: %s", tf)
552		}
553	}
554
555	args = append(args, "--config")
556	args = append(args, configs...)
557
558	removeFromArgs := func(arg string) {
559		args = remove(args, arg)
560	}
561
562	// Run tests, gms, and image decoding tests everywhere.
563	args = append(args, "--src", "tests", "gm", "image", "lottie", "colorImage", "svg", "skp")
564	if b.gpu() {
565		// Don't run the "svgparse_*" svgs on GPU.
566		skip("_ svg _ svgparse_")
567	} else if b.Name == "Test-Debian10-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN" {
568		// Only run the CPU SVGs on 8888.
569		skip("~8888 svg _ _")
570	} else {
571		// On CPU SVGs we only care about parsing. Only run them on the above bot.
572		removeFromArgs("svg")
573	}
574
575	// Eventually I'd like these to pass, but for now just skip 'em.
576	if b.extraConfig("SK_FORCE_RASTER_PIPELINE_BLITTER") {
577		removeFromArgs("tests")
578	}
579
580	if b.extraConfig("NativeFonts") { // images won't exercise native font integration :)
581		removeFromArgs("image")
582		removeFromArgs("colorImage")
583	}
584
585	if b.matchExtraConfig("Graphite") {
586		// The Graphite bots run the skps, gms and tests
587		removeFromArgs("image")
588		removeFromArgs("colorImage")
589		removeFromArgs("svg")
590	} else if b.matchExtraConfig("DDL", "PDF") {
591		// The DDL and PDF bots just render the large skps and the gms
592		removeFromArgs("tests")
593		removeFromArgs("image")
594		removeFromArgs("colorImage")
595		removeFromArgs("svg")
596	} else {
597		// No other bots render the .skps.
598		removeFromArgs("skp")
599	}
600
601	if b.extraConfig("Lottie") {
602		// Only run the lotties on Lottie bots.
603		removeFromArgs("tests")
604		removeFromArgs("gm")
605		removeFromArgs("image")
606		removeFromArgs("colorImage")
607		removeFromArgs("svg")
608		removeFromArgs("skp")
609	} else {
610		removeFromArgs("lottie")
611	}
612
613	if b.extraConfig("TSAN") {
614		// skbug.com/10848
615		removeFromArgs("svg")
616	}
617
618	// TODO: ???
619	skip("f16 _ _ dstreadshuffle")
620	skip("srgb-gl image _ _")
621	skip("srgb-gles image _ _")
622
623	// --src image --config g8 means "decode into Gray8", which isn't supported.
624	skip("g8 image _ _")
625	skip("g8 colorImage _ _")
626
627	if b.extraConfig("Valgrind") {
628		// These take 18+ hours to run.
629		skip("pdf gm _ fontmgr_iter")
630		skip("pdf _ _ PANO_20121023_214540.jpg")
631		skip("pdf skp _ worldjournal")
632		skip("pdf skp _ desk_baidu.skp")
633		skip("pdf skp _ desk_wikipedia.skp")
634		skip("_ svg _ _")
635		// skbug.com/9171 and 8847
636		skip("_ test _ InitialTextureClear")
637	}
638
639	if b.model("Pixel3") {
640		// skbug.com/10546
641		skip("vkddl gm _ compressed_textures_nmof")
642		skip("vkddl gm _ compressed_textures_npot")
643		skip("vkddl gm _ compressed_textures")
644	}
645
646	if b.model("TecnoSpark3Pro", "Wembley") {
647		// skbug.com/9421
648		skip("_ test _ InitialTextureClear")
649	}
650
651	if b.model("Wembley") {
652		// These tests run forever on the Wembley.
653		skip("_ gm _ async_rescale_and_read")
654	}
655
656	if b.os("iOS") {
657		skip(glPrefix + " skp _ _")
658	}
659
660	if b.matchOs("Mac", "iOS") {
661		// CG fails on questionable bmps
662		skip("_ image gen_platf rgba32abf.bmp")
663		skip("_ image gen_platf rgb24prof.bmp")
664		skip("_ image gen_platf rgb24lprof.bmp")
665		skip("_ image gen_platf 8bpp-pixeldata-cropped.bmp")
666		skip("_ image gen_platf 4bpp-pixeldata-cropped.bmp")
667		skip("_ image gen_platf 32bpp-pixeldata-cropped.bmp")
668		skip("_ image gen_platf 24bpp-pixeldata-cropped.bmp")
669
670		// CG has unpredictable behavior on this questionable gif
671		// It's probably using uninitialized memory
672		skip("_ image gen_platf frame_larger_than_image.gif")
673
674		// CG has unpredictable behavior on incomplete pngs
675		// skbug.com/5774
676		skip("_ image gen_platf inc0.png")
677		skip("_ image gen_platf inc1.png")
678		skip("_ image gen_platf inc2.png")
679		skip("_ image gen_platf inc3.png")
680		skip("_ image gen_platf inc4.png")
681		skip("_ image gen_platf inc5.png")
682		skip("_ image gen_platf inc6.png")
683		skip("_ image gen_platf inc7.png")
684		skip("_ image gen_platf inc8.png")
685		skip("_ image gen_platf inc9.png")
686		skip("_ image gen_platf inc10.png")
687		skip("_ image gen_platf inc11.png")
688		skip("_ image gen_platf inc12.png")
689		skip("_ image gen_platf inc13.png")
690		skip("_ image gen_platf inc14.png")
691		skip("_ image gen_platf incInterlaced.png")
692
693		// These images fail after Mac 10.13.1 upgrade.
694		skip("_ image gen_platf incInterlaced.gif")
695		skip("_ image gen_platf inc1.gif")
696		skip("_ image gen_platf inc0.gif")
697		skip("_ image gen_platf butterfly.gif")
698	}
699
700	// WIC fails on questionable bmps
701	if b.matchOs("Win") {
702		skip("_ image gen_platf pal8os2v2.bmp")
703		skip("_ image gen_platf pal8os2v2-16.bmp")
704		skip("_ image gen_platf rgba32abf.bmp")
705		skip("_ image gen_platf rgb24prof.bmp")
706		skip("_ image gen_platf rgb24lprof.bmp")
707		skip("_ image gen_platf 8bpp-pixeldata-cropped.bmp")
708		skip("_ image gen_platf 4bpp-pixeldata-cropped.bmp")
709		skip("_ image gen_platf 32bpp-pixeldata-cropped.bmp")
710		skip("_ image gen_platf 24bpp-pixeldata-cropped.bmp")
711		if b.arch("x86_64") && b.cpu() {
712			// This GM triggers a SkSmallAllocator assert.
713			skip("_ gm _ composeshader_bitmap")
714		}
715	}
716
717	if b.matchOs("Win", "Mac") {
718		// WIC and CG fail on arithmetic jpegs
719		skip("_ image gen_platf testimgari.jpg")
720		// More questionable bmps that fail on Mac, too. skbug.com/6984
721		skip("_ image gen_platf rle8-height-negative.bmp")
722		skip("_ image gen_platf rle4-height-negative.bmp")
723	}
724
725	// These PNGs have CRC errors. The platform generators seem to draw
726	// uninitialized memory without reporting an error, so skip them to
727	// avoid lots of images on Gold.
728	skip("_ image gen_platf error")
729
730	if b.os("Android", "iOS") {
731		// This test crashes the N9 (perhaps because of large malloc/frees). It also
732		// is fairly slow and not platform-specific. So we just disable it on all of
733		// Android and iOS. skia:5438
734		skip("_ test _ GrStyledShape")
735	}
736
737	if internalHardwareLabel == "5" {
738		// http://b/118312149#comment9
739		skip("_ test _ SRGBReadWritePixels")
740	}
741
742	// skia:4095
743	badSerializeGMs := []string{
744		"strict_constraint_batch_no_red_allowed", // https://crbug.com/skia/10278
745		"strict_constraint_no_red_allowed",       // https://crbug.com/skia/10278
746		"fast_constraint_red_is_allowed",         // https://crbug.com/skia/10278
747		"c_gms",
748		"colortype",
749		"colortype_xfermodes",
750		"drawfilter",
751		"fontmgr_bounds_0.75_0",
752		"fontmgr_bounds_1_-0.25",
753		"fontmgr_bounds",
754		"fontmgr_match",
755		"fontmgr_iter",
756		"imagemasksubset",
757		"wacky_yuv_formats_domain",
758		"imagemakewithfilter",
759		"imagemakewithfilter_crop",
760		"imagemakewithfilter_crop_ref",
761		"imagemakewithfilter_ref",
762	}
763
764	// skia:5589
765	badSerializeGMs = append(badSerializeGMs,
766		"bitmapfilters",
767		"bitmapshaders",
768		"convex_poly_clip",
769		"extractalpha",
770		"filterbitmap_checkerboard_32_32_g8",
771		"filterbitmap_image_mandrill_64",
772		"shadows",
773		"simpleaaclip_aaclip",
774	)
775
776	// skia:5595
777	badSerializeGMs = append(badSerializeGMs,
778		"composeshader_bitmap",
779		"scaled_tilemodes_npot",
780		"scaled_tilemodes",
781	)
782
783	// skia:5778
784	badSerializeGMs = append(badSerializeGMs, "typefacerendering_pfaMac")
785	// skia:5942
786	badSerializeGMs = append(badSerializeGMs, "parsedpaths")
787
788	// these use a custom image generator which doesn't serialize
789	badSerializeGMs = append(badSerializeGMs, "ImageGeneratorExternal_rect")
790	badSerializeGMs = append(badSerializeGMs, "ImageGeneratorExternal_shader")
791
792	// skia:6189
793	badSerializeGMs = append(badSerializeGMs, "shadow_utils")
794
795	// skia:7938
796	badSerializeGMs = append(badSerializeGMs, "persp_images")
797
798	// Not expected to round trip encoding/decoding.
799	badSerializeGMs = append(badSerializeGMs, "all_bitmap_configs")
800	badSerializeGMs = append(badSerializeGMs, "makecolorspace")
801	badSerializeGMs = append(badSerializeGMs, "readpixels")
802	badSerializeGMs = append(badSerializeGMs, "draw_image_set_rect_to_rect")
803	badSerializeGMs = append(badSerializeGMs, "draw_image_set_alpha_only")
804	badSerializeGMs = append(badSerializeGMs, "compositor_quads_shader")
805	badSerializeGMs = append(badSerializeGMs, "wacky_yuv_formats_qtr")
806	badSerializeGMs = append(badSerializeGMs, "runtime_effect_image")
807	badSerializeGMs = append(badSerializeGMs, "ctmpatheffect")
808
809	// This GM forces a path to be convex. That property doesn't survive
810	// serialization.
811	badSerializeGMs = append(badSerializeGMs, "analytic_antialias_convex")
812
813	for _, test := range badSerializeGMs {
814		skip("serialize-8888", "gm", "_", test)
815	}
816
817	// We skip these to avoid out-of-memory failures.
818	if b.matchOs("Win", "Android") {
819		for _, test := range []string{"verylargebitmap", "verylarge_picture_image"} {
820			skip("serialize-8888", "gm", "_", test)
821		}
822	}
823	if b.model("iPhone6") {
824		skip("_", "gm", "_", "verylargebitmap")
825		skip("_", "gm", "_", "verylarge_picture_image")
826		skip("_", "svg", "_", "A_large_blank_world_map_with_oceans_marked_in_blue.svg")
827		skip("_", "tests", "_", "ImageFilterBlurLargeImage_Gpu")
828	}
829	if b.matchOs("Mac") && b.cpu() {
830		// skia:6992
831		skip("pic-8888", "gm", "_", "encode-platform")
832		skip("serialize-8888", "gm", "_", "encode-platform")
833	}
834
835	// skia:4769
836	skip("pic-8888", "gm", "_", "drawfilter")
837
838	// skia:4703
839	for _, test := range []string{"image-cacherator-from-picture",
840		"image-cacherator-from-raster",
841		"image-cacherator-from-ctable"} {
842		skip("pic-8888", "gm", "_", test)
843		skip("serialize-8888", "gm", "_", test)
844	}
845
846	// GM that requires raster-backed canvas
847	for _, test := range []string{"complexclip4_bw", "complexclip4_aa", "p3",
848		"async_rescale_and_read_text_up_large",
849		"async_rescale_and_read_text_up",
850		"async_rescale_and_read_text_down",
851		"async_rescale_and_read_dog_up",
852		"async_rescale_and_read_dog_down",
853		"async_rescale_and_read_rose",
854		"async_rescale_and_read_no_bleed",
855		"async_rescale_and_read_alpha_type"} {
856		skip("pic-8888", "gm", "_", test)
857		skip("serialize-8888", "gm", "_", test)
858
859		// GM requires canvas->makeSurface() to return a valid surface.
860		// TODO(borenet): These should be just outside of this block but are
861		// left here to match the recipe which has an indentation bug.
862		skip("pic-8888", "gm", "_", "blurrect_compare")
863		skip("serialize-8888", "gm", "_", "blurrect_compare")
864	}
865
866	// Extensions for RAW images
867	r := []string{
868		"arw", "cr2", "dng", "nef", "nrw", "orf", "raf", "rw2", "pef", "srw",
869		"ARW", "CR2", "DNG", "NEF", "NRW", "ORF", "RAF", "RW2", "PEF", "SRW",
870	}
871
872	// skbug.com/4888
873	// Skip RAW images (and a few large PNGs) on GPU bots
874	// until we can resolve failures.
875	if b.gpu() {
876		skip("_ image _ interlaced1.png")
877		skip("_ image _ interlaced2.png")
878		skip("_ image _ interlaced3.png")
879		for _, rawExt := range r {
880			skip(fmt.Sprintf("_ image _ .%s", rawExt))
881		}
882	}
883
884	// Skip memory intensive tests on 32-bit bots.
885	if b.os("Win8") && b.arch("x86") {
886		skip("_ image f16 _")
887		skip("_ image _ abnormal.wbmp")
888		skip("_ image _ interlaced1.png")
889		skip("_ image _ interlaced2.png")
890		skip("_ image _ interlaced3.png")
891		for _, rawExt := range r {
892			skip(fmt.Sprintf("_ image _ .%s", rawExt))
893		}
894	}
895
896	if b.model("Nexus5", "Nexus5x") && b.gpu() {
897		// skia:5876
898		skip("_", "gm", "_", "encode-platform")
899	}
900
901	if b.model("AndroidOne") && b.gpu() { // skia:4697, skia:4704, skia:4694, skia:4705, skia:11133
902		skip("_", "gm", "_", "bigblurs")
903		skip("_", "gm", "_", "strict_constraint_no_red_allowed")
904		skip("_", "gm", "_", "fast_constraint_red_is_allowed")
905		skip("_", "gm", "_", "dropshadowimagefilter")
906		skip("_", "gm", "_", "filterfastbounds")
907		skip(glPrefix, "gm", "_", "imageblurtiled")
908		skip("_", "gm", "_", "imagefiltersclipped")
909		skip("_", "gm", "_", "imagefiltersscaled")
910		skip("_", "gm", "_", "imageresizetiled")
911		skip("_", "gm", "_", "matrixconvolution")
912		skip("_", "gm", "_", "strokedlines")
913		skip("_", "gm", "_", "runtime_intrinsics_matrix")
914		if sampleCount > 0 {
915			glMsaaConfig := fmt.Sprintf("%smsaa%d", glPrefix, sampleCount)
916			skip(glMsaaConfig, "gm", "_", "imageblurtiled")
917			skip(glMsaaConfig, "gm", "_", "imagefiltersbase")
918		}
919	}
920
921	if b.matchGpu("Adreno[3456]") { // disable broken tests on Adreno 3/4/5/6xx
922		skip("_", "tests", "_", "SkSLArrayCast_GPU")       // skia:12332
923		skip("_", "tests", "_", "SkSLArrayComparison_GPU") // skia:12332
924	}
925
926	if b.matchGpu("Adreno[345]") && !b.extraConfig("Vulkan") { // disable broken tests on Adreno 3/4/5xx GLSL
927		skip("_", "tests", "_", "DSLFPTest_SwitchStatement")  // skia:11891
928		skip("_", "tests", "_", "SkSLMatrixToVectorCast_GPU") // skia:12192
929		skip("_", "tests", "_", "SkSLStructsInFunctions_GPU") // skia:11929
930	}
931
932	if b.matchGpu("Adreno6") && !b.extraConfig("Vulkan") { // disable broken tests on Adreno 6xx GLSL
933		skip("_", "tests", "_", "SkSLIntrinsicIsInf_GPU") // skia:12377
934	}
935
936	if (b.matchGpu("Adreno3") || b.matchGpu("Mali400")) && !b.extraConfig("Vulkan") {
937		skip("_", "tests", "_", "SkSLMatrices") // skia:12456
938	}
939
940	if b.gpu("IntelIris6100", "IntelHD4400") && b.matchOs("Win") && !b.extraConfig("Vulkan") {
941		skip("_", "tests", "_", "SkSLVectorToMatrixCast_GPU") // skia:12179
942	}
943
944	if b.matchGpu("Intel") && b.matchOs("Win") && !b.extraConfig("Vulkan") {
945		skip("_", "tests", "_", "SkSLReturnsValueOnEveryPathES3_GPU") // skia:12465
946	}
947
948	if (b.extraConfig("Vulkan") && b.isLinux() && b.matchGpu("Intel")) ||
949		(b.extraConfig("ANGLE") && b.matchOs("Win") && b.matchGpu("IntelIris(540|655)")) {
950		skip("_", "tests", "_", "SkSLSwitchDefaultOnly_GPU") // skia:12465
951	}
952
953	if b.gpu("Tegra3") {
954		// Tegra3 fails to compile break stmts inside a for loop (skia:12477)
955		skip("_", "tests", "_", "SkSLSwitch_GPU")
956		skip("_", "tests", "_", "SkSLSwitchDefaultOnly_GPU")
957		skip("_", "tests", "_", "SkSLSwitchWithFallthrough_GPU")
958		skip("_", "tests", "_", "SkSLSwitchWithLoops_GPU")
959		skip("_", "tests", "_", "SkSLLoopFloat_GPU")
960		skip("_", "tests", "_", "SkSLLoopInt_GPU")
961	}
962
963	if !b.extraConfig("Vulkan") &&
964		(b.gpu("QuadroP400") || b.gpu("GTX660") || b.gpu("GTX960") || b.gpu("Tegra3")) {
965		// Various Nvidia GPUs crash or generate errors when assembling weird matrices (skia:12443)
966		skip("_", "tests", "_", "SkSLMatrixConstructorsES2_GPU")
967		skip("_", "tests", "_", "SkSLMatrixConstructorsES3_GPU")
968	}
969
970	if !b.extraConfig("Vulkan") && (b.gpu("RadeonR9M470X") || b.gpu("RadeonHD7770")) {
971		// Some AMD GPUs can get the wrong result when assembling non-square matrices (skia:12443)
972		skip("_", "tests", "_", "SkSLMatrixConstructorsES3_GPU")
973	}
974
975	if b.matchGpu("Intel") { // some Intel GPUs don't return zero for the derivative of a uniform
976		skip("_", "tests", "_", "SkSLIntrinsicDFdy_GPU")
977		skip("_", "tests", "_", "SkSLIntrinsicDFdx_GPU")
978		skip("_", "tests", "_", "SkSLIntrinsicFwidth_GPU")
979	}
980
981	if b.matchOs("Mac") && b.matchGpu("Intel(Iris5100|HD6000)") {
982		skip("_", "tests", "_", "SkSLLoopFloat_GPU") // skia:12426
983	}
984
985	match := []string{}
986	if b.extraConfig("Valgrind") { // skia:3021
987		match = append(match, "~Threaded")
988	}
989
990	if b.extraConfig("Valgrind") && b.extraConfig("PreAbandonGpuContext") {
991		// skia:6575
992		match = append(match, "~multipicturedraw_")
993	}
994
995	if b.model("AndroidOne") {
996		match = append(match, "~WritePixels")                             // skia:4711
997		match = append(match, "~PremulAlphaRoundTrip_Gpu")                // skia:7501
998		match = append(match, "~ReimportImageTextureWithMipLevels")       // skia:8090
999		match = append(match, "~MorphologyFilterRadiusWithMirrorCTM_Gpu") // skia:10383
1000	}
1001
1002	if b.extraConfig("MSAN") {
1003		match = append(match, "~Once", "~Shared") // Not sure what's up with these tests.
1004	}
1005
1006	// By default, we test with GPU threading enabled, unless specifically
1007	// disabled.
1008	if b.extraConfig("NoGPUThreads") {
1009		args = append(args, "--gpuThreads", "0")
1010	}
1011
1012	if b.extraConfig("Vulkan") && b.gpu("Adreno530") {
1013		// skia:5777
1014		match = append(match, "~CopySurface")
1015	}
1016
1017	if b.extraConfig("Vulkan") && b.matchGpu("Adreno") {
1018		// skia:7663
1019		match = append(match, "~WritePixelsNonTextureMSAA_Gpu")
1020		match = append(match, "~WritePixelsMSAA_Gpu")
1021	}
1022
1023	if b.extraConfig("Vulkan") && b.isLinux() && b.gpu("IntelIris640") {
1024		match = append(match, "~VkHeapTests") // skia:6245
1025	}
1026
1027	if b.isLinux() && b.gpu("IntelIris640") {
1028		match = append(match, "~Programs") // skia:7849
1029	}
1030
1031	if b.model("TecnoSpark3Pro", "Wembley") {
1032		// skia:9814
1033		match = append(match, "~Programs")
1034		match = append(match, "~ProcessorCloneTest")
1035		match = append(match, "~ProcessorOptimizationValidationTest")
1036	}
1037
1038	if b.gpu("IntelIris640", "IntelHD615", "IntelHDGraphics615") {
1039		match = append(match, "~^SRGBReadWritePixels$") // skia:9225
1040	}
1041
1042	if b.extraConfig("Vulkan") && b.isLinux() && b.gpu("IntelHD405") {
1043		// skia:7322
1044		skip("vk", "gm", "_", "skbug_257")
1045		skip("vk", "gm", "_", "filltypespersp")
1046		match = append(match, "~^ClearOp$")
1047		match = append(match, "~^CopySurface$")
1048		match = append(match, "~^ImageNewShader_GPU$")
1049		match = append(match, "~^InitialTextureClear$")
1050		match = append(match, "~^PinnedImageTest$")
1051		match = append(match, "~^ReadPixels_Gpu$")
1052		match = append(match, "~^ReadPixels_Texture$")
1053		match = append(match, "~^SRGBReadWritePixels$")
1054		match = append(match, "~^VkUploadPixelsTests$")
1055		match = append(match, "~^WritePixelsNonTexture_Gpu$")
1056		match = append(match, "~^WritePixelsNonTextureMSAA_Gpu$")
1057		match = append(match, "~^WritePixels_Gpu$")
1058		match = append(match, "~^WritePixelsMSAA_Gpu$")
1059	}
1060
1061	if b.extraConfig("Vulkan") && b.gpu("GTX660") && b.matchOs("Win") {
1062		// skbug.com/8047
1063		match = append(match, "~FloatingPointTextureTest$")
1064	}
1065
1066	if b.extraConfig("Metal") && b.gpu("RadeonHD8870M") && b.matchOs("Mac") {
1067		// skia:9255
1068		match = append(match, "~WritePixelsNonTextureMSAA_Gpu")
1069		// skbug.com/11366
1070		match = append(match, "~SurfacePartialDraw_Gpu")
1071	}
1072
1073	if b.extraConfig("Metal") && b.gpu("PowerVRGX6450") && b.matchOs("iOS") {
1074		// skbug.com/11885
1075		match = append(match, "~flight_animated_image")
1076	}
1077
1078	if b.extraConfig("ANGLE") {
1079		// skia:7835
1080		match = append(match, "~BlurMaskBiggerThanDest")
1081	}
1082
1083	if b.gpu("IntelIris6100") && b.extraConfig("ANGLE") && !b.debug() {
1084		// skia:7376
1085		match = append(match, "~^ProcessorOptimizationValidationTest$")
1086	}
1087
1088	if b.gpu("IntelIris6100", "IntelHD4400") && b.extraConfig("ANGLE") {
1089		// skia:6857
1090		skip("angle_d3d9_es2", "gm", "_", "lighting")
1091	}
1092
1093	if b.gpu("PowerVRGX6250") {
1094		match = append(match, "~gradients_view_perspective_nodither") //skia:6972
1095	}
1096
1097	if b.arch("arm") && b.extraConfig("ASAN") {
1098		// TODO: can we run with env allocator_may_return_null=1 instead?
1099		match = append(match, "~BadImage")
1100	}
1101
1102	if b.matchOs("Mac") && b.gpu("IntelHD6000") {
1103		// skia:7574
1104		match = append(match, "~^ProcessorCloneTest$")
1105		match = append(match, "~^GrMeshTest$")
1106	}
1107
1108	if b.matchOs("Mac") && b.gpu("IntelHD615") {
1109		// skia:7603
1110		match = append(match, "~^GrMeshTest$")
1111	}
1112
1113	if b.extraConfig("Vulkan") && b.model("GalaxyS20") {
1114		// skia:10247
1115		match = append(match, "~VkPrepareForExternalIOQueueTransitionTest")
1116	}
1117
1118	if len(skipped) > 0 {
1119		args = append(args, "--skip")
1120		args = append(args, skipped...)
1121	}
1122
1123	if len(match) > 0 {
1124		args = append(args, "--match")
1125		args = append(args, match...)
1126	}
1127
1128	// These bots run out of memory running RAW codec tests. Do not run them in
1129	// parallel
1130	// TODO(borenet): Previously this was `'Nexus5' in bot or 'Nexus9' in bot`
1131	// which also matched 'Nexus5x'. I added That here to maintain the
1132	// existing behavior, but we should verify that it's needed.
1133	if b.model("Nexus5", "Nexus5x", "Nexus9") {
1134		args = append(args, "--noRAW_threading")
1135	}
1136
1137	if b.extraConfig("FSAA") {
1138		args = append(args, "--analyticAA", "false")
1139	}
1140	if b.extraConfig("FAAA") {
1141		args = append(args, "--forceAnalyticAA")
1142	}
1143
1144	if !b.extraConfig("NativeFonts") {
1145		args = append(args, "--nonativeFonts")
1146	}
1147
1148	if b.extraConfig("GDI") {
1149		args = append(args, "--gdi")
1150	}
1151
1152	// Let's make all bots produce verbose output by default.
1153	args = append(args, "--verbose")
1154
1155	// See skia:2789.
1156	if b.extraConfig("AbandonGpuContext") {
1157		args = append(args, "--abandonGpuContext")
1158	}
1159	if b.extraConfig("PreAbandonGpuContext") {
1160		args = append(args, "--preAbandonGpuContext")
1161	}
1162	if b.extraConfig("ReleaseAndAbandonGpuContext") {
1163		args = append(args, "--releaseAndAbandonGpuContext")
1164	}
1165
1166	// Finalize the DM flags and properties.
1167	b.recipeProp("dm_flags", marshalJson(args))
1168	b.recipeProp("dm_properties", marshalJson(properties))
1169
1170	// Add properties indicating which assets the task should use.
1171	if b.matchExtraConfig("Lottie") {
1172		b.asset("lottie-samples")
1173		b.recipeProp("lotties", "true")
1174	} else {
1175		b.asset("skimage")
1176		b.recipeProp("images", "true")
1177		b.asset("skp")
1178		b.recipeProp("skps", "true")
1179		b.asset("svg")
1180		b.recipeProp("svgs", "true")
1181	}
1182	b.recipeProp("do_upload", fmt.Sprintf("%t", b.doUpload()))
1183	b.recipeProp("resources", "true")
1184}
1185