Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions impeller/tools/args.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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
Expand Down
32 changes: 6 additions & 26 deletions impeller/tools/compiler.gni
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Expand Down
31 changes: 8 additions & 23 deletions impeller/tools/scene.gni
Original file line number Diff line number Diff line change
@@ -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" ]
Expand Down
20 changes: 0 additions & 20 deletions tools/gn
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -1162,27 +1156,13 @@ 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,
action='store_true',
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(
Expand Down