| # Copyright 2013 The Flutter Authors. All rights reserved. |
| # 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", |
| "display_list.h", |
| "display_list_attributes.h", |
| "display_list_blend_mode.cc", |
| "display_list_blend_mode.h", |
| "display_list_builder.cc", |
| "display_list_builder.h", |
| "display_list_canvas_dispatcher.cc", |
| "display_list_canvas_dispatcher.h", |
| "display_list_canvas_recorder.cc", |
| "display_list_canvas_recorder.h", |
| "display_list_color_filter.cc", |
| "display_list_color_filter.h", |
| "display_list_color_source.cc", |
| "display_list_color_source.h", |
| "display_list_complexity.cc", |
| "display_list_complexity.h", |
| "display_list_complexity_gl.cc", |
| "display_list_complexity_gl.h", |
| "display_list_complexity_metal.cc", |
| "display_list_complexity_metal.h", |
| "display_list_dispatcher.cc", |
| "display_list_dispatcher.h", |
| "display_list_flags.cc", |
| "display_list_flags.h", |
| "display_list_image.cc", |
| "display_list_image.h", |
| "display_list_image_filter.cc", |
| "display_list_image_filter.h", |
| "display_list_image_skia.cc", |
| "display_list_image_skia.h", |
| "display_list_mask_filter.cc", |
| "display_list_mask_filter.h", |
| "display_list_ops.cc", |
| "display_list_ops.h", |
| "display_list_paint.cc", |
| "display_list_paint.h", |
| "display_list_tile_mode.h", |
| "display_list_utils.cc", |
| "display_list_utils.h", |
| "display_list_vertices.cc", |
| "display_list_vertices.h", |
| "types.h", |
| ] |
| |
| public_deps = [ |
| "//flutter/fml", |
| "//third_party/skia", |
| ] |
| } |
| |
| # Instead of creating a new test harness for display lists, the flow_unittests |
| # harness includes these in its own. |
| source_set("unittests") { |
| testonly = true |
| |
| sources = [ |
| "display_list_attributes_testing.h", |
| "display_list_canvas_unittests.cc", |
| "display_list_color_filter_unittests.cc", |
| "display_list_color_source_unittests.cc", |
| "display_list_complexity_unittests.cc", |
| "display_list_enum_unittests.cc", |
| "display_list_image_filter_unittests.cc", |
| "display_list_mask_filter_unittests.cc", |
| "display_list_paint_unittests.cc", |
| "display_list_test_utils.cc", |
| "display_list_test_utils.h", |
| "display_list_unittests.cc", |
| "display_list_vertices_unittests.cc", |
| ] |
| |
| deps = [ |
| "//flutter/testing:testing_lib", |
| "//third_party/skia", |
| ] |
| |
| public_deps = [ ":display_list" ] |
| } |
| |
| fixtures_location("display_list_benchmarks_fixtures") { |
| assets_dir = "$target_gen_dir/" |
| } |
| |
| source_set("display_list_benchmarks_source") { |
| 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", |
| ] |
| |
| defines = [] |
| |
| if (is_android) { |
| libs = [ |
| "android", |
| "EGL", |
| "GLESv2", |
| ] |
| } |
| |
| # We only do software benchmarks on non-mobile platforms |
| if (!is_android && !is_ios) { |
| sources += [ |
| "display_list_benchmarks_software.cc", |
| "display_list_benchmarks_software.h", |
| ] |
| defines += [ "ENABLE_SOFTWARE_BENCHMARKS" ] |
| } |
| |
| # iOS and Fuchsia don't support OpenGL |
| if (!is_fuchsia && !is_ios) { |
| defines += [ "ENABLE_OPENGL_BENCHMARKS" ] |
| sources += [ |
| "display_list_benchmarks_gl.cc", |
| "display_list_benchmarks_gl.h", |
| ] |
| deps += [ "//flutter/testing:opengl" ] |
| } |
| |
| if (is_mac || is_ios) { |
| defines += [ "ENABLE_METAL_BENCHMARKS" ] |
| sources += [ |
| "display_list_benchmarks_metal.cc", |
| "display_list_benchmarks_metal.h", |
| ] |
| deps += [ "//flutter/testing:metal" ] |
| } |
| |
| # Don't snapshot test results on mobile platforms |
| if (is_android || is_ios) { |
| defines += [ "BENCHMARKS_NO_SNAPSHOT" ] |
| } |
| } |
| |
| executable("display_list_benchmarks") { |
| testonly = true |
| |
| deps = [ ":display_list_benchmarks_source" ] |
| } |
| |
| if (is_ios) { |
| shared_library("ios_display_list_benchmarks") { |
| testonly = true |
| visibility = [ ":*" ] |
| |
| configs -= [ |
| "//build/config/gcc:symbol_visibility_hidden", |
| "//build/config:symbol_visibility_hidden", |
| ] |
| configs += [ "//flutter/benchmarking:benchmark_library_config" ] |
| cflags = [ |
| "-fobjc-arc", |
| "-mios-simulator-version-min=$ios_testing_deployment_target", |
| ] |
| ldflags = |
| [ "-Wl,-install_name,@rpath/libios_display_list_benchmarks.dylib" ] |
| deps = [ |
| ":display_list_benchmarks_source", |
| "//flutter/benchmarking:benchmarking_library", |
| ] |
| } |
| } |