Skip to content

Commit fcce8d2

Browse files
skia-flutter-autorollbdero
authored andcommitted
Roll Dart SDK from 418bee5da2e2 to 8d7a6aabd3a3 (2 revisions) (flutter#38738)
https://dart.googlesource.com/sdk.git/+log/418bee5da2e2..8d7a6aabd3a3 2023-01-10 [email protected] Version 3.0.0-105.0.dev 2023-01-10 [email protected] Version 3.0.0-104.0.dev If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/dart-sdk-flutter-engine Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter Engine: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
1 parent 24ee5c1 commit fcce8d2

File tree

12 files changed

+178
-54
lines changed

12 files changed

+178
-54
lines changed

DEPS

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ 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': '418bee5da2e2505a13d992a35389d6406cf1bfec',
51+
'dart_revision': '8d7a6aabd3a381fe630c111746789ccb34b2c42a',
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
@@ -63,7 +63,7 @@ vars = {
6363
'dart_pub_rev': '0cbaf7a2fb8c8ca543c6f222bf25d5f5c63abbf3',
6464
'dart_root_certificates_rev': '692f6d6488af68e0121317a9c2c9eb393eb0ee50',
6565
'dart_watcher_rev': '2e0db7175016382c38e786356f6c36c6a2bd416a',
66-
'dart_webdev_rev': '8795ca5b89df0f912e31b0f5fa372b90f2a0bf66',
66+
'dart_webdev_rev': '49f97b8848c264e634affb045cf95ff4a34a7784',
6767
'dart_webkit_inspection_protocol_rev': 'ddb624cd85954dd384056cc253a8fc2b9da5364d',
6868
'dart_yaml_edit_rev': '299f74594ff9fda412c1da5c0b5d5231d0c6fc42',
6969
'dart_zlib_rev': '27c2f474b71d0d20764f86f60ef8b00da1a16cda',
@@ -340,7 +340,7 @@ deps = {
340340
Var('dart_git') + '/dart_style.git@d0c6b1da52c9f80679a7aaa05e5935ef5c6bb52f',
341341

342342
'src/third_party/dart/third_party/pkg/dartdoc':
343-
Var('dart_git') + '/dartdoc.git@9ed196f1cec6c764c22acaa6599de5c30e361d4a',
343+
Var('dart_git') + '/dartdoc.git@29a1bbf8576f39c6f7c7dcf71f131a59bb346625',
344344

345345
'src/third_party/dart/third_party/pkg/ffi':
346346
Var('dart_git') + '/ffi.git@2a56c2a9a87122c057168874bde384debbb806b0',
@@ -373,7 +373,7 @@ deps = {
373373
Var('dart_git') + '/json_rpc_2.git@bd9f8d90ec9ce9d0da5c11f3e71b87af3aaca3b4',
374374

375375
'src/third_party/dart/third_party/pkg/linter':
376-
Var('dart_git') + '/linter.git@79b843349deaea4a2455cfa37cc47cbc0e472190',
376+
Var('dart_git') + '/linter.git@8f7b75f8a3501ca2c4d5bbc1f003d90d66447544',
377377

378378
'src/third_party/dart/third_party/pkg/logging':
379379
Var('dart_git') + '/logging.git@b525d5c39c8ae6f0826c63a371d286080e2ec93e',
@@ -430,7 +430,7 @@ deps = {
430430
Var('dart_git') + '/stream_channel.git@0a7800ae41be5f7ba9990388fecc30a700186a48',
431431

432432
'src/third_party/dart/third_party/pkg/string_scanner':
433-
Var('dart_git') + '/string_scanner.git@6ddab2c6a3374c9b0fe5ba08ff9badce944a797e',
433+
Var('dart_git') + '/string_scanner.git@c58618df0f17cbed664b3868c949abb13491e4d3',
434434

435435
'src/third_party/dart/third_party/pkg/term_glyph':
436436
Var('dart_git') + '/term_glyph.git@2bf45943466a5bb2d8d1add714fbfeebe5cabab5',

ci/licenses_golden/licenses_third_party

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Signature: e597cfe931e7b4964f4d51218347aff0
1+
Signature: e0d2a30edffb57a66287705548386e33
22

33
====================================================================================================
44
LIBRARY: angle
@@ -40027,6 +40027,7 @@ ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/class_id.dart + ../
4002740027
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/convert_patch.dart + ../../../third_party/dart/LICENSE
4002840028
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/core_patch.dart + ../../../third_party/dart/LICENSE
4002940029
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/date_patch.dart + ../../../third_party/dart/LICENSE
40030+
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/deferred.dart + ../../../third_party/dart/LICENSE
4003040031
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/developer.dart + ../../../third_party/dart/LICENSE
4003140032
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/double.dart + ../../../third_party/dart/LICENSE
4003240033
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/errors_patch.dart + ../../../third_party/dart/LICENSE
@@ -40113,6 +40114,7 @@ FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/class_id.dart
4011340114
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/convert_patch.dart
4011440115
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/core_patch.dart
4011540116
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/date_patch.dart
40117+
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/deferred.dart
4011640118
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/developer.dart
4011740119
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/double.dart
4011840120
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/errors_patch.dart

impeller/scene/animation/animation_player.cc

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,15 @@ AnimationPlayer::~AnimationPlayer() = default;
1919
AnimationPlayer::AnimationPlayer(AnimationPlayer&&) = default;
2020
AnimationPlayer& AnimationPlayer::operator=(AnimationPlayer&&) = default;
2121

22-
AnimationClip& AnimationPlayer::AddAnimation(
23-
std::shared_ptr<Animation> animation,
22+
AnimationClip* AnimationPlayer::AddAnimation(
23+
const std::shared_ptr<Animation>& animation,
2424
Node* bind_target) {
25-
AnimationClip clip(std::move(animation), bind_target);
25+
if (!animation) {
26+
VALIDATION_LOG << "Cannot add null animation.";
27+
return nullptr;
28+
}
29+
30+
AnimationClip clip(animation, bind_target);
2631

2732
// Record all of the unique default transforms that this AnimationClip
2833
// will mutate.
@@ -31,8 +36,18 @@ AnimationClip& AnimationPlayer::AddAnimation(
3136
{binding.node, binding.node->GetLocalTransform()});
3237
}
3338

34-
clips_.push_back(std::move(clip));
35-
return clips_.back();
39+
clips_.insert({animation->GetName(), std::move(clip)});
40+
auto found = clips_.find(animation->GetName());
41+
FML_DCHECK(found != clips_.end());
42+
return &found->second;
43+
}
44+
45+
AnimationClip* AnimationPlayer::GetClip(const std::string& name) {
46+
auto result = clips_.find(name);
47+
if (result == clips_.end()) {
48+
return nullptr;
49+
}
50+
return &result->second;
3651
}
3752

3853
void AnimationPlayer::Update() {
@@ -46,7 +61,7 @@ void AnimationPlayer::Update() {
4661
Reset();
4762

4863
// Update and apply all clips.
49-
for (auto& clip : clips_) {
64+
for (auto& [_, clip] : clips_) {
5065
clip.Advance(delta_time);
5166
clip.ApplyToBindings();
5267
}

impeller/scene/animation/animation_player.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
#pragma once
66

7+
#include <map>
78
#include <memory>
89
#include <optional>
9-
#include <unordered_map>
1010
#include <vector>
1111

1212
#include "flutter/fml/hash_combine.h"
@@ -29,9 +29,11 @@ class AnimationPlayer final {
2929
AnimationPlayer(AnimationPlayer&&);
3030
AnimationPlayer& operator=(AnimationPlayer&&);
3131

32-
AnimationClip& AddAnimation(std::shared_ptr<Animation> animation,
32+
AnimationClip* AddAnimation(const std::shared_ptr<Animation>& animation,
3333
Node* bind_target);
3434

35+
AnimationClip* GetClip(const std::string& name);
36+
3537
/// @brief Advanced all clips and updates animated properties in the scene.
3638
void Update();
3739

@@ -41,7 +43,7 @@ class AnimationPlayer final {
4143
private:
4244
std::unordered_map<Node*, Matrix> default_target_transforms_;
4345

44-
std::vector<AnimationClip> clips_;
46+
std::map<std::string, AnimationClip> clips_;
4547

4648
std::optional<TimePoint> previous_time_;
4749

impeller/scene/geometry.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ std::shared_ptr<Geometry> Geometry::MakeFromFlatbuffer(
9595
}
9696

9797
DeviceBufferDescriptor buffer_desc;
98-
buffer_desc.size = vertices_bytes * indices_bytes;
98+
buffer_desc.size = vertices_bytes + indices_bytes;
9999
buffer_desc.storage_mode = StorageMode::kHostVisible;
100100

101101
auto buffer = allocator.CreateBuffer(buffer_desc);

impeller/scene/node.cc

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <inttypes.h>
88
#include <atomic>
99
#include <memory>
10+
#include <vector>
1011

1112
#include "flutter/fml/logging.h"
1213
#include "impeller/base/strings.h"
@@ -24,6 +25,24 @@ namespace scene {
2425

2526
static std::atomic_uint64_t kNextNodeID = 0;
2627

28+
void Node::MutationLog::Append(const Entry& entry) {
29+
std::lock_guard<std::mutex> lock(write_mutex_);
30+
dirty_ = true;
31+
entries_.push_back(entry);
32+
}
33+
34+
std::optional<std::vector<Node::MutationLog::Entry>>
35+
Node::MutationLog::Flush() {
36+
if (!dirty_) {
37+
return std::nullopt;
38+
}
39+
std::lock_guard<std::mutex> lock(write_mutex_);
40+
dirty_ = false;
41+
auto result = entries_;
42+
entries_ = {};
43+
return result;
44+
}
45+
2746
std::shared_ptr<Node> Node::MakeFromFlatbuffer(
2847
const fml::Mapping& ipscene_mapping,
2948
Allocator& allocator) {
@@ -257,7 +276,7 @@ std::shared_ptr<Animation> Node::FindAnimationByName(
257276
return nullptr;
258277
}
259278

260-
AnimationClip& Node::AddAnimation(const std::shared_ptr<Animation>& animation) {
279+
AnimationClip* Node::AddAnimation(const std::shared_ptr<Animation>& animation) {
261280
if (!animation_player_.has_value()) {
262281
animation_player_ = AnimationPlayer();
263282
}
@@ -287,6 +306,11 @@ Matrix Node::GetGlobalTransform() const {
287306
}
288307

289308
bool Node::AddChild(std::shared_ptr<Node> node) {
309+
if (!node) {
310+
VALIDATION_LOG << "Cannot add null child to node.";
311+
return false;
312+
}
313+
290314
// TODO(bdero): Figure out a better paradigm/rules for nodes with multiple
291315
// parents. We should probably disallow this, make deep
292316
// copying of nodes cheap and easy, add mesh instancing, etc.
@@ -328,7 +352,32 @@ bool Node::IsJoint() const {
328352

329353
bool Node::Render(SceneEncoder& encoder,
330354
Allocator& allocator,
331-
const Matrix& parent_transform) const {
355+
const Matrix& parent_transform) {
356+
std::optional<std::vector<MutationLog::Entry>> log = mutation_log_.Flush();
357+
if (log.has_value()) {
358+
for (const auto& entry : log.value()) {
359+
if (auto e = std::get_if<MutationLog::SetTransformEntry>(&entry)) {
360+
local_transform_ = e->transform;
361+
} else if (auto e =
362+
std::get_if<MutationLog::SetAnimationStateEntry>(&entry)) {
363+
auto* clip = animation_player_->GetClip(e->animation_name);
364+
if (!clip) {
365+
continue;
366+
}
367+
clip->SetPlaying(e->playing);
368+
clip->SetWeight(e->weight);
369+
clip->SetPlaybackTimeScale(e->time_scale);
370+
} else if (auto e =
371+
std::get_if<MutationLog::SeekAnimationEntry>(&entry)) {
372+
auto* clip = animation_player_->GetClip(e->animation_name);
373+
if (!clip) {
374+
continue;
375+
}
376+
clip->Seek(SecondsF(e->time));
377+
}
378+
}
379+
}
380+
332381
if (animation_player_.has_value()) {
333382
animation_player_->Update();
334383
}
@@ -345,5 +394,9 @@ bool Node::Render(SceneEncoder& encoder,
345394
return true;
346395
}
347396

397+
void Node::AddMutation(const MutationLog::Entry& entry) {
398+
mutation_log_.Append(entry);
399+
}
400+
348401
} // namespace scene
349402
} // namespace impeller

impeller/scene/node.h

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#pragma once
66

77
#include <memory>
8+
#include <mutex>
89
#include <optional>
910
#include <vector>
1011

@@ -25,6 +26,39 @@ namespace scene {
2526

2627
class Node final {
2728
public:
29+
class MutationLog {
30+
public:
31+
struct SetTransformEntry {
32+
Matrix transform;
33+
};
34+
35+
struct SetAnimationStateEntry {
36+
std::string animation_name;
37+
bool playing;
38+
float weight;
39+
float time_scale;
40+
};
41+
42+
struct SeekAnimationEntry {
43+
std::string animation_name;
44+
float time;
45+
};
46+
47+
using Entry = std::
48+
variant<SetTransformEntry, SetAnimationStateEntry, SeekAnimationEntry>;
49+
50+
void Append(const Entry& entry);
51+
52+
private:
53+
std::optional<std::vector<Entry>> Flush();
54+
55+
bool dirty_ = false;
56+
std::vector<Entry> entries_;
57+
std::mutex write_mutex_;
58+
59+
friend Node;
60+
};
61+
2862
static std::shared_ptr<Node> MakeFromFlatbuffer(
2963
const fml::Mapping& ipscene_mapping,
3064
Allocator& allocator);
@@ -44,7 +78,7 @@ class Node final {
4478
bool exclude_animation_players = false) const;
4579

4680
std::shared_ptr<Animation> FindAnimationByName(const std::string& name) const;
47-
AnimationClip& AddAnimation(const std::shared_ptr<Animation>& animation);
81+
AnimationClip* AddAnimation(const std::shared_ptr<Animation>& animation);
4882

4983
void SetLocalTransform(Matrix transform);
5084
Matrix GetLocalTransform() const;
@@ -63,7 +97,9 @@ class Node final {
6397

6498
bool Render(SceneEncoder& encoder,
6599
Allocator& allocator,
66-
const Matrix& parent_transform) const;
100+
const Matrix& parent_transform);
101+
102+
void AddMutation(const MutationLog::Entry& entry);
67103

68104
private:
69105
void UnpackFromFlatbuffer(
@@ -72,6 +108,8 @@ class Node final {
72108
const std::vector<std::shared_ptr<Texture>>& textures,
73109
Allocator& allocator);
74110

111+
mutable MutationLog mutation_log_;
112+
75113
Matrix local_transform_;
76114

77115
std::string name_;

impeller/scene/scene.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Node& Scene::GetRoot() {
3131
}
3232

3333
bool Scene::Render(const RenderTarget& render_target,
34-
const Matrix& camera_transform) const {
34+
const Matrix& camera_transform) {
3535
// Collect the render commands from the scene.
3636
SceneEncoder encoder;
3737
if (!root_.Render(encoder,
@@ -57,8 +57,7 @@ bool Scene::Render(const RenderTarget& render_target,
5757
return true;
5858
}
5959

60-
bool Scene::Render(const RenderTarget& render_target,
61-
const Camera& camera) const {
60+
bool Scene::Render(const RenderTarget& render_target, const Camera& camera) {
6261
return Render(render_target,
6362
camera.GetTransform(render_target.GetRenderTargetSize()));
6463
}

impeller/scene/scene.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ class Scene {
2828
Node& GetRoot();
2929

3030
bool Render(const RenderTarget& render_target,
31-
const Matrix& camera_transform) const;
31+
const Matrix& camera_transform);
3232

33-
bool Render(const RenderTarget& render_target, const Camera& camera) const;
33+
bool Render(const RenderTarget& render_target, const Camera& camera);
3434

3535
private:
3636
std::shared_ptr<SceneContext> scene_context_;

0 commit comments

Comments
 (0)