• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load("//bazel:skia_rules.bzl", "exports_files_legacy", "skia_cc_library", "skia_cc_test", "supports_platforms")
2load("//tools/testrunners/gm:android_gm_test.bzl", "android_gm_test")
3load(":png_codec.bzl", "png_codec_tests")
4
5package(
6    default_applicable_licenses = ["//:license"],
7)
8
9licenses(["notice"])
10
11exports_files_legacy()
12
13filegroup(
14    name = "gm_subset",
15    srcs = [
16        "bitmaprect.cpp",
17        "colrv1.cpp",
18        "fontations.cpp",
19        "palette.cpp",
20    ],
21    visibility = ["//tools/viewer:__pkg__"],
22)
23
24skia_cc_library(
25    name = "gm",
26    testonly = True,
27    srcs = [
28        "gm.cpp",
29    ],
30    hdrs = ["gm.h"],
31    visibility = [
32        "//tools/testrunners/gm:__subpackages__",
33        "//tools/viewer:__pkg__",
34    ],
35    deps = [
36        "//:core",
37        "//tools:registry",
38        "//tools:tool_utils",
39        "//tools/fonts:font_tool_utils",
40    ],
41)
42
43CPU_GMS = [
44    # This is an incomplete list of GMs that only require a CPU.
45    # TODO(lovisolo): Complete this list.
46    "3d.cpp",
47    "aaa.cpp",
48    "aaclip.cpp",
49    "aarectmodes.cpp",
50    "aaxfermodes.cpp",
51    "addarc.cpp",
52    "all_bitmap_configs.cpp",
53    "alphagradients.cpp",
54    "alpha_image.cpp",
55    "analytic_gradients.cpp",
56    "androidblendmodes.cpp",
57    # "animated_gif.cpp", # needs a dep on SkResources
58    "animatedimageblurs.cpp",
59    # "animated_image_orientation.cpp", # Requires //include/android/SkAnimatedImage.h
60    # "annotated_text.cpp",  # ./include/core/SkRefCnt.h:41: fatal error: "assert(this->getRefCnt() == 1)"
61    "arcofzorro.cpp",
62    "arcto.cpp",
63    "arithmode.cpp",
64
65    # TODO(lovisolo): Are these CPU-only, GPU-only or something else? Try them and add them to the
66    #                 corresponding list.
67    # "b_119394958.cpp",
68    # "backdrop.cpp",
69    # "backdrop_imagefilter_croprect.cpp",
70    # "badpaint.cpp",
71    # "batchedconvexpaths.cpp",
72    # "bc1_transparency.cpp",
73    # "beziereffects.cpp",
74    # "beziers.cpp",
75    # "bicubic.cpp",
76    # "bigblurs.cpp",
77    # "bigmatrix.cpp",
78    # "bigrect.cpp",
79    # "bigrrectaaeffect.cpp",
80    # "bigtext.cpp",
81    # "bigtileimagefilter.cpp",
82    # "bitmapcopy.cpp",
83    # "bitmapfilters.cpp",
84    # "bitmapimage.cpp",
85    # "bitmappremul.cpp",
86    # "bitmaprect.cpp",
87    # "bitmaprecttest.cpp",
88    # "bitmapshader.cpp",
89    # "bitmaptiled.cpp",
90    # "bleed.cpp",
91    # "blend.cpp",
92    # "blurcircles2.cpp",
93    # "blurcircles.cpp",
94    # "blurignorexform.cpp",
95    # "blurimagevmask.cpp",
96    # "blurpositioning.cpp",
97    # "blurquickreject.cpp",
98    # "blurrect.cpp",
99    # "blurredclippedcircle.cpp",
100    # "blurroundrect.cpp",
101    # "blurs.cpp",
102    # "blurtextsmallradii.cpp",
103    # "bmpfilterqualityrepeat.cpp",
104    # "bug12866.cpp",
105    # "bug5252.cpp",
106    # "bug530095.cpp",
107    # "bug615686.cpp",
108    # "bug6643.cpp",
109    # "bug6783.cpp",
110    # "bug9331.cpp",
111    # "circle_sizes.cpp",
112    # "circulararcs.cpp",
113    # "circularclips.cpp",
114    # "clear_swizzle.cpp",
115    # "clipdrawdraw.cpp",
116    # "clip_error.cpp",
117    # "clippedbitmapshaders.cpp",
118    # "clipshader.cpp",
119    # "clip_sierpinski_region.cpp",
120    # "clip_strokerect.cpp",
121    # "clockwise.cpp",
122    # "collapsepaths.cpp",
123    # "color4f.cpp",
124    # "coloremoji_blendmodes.cpp",
125    # "coloremoji.cpp",
126    # "colorfilteralpha8.cpp",
127    # "colorfilterimagefilter.cpp",
128    # "colorfilters.cpp",
129    # "colormatrix.cpp",
130    # "colorspace.cpp",
131    # "colorwheel.cpp",
132    # "colrv1.cpp",
133    # "complexclip2.cpp",
134    # "complexclip3.cpp",
135    # "complexclip4.cpp",
136    # "complexclip_blur_tiled.cpp",
137    # "complexclip.cpp",
138    # "composecolorfilter.cpp",
139    # "composeshader.cpp",
140    # "compositor_quads.cpp",
141    # "compressed_textures.cpp",
142    # "concavepaths.cpp",
143    # "conicpaths.cpp",
144    # "constcolorprocessor.cpp",
145    # "convex_all_line_paths.cpp",
146    # "convexpaths.cpp",
147    # "convexpolyclip.cpp",
148    # "convexpolyeffect.cpp",
149    # "coordclampshader.cpp",
150    # "copy_to_4444.cpp",
151    # "crbug_1041204.cpp",
152    # "crbug_1073670.cpp",
153    # "crbug_1086705.cpp",
154    # "crbug_1113794.cpp",
155    # "crbug_1139750.cpp",
156    # "crbug_1156804.cpp",
157    # "crbug_1162942.cpp",
158    # "crbug_1167277.cpp",
159    # "crbug_1174186.cpp",
160    # "crbug_1174354.cpp",
161    # "crbug_1177833.cpp",
162    # "crbug_1257515.cpp",
163    # "crbug_1313579.cpp",
164    # "crbug_224618.cpp",
165    # "crbug_691386.cpp",
166    # "crbug_788500.cpp",
167    # "crbug_847759.cpp",
168    # "crbug_884166.cpp",
169    # "crbug_887103.cpp",
170    # "crbug_892988.cpp",
171    # "crbug_899512.cpp",
172    # "crbug_905548.cpp",
173    # "crbug_908646.cpp",
174    # "crbug_913349.cpp",
175    # "crbug_918512.cpp",
176    # "crbug_938592.cpp",
177    # "crbug_946965.cpp",
178    # "crbug_947055.cpp",
179    # "crbug_996140.cpp",
180    # "crop_imagefilter.cpp",
181    # "croppedrects.cpp",
182    # "crosscontextimage.cpp",
183    # "cubicpaths.cpp",
184    # "daa.cpp",
185    # "dashcircle.cpp",
186    # "dashcubics.cpp",
187    # "dashing.cpp",
188    # "degeneratesegments.cpp",
189    # "destcolor.cpp",
190    # "dftext_blob_persp.cpp",
191    # "dftext.cpp",
192    # "discard.cpp",
193    # "displacement.cpp",
194    # "distantclip.cpp",
195    # "drawable.cpp",
196    # "drawatlascolor.cpp",
197    # "drawatlas.cpp",
198    # "drawbitmaprect.cpp",
199    # "draw_bitmap_rect_skbug4374.cpp",
200    # "drawglyphs.cpp",
201    # "drawimageset.cpp",
202    # "drawlines_with_local_matrix.cpp",
203    # "drawminibitmaprect.cpp",
204    # "drawquadset.cpp",
205    # "drawregion.cpp",
206    # "drawregionmodes.cpp",
207    # "dropshadowimagefilter.cpp",
208    # "drrect.cpp",
209    # "drrect_small_inner.cpp",
210    # "dstreadshuffle.cpp",
211    # "ducky_yuv_blend.cpp",
212    # "emboss.cpp",
213    # "emptypath.cpp",
214    # "encode_alpha_jpeg.cpp",
215    # "encode_color_types.cpp",
216    # "encode.cpp",
217    # "encode_platform.cpp",
218    # "encode_srgb.cpp",
219    # "exoticformats.cpp",
220    # "fadefilter.cpp",
221    # "fatpathfill.cpp",
222    # "fiddle.cpp",
223    # "fillrect_gradient.cpp",
224    # "filltypes.cpp",
225    # "filltypespersp.cpp",
226    # "filterbug.cpp",
227    # "filterfastbounds.cpp",
228    # "filterindiabox.cpp",
229    # "flippity.cpp",
230    # "fontations.cpp",
231    # "fontcache.cpp",
232    # "fontmgr.cpp",
233    # "fontregen.cpp",
234    # "fontscaler.cpp",
235    # "fontscalerdistortable.cpp",
236    # "fpcoordinateoverride.cpp",
237    # "fp_sample_chaining.cpp",
238    # "fwidth_squircle.cpp",
239    # "gammatext.cpp",
240    # "getpostextpath.cpp",
241    # "giantbitmap.cpp",
242    # "glyph_pos.cpp",
243    # "gpu_blur_utils.cpp",
244    # "gradient_dirty_laundry.cpp",
245    # "gradient_matrix.cpp",
246    # "gradients_2pt_conical.cpp",
247    # "gradients.cpp",
248    # "gradients_degenerate.cpp",
249    # "gradients_no_texture.cpp",
250    # "gradtext.cpp",
251    # "graphite_replay.cpp",
252    # "graphitestart.cpp",
253    # "grayscalejpg.cpp",
254    # "hairlines.cpp",
255    # "hairmodes.cpp",
256    # "hardstop_gradients.cpp",
257    # "hardstop_gradients_many.cpp",
258    # "highcontrastfilter.cpp",
259    # "hittestpath.cpp",
260    # "hsl.cpp",
261    # "hugepath.cpp",
262    # "imageblur2.cpp",
263    # "imageblurclampmode.cpp",
264    # "imageblur.cpp",
265    # "imageblurrepeatmode.cpp",
266    # "imageblurtiled.cpp",
267    # "image.cpp",
268    # "imagefiltersbase.cpp",
269    # "imagefiltersclipped.cpp",
270    # "imagefilters.cpp",
271    # "imagefilterscropexpand.cpp",
272    # "imagefilterscropped.cpp",
273    # "imagefiltersgraph.cpp",
274    # "imagefiltersscaled.cpp",
275    # "imagefiltersstroked.cpp",
276    # "imagefilterstransformed.cpp",
277    # "imagefiltersunpremul.cpp",
278    # "imagefromyuvtextures.cpp",
279    # "imagemagnifier.cpp",
280    # "imagemakewithfilter.cpp",
281    # "imagemasksubset.cpp",
282    # "image_pict.cpp",
283    # "imageresizetiled.cpp",
284    # "image_shader.cpp",
285    # "imagesource2.cpp",
286    # "imagesource.cpp",
287    # "internal_links.cpp",
288    # "inverseclip.cpp",
289    # "inversepaths.cpp",
290    # "jpg_color_cube.cpp",
291    # "kawase_blur_rt.cpp",
292    # "labyrinth.cpp",
293    # "largeclippedpath.cpp",
294    # "largeglyphblur.cpp",
295    # "lattice.cpp",
296    # "lazytiling.cpp",
297    # "lcdblendmodes.cpp",
298    # "lcdoverlap.cpp",
299    # "lcdtext.cpp",
300    # "lighting.cpp",
301    # "linepaths.cpp",
302    # "localmatriximagefilter.cpp",
303    # "localmatriximageshader.cpp",
304    # "localmatrixshader.cpp",
305    # "lumafilter.cpp",
306    # "mac_aa_explorer.cpp",
307    # "makecolorspace.cpp",
308    # "make_raster_image.cpp",
309    # "mandoline.cpp",
310    # "manypathatlases.cpp",
311    # "manypaths.cpp",
312    # "matrixconvolution.cpp",
313    # "matriximagefilter.cpp",
314    # "mesh.cpp",
315    # "mipmap.cpp",
316    # "mirrortile.cpp",
317    # "mixedtextblobs.cpp",
318    # "mixercolorfilter.cpp",
319    # "modecolorfilters.cpp",
320    # "morphology.cpp",
321    # "nearesthalfpixelimage.cpp",
322    # "nested.cpp",
323    # "ninepatchstretch.cpp",
324    # "nonclosedpaths.cpp",
325    # "offsetimagefilter.cpp",
326    # "orientation.cpp",
327    # "ovals.cpp",
328    # "overdrawcanvas.cpp",
329    # "overdrawcolorfilter.cpp",
330    # "overstroke.cpp",
331    # "p3.cpp",
332    # "palette.cpp",
333    # "patch.cpp",
334    # "patharcto.cpp",
335    # "pathcontourstart.cpp",
336    # "patheffects.cpp",
337    # "pathfill.cpp",
338    # "pathinterior.cpp",
339    # "pathmaskcache.cpp",
340    # "pathmeasure.cpp",
341    # "pathopsinverse.cpp",
342    # "pathreverse.cpp",
343    # "path_stroke_with_zero_length.cpp",
344    # "pdf_never_embed.cpp",
345    # "perlinnoise.cpp",
346    # "perspimages.cpp",
347    # "perspshaders.cpp",
348    # "persptext.cpp",
349    # "picture.cpp",
350    # "pictureimagefilter.cpp",
351    # "pictureimagegenerator.cpp",
352    # "pictureshadercache.cpp",
353    # "pictureshader.cpp",
354    # "pictureshadertile.cpp",
355    # "plus.cpp",
356    # "points.cpp",
357    # "poly2poly.cpp",
358    # "polygonoffset.cpp",
359    # "polygons.cpp",
360    # "postercircle.cpp",
361    # "preservefillrule.cpp",
362    # "quadpaths.cpp",
363    # "radial_gradient_precision.cpp",
364    # "rasterhandleallocator.cpp",
365    # "readpixels.cpp",
366    # "recordopts.cpp",
367    # "rectangletexture.cpp",
368    # "repeated_bitmap.cpp",
369    # "resizeimagefilter.cpp",
370    # "rippleshadergm.cpp",
371    # "roundrects.cpp",
372    # "rrectclipdrawpaint.cpp",
373    # "rrect.cpp",
374    # "rrects.cpp",
375    # "rsxtext.cpp",
376    # "runtimecolorfilter.cpp",
377    # "runtimefunctions.cpp",
378    # "runtimeimagefilter.cpp",
379    # "runtimeintrinsics.cpp",
380    # "runtimeshader.cpp",
381    # "samplerstress.cpp",
382    # "savelayer.cpp",
383    # "scaledemoji.cpp",
384    # "scaledemoji_rendering.cpp",
385    # "scaledrects.cpp",
386    # "scaledstrokes.cpp",
387    # "shadermaskfilter.cpp",
388    # "shaderpath.cpp",
389    # "shadertext3.cpp",
390    # "shadowutils.cpp",
391    # "shallowgradient.cpp",
392    # "shapes.cpp",
393    # "sharedcorners.cpp",
394    # "showmiplevels.cpp",
395    # "simpleaaclip.cpp",
396    # "simplerect.cpp",
397    # "skbug_12212.cpp",
398    # "skbug1719.cpp",
399    # "skbug_257.cpp",
400    # "skbug_4868.cpp",
401    # "skbug_5321.cpp",
402    # "skbug_8664.cpp",
403    # "skbug_8955.cpp",
404    # "skbug_9319.cpp",
405    # "skbug_9819.cpp",
406    # "slug.cpp",
407    # "smallarc.cpp",
408    # "smallpaths.cpp",
409    # "spritebitmap.cpp",
410    # "srcmode.cpp",
411    # "srgb.cpp",
412    # "stlouisarch.cpp",
413    # "stringart.cpp",
414    # "strokedlines.cpp",
415    # "strokefill.cpp",
416    # "strokerect_anisotropic.cpp",
417    # "strokerect.cpp",
418    # "strokerects.cpp",
419    # "stroke_rect_shader.cpp",
420    # "strokes.cpp",
421    # "stroketext.cpp",
422    # "subsetshader.cpp",
423    # "surface.cpp",
424    # "swizzle.cpp",
425    # "tablecolorfilter.cpp",
426    # "tallstretchedbitmaps.cpp",
427    # "testgradient.cpp",
428    # "texelsubset.cpp",
429    # "textblobblockreordering.cpp",
430    # "textblobcolortrans.cpp",
431    # "textblob.cpp",
432    # "textblobgeometrychange.cpp",
433    # "textblobmixedsizes.cpp",
434    # "textblobrandomfont.cpp",
435    # "textblobshader.cpp",
436    # "textblobtransforms.cpp",
437    # "textblobuseaftergpufree.cpp",
438    # "texteffects.cpp",
439    # "text_scale_skew.cpp",
440    # "thinconcavepaths.cpp",
441    # "thinrects.cpp",
442    # "thinstrokedrects.cpp",
443    # "tiledscaledbitmap.cpp",
444    # "tileimagefilter.cpp",
445    # "tilemodes_alpha.cpp",
446    # "tilemodes.cpp",
447    # "tilemodes_scaled.cpp",
448    # "tinybitmap.cpp",
449    # "transparency.cpp",
450    # "trickycubicstrokes.cpp",
451    # "typeface.cpp",
452    # "unpremul.cpp",
453    # "userfont.cpp",
454    # "variedtext.cpp",
455    # "verifiers",
456    # "vertices.cpp",
457    # "verylargebitmap.cpp",
458    # "video_decoder.cpp",
459    # "wacky_yuv_formats.cpp",
460    # "widebuttcaps.cpp",
461    # "windowrectangles.cpp",
462    # "workingspace.cpp",
463    # "xfermodeimagefilter.cpp",
464    # "xfermodes2.cpp",
465    # "xfermodes3.cpp",
466    # "xfermodes.cpp",
467    # "ycbcrimage.cpp",
468    # "yuv420_odd_dim.cpp",
469    # "yuvtorgbsubset.cpp",
470]
471
472GPU_GMS = [
473    # TODO(lovisolo): Incomplete list. Some commented out files in CPU_GMS probably belong here.
474    # "aarecteffect.cpp",  # ./include/core/SkRefCnt.h:41: fatal error: "assert(this->getRefCnt() == 1)"
475    "anisotropic.cpp",
476    # "asyncrescaleandread.cpp",  # ./include/core/SkRefCnt.h:41: fatal error: "assert(this->getRefCnt() == 1)"
477    # "attributes.cpp",  # ./include/core/SkRefCnt.h:41: fatal error: "assert(this->getRefCnt() == 1)"
478    # "beziereffects.cpp",  # ./include/core/SkRefCnt.h:41: fatal error: "assert(this->getRefCnt() == 1)"
479    # "clockwise.cpp",  # ./include/core/SkRefCnt.h:41: fatal error: "assert(this->getRefCnt() == 1)"
480]
481
482COMMON_DEPS = [
483    "//:core",
484    "//gm",
485    "//src/core:core_priv",
486    "//tools:codec_utils",
487    "//tools:hash_and_encode",
488    "//tools:tool_utils",
489    "//tools/testrunners/common:testrunner",
490    "//tools/testrunners/common/compilation_mode_keys",
491]
492
493# Sample invocation:
494#
495#     $ bazel run --config=linux_rbe //gm:cpu_8888_test
496#
497# Then inspect the PNG and JSON files produced by the GMs:
498#
499#     $ unzip -l bazel-testlogs/gm/cpu_8888_test/test.outputs/outputs.zip
500skia_cc_test(
501    name = "cpu_8888_test",
502    srcs = CPU_GMS + [
503        "//tools/testrunners/gm:BazelGMTestRunner.cpp",
504    ],
505    args = [
506        "--surfaceConfig",
507        "8888",
508    ],
509    data = ["//resources"],
510    target_compatible_with = supports_platforms(
511        "@platforms//os:linux",
512        "@platforms//os:windows",
513        "@platforms//os:macos",
514    ),
515    deps = COMMON_DEPS + [
516        "//tools/testrunners/common/surface_manager:raster",
517        "//tools/testrunners/gm/vias:simple_vias",
518        "//tools/timer",  # Required by addarc.cpp and animatedimageblurs.cpp.
519    ],
520)
521
522skia_cc_test(
523    name = "cpu_8888_via_picture_serialization_test",
524    srcs = CPU_GMS + [
525        "//tools/testrunners/gm:BazelGMTestRunner.cpp",
526    ],
527    args = [
528        "--surfaceConfig",
529        "8888",
530        "--via",
531        "picture_serialization",
532        # These tests fail with "Recorded and reference bitmap pixels do not match."
533        "--skip",
534        "analytic_antialias_convex",
535        "arithmode",
536        "arithmode_blender",
537    ],
538    data = ["//resources"],
539    target_compatible_with = supports_platforms(
540        "@platforms//os:linux",
541        "@platforms//os:windows",
542        "@platforms//os:macos",
543    ),
544    deps = COMMON_DEPS + [
545        "//tools/testrunners/common/surface_manager:raster",
546        "//tools/testrunners/gm/vias:simple_vias",
547        "//tools/timer",  # Required by addarc.cpp and animatedimageblurs.cpp.
548    ],
549)
550
551skia_cc_test(
552    name = "cpu_8888_via_picture_test",
553    srcs = CPU_GMS + [
554        "//tools/testrunners/gm:BazelGMTestRunner.cpp",
555    ],
556    args = [
557        "--surfaceConfig",
558        "8888",
559        "--via",
560        "picture",
561    ],
562    data = ["//resources"],
563    target_compatible_with = supports_platforms(
564        "@platforms//os:linux",
565        "@platforms//os:windows",
566        "@platforms//os:macos",
567    ),
568    deps = COMMON_DEPS + [
569        "//tools/testrunners/common/surface_manager:raster",
570        "//tools/testrunners/gm/vias:simple_vias",
571        "//tools/timer",  # Required by addarc.cpp and animatedimageblurs.cpp.
572    ],
573)
574
575png_codec_tests(name = "png_codec_tests")
576
577test_suite(
578    name = "cpu_gm_tests",
579    tests = [
580        "cpu_8888_test",
581        "cpu_8888_via_picture_serialization_test",
582        "cpu_8888_via_picture_test",
583        ":png_codec_tests",
584    ],
585)
586
587skia_cc_test(
588    name = "ganesh_gles_test",
589    srcs = GPU_GMS + [
590        "//tools/testrunners/gm:BazelGMTestRunner.cpp",
591    ],
592    args = [
593        "--surfaceConfig",
594        "gles",
595    ],
596    data = ["//resources"],
597    target_compatible_with = supports_platforms(
598        "@platforms//os:linux",
599        "@platforms//os:windows",
600        "@platforms//os:macos",
601    ),
602    deps = COMMON_DEPS + [
603        "//tools/testrunners/common/surface_manager:ganesh_gl",
604        "//tools/testrunners/gm/vias:simple_vias",
605    ],
606)
607
608# Vulkan GMs.
609[
610    skia_cc_test(
611        name = name,
612        srcs = GPU_GMS + [
613            "//tools/testrunners/gm:BazelGMTestRunner.cpp",
614        ],
615        args = [
616            "--surfaceConfig",
617            surfaceConfig,
618        ],
619        data = ["//resources"],
620        target_compatible_with = supports_platforms(
621            "@platforms//os:linux",
622            "@platforms//os:windows",
623            "@platforms//os:macos",
624        ),
625        deps = COMMON_DEPS + [
626            "//tools/testrunners/common/surface_manager:ganesh_vulkan",
627            "//tools/testrunners/gm/vias:simple_vias",
628        ],
629    )
630    for name, surfaceConfig in [
631        [
632            "ganesh_vk_test",
633            "vk",
634        ],
635        [
636            "ganesh_vk_1010102_test",
637            "vk_1010102",
638        ],
639        [
640            "ganesh_vk_msaa4_test",
641            "vk_msaa4",
642        ],
643        [
644            "ganesh_vk_msaa8_test",
645            "vk_msaa8",
646        ],
647        [
648            "ganesh_vk_dmsaa_test",
649            "vk_dmsaa",
650        ],
651        [
652            "ganesh_vk_betex_test",
653            "vk_betex",
654        ],
655        [
656            "ganesh_vk_bert_test",
657            "vk_bert",
658        ],
659    ]
660]
661
662skia_cc_test(
663    name = "hello_bazel_world_test",
664    srcs = [
665        "hello_bazel_world.cpp",
666        "//tools/testrunners/gm:BazelGMTestRunner.cpp",
667    ],
668    args = [
669        "--surfaceConfig",
670        "8888",
671    ],
672    data = ["//resources"],
673    target_compatible_with = supports_platforms(
674        "@platforms//os:linux",
675        "@platforms//os:windows",
676        "@platforms//os:macos",
677    ),
678    deps = COMMON_DEPS + [
679        "//tools/testrunners/common/surface_manager:raster",
680        "//tools/testrunners/gm/vias:simple_vias",
681    ],
682)
683
684android_gm_test(
685    name = "hello_bazel_world_android_test",
686    srcs = [
687        "hello_bazel_world.cpp",
688        "//tools/testrunners/gm:BazelGMTestRunner.cpp",
689    ],
690    args = [
691        "--surfaceConfig",
692        "8888",
693    ],
694    requires_resources_dir = True,
695    deps = COMMON_DEPS + [
696        "//tools/testrunners/common/surface_manager:raster",
697        "//tools/testrunners/gm/vias:simple_vias",
698    ],
699)
700
701[
702    # Sample invocation (assuming there's a Pixel 5 or similar device available via adb):
703    #
704    #     $ bazel test --config=android_rbe --config=Pixel5 //gm:cpu_8888_android_test
705    #
706    # Then inspect the PNG and JSON files produced by the GMs:
707    #
708    #     $ unzip -l bazel-testlogs/gm/cpu_8888_android_test/test.outputs/outputs.zip
709    android_gm_test(
710        name = "cpu_%s_android_test" % surface_config,
711        srcs = CPU_GMS + [
712            "//tools/testrunners/gm:BazelGMTestRunner.cpp",
713        ],
714        args = [
715            "--surfaceConfig",
716            "8888",
717        ],
718        requires_resources_dir = True,
719        deps = COMMON_DEPS + [
720            "//tools/testrunners/common/surface_manager:raster",
721            "//tools/testrunners/gm/vias:simple_vias",
722            "//tools/timer",  # Required by addarc.cpp and animatedimageblurs.cpp.
723        ],
724    )
725    for surface_config in [
726        "8888",
727        "565",
728    ]
729]
730
731android_gm_test(
732    name = "ganesh_gles_android_test",
733    srcs = GPU_GMS + [
734        "//tools/testrunners/gm:BazelGMTestRunner.cpp",
735    ],
736    args = [
737        "--surfaceConfig",
738        "gles",
739    ],
740    requires_resources_dir = True,
741    deps = COMMON_DEPS + [
742        "//tools/testrunners/common/surface_manager:ganesh_gl",
743        "//tools/testrunners/gm/vias:simple_vias",
744    ],
745)
746
747android_gm_test(
748    name = "ganesh_gles_via_picture_serialization_android_test",
749    srcs = GPU_GMS + [
750        "//tools/testrunners/gm:BazelGMTestRunner.cpp",
751    ],
752    args = [
753        "--surfaceConfig",
754        "gles",
755        "--via",
756        "picture_serialization",
757        "--skip",
758        "anisomips",  # Fails with "Recorded and reference bitmap pixels do not match".
759    ],
760    requires_resources_dir = True,
761    deps = COMMON_DEPS + [
762        "//tools/testrunners/common/surface_manager:ganesh_gl",
763        "//tools/testrunners/gm/vias:simple_vias",
764    ],
765)
766
767android_gm_test(
768    name = "ganesh_gles_via_picture_android_test",
769    srcs = GPU_GMS + [
770        "//tools/testrunners/gm:BazelGMTestRunner.cpp",
771    ],
772    args = [
773        "--surfaceConfig",
774        "gles",
775        "--via",
776        "picture",
777        "--skip",
778        "anisomips",  # Fails with "Recorded and reference bitmap pixels do not match".
779    ],
780    requires_resources_dir = True,
781    deps = COMMON_DEPS + [
782        "//tools/testrunners/common/surface_manager:ganesh_gl",
783        "//tools/testrunners/gm/vias:simple_vias",
784    ],
785)
786
787android_gm_test(
788    name = "ganesh_vk_android_test",
789    srcs = GPU_GMS + [
790        "//tools/testrunners/gm:BazelGMTestRunner.cpp",
791    ],
792    args = [
793        "--surfaceConfig",
794        "vk",
795    ],
796    requires_resources_dir = True,
797    deps = COMMON_DEPS + [
798        "//tools/testrunners/common/surface_manager:ganesh_vulkan",
799        "//tools/testrunners/gm/vias:simple_vias",
800    ],
801)
802