Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit c38d947

Browse files
Merge remote-tracking branch 'upstream/master' into ios-text-input-arc2
2 parents 9d99dfd + 9e37c98 commit c38d947

35 files changed

+396
-326
lines changed

DEPS

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ vars = {
1818
'llvm_git': 'https://llvm.googlesource.com',
1919
# OCMock is for testing only so there is no google clone
2020
'ocmock_git': 'https://github.com/erikdoe/ocmock.git',
21-
'skia_revision': '1b194c67700e9e3083e6d45bde1f558228ecff14',
21+
'skia_revision': '7bd37737e35df1cfe1a95a6d908e79348deb1504',
2222

2323
# WARNING: DO NOT EDIT canvaskit_cipd_instance MANUALLY
2424
# See `lib/web_ui/README.md` for how to roll CanvasKit to a new version.
@@ -48,22 +48,22 @@ vars = {
4848
# Dart is: https://github.com/dart-lang/sdk/blob/main/DEPS
4949
# You can use //tools/dart/create_updated_flutter_deps.py to produce
5050
# updated revision list of existing dependencies.
51-
'dart_revision': '0940b5e6ccd5d6a50b6425cf4f1449df56fd4095',
51+
'dart_revision': '21f2997a8fc68a791f9bae48ef3f429fd483cc54',
5252

5353
# WARNING: DO NOT EDIT MANUALLY
5454
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py
55-
'dart_binaryen_rev': 'ec53f4b2d5b0d52ae703c5b696ecf052ad5fffbb',
55+
'dart_binaryen_rev': '7769139efbe818c7ba36d1a382db5114ebee9df8',
5656
'dart_boringssl_gen_rev': 'ced85ef0a00bbca77ce5a91261a5f2ae61b1e62f',
5757
'dart_boringssl_rev': '87f316d7748268eb56f2dc147bd593254ae93198',
5858
'dart_browser_launcher_rev': '5fa0bd6cddc33785f43c920576fc03dcee1c3caa',
5959
'dart_clock_rev': '8a8231fa7912d84c7e99236b7800cfbef5ea7ae5',
6060
'dart_collection_rev': 'caf6802bbea65a1a2f9c455add31449dc15b92ba',
6161
'dart_devtools_rev': 'dd3fade2bd2ef74fc6102e56333a48f0efc594d3',
62-
'dart_protobuf_rev': '4f3e32808a954060e48fea1178e943bfa989fcd5',
62+
'dart_protobuf_rev': '2706b53d2175b5e1081603059ef1b7b30956f6b8',
6363
'dart_pub_rev': '21aa23f148a428ae4dd97a27ecc70b08c1328089',
6464
'dart_root_certificates_rev': '692f6d6488af68e0121317a9c2c9eb393eb0ee50',
6565
'dart_watcher_rev': '32591071a83f632478e702f67e29de6e54428ce9',
66-
'dart_webdev_rev': 'e39506eec48f1d83f8b7fa6de4405e7bb9137418',
66+
'dart_webdev_rev': '3e2364ee3539ae08f350d03a3a5f3c22aa74d994',
6767
'dart_webkit_inspection_protocol_rev': 'ddb624cd85954dd384056cc253a8fc2b9da5364d',
6868
'dart_yaml_edit_rev': '299f74594ff9fda412c1da5c0b5d5231d0c6fc42',
6969
'dart_zlib_rev': '27c2f474b71d0d20764f86f60ef8b00da1a16cda',
@@ -298,7 +298,7 @@ deps = {
298298
# WARNING: Unused Dart dependencies in the list below till "WARNING:" marker are removed automatically - see create_updated_flutter_deps.py.
299299

300300
'src/third_party/dart/third_party/binaryen/src':
301-
Var('chromium_git') + '/external/github.com/WebAssembly/binaryen.git@ec53f4b2d5b0d52ae703c5b696ecf052ad5fffbb',
301+
Var('chromium_git') + '/external/github.com/WebAssembly/binaryen.git@7769139efbe818c7ba36d1a382db5114ebee9df8',
302302

303303
'src/third_party/dart/third_party/devtools':
304304
{'packages': [{'version': 'git_revision:dd3fade2bd2ef74fc6102e56333a48f0efc594d3', 'package': 'dart/third_party/flutter/devtools'}], 'dep_type': 'cipd'},
@@ -340,7 +340,7 @@ deps = {
340340
Var('dart_git') + '/dart_style.git@bc86574772350fa7d4cd4fa334b6652f08f750ba',
341341

342342
'src/third_party/dart/third_party/pkg/dartdoc':
343-
Var('dart_git') + '/dartdoc.git@4d7dc93bdcca4f8c5c3760122930f17aac8a7db6',
343+
Var('dart_git') + '/dartdoc.git@f2bb6e92aa4fa76a409f301773d5be6bfda897dc',
344344

345345
'src/third_party/dart/third_party/pkg/ffi':
346346
Var('dart_git') + '/ffi.git@17a8142da8114a065e03200467c7657b5368a86d',
@@ -349,7 +349,7 @@ deps = {
349349
Var('dart_git') + '/external/github.com/google/file.dart@b768f79dcd104a5feabafab47101c4355b71cd8f',
350350

351351
'src/third_party/dart/third_party/pkg/fixnum':
352-
Var('dart_git') + '/fixnum.git@62916f2de9074a2832de6211df8d72c912902e97',
352+
Var('dart_git') + '/fixnum.git@e4f5e9773de053adcb03bff9f02fa6f9c596fe4c',
353353

354354
'src/third_party/dart/third_party/pkg/glob':
355355
Var('dart_git') + '/glob.git@7f97bf5be6bfe8c90a92283e4c590dba2a676083',
@@ -376,13 +376,13 @@ deps = {
376376
Var('dart_git') + '/linter.git@7fe671cdadb52139295bae0abf62c014369af93a',
377377

378378
'src/third_party/dart/third_party/pkg/logging':
379-
Var('dart_git') + '/logging.git@f322480fb9d9e83e677c08db6d09067059f7ff74',
379+
Var('dart_git') + '/logging.git@0373ef85aa1dfe9e179b9fa006c45b65903787f2',
380380

381381
'src/third_party/dart/third_party/pkg/markdown':
382382
Var('dart_git') + '/markdown.git@ee3f4e976efcfed87c6ec78364bc2dd3c6e717b9',
383383

384384
'src/third_party/dart/third_party/pkg/matcher':
385-
Var('dart_git') + '/matcher.git@15d4af21002ae9adee952110192a3face96307c7',
385+
Var('dart_git') + '/matcher.git@7e6a665da079baa3e2a2046ab02e4353ee32556c',
386386

387387
'src/third_party/dart/third_party/pkg/mime':
388388
Var('dart_git') + '/mime.git@c0c4c47a3d7bf696f1aa1959fb83d598baadb33c',
@@ -409,7 +409,7 @@ deps = {
409409
Var('dart_git') + '/pub_semver.git@17231113f98c80285881cc4452863bcfd085d1a8',
410410

411411
'src/third_party/dart/third_party/pkg/shelf':
412-
Var('dart_git') + '/shelf.git@1c2104737973715426035c11ba840c7f23d8f186',
412+
Var('dart_git') + '/shelf.git@32e342d2498db739d2d79123cecd8f2e8d598c3b',
413413

414414
'src/third_party/dart/third_party/pkg/source_map_stack_trace':
415415
Var('dart_git') + '/source_map_stack_trace.git@8d8078fcc81c8f7936805cd277198493e0b7fc62',
@@ -436,7 +436,7 @@ deps = {
436436
Var('dart_git') + '/term_glyph.git@822cd5b3418615c6db715a796c2c9ba9acb63b0d',
437437

438438
'src/third_party/dart/third_party/pkg/test':
439-
Var('dart_git') + '/test.git@4dceb87cd7bb5995e43639a3e93c8fcbe303e228',
439+
Var('dart_git') + '/test.git@73cd75404cea342cce06361d4e2fc1069f69122b',
440440

441441
'src/third_party/dart/third_party/pkg/test_reflective_loader':
442442
Var('dart_git') + '/test_reflective_loader.git@52b6753852661787208e003f9716b079026c7ac7',
@@ -826,7 +826,7 @@ deps = {
826826
'packages': [
827827
{
828828
'package': 'fuchsia/sdk/core/linux-amd64',
829-
'version': 'rRJIjuO-dPNCpCTd9fnOc5ISL21HS5JbpRnk-HNpdsQC'
829+
'version': '8O5rMR_ehMaL3YhZ56B1Q-pS15TRm3MJOichyVr5L7MC'
830830
}
831831
],
832832
'condition': 'host_os == "linux" and not download_fuchsia_sdk',

ci/licenses_golden/licenses_flutter

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,19 +1662,19 @@ FILE: ../../../flutter/impeller/scene/importer/vertices_builder.cc
16621662
FILE: ../../../flutter/impeller/scene/importer/vertices_builder.h
16631663
FILE: ../../../flutter/impeller/scene/material.cc
16641664
FILE: ../../../flutter/impeller/scene/material.h
1665+
FILE: ../../../flutter/impeller/scene/mesh.cc
1666+
FILE: ../../../flutter/impeller/scene/mesh.h
1667+
FILE: ../../../flutter/impeller/scene/node.cc
1668+
FILE: ../../../flutter/impeller/scene/node.h
16651669
FILE: ../../../flutter/impeller/scene/scene.cc
16661670
FILE: ../../../flutter/impeller/scene/scene.h
16671671
FILE: ../../../flutter/impeller/scene/scene_context.cc
16681672
FILE: ../../../flutter/impeller/scene/scene_context.h
16691673
FILE: ../../../flutter/impeller/scene/scene_encoder.cc
16701674
FILE: ../../../flutter/impeller/scene/scene_encoder.h
1671-
FILE: ../../../flutter/impeller/scene/scene_entity.cc
1672-
FILE: ../../../flutter/impeller/scene/scene_entity.h
16731675
FILE: ../../../flutter/impeller/scene/scene_unittests.cc
16741676
FILE: ../../../flutter/impeller/scene/shaders/geometry.vert
16751677
FILE: ../../../flutter/impeller/scene/shaders/unlit.frag
1676-
FILE: ../../../flutter/impeller/scene/static_mesh_entity.cc
1677-
FILE: ../../../flutter/impeller/scene/static_mesh_entity.h
16781678
FILE: ../../../flutter/impeller/tessellator/c/tessellator.cc
16791679
FILE: ../../../flutter/impeller/tessellator/c/tessellator.h
16801680
FILE: ../../../flutter/impeller/tessellator/dart/lib/tessellator.dart

ci/licenses_golden/licenses_fuchsia

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Signature: 6d236eac71842efcfd0e0ebd5345abaa
1+
Signature: 51bd5d6a89ef1e691f6d7e38c5867036
22

33
UNUSED LICENSES:
44

ci/licenses_golden/licenses_skia

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Signature: 4f2a325d6153a64a89594520fa0afd23
1+
Signature: bdf58cf8eb6e1b77bc9810baa4bc2c37
22

33
UNUSED LICENSES:
44

ci/licenses_golden/licenses_third_party

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Signature: 849b54362fec2170c5801c1c838b3af4
1+
Signature: bbed4848080f583e902b9c35c163678b
22

33
UNUSED LICENSES:
44

@@ -14311,6 +14311,7 @@ FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_patch.dart
1431114311
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/js_util_patch.dart
1431214312
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/list.dart
1431314313
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/math_patch.dart
14314+
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/named_parameters.dart
1431414315
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/object_patch.dart
1431514316
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/print_patch.dart
1431614317
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/regexp_helper.dart

ci/licenses_golden/tool_signature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Signature: f6d8146c82d268e2e2549bf5019ebf07
1+
Signature: 9d0f7a4c4f53b80e33da848062bef937
22

impeller/compiler/compiler.cc

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ static CompilerBackend CreateMSLCompiler(const spirv_cross::ParsedIR& ir,
4242
// shaders in the flutter/engine tree.
4343
if (source_options.remap_samplers) {
4444
std::vector<uint32_t> sampler_offsets;
45-
std::vector<uint32_t> float_offsets;
4645
ir.for_each_typed_id<spirv_cross::SPIRVariable>(
4746
[&](uint32_t, const spirv_cross::SPIRVariable& var) {
4847
if (var.storage != spv::StorageClassUniformConstant) {
@@ -54,9 +53,6 @@ static CompilerBackend CreateMSLCompiler(const spirv_cross::ParsedIR& ir,
5453
if (spir_type.basetype ==
5554
spirv_cross::SPIRType::BaseType::SampledImage) {
5655
sampler_offsets.push_back(location);
57-
} else if (spir_type.basetype ==
58-
spirv_cross::SPIRType::BaseType::Float) {
59-
float_offsets.push_back(location);
6056
}
6157
});
6258
if (sampler_offsets.size() > 0) {
@@ -68,20 +64,11 @@ static CompilerBackend CreateMSLCompiler(const spirv_cross::ParsedIR& ir,
6864
.basetype = spirv_cross::SPIRType::BaseType::SampledImage,
6965
.binding = offset,
7066
.count = 1u,
67+
// A sampled image is both an image and a sampler, so both
68+
// offsets need to be set or depending on the partiular shader
69+
// the bindings may be incorrect.
7170
.msl_texture = offset - start_offset,
72-
});
73-
}
74-
}
75-
if (float_offsets.size() > 0) {
76-
auto start_offset =
77-
*std::min_element(float_offsets.begin(), float_offsets.end());
78-
for (auto offset : float_offsets) {
79-
sl_compiler->add_msl_resource_binding({
80-
.stage = spv::ExecutionModel::ExecutionModelFragment,
81-
.basetype = spirv_cross::SPIRType::BaseType::Float,
82-
.binding = offset,
83-
.count = 1u,
84-
.msl_buffer = offset - start_offset,
71+
.msl_sampler = offset - start_offset,
8572
});
8673
}
8774
}

impeller/compiler/switches_unittests.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,17 @@ TEST(SwitchesTest, EntryPointCanBeSetForHLSL) {
6969
ASSERT_EQ(switches.entry_point, "CustomEntryPoint");
7070
}
7171

72+
TEST(SwitchesTEst, ConvertToEntrypointName) {
73+
ASSERT_EQ(ConvertToEntrypointName("mandelbrot_unrolled"),
74+
"mandelbrot_unrolled");
75+
ASSERT_EQ(ConvertToEntrypointName("mandelbrot-unrolled"),
76+
"mandelbrotunrolled");
77+
ASSERT_EQ(ConvertToEntrypointName("7_"), "i_7_");
78+
ASSERT_EQ(ConvertToEntrypointName("415"), "i_415");
79+
ASSERT_EQ(ConvertToEntrypointName("#$%"), "i_");
80+
ASSERT_EQ(ConvertToEntrypointName(""), "");
81+
}
82+
7283
} // namespace testing
7384
} // namespace compiler
7485
} // namespace impeller

impeller/compiler/types.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ std::string EntryPointFunctionNameFromSourceName(
9696

9797
std::stringstream stream;
9898
std::filesystem::path file_path(file_name);
99-
stream << Utf8FromPath(file_path.stem()) << "_";
99+
stream << ConvertToEntrypointName(Utf8FromPath(file_path.stem())) << "_";
100100
switch (type) {
101101
case SourceType::kUnknown:
102102
stream << "unknown";

impeller/compiler/utilities.cc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,23 @@ std::string ConvertToCamelCase(std::string_view string) {
4343
return stream.str();
4444
}
4545

46+
std::string ConvertToEntrypointName(std::string_view string) {
47+
if (string.empty()) {
48+
return "";
49+
}
50+
std::stringstream stream;
51+
// Append a prefix if the first character is not a letter.
52+
if (!std::isalpha(string.data()[0])) {
53+
stream << "i_";
54+
}
55+
for (size_t i = 0, count = string.length(); i < count; i++) {
56+
auto ch = string.data()[i];
57+
if (std::isalnum(ch) || ch == '_') {
58+
stream << ch;
59+
}
60+
}
61+
return stream.str();
62+
}
63+
4664
} // namespace compiler
4765
} // namespace impeller

impeller/compiler/utilities.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,9 @@ std::string InferShaderNameFromPath(std::string_view path);
2525

2626
std::string ConvertToCamelCase(std::string_view string);
2727

28+
/// @brief Ensure that the entrypoint name is a valid identifier in the target
29+
/// language.
30+
std::string ConvertToEntrypointName(std::string_view string);
31+
2832
} // namespace compiler
2933
} // namespace impeller

impeller/fixtures/ordering/shader_with_matrix.frag

Lines changed: 0 additions & 15 deletions
This file was deleted.

impeller/fixtures/ordering/shader_with_ordered_floats.frag

Lines changed: 0 additions & 15 deletions
This file was deleted.

impeller/scene/BUILD.gn

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ impeller_component("scene") {
1212
"geometry.h",
1313
"material.cc",
1414
"material.h",
15+
"mesh.cc",
16+
"mesh.h",
17+
"node.cc",
18+
"node.h",
1519
"scene.cc",
1620
"scene.h",
1721
"scene_context.cc",
1822
"scene_context.h",
1923
"scene_encoder.cc",
2024
"scene_encoder.h",
21-
"scene_entity.cc",
22-
"scene_entity.h",
23-
"static_mesh_entity.cc",
24-
"static_mesh_entity.h",
2525
]
2626

2727
public_deps = [

impeller/scene/README.md

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -43,54 +43,52 @@ run_action.SetLoop(impeller::scene::AnimationAction::kLoopForever);
4343
run_action.SetWeight(0.3f);
4444
run_action.Play();
4545

46-
scene.Add(
46+
scene.GetRoot().AddChild(
4747
impeller::scene::DirectionalLight(
4848
/* color */ impeller::Color::AntiqueWhite(),
4949
/* intensity */ 5,
5050
/* direction */ {2, 3, 4}));
5151

52-
impeller::scene::StaticMeshEntity sphere_entity;
53-
sphere_entity.SetGlobalTransform(
52+
Node sphere_node;
53+
Mesh sphere_mesh;
54+
sphere_node.SetGlobalTransform(
5455
Matrix::MakeRotationEuler({kPiOver4, kPiOver4, 0}));
55-
sphere_entity.SetCullingMode(impeller::scene::CullingMode::kFrustum);
5656

57-
std::unique_ptr<impeller::scene::SphereGeometry> sphere =
57+
auto sphere_geometry =
5858
impeller::scene::Geometry::MakeSphere(allocator, /* radius */ 2);
5959

60-
sphere_entity.SetGeometry(sphere);
61-
6260
auto material = impeller::scene::Material::MakeStandard();
63-
material.SetAlbedo(impeller::Color::Red());
64-
material.SetRoughness(0.4);
65-
material.SetMetallic(0.2);
61+
material->SetAlbedo(impeller::Color::Red());
62+
material->SetRoughness(0.4);
63+
material->SetMetallic(0.2);
6664
// Common properties shared by all materials.
67-
material.SetEnvironmentMap(environment_hdri);
68-
material.SetFlatShaded(true);
69-
material.SetBlendConfig({
65+
material->SetEnvironmentMap(environment_hdri);
66+
material->SetFlatShaded(true);
67+
material->SetBlendConfig({
7068
impeller::BlendOperation::kAdd, // color_op
7169
impeller::BlendFactor::kOne, // source_color_factor
7270
impeller::BlendFactor::kOneMinusSourceAlpha, // destination_color_factor
7371
impeller::BlendOperation::kAdd, // alpha_op
7472
impeller::BlendFactor::kOne, // source_alpha_factor
7573
impeller::BlendFactor::kOneMinusSourceAlpha, // destination_alpha_factor
7674
});
77-
material.SetStencilConfig({
75+
material->SetStencilConfig({
7876
impeller::StencilOperation::kIncrementClamp, // operation
7977
impeller::CompareFunction::kAlways, // compare
8078
});
81-
82-
sphere_entity->SetMaterials({material});
83-
84-
85-
impeller::scene::StaticMeshEntity cube_entity;
86-
cube_entity.GetGeometry(
87-
impeller::scene::Geometry::MakeCube(allocator, {4, 4, 4}));
88-
cube_entity.SetMaterials({material});
89-
90-
cube_entity.SetLocalTransform(Matrix::MakeTranslation({4, 0, 0}));
91-
92-
sphere_entity->Add(sube_entity);
93-
scene.Add(sphere_entity);
79+
sphere_mesh.AddPrimitive({sphere_geometry, material});
80+
sphere_node.SetMesh(sphere_mesh);
81+
82+
Node cube_node;
83+
cube_node.SetLocalTransform(Matrix::MakeTranslation({4, 0, 0}));
84+
Mesh cube_mesh;
85+
auto cube_geometry = impeller::scene::Geometry::MakeCuboid(
86+
allocator, {4, 4, 4});
87+
cube_mesh.AddPrimitive({cube_geometry, material});
88+
cube_node.SetMesh(cube_mesh);
89+
90+
sphere_node.AddChild(cube_node);
91+
scene.GetRoot().AddChild(sphere_node);
9492

9593
/// Post processing.
9694

0 commit comments

Comments
 (0)