| # 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("//build/fuchsia/sdk.gni") |
| import("//flutter/common/config.gni") |
| import("//flutter/impeller/tools/impeller.gni") |
| 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_builder_multiplexer.cc", |
| "display_list_builder_multiplexer.h", |
| "display_list_canvas_dispatcher.cc", |
| "display_list_canvas_dispatcher.h", |
| "display_list_canvas_recorder.cc", |
| "display_list_canvas_recorder.h", |
| "display_list_color.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_path_effect.cc", |
| "display_list_path_effect.h", |
| "display_list_rtree.cc", |
| "display_list_rtree.h", |
| "display_list_sampling_options.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", |
| ] |
| } |
| |
| if (enable_unittests) { |
| test_fixtures("display_list_fixtures") { |
| fixtures = [] |
| } |
| |
| source_set("display_list_testing") { |
| testonly = true |
| |
| sources = [ |
| "display_list_attributes_testing.h", |
| "display_list_test_utils.cc", |
| "display_list_test_utils.h", |
| ] |
| |
| deps = [ |
| "//flutter/testing:testing_lib", |
| "//third_party/skia", |
| ] |
| |
| public_deps = [ ":display_list" ] |
| } |
| |
| executable("display_list_unittests") { |
| testonly = true |
| |
| sources = [ |
| "display_list_color_filter_unittests.cc", |
| "display_list_color_source_unittests.cc", |
| "display_list_color_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_path_effect_unittests.cc", |
| "display_list_unittests.cc", |
| "display_list_utils_unittests.cc", |
| "display_list_vertices_unittests.cc", |
| ] |
| |
| deps = [ |
| ":display_list", |
| ":display_list_fixtures", |
| ":display_list_testing", |
| "//flutter/testing", |
| ] |
| |
| if (!defined(defines)) { |
| defines = [] |
| } |
| if (is_win) { |
| # Required for M_PI and others. |
| defines += [ "_USE_MATH_DEFINES" ] |
| } |
| |
| # This is needed for //third_party/googletest for linking zircon symbols. |
| if (is_fuchsia) { |
| libs = |
| [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ] |
| } |
| } |
| |
| executable("display_list_rendertests") { |
| testonly = true |
| |
| sources = [ "display_list_canvas_unittests.cc" ] |
| |
| deps = [ |
| ":display_list", |
| ":display_list_fixtures", |
| ":display_list_testing", |
| "//flutter/testing", |
| ] |
| |
| if (!defined(defines)) { |
| defines = [] |
| } |
| if (is_win) { |
| # Required for M_PI and others. |
| defines += [ "_USE_MATH_DEFINES" ] |
| } |
| |
| # This is needed for //third_party/googletest for linking zircon symbols. |
| if (is_fuchsia) { |
| libs = |
| [ "${fuchsia_sdk_path}/arch/${target_cpu}/sysroot/lib/libzircon.so" ] |
| } |
| } |
| |
| executable("display_list_builder_benchmarks") { |
| testonly = true |
| |
| sources = [ "display_list_builder_benchmarks.cc" ] |
| |
| deps = [ |
| ":display_list", |
| ":display_list_fixtures", |
| ":display_list_testing", |
| "//flutter/benchmarking", |
| "//flutter/testing:testing_lib", |
| ] |
| } |
| } |
| |
| 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 |
| _enable_gl_benchmarks = !is_fuchsia && !is_ios |
| |
| # TODO (https://github.com/flutter/flutter/issues/107357): |
| # impeller_enable_vulkan currently requires skia to not use VMA, which inturn |
| # causes linkage problems with swiftshader. |
| if (impeller_enable_vulkan) { |
| _enable_gl_benchmarks = false |
| } |
| |
| if (_enable_gl_benchmarks) { |
| 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", |
| ] |
| } |
| } |