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

Commit b23ac23

Browse files
Merge branch 'main' into do_everything_plus_barrier
2 parents a071e9b + 924d5db commit b23ac23

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1003
-883
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ vars = {
6262
# Dart is: https://github.com/dart-lang/sdk/blob/main/DEPS
6363
# You can use //tools/dart/create_updated_flutter_deps.py to produce
6464
# updated revision list of existing dependencies.
65-
'dart_revision': 'c479735adcf91684b66e94747199e3c1b17516b9',
65+
'dart_revision': '2876f5684ceddf924aa0e2ab7d34a6baf4717496',
6666

6767
# WARNING: DO NOT EDIT MANUALLY
6868
# The lines between blank lines above and below are generated by a script. See create_updated_flutter_deps.py

ci/builders/mac_unopt.json

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,21 @@
142142
"$flutter/osx_sdk": {
143143
"sdk_version": "15a240d"
144144
}
145-
}
145+
},
146+
"tests": [
147+
{
148+
"language": "python3",
149+
"name": "Host Tests for host_debug_unopt_arm64",
150+
"script": "flutter/testing/run_tests.py",
151+
"parameters": [
152+
"--variant",
153+
"host_debug_unopt_arm64",
154+
"--type",
155+
"dart,dart-host,engine",
156+
"--engine-capture-core-dump"
157+
]
158+
}
159+
]
146160
},
147161
{
148162
"properties": {

ci/licenses_golden/licenses_dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Signature: aee8d76d23570c7efd9439c5f991502a
1+
Signature: 7fd3eb25284e36712433374678f727d7
22

33
====================================================================================================
44
LIBRARY: dart
@@ -3728,7 +3728,6 @@ ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/class_id.dart + ../
37283728
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/convert_patch.dart + ../../../third_party/dart/LICENSE
37293729
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/core_patch.dart + ../../../third_party/dart/LICENSE
37303730
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/deferred.dart + ../../../third_party/dart/LICENSE
3731-
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/developer.dart + ../../../third_party/dart/LICENSE
37323731
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/double_patch.dart + ../../../third_party/dart/LICENSE
37333732
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/errors_patch.dart + ../../../third_party/dart/LICENSE
37343733
ORIGIN: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/growable_list.dart + ../../../third_party/dart/LICENSE
@@ -3804,7 +3803,6 @@ FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/class_id.dart
38043803
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/convert_patch.dart
38053804
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/core_patch.dart
38063805
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/deferred.dart
3807-
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/developer.dart
38083806
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/double_patch.dart
38093807
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/errors_patch.dart
38103808
FILE: ../../../third_party/dart/sdk/lib/_internal/wasm/lib/growable_list.dart
@@ -4753,7 +4751,7 @@ Exhibit B - "Incompatible With Secondary Licenses" Notice
47534751
This Source Code Form is "Incompatible With Secondary Licenses", as
47544752
defined by the Mozilla Public License, v. 2.0.
47554753

4756-
You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/e5e4aaceaf23200d0cf92ebed1506f915f364b4d
4754+
You may obtain a copy of this library's Source Code Form from: https://dart.googlesource.com/sdk/+/2876f5684ceddf924aa0e2ab7d34a6baf4717496
47574755
/third_party/fallback_root_certificates/
47584756

47594757
====================================================================================================

flow/frame_timings.cc

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,6 @@
1313

1414
namespace flutter {
1515

16-
namespace {
17-
18-
const char* StateToString(FrameTimingsRecorder::State state) {
19-
#ifndef NDEBUG
20-
switch (state) {
21-
case FrameTimingsRecorder::State::kUninitialized:
22-
return "kUninitialized";
23-
case FrameTimingsRecorder::State::kVsync:
24-
return "kVsync";
25-
case FrameTimingsRecorder::State::kBuildStart:
26-
return "kBuildStart";
27-
case FrameTimingsRecorder::State::kBuildEnd:
28-
return "kBuildEnd";
29-
case FrameTimingsRecorder::State::kRasterStart:
30-
return "kRasterStart";
31-
case FrameTimingsRecorder::State::kRasterEnd:
32-
return "kRasterEnd";
33-
};
34-
FML_UNREACHABLE();
35-
#endif
36-
return "";
37-
}
38-
39-
} // namespace
40-
4116
std::atomic<uint64_t> FrameTimingsRecorder::frame_number_gen_ = {1};
4217

4318
FrameTimingsRecorder::FrameTimingsRecorder()
@@ -280,8 +255,7 @@ const char* FrameTimingsRecorder::GetFrameNumberTraceArg() const {
280255
}
281256

282257
void FrameTimingsRecorder::AssertInState(State state) const {
283-
FML_DCHECK(state_ == state) << "Expected state " << StateToString(state)
284-
<< ", actual state " << StateToString(state_);
258+
FML_DCHECK(state_ == state);
285259
}
286260

287261
} // namespace flutter

flow/frame_timings.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ class FrameTimingsRecorder {
3131
public:
3232
/// Various states that the recorder can be in. When created the recorder is
3333
/// in an unitialized state and transtions in sequential order of the states.
34-
// After adding an item to this enum, modify StateToString accordingly.
3534
enum class State : uint32_t {
3635
kUninitialized,
3736
kVsync,
@@ -122,8 +121,6 @@ class FrameTimingsRecorder {
122121
///
123122
/// Instead of adding a `GetState` method and asserting on the result, this
124123
/// method prevents other logic from relying on the state.
125-
///
126-
/// In release builds, this call is a no-op.
127124
void AssertInState(State state) const;
128125

129126
private:

impeller/base/base_unittests.cc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
// found in the LICENSE file.
44

55
#include "flutter/testing/testing.h"
6+
#include "impeller/base/promise.h"
67
#include "impeller/base/strings.h"
78
#include "impeller/base/thread.h"
89

@@ -233,5 +234,21 @@ TEST(ConditionVariableTest, TestsCriticalSectionAfterWait) {
233234
ASSERT_EQ(sum, kThreadCount);
234235
}
235236

237+
TEST(BaseTest, NoExceptionPromiseValue) {
238+
NoExceptionPromise<int> wrapper;
239+
std::future future = wrapper.get_future();
240+
wrapper.set_value(123);
241+
ASSERT_EQ(future.get(), 123);
242+
}
243+
244+
TEST(BaseTest, NoExceptionPromiseEmpty) {
245+
auto wrapper = std::make_shared<NoExceptionPromise<int>>();
246+
std::future future = wrapper->get_future();
247+
248+
// Destroy the empty promise with the future still pending. Verify that the
249+
// process does not abort while destructing the promise.
250+
wrapper.reset();
251+
}
252+
236253
} // namespace testing
237254
} // namespace impeller

impeller/base/promise.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,34 @@ std::future<T> RealizedFuture(T t) {
1717
return future;
1818
}
1919

20+
// Wraps a std::promise and completes the promise with a value during
21+
// destruction if the promise does not already have a value.
22+
//
23+
// By default the std::promise destructor will complete an empty promise with an
24+
// exception. This will fail because Flutter is built without exception support.
25+
template <typename T>
26+
class NoExceptionPromise {
27+
public:
28+
NoExceptionPromise() = default;
29+
30+
~NoExceptionPromise() {
31+
if (!value_set_) {
32+
promise_.set_value({});
33+
}
34+
}
35+
36+
std::future<T> get_future() { return promise_.get_future(); }
37+
38+
void set_value(const T& value) {
39+
promise_.set_value(value);
40+
value_set_ = true;
41+
}
42+
43+
private:
44+
std::promise<T> promise_;
45+
bool value_set_ = false;
46+
};
47+
2048
} // namespace impeller
2149

2250
#endif // FLUTTER_IMPELLER_BASE_PROMISE_H_

impeller/fixtures/box_fade.frag

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ uniform FrameInfo {
99
}
1010
frame_info;
1111

12-
in vec2 interporlated_texture_coordinates;
12+
in vec2 interpolated_texture_coordinates;
1313

1414
out vec4 frag_color;
1515

1616
uniform sampler2D contents1;
1717
uniform sampler2D contents2;
1818

1919
void main() {
20-
vec4 tex1 = texture(contents1, interporlated_texture_coordinates);
21-
vec4 tex2 = texture(contents2, interporlated_texture_coordinates);
20+
vec4 tex1 = texture(contents1, interpolated_texture_coordinates);
21+
vec4 tex2 = texture(contents2, interpolated_texture_coordinates);
2222
frag_color = mix(
2323
tex1, tex2,
2424
clamp(frame_info.cursor_position.x / frame_info.window_size.x, 0.0, 1.0));

impeller/fixtures/box_fade.vert

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ uniform_buffer;
1010
in vec3 vertex_position;
1111
in vec2 texture_coordinates;
1212

13-
out vec2 interporlated_texture_coordinates;
13+
out vec2 interpolated_texture_coordinates;
1414

1515
void main() {
1616
gl_Position = uniform_buffer.mvp * vec4(vertex_position, 1.0);
17-
interporlated_texture_coordinates = texture_coordinates;
17+
interpolated_texture_coordinates = texture_coordinates;
1818
}

impeller/fixtures/texture.frag

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
in vec2 interporlated_texture_coordinates;
5+
in vec2 interpolated_texture_coordinates;
66

77
out vec4 frag_color;
88

99
uniform sampler2D texture_contents;
1010

1111
void main() {
12-
frag_color = texture(texture_contents, interporlated_texture_coordinates);
12+
frag_color = texture(texture_contents, interpolated_texture_coordinates);
1313
}

impeller/renderer/backend/vulkan/pipeline_library_vk.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ PipelineFuture<PipelineDescriptor> PipelineLibraryVK::GetPipeline(
170170
}
171171

172172
auto promise = std::make_shared<
173-
std::promise<std::shared_ptr<Pipeline<PipelineDescriptor>>>>();
173+
NoExceptionPromise<std::shared_ptr<Pipeline<PipelineDescriptor>>>>();
174174
auto pipeline_future =
175175
PipelineFuture<PipelineDescriptor>{descriptor, promise->get_future()};
176176
pipelines_[descriptor] = pipeline_future;

impeller/renderer/backend/vulkan/render_pass_cache_unittests.cc

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,7 @@
1111
namespace impeller {
1212
namespace testing {
1313

14-
using RendererTest = PlaygroundTest;
15-
16-
TEST_P(RendererTest, CachesRenderPassAndFramebuffer) {
17-
if (GetBackend() != PlaygroundBackend::kVulkan) {
18-
GTEST_SKIP() << "Test only applies to Vulkan";
19-
}
20-
21-
auto allocator = std::make_shared<RenderTargetAllocator>(
22-
GetContext()->GetResourceAllocator());
23-
24-
auto render_target = RenderTarget::CreateOffscreenMSAA(
25-
*GetContext(), *allocator, {100, 100}, 1);
26-
auto resolve_texture =
27-
render_target.GetColorAttachments().find(0u)->second.resolve_texture;
28-
auto& texture_vk = TextureVK::Cast(*resolve_texture);
29-
30-
EXPECT_EQ(texture_vk.GetFramebuffer(), nullptr);
31-
EXPECT_EQ(texture_vk.GetRenderPass(), nullptr);
32-
33-
auto buffer = GetContext()->CreateCommandBuffer();
34-
auto render_pass = buffer->CreateRenderPass(render_target);
35-
36-
EXPECT_NE(texture_vk.GetFramebuffer(), nullptr);
37-
EXPECT_NE(texture_vk.GetRenderPass(), nullptr);
38-
39-
render_pass->EncodeCommands();
40-
GetContext()->GetCommandQueue()->Submit({buffer});
41-
42-
// Can be reused without error.
43-
auto buffer_2 = GetContext()->CreateCommandBuffer();
44-
auto render_pass_2 = buffer_2->CreateRenderPass(render_target);
45-
46-
EXPECT_TRUE(render_pass_2->EncodeCommands());
47-
EXPECT_TRUE(GetContext()->GetCommandQueue()->Submit({buffer_2}).ok());
48-
}
14+
//
4915

5016
} // namespace testing
5117
} // namespace impeller

impeller/renderer/backend/vulkan/render_pass_vk.cc

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -170,26 +170,16 @@ RenderPassVK::RenderPassVK(const std::shared_ptr<const Context>& context,
170170
return true;
171171
});
172172

173-
SharedHandleVK<vk::RenderPass> recycled_render_pass;
174-
SharedHandleVK<vk::Framebuffer> recycled_framebuffer;
175-
if (resolve_image_vk_) {
176-
recycled_render_pass = TextureVK::Cast(*resolve_image_vk_).GetRenderPass();
177-
recycled_framebuffer = TextureVK::Cast(*resolve_image_vk_).GetFramebuffer();
178-
}
179-
180173
const auto& target_size = render_target_.GetRenderTargetSize();
181174

182-
render_pass_ =
183-
CreateVKRenderPass(vk_context, recycled_render_pass, command_buffer_);
175+
render_pass_ = CreateVKRenderPass(vk_context, nullptr, command_buffer_);
184176
if (!render_pass_) {
185177
VALIDATION_LOG << "Could not create renderpass.";
186178
is_valid_ = false;
187179
return;
188180
}
189181

190-
auto framebuffer = (recycled_framebuffer == nullptr)
191-
? CreateVKFramebuffer(vk_context, *render_pass_)
192-
: recycled_framebuffer;
182+
auto framebuffer = CreateVKFramebuffer(vk_context, *render_pass_);
193183
if (!framebuffer) {
194184
VALIDATION_LOG << "Could not create framebuffer.";
195185
is_valid_ = false;
@@ -200,10 +190,6 @@ RenderPassVK::RenderPassVK(const std::shared_ptr<const Context>& context,
200190
is_valid_ = false;
201191
return;
202192
}
203-
if (resolve_image_vk_) {
204-
TextureVK::Cast(*resolve_image_vk_).SetFramebuffer(framebuffer);
205-
TextureVK::Cast(*resolve_image_vk_).SetRenderPass(render_pass_);
206-
}
207193

208194
auto clear_values = GetVKClearValues(render_target_);
209195

impeller/renderer/blit_pass_unittests.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ TEST_P(BlitPassTest, BlitAcrossDifferentPixelFormatsFails) {
2424
TextureDescriptor src_desc;
2525
src_desc.format = PixelFormat::kA8UNormInt;
2626
src_desc.size = {100, 100};
27+
src_desc.storage_mode = StorageMode::kHostVisible;
2728
auto src = context->GetResourceAllocator()->CreateTexture(src_desc);
2829

2930
TextureDescriptor dst_format;
3031
dst_format.format = PixelFormat::kR8G8B8A8UNormInt;
3132
dst_format.size = {100, 100};
33+
dst_format.storage_mode = StorageMode::kHostVisible;
3234
auto dst = context->GetResourceAllocator()->CreateTexture(dst_format);
3335

3436
EXPECT_FALSE(blit_pass->AddCopy(src, dst));

lib/ui/painting/image_dispose_unittests.cc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#define FML_USED_ON_EMBEDDER
66

77
#include "flutter/common/task_runners.h"
8-
#include "flutter/fml/synchronization/count_down_latch.h"
98
#include "flutter/fml/synchronization/waitable_event.h"
109
#include "flutter/lib/ui/painting/canvas.h"
1110
#include "flutter/lib/ui/painting/image.h"
@@ -58,10 +57,6 @@ TEST_F(ImageDisposeTest, ImageReleasedAfterFrameAndDisposePictureAndLayer) {
5857
};
5958

6059
Settings settings = CreateSettingsForFixture();
61-
fml::CountDownLatch frame_latch{2};
62-
settings.frame_rasterized_callback = [&frame_latch](const FrameTiming& t) {
63-
frame_latch.CountDown();
64-
};
6560
auto task_runner = CreateNewThread();
6661
TaskRunners task_runners("test", // label
6762
GetCurrentTaskRunner(), // platform
@@ -88,15 +83,12 @@ TEST_F(ImageDisposeTest, ImageReleasedAfterFrameAndDisposePictureAndLayer) {
8883
shell->RunEngine(std::move(configuration), [&](auto result) {
8984
ASSERT_EQ(result, Engine::RunStatus::Success);
9085
});
86+
9187
message_latch_.Wait();
9288

9389
ASSERT_TRUE(current_display_list_);
9490
ASSERT_TRUE(current_image_);
9591

96-
// Wait for 2 frames to be rasterized. The 2nd frame releases resources of the
97-
// 1st frame.
98-
frame_latch.Wait();
99-
10092
// Force a drain the SkiaUnrefQueue. The engine does this normally as frames
10193
// pump, but we force it here to make the test more deterministic.
10294
message_latch_.Reset();

lib/ui/window/platform_configuration.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,9 +453,12 @@ void PlatformConfigurationNativeApi::Render(int64_t view_id,
453453
Scene* scene,
454454
double width,
455455
double height) {
456+
// TODO(dkwingsmt): Currently only supports a single window.
457+
// See https://github.com/flutter/flutter/issues/135530, item 2.
458+
FML_DCHECK(view_id == kFlutterImplicitViewId);
456459
UIDartState::ThrowIfUIOperationsProhibited();
457460
UIDartState::Current()->platform_configuration()->client()->Render(
458-
view_id, scene, width, height);
461+
scene, width, height);
459462
}
460463

461464
void PlatformConfigurationNativeApi::SetNeedsReportTimings(bool value) {

0 commit comments

Comments
 (0)