From 6295306ee65405a8ddedc2101d079f65e0e459ba Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Tue, 21 May 2024 11:37:29 -0700 Subject: [PATCH] [Impeller] Remove unused GN flags. Removes impeller_capture, impeller_use_prebuilt_impellerc, impeller_use_prebuilt_scenec, and impeller_trace_canvas. Also removes setting these flags from ./flutter/tools/gn. --- impeller/tools/args.gni | 16 ---------------- impeller/tools/compiler.gni | 32 ++++++-------------------------- impeller/tools/scene.gni | 31 ++++++++----------------------- tools/gn | 20 -------------------- 4 files changed, 14 insertions(+), 85 deletions(-) diff --git a/impeller/tools/args.gni b/impeller/tools/args.gni index 6c81b2da7b16a..70d3c2326d958 100644 --- a/impeller/tools/args.gni +++ b/impeller/tools/args.gni @@ -9,9 +9,6 @@ declare_args() { impeller_debug = flutter_runtime_mode == "debug" || flutter_runtime_mode == "profile" - # Whether the runtime capture/playback system is enabled. - impeller_capture = flutter_runtime_mode == "debug" - # Whether the Metal backend is enabled. impeller_enable_metal = (is_mac || is_ios) && target_os != "fuchsia" @@ -23,25 +20,12 @@ declare_args() { impeller_enable_vulkan = (is_linux || is_win || is_android || is_mac || enable_unittests) && target_os != "fuchsia" - # Whether to use a prebuilt impellerc. - # If this is the empty string, impellerc will be built. - # If it is non-empty, it should be the absolute path to impellerc. - impeller_use_prebuilt_impellerc = "" - - # Whether to use a prebuilt scenec. - # If this is the empty string, scenec will be built. - # If it is non-empty, it should be the absolute path to scenec. - impeller_use_prebuilt_scenec = "" - # If enabled, all OpenGL calls will be traced. Because additional trace # overhead may be substantial, this is not enabled by default. impeller_trace_all_gl_calls = false # Enable experimental 3D scene rendering. impeller_enable_3d = false - - # Enable to get trace statements for canvas usage. - impeller_trace_canvas = false } # Arguments that are combinations of other arguments by default but which can diff --git a/impeller/tools/compiler.gni b/impeller/tools/compiler.gni index 3857b7c38f810..6c2d080865ee1 100644 --- a/impeller/tools/compiler.gni +++ b/impeller/tools/compiler.gni @@ -14,34 +14,14 @@ import("//flutter/impeller/tools/args.gni") # invoked once via `compiled_action` or `action`. template("_impellerc") { if (invoker.single_invocation) { - if (impeller_use_prebuilt_impellerc == "") { - compiled_action(target_name) { - forward_variables_from(invoker, "*") - tool = "//flutter/impeller/compiler:impellerc" - } - } else { - action(target_name) { - forward_variables_from(invoker, "*", [ "args" ]) - script = "//build/gn_run_binary.py" - impellerc_path = - rebase_path(impeller_use_prebuilt_impellerc, root_build_dir) - args = [ impellerc_path ] + invoker.args - } + compiled_action(target_name) { + forward_variables_from(invoker, "*") + tool = "//flutter/impeller/compiler:impellerc" } } else { - if (impeller_use_prebuilt_impellerc == "") { - compiled_action_foreach(target_name) { - forward_variables_from(invoker, "*") - tool = "//flutter/impeller/compiler:impellerc" - } - } else { - action_foreach(target_name) { - forward_variables_from(invoker, "*", [ "args" ]) - script = "//build/gn_run_binary.py" - impellerc_path = - rebase_path(impeller_use_prebuilt_impellerc, root_build_dir) - args = [ impellerc_path ] + invoker.args - } + compiled_action_foreach(target_name) { + forward_variables_from(invoker, "*") + tool = "//flutter/impeller/compiler:impellerc" } } } diff --git a/impeller/tools/scene.gni b/impeller/tools/scene.gni index 447c835a3be3a..a29c1f0199e81 100644 --- a/impeller/tools/scene.gni +++ b/impeller/tools/scene.gni @@ -1,42 +1,27 @@ -# Dispatches to the build or prebuilt scenec depending on the value of -# the impeller_use_prebuilt_scenec argument. Forwards all variables to -# compiled_action_foreach or action_foreach as appropriate. +# 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/compiled_action.gni") import("//flutter/impeller/tools/args.gni") -template("_scenec") { - if (impeller_use_prebuilt_scenec == "") { - compiled_action_foreach(target_name) { - forward_variables_from(invoker, "*") - tool = "//flutter/impeller/scene/importer:scenec" - } - } else { - action_foreach(target_name) { - forward_variables_from(invoker, "*", [ "args" ]) - script = "//build/gn_run_binary.py" - scenec_path = rebase_path(impeller_use_prebuilt_scenec, root_build_dir) - args = [ scenec_path ] + invoker.args - } - } -} - template("scenec") { assert(defined(invoker.geometry), "Geometry input files must be specified.") assert(defined(invoker.type), "The type of geometry to be parsed (gltf, etc..).") - _scenec(target_name) { - sources = invoker.geometry - generated_dir = "$target_gen_dir" + compiled_action_foreach(target_name) { + tool = "//flutter/impeller/scene/importer:scenec" + sources = invoker.geometry input_type = invoker.type + args = [ "--input={{source}}", "--input-type=$input_type", ] - output = "$generated_dir/{{source_file_part}}.ipscene" + output = "$target_gen_dir/{{source_file_part}}.ipscene" output_path = rebase_path(output, root_build_dir) args += [ "--output=$output_path" ] diff --git a/tools/gn b/tools/gn index e8ec2d050536d..70d2ff4a690d7 100755 --- a/tools/gn +++ b/tools/gn @@ -719,12 +719,6 @@ def to_gn_args(args): if args.enable_impeller_3d: gn_args['impeller_enable_3d'] = True - if args.enable_impeller_trace_canvas: - gn_args['impeller_trace_canvas'] = True - - if args.prebuilt_impellerc is not None: - gn_args['impeller_use_prebuilt_impellerc'] = args.prebuilt_impellerc - malioc_path = args.malioc_path if not malioc_path: malioc_path = os.environ.get('MALIOC_PATH') @@ -1162,14 +1156,6 @@ def parse_args(args): ) # Impeller flags. - parser.add_argument( - '--prebuilt-impellerc', - default=None, - type=str, - help='Absolute path to a prebuilt impellerc. ' + - 'Do not use this outside of CI or with impellerc from a different engine version.' - ) - parser.add_argument( '--enable-impeller-3d', default=False, @@ -1177,12 +1163,6 @@ def parse_args(args): help='Enables experimental 3d support.' ) - parser.add_argument( - '--enable-impeller-trace-canvas', - default=False, - action='store_true', - help='Enables tracing calls to Canvas.' - ) parser.add_argument('--malioc-path', type=str, help='The path to the malioc tool.') parser.add_argument(