Chinmay Garde | 880fcca | 2021-12-20 17:14:01 -0800 | [diff] [blame] | 1 | # 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 Wright | c726121 | 2022-01-04 17:01:53 -0800 | [diff] [blame] | 5 | import("//flutter/testing/testing.gni") |
| 6 | |
Chinmay Garde | 880fcca | 2021-12-20 17:14:01 -0800 | [diff] [blame] | 7 | source_set("display_list") { |
| 8 | sources = [ |
| 9 | "display_list.cc", |
| 10 | "display_list.h", |
Jim Graham | eef4f8e | 2022-02-25 11:51:02 -0800 | [diff] [blame] | 11 | "display_list_attributes.h", |
JsouLiang | 1aa5255 | 2022-03-20 05:10:07 +0800 | [diff] [blame] | 12 | "display_list_blend_mode.cc", |
| 13 | "display_list_blend_mode.h", |
Chinmay Garde | 41869f6 | 2021-12-28 15:19:35 -0800 | [diff] [blame] | 14 | "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 Graham | 70c1173 | 2022-02-17 11:19:11 -0800 | [diff] [blame] | 20 | "display_list_color_filter.cc", |
| 21 | "display_list_color_filter.h", |
Jim Graham | dc22c4c | 2022-03-15 16:55:04 -0700 | [diff] [blame] | 22 | "display_list_color_source.cc", |
| 23 | "display_list_color_source.h", |
George Wright | 0bd729b | 2022-02-01 21:40:35 -0800 | [diff] [blame] | 24 | "display_list_complexity.cc", |
| 25 | "display_list_complexity.h", |
George Wright | d476e7a | 2022-02-17 20:01:40 -0800 | [diff] [blame] | 26 | "display_list_complexity_gl.cc", |
| 27 | "display_list_complexity_gl.h", |
| 28 | "display_list_complexity_metal.cc", |
| 29 | "display_list_complexity_metal.h", |
Chinmay Garde | 41869f6 | 2021-12-28 15:19:35 -0800 | [diff] [blame] | 30 | "display_list_dispatcher.cc", |
| 31 | "display_list_dispatcher.h", |
| 32 | "display_list_flags.cc", |
| 33 | "display_list_flags.h", |
Chinmay Garde | 6dd43e6 | 2022-03-30 13:31:37 -0700 | [diff] [blame] | 34 | "display_list_image.cc", |
| 35 | "display_list_image.h", |
Jim Graham | 3f2750c | 2022-03-21 13:55:08 -0700 | [diff] [blame] | 36 | "display_list_image_filter.cc", |
| 37 | "display_list_image_filter.h", |
Chinmay Garde | 6dd43e6 | 2022-03-30 13:31:37 -0700 | [diff] [blame] | 38 | "display_list_image_skia.cc", |
| 39 | "display_list_image_skia.h", |
Jim Graham | d1fbb63 | 2022-02-18 09:19:09 -0800 | [diff] [blame] | 40 | "display_list_mask_filter.cc", |
| 41 | "display_list_mask_filter.h", |
Chinmay Garde | 1bd50ca | 2021-12-29 17:46:31 -0800 | [diff] [blame] | 42 | "display_list_ops.cc", |
| 43 | "display_list_ops.h", |
Jim Graham | e881225 | 2022-04-22 15:54:03 -0700 | [diff] [blame^] | 44 | "display_list_paint.cc", |
| 45 | "display_list_paint.h", |
Jim Graham | dc22c4c | 2022-03-15 16:55:04 -0700 | [diff] [blame] | 46 | "display_list_tile_mode.h", |
Chinmay Garde | 880fcca | 2021-12-20 17:14:01 -0800 | [diff] [blame] | 47 | "display_list_utils.cc", |
| 48 | "display_list_utils.h", |
Jim Graham | e4f9ee1 | 2022-03-31 00:15:04 -0700 | [diff] [blame] | 49 | "display_list_vertices.cc", |
| 50 | "display_list_vertices.h", |
Chinmay Garde | 41869f6 | 2021-12-28 15:19:35 -0800 | [diff] [blame] | 51 | "types.h", |
Chinmay Garde | 880fcca | 2021-12-20 17:14:01 -0800 | [diff] [blame] | 52 | ] |
| 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. |
| 62 | source_set("unittests") { |
| 63 | testonly = true |
| 64 | |
| 65 | sources = [ |
Jim Graham | dc22c4c | 2022-03-15 16:55:04 -0700 | [diff] [blame] | 66 | "display_list_attributes_testing.h", |
Chinmay Garde | 880fcca | 2021-12-20 17:14:01 -0800 | [diff] [blame] | 67 | "display_list_canvas_unittests.cc", |
Jim Graham | 70c1173 | 2022-02-17 11:19:11 -0800 | [diff] [blame] | 68 | "display_list_color_filter_unittests.cc", |
Jim Graham | dc22c4c | 2022-03-15 16:55:04 -0700 | [diff] [blame] | 69 | "display_list_color_source_unittests.cc", |
George Wright | d476e7a | 2022-02-17 20:01:40 -0800 | [diff] [blame] | 70 | "display_list_complexity_unittests.cc", |
Jim Graham | dc22c4c | 2022-03-15 16:55:04 -0700 | [diff] [blame] | 71 | "display_list_enum_unittests.cc", |
Jim Graham | 3f2750c | 2022-03-21 13:55:08 -0700 | [diff] [blame] | 72 | "display_list_image_filter_unittests.cc", |
Jim Graham | d1fbb63 | 2022-02-18 09:19:09 -0800 | [diff] [blame] | 73 | "display_list_mask_filter_unittests.cc", |
Jim Graham | e881225 | 2022-04-22 15:54:03 -0700 | [diff] [blame^] | 74 | "display_list_paint_unittests.cc", |
George Wright | d476e7a | 2022-02-17 20:01:40 -0800 | [diff] [blame] | 75 | "display_list_test_utils.cc", |
| 76 | "display_list_test_utils.h", |
Chinmay Garde | 880fcca | 2021-12-20 17:14:01 -0800 | [diff] [blame] | 77 | "display_list_unittests.cc", |
Jim Graham | e4f9ee1 | 2022-03-31 00:15:04 -0700 | [diff] [blame] | 78 | "display_list_vertices_unittests.cc", |
Chinmay Garde | 880fcca | 2021-12-20 17:14:01 -0800 | [diff] [blame] | 79 | ] |
| 80 | |
| 81 | deps = [ |
| 82 | "//flutter/testing:testing_lib", |
| 83 | "//third_party/skia", |
| 84 | ] |
| 85 | |
| 86 | public_deps = [ ":display_list" ] |
| 87 | } |
George Wright | c726121 | 2022-01-04 17:01:53 -0800 | [diff] [blame] | 88 | |
| 89 | fixtures_location("display_list_benchmarks_fixtures") { |
| 90 | assets_dir = "$target_gen_dir/" |
| 91 | } |
| 92 | |
George Wright | 6f99a71 | 2022-02-08 11:00:09 -0800 | [diff] [blame] | 93 | source_set("display_list_benchmarks_source") { |
| 94 | testonly = true |
George Wright | c726121 | 2022-01-04 17:01:53 -0800 | [diff] [blame] | 95 | |
George Wright | 6f99a71 | 2022-02-08 11:00:09 -0800 | [diff] [blame] | 96 | 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 Wright | fcf7458 | 2022-01-13 15:35:09 -0800 | [diff] [blame] | 126 | "display_list_benchmarks_software.cc", |
George Wright | 323a794 | 2022-01-19 13:39:37 -0800 | [diff] [blame] | 127 | "display_list_benchmarks_software.h", |
George Wright | c726121 | 2022-01-04 17:01:53 -0800 | [diff] [blame] | 128 | ] |
George Wright | 6f99a71 | 2022-02-08 11:00:09 -0800 | [diff] [blame] | 129 | defines += [ "ENABLE_SOFTWARE_BENCHMARKS" ] |
George Wright | c726121 | 2022-01-04 17:01:53 -0800 | [diff] [blame] | 130 | } |
George Wright | 6f99a71 | 2022-02-08 11:00:09 -0800 | [diff] [blame] | 131 | |
| 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 | |
| 157 | executable("display_list_benchmarks") { |
| 158 | testonly = true |
| 159 | |
| 160 | deps = [ ":display_list_benchmarks_source" ] |
George Wright | c726121 | 2022-01-04 17:01:53 -0800 | [diff] [blame] | 161 | } |
George Wright | f121c1f | 2022-01-13 14:32:54 -0800 | [diff] [blame] | 162 | |
| 163 | if (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 Wright | f121c1f | 2022-01-13 14:32:54 -0800 | [diff] [blame] | 179 | deps = [ |
George Wright | 6f99a71 | 2022-02-08 11:00:09 -0800 | [diff] [blame] | 180 | ":display_list_benchmarks_source", |
George Wright | f121c1f | 2022-01-13 14:32:54 -0800 | [diff] [blame] | 181 | "//flutter/benchmarking:benchmarking_library", |
George Wright | f121c1f | 2022-01-13 14:32:54 -0800 | [diff] [blame] | 182 | ] |
| 183 | } |
| 184 | } |