blob: 0f06821122f9c80057bd145eeadb522bf5933e28 [file] [log] [blame]
load("//bazel:cc_test_with_flags.bzl", "cc_test_with_flags")
load("//bazel:skia_rules.bzl", "exports_files_legacy", "skia_cc_library", "skia_filegroup")
load("//tools/testrunners/benchmark:android_benchmark_test.bzl", "android_benchmark_test")
licenses(["notice"])
exports_files_legacy()
skia_filegroup(
name = "gpu_tools",
srcs = ["GpuTools.h"],
visibility = ["//tools/viewer:__pkg__"],
)
skia_cc_library(
name = "benchmark",
srcs = ["Benchmark.cpp"],
hdrs = ["Benchmark.h"],
visibility = ["//tools/testrunners/benchmark:__subpackages__"],
deps = [
"//:skia_internal",
"//tools:registry",
],
)
skia_cc_library(
name = "benchmarks_base",
testonly = True,
deps = [
":benchmark",
"//:skia_internal",
"//tools/testrunners/benchmark:testrunner",
],
)
cc_test_with_flags(
name = "cpu_nonrendering_test",
srcs = [
"GradientBench.cpp",
"TextBlobBench.cpp",
],
args = [
"--surfaceConfig",
"nonrendering",
"--autoTuneLoops",
],
set_flags = {
"include_encoder": [
"png_encode_codec",
],
},
deps = [":benchmarks_base"],
)
cc_test_with_flags(
name = "cpu_8888_test",
srcs = [
"GradientBench.cpp",
"TextBlobBench.cpp",
],
args = [
"--surfaceConfig",
"8888",
"--autoTuneLoops",
],
set_flags = {
"include_encoder": [
"png_encode_codec",
],
},
deps = [":benchmarks_base"],
)
# Vulkan benchmarks.
[
cc_test_with_flags(
name = name,
srcs = [
"GradientBench.cpp",
"TextBlobBench.cpp",
],
args = [
"--surfaceConfig",
surfaceConfig,
"--autoTuneLoops",
],
set_flags = {
"include_encoder": [
"png_encode_codec",
],
},
deps = [":benchmarks_base"],
)
for name, surfaceConfig in [
[
"ganesh_vk_test",
"vk",
],
[
"ganesh_vk_1010102_test",
"vk_1010102",
],
[
"ganesh_vk_msaa4_test",
"vk_msaa4",
],
[
"ganesh_vk_msaa8_test",
"vk_msaa8",
],
[
"ganesh_vk_dmsaa_test",
"vk_dmsaa",
],
[
"ganesh_vk_betex_test",
"vk_betex",
],
[
"ganesh_vk_bert_test",
"vk_bert",
],
]
]
cc_test_with_flags(
name = "gpu_gles_test",
srcs = [
"GradientBench.cpp",
"TextBlobBench.cpp",
],
args = [
"--surfaceConfig",
"gles",
"--autoTuneLoops",
],
set_flags = {
"include_encoder": [
"png_encode_codec",
],
},
deps = [":benchmarks_base"],
)
android_benchmark_test(
name = "cpu_nonrendering_android_test",
srcs = [
"GradientBench.cpp",
"TextBlobBench.cpp",
],
extra_args = [
"--autoTuneLoops",
],
surface_config = "nonrendering",
deps = [":benchmarks_base"],
)
android_benchmark_test(
name = "cpu_8888_android_test",
srcs = [
"GradientBench.cpp",
"TextBlobBench.cpp",
],
extra_args = [
"--autoTuneLoops",
],
surface_config = "8888",
deps = [":benchmarks_base"],
)
android_benchmark_test(
name = "gpu_gles_android_test",
srcs = [
"GradientBench.cpp",
"TextBlobBench.cpp",
],
extra_args = [
"--autoTuneLoops",
],
surface_config = "gles",
deps = [":benchmarks_base"],
)