blob: 678631c4dda15e1f5a7348fd9347bce1aea44a2e [file] [log] [blame]
Chinmay Garde880fcca2021-12-20 17:14:01 -08001# Copyright 2013 The Flutter 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
George Wrightc7261212022-01-04 17:01:53 -08005import("//flutter/testing/testing.gni")
6
Chinmay Garde880fcca2021-12-20 17:14:01 -08007source_set("display_list") {
8 sources = [
9 "display_list.cc",
10 "display_list.h",
Jim Grahameef4f8e2022-02-25 11:51:02 -080011 "display_list_attributes.h",
JsouLiang1aa52552022-03-20 05:10:07 +080012 "display_list_blend_mode.cc",
13 "display_list_blend_mode.h",
Chinmay Garde41869f62021-12-28 15:19:35 -080014 "display_list_builder.cc",
15 "display_list_builder.h",
16 "display_list_canvas_dispatcher.cc",
17 "display_list_canvas_dispatcher.h",
18 "display_list_canvas_recorder.cc",
19 "display_list_canvas_recorder.h",
Jim Graham70c11732022-02-17 11:19:11 -080020 "display_list_color_filter.cc",
21 "display_list_color_filter.h",
Jim Grahamdc22c4c2022-03-15 16:55:04 -070022 "display_list_color_source.cc",
23 "display_list_color_source.h",
George Wright0bd729b2022-02-01 21:40:35 -080024 "display_list_complexity.cc",
25 "display_list_complexity.h",
George Wrightd476e7a2022-02-17 20:01:40 -080026 "display_list_complexity_gl.cc",
27 "display_list_complexity_gl.h",
28 "display_list_complexity_metal.cc",
29 "display_list_complexity_metal.h",
Chinmay Garde41869f62021-12-28 15:19:35 -080030 "display_list_dispatcher.cc",
31 "display_list_dispatcher.h",
32 "display_list_flags.cc",
33 "display_list_flags.h",
Chinmay Garde6dd43e62022-03-30 13:31:37 -070034 "display_list_image.cc",
35 "display_list_image.h",
Jim Graham3f2750c2022-03-21 13:55:08 -070036 "display_list_image_filter.cc",
37 "display_list_image_filter.h",
Chinmay Garde6dd43e62022-03-30 13:31:37 -070038 "display_list_image_skia.cc",
39 "display_list_image_skia.h",
Jim Grahamd1fbb632022-02-18 09:19:09 -080040 "display_list_mask_filter.cc",
41 "display_list_mask_filter.h",
Chinmay Garde1bd50ca2021-12-29 17:46:31 -080042 "display_list_ops.cc",
43 "display_list_ops.h",
Jim Grahame8812252022-04-22 15:54:03 -070044 "display_list_paint.cc",
45 "display_list_paint.h",
Jim Grahamdc22c4c2022-03-15 16:55:04 -070046 "display_list_tile_mode.h",
Chinmay Garde880fcca2021-12-20 17:14:01 -080047 "display_list_utils.cc",
48 "display_list_utils.h",
Jim Grahame4f9ee12022-03-31 00:15:04 -070049 "display_list_vertices.cc",
50 "display_list_vertices.h",
Chinmay Garde41869f62021-12-28 15:19:35 -080051 "types.h",
Chinmay Garde880fcca2021-12-20 17:14:01 -080052 ]
53
54 public_deps = [
55 "//flutter/fml",
56 "//third_party/skia",
57 ]
58}
59
60# Instead of creating a new test harness for display lists, the flow_unittests
61# harness includes these in its own.
62source_set("unittests") {
63 testonly = true
64
65 sources = [
Jim Grahamdc22c4c2022-03-15 16:55:04 -070066 "display_list_attributes_testing.h",
Chinmay Garde880fcca2021-12-20 17:14:01 -080067 "display_list_canvas_unittests.cc",
Jim Graham70c11732022-02-17 11:19:11 -080068 "display_list_color_filter_unittests.cc",
Jim Grahamdc22c4c2022-03-15 16:55:04 -070069 "display_list_color_source_unittests.cc",
George Wrightd476e7a2022-02-17 20:01:40 -080070 "display_list_complexity_unittests.cc",
Jim Grahamdc22c4c2022-03-15 16:55:04 -070071 "display_list_enum_unittests.cc",
Jim Graham3f2750c2022-03-21 13:55:08 -070072 "display_list_image_filter_unittests.cc",
Jim Grahamd1fbb632022-02-18 09:19:09 -080073 "display_list_mask_filter_unittests.cc",
Jim Grahame8812252022-04-22 15:54:03 -070074 "display_list_paint_unittests.cc",
George Wrightd476e7a2022-02-17 20:01:40 -080075 "display_list_test_utils.cc",
76 "display_list_test_utils.h",
Chinmay Garde880fcca2021-12-20 17:14:01 -080077 "display_list_unittests.cc",
Jim Grahame4f9ee12022-03-31 00:15:04 -070078 "display_list_vertices_unittests.cc",
Chinmay Garde880fcca2021-12-20 17:14:01 -080079 ]
80
81 deps = [
82 "//flutter/testing:testing_lib",
83 "//third_party/skia",
84 ]
85
86 public_deps = [ ":display_list" ]
87}
George Wrightc7261212022-01-04 17:01:53 -080088
89fixtures_location("display_list_benchmarks_fixtures") {
90 assets_dir = "$target_gen_dir/"
91}
92
George Wright6f99a712022-02-08 11:00:09 -080093source_set("display_list_benchmarks_source") {
94 testonly = true
George Wrightc7261212022-01-04 17:01:53 -080095
George Wright6f99a712022-02-08 11:00:09 -080096 sources = [
97 "display_list_benchmarks.cc",
98 "display_list_benchmarks.h",
99 ]
100
101 deps = [
102 ":display_list",
103 ":display_list_benchmarks_fixtures",
104 "//flutter/benchmarking",
105 "//flutter/common/graphics",
106 "//flutter/fml",
107 "//flutter/testing:skia",
108 "//flutter/testing:testing_lib",
109 "//third_party/dart/runtime:libdart_jit", # for tracing
110 "//third_party/skia",
111 ]
112
113 defines = []
114
115 if (is_android) {
116 libs = [
117 "android",
118 "EGL",
119 "GLESv2",
120 ]
121 }
122
123 # We only do software benchmarks on non-mobile platforms
124 if (!is_android && !is_ios) {
125 sources += [
George Wrightfcf74582022-01-13 15:35:09 -0800126 "display_list_benchmarks_software.cc",
George Wright323a7942022-01-19 13:39:37 -0800127 "display_list_benchmarks_software.h",
George Wrightc7261212022-01-04 17:01:53 -0800128 ]
George Wright6f99a712022-02-08 11:00:09 -0800129 defines += [ "ENABLE_SOFTWARE_BENCHMARKS" ]
George Wrightc7261212022-01-04 17:01:53 -0800130 }
George Wright6f99a712022-02-08 11:00:09 -0800131
132 # iOS and Fuchsia don't support OpenGL
133 if (!is_fuchsia && !is_ios) {
134 defines += [ "ENABLE_OPENGL_BENCHMARKS" ]
135 sources += [
136 "display_list_benchmarks_gl.cc",
137 "display_list_benchmarks_gl.h",
138 ]
139 deps += [ "//flutter/testing:opengl" ]
140 }
141
142 if (is_mac || is_ios) {
143 defines += [ "ENABLE_METAL_BENCHMARKS" ]
144 sources += [
145 "display_list_benchmarks_metal.cc",
146 "display_list_benchmarks_metal.h",
147 ]
148 deps += [ "//flutter/testing:metal" ]
149 }
150
151 # Don't snapshot test results on mobile platforms
152 if (is_android || is_ios) {
153 defines += [ "BENCHMARKS_NO_SNAPSHOT" ]
154 }
155}
156
157executable("display_list_benchmarks") {
158 testonly = true
159
160 deps = [ ":display_list_benchmarks_source" ]
George Wrightc7261212022-01-04 17:01:53 -0800161}
George Wrightf121c1f2022-01-13 14:32:54 -0800162
163if (is_ios) {
164 shared_library("ios_display_list_benchmarks") {
165 testonly = true
166 visibility = [ ":*" ]
167
168 configs -= [
169 "//build/config/gcc:symbol_visibility_hidden",
170 "//build/config:symbol_visibility_hidden",
171 ]
172 configs += [ "//flutter/benchmarking:benchmark_library_config" ]
173 cflags = [
174 "-fobjc-arc",
175 "-mios-simulator-version-min=$ios_testing_deployment_target",
176 ]
177 ldflags =
178 [ "-Wl,-install_name,@rpath/libios_display_list_benchmarks.dylib" ]
George Wrightf121c1f2022-01-13 14:32:54 -0800179 deps = [
George Wright6f99a712022-02-08 11:00:09 -0800180 ":display_list_benchmarks_source",
George Wrightf121c1f2022-01-13 14:32:54 -0800181 "//flutter/benchmarking:benchmarking_library",
George Wrightf121c1f2022-01-13 14:32:54 -0800182 ]
183 }
184}