Skip to content

Commit

Permalink
Add a new display_list_benchmarks test suite (#30678)
Browse files Browse the repository at this point in the history
* Add a new display_list_benchmarks test suite that will allow us to microbenchmark all the rasterops defined in
our DisplayList format on both CPU and GPU canvases.
  • Loading branch information
George Wright authored Jan 5, 2022
1 parent 830abeb commit c726121
Show file tree
Hide file tree
Showing 7 changed files with 1,665 additions and 0 deletions.
1 change: 1 addition & 0 deletions BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ group("flutter") {
# Compile all benchmark targets if enabled.
if (enable_unittests && !is_win) {
public_deps += [
"//flutter/display_list:display_list_benchmarks",
"//flutter/fml:fml_benchmarks",
"//flutter/lib/ui:ui_benchmarks",
"//flutter/shell/common:shell_benchmarks",
Expand Down
4 changes: 4 additions & 0 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ FILE: ../../../flutter/common/task_runners.cc
FILE: ../../../flutter/common/task_runners.h
FILE: ../../../flutter/display_list/display_list.cc
FILE: ../../../flutter/display_list/display_list.h
FILE: ../../../flutter/display_list/display_list_benchmarks.cc
FILE: ../../../flutter/display_list/display_list_benchmarks.h
FILE: ../../../flutter/display_list/display_list_benchmarks_gl.cc
FILE: ../../../flutter/display_list/display_list_benchmarks_metal.cc
FILE: ../../../flutter/display_list/display_list_builder.cc
FILE: ../../../flutter/display_list/display_list_builder.h
FILE: ../../../flutter/display_list/display_list_canvas_dispatcher.cc
Expand Down
39 changes: 39 additions & 0 deletions display_list/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//flutter/testing/testing.gni")

source_set("display_list") {
sources = [
"display_list.cc",
Expand Down Expand Up @@ -46,3 +48,40 @@ source_set("unittests") {

public_deps = [ ":display_list" ]
}

fixtures_location("display_list_benchmarks_fixtures") {
assets_dir = "$target_gen_dir/"
}

if (enable_unittests) {
executable("display_list_benchmarks") {
testonly = true

sources = [
"display_list_benchmarks.cc",
"display_list_benchmarks.h",
]

deps = [
":display_list",
":display_list_benchmarks_fixtures",
"//flutter/benchmarking",
"//flutter/common/graphics",
"//flutter/fml",
"//flutter/testing:skia",
"//flutter/testing:testing_lib",
"//third_party/dart/runtime:libdart_jit", # for tracing
"//third_party/skia",
]

if (!is_fuchsia) {
sources += [ "display_list_benchmarks_gl.cc" ]
deps += [ "//flutter/testing:opengl" ]
}

if (is_mac) {
sources += [ "display_list_benchmarks_metal.cc" ]
deps += [ "//flutter/testing:metal" ]
}
}
}
Loading

0 comments on commit c726121

Please sign in to comment.