Skip to content

Commit

Permalink
[Impeller Scene] Rename mesh importer to scenec (#38049)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdero authored Dec 3, 2022
1 parent 7a35191 commit f9067ed
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 31 deletions.
2 changes: 1 addition & 1 deletion ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -1650,8 +1650,8 @@ FILE: ../../../flutter/impeller/scene/geometry.cc
FILE: ../../../flutter/impeller/scene/geometry.h
FILE: ../../../flutter/impeller/scene/importer/importer.h
FILE: ../../../flutter/impeller/scene/importer/importer_gltf.cc
FILE: ../../../flutter/impeller/scene/importer/importer_main.cc
FILE: ../../../flutter/impeller/scene/importer/mesh.fbs
FILE: ../../../flutter/impeller/scene/importer/scenec_main.cc
FILE: ../../../flutter/impeller/scene/importer/switches.cc
FILE: ../../../flutter/impeller/scene/importer/switches.h
FILE: ../../../flutter/impeller/scene/importer/types.h
Expand Down
2 changes: 1 addition & 1 deletion impeller/fixtures/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impeller_shaders("shader_fixtures") {
}
}

scene_importer("geometry_fixtures") {
scenec("geometry_fixtures") {
geometry = [ "flutter_logo.glb" ]
type = "gltf"
}
Expand Down
26 changes: 13 additions & 13 deletions impeller/scene/importer/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ flatbuffers("importer_flatbuffers") {
public_deps = [ "//third_party/flatbuffers" ]
}

impeller_component("importer_lib") {
impeller_component("scenec_lib") {
# Current versions of libcxx have deprecated some of the UTF-16 string
# conversion APIs.
defines = [ "_LIBCPP_DISABLE_DEPRECATION_WARNINGS" ]
Expand All @@ -37,34 +37,34 @@ impeller_component("importer_lib") {
"../../geometry",
"//flutter/fml",

# All third_party deps must be reflected below in the scene_importer_license
# All third_party deps must be reflected below in the scenec_license
# target.
# TODO(bdero): Fix tinygltf compilation warnings.
#"//third_party/tinygltf",
]
}

generated_file("scene_importer_license") {
generated_file("scenec_license") {
source_path = rebase_path(".", "//flutter")
git_url = "https://github.com/flutter/engine/tree/$engine_version"
outputs = [ "$target_gen_dir/LICENSE.scene_importer.md" ]
outputs = [ "$target_gen_dir/LICENSE.scenec.md" ]
contents = [
"# scene_importer",
"# scenec",
"",
"This tool is used by the Flutter SDK to import 3D geometry.",
"",
"Source code for this tool: [flutter/engine/$source_path]($git_url/$source_path).",
"",
"## Licenses",
"",
"### scene_importer",
"### scenec",
"",
read_file("//flutter/sky/packages/sky_engine/LICENSE", "string"),
"",

# These licenses are ignored by the main license checker, since they are not
# shipped to end-application binaries and only shipped as part of developer
# tooling in scene_importer. Add them here.
# tooling in scenec. Add them here.
"## Additional open source licenses",
"",
"### tinygltf",
Expand All @@ -75,19 +75,19 @@ generated_file("scene_importer_license") {

group("importer") {
deps = [
":scene_importer",
":scene_importer_license",
":scenec",
":scenec_license",
]
}

impeller_component("scene_importer") {
impeller_component("scenec") {
target_type = "executable"

sources = [ "importer_main.cc" ]
sources = [ "scenec_main.cc" ]

deps = [ ":importer_lib" ]
deps = [ ":scenec_lib" ]

metadata = {
entitlement_file_path = [ "scene_importer" ]
entitlement_file_path = [ "scenec" ]
}
}
File renamed without changes.
3 changes: 1 addition & 2 deletions impeller/scene/importer/switches.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ static const std::map<std::string, SourceType> kKnownSourceTypes = {

void Switches::PrintHelp(std::ostream& stream) {
stream << std::endl;
stream << "Scene Importer is an offline 3D geometry file parser."
<< std::endl;
stream << "SceneC is an offline 3D geometry file parser." << std::endl;
stream << "---------------------------------------------------------------"
<< std::endl;
stream << "Valid Argument are:" << std::endl;
Expand Down
27 changes: 13 additions & 14 deletions impeller/tools/impeller.gni
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ declare_args() {
# If it is non-empty, it should be the absolute path to impellerc.
impeller_use_prebuilt_impellerc = ""

# Whether to use a prebuilt scene_importer.
# If this is the empty string, scene_importer will be built.
# If it is non-empty, it should be the absolute path to scene_importer.
impeller_use_prebuilt_scene_importer = ""
# 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.
Expand Down Expand Up @@ -622,32 +622,31 @@ template("impeller_shaders") {
}
}

# Dispatches to the build or prebuilt scene_importer depending on the value of
# the impeller_use_prebuilt_scene_importer argument. Forwards all variables to
# 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.
template("_scene_importer") {
if (impeller_use_prebuilt_scene_importer == "") {
template("_scenec") {
if (impeller_use_prebuilt_scenec == "") {
compiled_action_foreach(target_name) {
forward_variables_from(invoker, "*")
tool = "//flutter/impeller/scene/importer:scene_importer"
tool = "//flutter/impeller/scene/importer:scenec"
}
} else {
action_foreach(target_name) {
forward_variables_from(invoker, "*", [ "args" ])
script = "//build/gn_run_binary.py"
scene_importer_path =
rebase_path(impeller_use_prebuilt_scene_importer, root_build_dir)
args = [ scene_importer_path ] + invoker.args
scenec_path = rebase_path(impeller_use_prebuilt_scenec, root_build_dir)
args = [ scenec_path ] + invoker.args
}
}
}

template("scene_importer") {
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..).")

_scene_importer(target_name) {
_scenec(target_name) {
sources = invoker.geometry
generated_dir = "$target_gen_dir"

Expand Down

0 comments on commit f9067ed

Please sign in to comment.