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

Commit e7c0448

Browse files
committed
Merge remote-tracking branch 'upstream/main' into vulkan-orientation-polling
2 parents d23b8b6 + 3603028 commit e7c0448

File tree

17 files changed

+86
-37
lines changed

17 files changed

+86
-37
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
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': '9fa8ebdfdbb8fa2b122f452be7eef113e378f931',
21+
'skia_revision': '1fbe521b2c56cca97a69b659c09d9954dd1baaf8',
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.

ci/licenses_golden/excluded_files

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2617,6 +2617,7 @@
26172617
../../../third_party/skia/fuzz/README.md
26182618
../../../third_party/skia/gm/BUILD.bazel
26192619
../../../third_party/skia/gm/android_gm_test.bzl
2620+
../../../third_party/skia/gm/png_codec.bzl
26202621
../../../third_party/skia/gm/surface_manager/BUILD.bazel
26212622
../../../third_party/skia/gm/vias/BUILD.bazel
26222623
../../../third_party/skia/gn/BUILD.bazel

ci/licenses_golden/licenses_skia

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

33
====================================================================================================
44
LIBRARY: etc1
@@ -8868,6 +8868,7 @@ ORIGIN: ../../../third_party/skia/fuzz/oss_fuzz/FuzzQuadRoots.cpp + ../../../thi
88688868
ORIGIN: ../../../third_party/skia/gm/BazelGMRunner.cpp + ../../../third_party/skia/LICENSE
88698869
ORIGIN: ../../../third_party/skia/gm/BazelNoopRunner.cpp + ../../../third_party/skia/LICENSE
88708870
ORIGIN: ../../../third_party/skia/gm/graphite_replay.cpp + ../../../third_party/skia/LICENSE
8871+
ORIGIN: ../../../third_party/skia/gm/png_codec.cpp + ../../../third_party/skia/LICENSE
88718872
ORIGIN: ../../../third_party/skia/gm/rippleshadergm.cpp + ../../../third_party/skia/LICENSE
88728873
ORIGIN: ../../../third_party/skia/gm/scaledrects.cpp + ../../../third_party/skia/LICENSE
88738874
ORIGIN: ../../../third_party/skia/gm/surface_manager/GaneshGLSurfaceManager.cpp + ../../../third_party/skia/LICENSE
@@ -9094,6 +9095,7 @@ FILE: ../../../third_party/skia/fuzz/oss_fuzz/FuzzQuadRoots.cpp
90949095
FILE: ../../../third_party/skia/gm/BazelGMRunner.cpp
90959096
FILE: ../../../third_party/skia/gm/BazelNoopRunner.cpp
90969097
FILE: ../../../third_party/skia/gm/graphite_replay.cpp
9098+
FILE: ../../../third_party/skia/gm/png_codec.cpp
90979099
FILE: ../../../third_party/skia/gm/rippleshadergm.cpp
90989100
FILE: ../../../third_party/skia/gm/scaledrects.cpp
90999101
FILE: ../../../third_party/skia/gm/surface_manager/GaneshGLSurfaceManager.cpp

impeller/entity/contents/checkerboard_contents.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ bool CheckerboardContents::Render(const ContentContext& renderer,
4949
frag_info.square_size = square_size_;
5050
FS::BindFragInfo(cmd, host_buffer.EmplaceUniform(frag_info));
5151

52-
pass.AddCommand(cmd);
52+
pass.AddCommand(std::move(cmd));
5353

5454
return true;
5555
}

impeller/entity/contents/clip_contents.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ bool ClipContents::Render(const ContentContext& renderer,
107107

108108
options.primitive_type = PrimitiveType::kTriangleStrip;
109109
cmd.pipeline = renderer.GetClipPipeline(options);
110-
pass.AddCommand(cmd);
110+
pass.AddCommand(Command(cmd));
111111
}
112112

113113
{

impeller/entity/contents/filters/blend_filter_contents.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static std::optional<Entity> AdvancedBlend(
180180

181181
auto uniform_view = host_buffer.EmplaceUniform(frame_info);
182182
VS::BindFrameInfo(cmd, uniform_view);
183-
pass.AddCommand(cmd);
183+
pass.AddCommand(std::move(cmd));
184184

185185
return true;
186186
};
@@ -336,7 +336,7 @@ std::optional<Entity> BlendFilterContents::CreateForegroundAdvancedBlend(
336336
auto uniform_view = host_buffer.EmplaceUniform(frame_info);
337337
VS::BindFrameInfo(cmd, uniform_view);
338338

339-
return pass.AddCommand(cmd);
339+
return pass.AddCommand(std::move(cmd));
340340
};
341341
CoverageProc coverage_proc =
342342
[coverage](const Entity& entity) -> std::optional<Rect> {
@@ -476,7 +476,7 @@ std::optional<Entity> BlendFilterContents::CreateForegroundPorterDuffBlend(
476476
auto uniform_view = host_buffer.EmplaceUniform(frame_info);
477477
VS::BindFrameInfo(cmd, uniform_view);
478478

479-
return pass.AddCommand(cmd);
479+
return pass.AddCommand(std::move(cmd));
480480
};
481481

482482
CoverageProc coverage_proc =
@@ -573,7 +573,7 @@ static std::optional<Entity> PipelineBlend(
573573
FS::BindFragInfo(cmd, host_buffer.EmplaceUniform(frag_info));
574574
VS::BindFrameInfo(cmd, host_buffer.EmplaceUniform(frame_info));
575575

576-
pass.AddCommand(cmd);
576+
pass.AddCommand(std::move(cmd));
577577
return true;
578578
};
579579

impeller/entity/contents/filters/gaussian_blur_filter_contents.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ std::optional<Entity> DirectionalGaussianBlurFilterContents::RenderFilter(
303303
FS::BindMaskInfo(cmd, host_buffer.EmplaceUniform(mask_info));
304304
}
305305

306-
return pass.AddCommand(cmd);
306+
return pass.AddCommand(std::move(cmd));
307307
};
308308

309309
Vector2 scale;

impeller/entity/contents/filters/morphology_filter_contents.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ std::optional<Entity> DirectionalMorphologyFilterContents::RenderFilter(
135135
VS::BindFrameInfo(cmd, host_buffer.EmplaceUniform(frame_info));
136136
FS::BindFragInfo(cmd, host_buffer.EmplaceUniform(frag_info));
137137

138-
return pass.AddCommand(cmd);
138+
return pass.AddCommand(std::move(cmd));
139139
};
140140

141141
auto out_texture = renderer.MakeSubpass("Directional Morphology Filter",

impeller/entity/contents/framebuffer_blend_contents.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ bool FramebufferBlendContents::Render(const ContentContext& renderer,
154154
frag_info.src_input_alpha = src_snapshot->opacity;
155155
FS::BindFragInfo(cmd, host_buffer.EmplaceUniform(frag_info));
156156

157-
return pass.AddCommand(cmd);
157+
return pass.AddCommand(std::move(cmd));
158158
}
159159

160160
} // namespace impeller

impeller/entity/contents/text_contents.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ bool TextContents::Render(const ContentContext& renderer,
212212
.index_type = IndexType::kNone,
213213
});
214214

215-
return pass.AddCommand(cmd);
215+
return pass.AddCommand(std::move(cmd));
216216
}
217217

218218
} // namespace impeller

impeller/renderer/render_pass.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void RenderPass::SetLabel(std::string label) {
4343
OnSetLabel(std::move(label));
4444
}
4545

46-
bool RenderPass::AddCommand(Command command) {
46+
bool RenderPass::AddCommand(Command&& command) {
4747
if (!command) {
4848
VALIDATION_LOG << "Attempted to add an invalid command to the render pass.";
4949
return false;

impeller/renderer/render_pass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class RenderPass {
4747
///
4848
/// @return If the command was valid for subsequent commitment.
4949
///
50-
bool AddCommand(Command command);
50+
bool AddCommand(Command&& command);
5151

5252
//----------------------------------------------------------------------------
5353
/// @brief Encode the recorded commands to the underlying command buffer.

impeller/renderer/renderer_unittests.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ TEST_P(RendererTest, CanRenderMultiplePrimitives) {
270270
Matrix::MakeTranslation({i * 50.0f, j * 50.0f, 0.0f});
271271
VS::BindUniformBuffer(
272272
cmd, pass.GetTransientsBuffer().EmplaceUniform(uniforms));
273-
if (!pass.AddCommand(cmd)) {
273+
if (!pass.AddCommand(std::move(cmd))) {
274274
return false;
275275
}
276276
}
@@ -445,7 +445,7 @@ TEST_P(RendererTest, CanRenderInstanced) {
445445
cmd.BindVertices(builder.CreateVertexBuffer(pass.GetTransientsBuffer()));
446446

447447
cmd.instance_count = kInstancesCount;
448-
pass.AddCommand(cmd);
448+
pass.AddCommand(std::move(cmd));
449449
return true;
450450
}));
451451
}
@@ -863,7 +863,7 @@ TEST_P(RendererTest, TheImpeller) {
863863
FS::BindBlueNoise(cmd, blue_noise, noise_sampler);
864864
FS::BindCubeMap(cmd, cube_map, cube_map_sampler);
865865

866-
pass.AddCommand(cmd);
866+
pass.AddCommand(std::move(cmd));
867867
return true;
868868
};
869869
OpenPlaygroundHere(callback);
@@ -919,7 +919,7 @@ TEST_P(RendererTest, ArrayUniforms) {
919919
FS::BindFragInfo(cmd,
920920
pass.GetTransientsBuffer().EmplaceUniform(fs_uniform));
921921

922-
pass.AddCommand(cmd);
922+
pass.AddCommand(std::move(cmd));
923923
return true;
924924
};
925925
OpenPlaygroundHere(callback);
@@ -964,7 +964,7 @@ TEST_P(RendererTest, InactiveUniforms) {
964964
FS::BindFragInfo(cmd,
965965
pass.GetTransientsBuffer().EmplaceUniform(fs_uniform));
966966

967-
pass.AddCommand(cmd);
967+
pass.AddCommand(std::move(cmd));
968968
return true;
969969
};
970970
OpenPlaygroundHere(callback);

lib/web_ui/lib/src/engine/text/canvas_paragraph.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ class CanvasParagraph implements ui.Paragraph {
9494
// `30.5` then the TextPainter in the framework will ceil the `30.5` width
9595
// which will result in a width of `40.0` that's higher than the constraint
9696
// width.
97-
constraints = ui.ParagraphConstraints(
98-
width: constraints.width.floorToDouble(),
99-
);
97+
if (!ui.ParagraphBuilder.shouldDisableRoundingHack) {
98+
constraints = ui.ParagraphConstraints(width: constraints.width.floorToDouble());
99+
}
100100

101101
if (constraints == _lastUsedConstraints) {
102102
return;

lib/web_ui/test/html/text_test.dart

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,32 @@ Future<void> testMain() async {
9494
}
9595
});
9696

97+
test('Can disable rounding hack', () {
98+
if (!ParagraphBuilder.shouldDisableRoundingHack) {
99+
ParagraphBuilder.setDisableRoundingHack(true);
100+
addTearDown(() => ParagraphBuilder.setDisableRoundingHack(false));
101+
}
102+
assert(ParagraphBuilder.shouldDisableRoundingHack);
103+
const double fontSize = 1;
104+
const String text = '12345';
105+
const double letterSpacing = 0.25;
106+
const double expectedIntrinsicWidth = text.length * (fontSize + letterSpacing);
107+
assert(expectedIntrinsicWidth.truncate() != expectedIntrinsicWidth);
108+
final ParagraphBuilder builder = ParagraphBuilder(ParagraphStyle(fontSize: fontSize, fontFamily: 'FlutterTest'));
109+
builder.pushStyle(TextStyle(letterSpacing: letterSpacing));
110+
builder.addText(text);
111+
final Paragraph paragraph = builder.build()
112+
..layout(const ParagraphConstraints(width: expectedIntrinsicWidth));
113+
114+
expect(paragraph.maxIntrinsicWidth, expectedIntrinsicWidth);
115+
switch (paragraph.computeLineMetrics()) {
116+
case [LineMetrics(width: final double width)]:
117+
expect(width, expectedIntrinsicWidth);
118+
case final List<LineMetrics> metrics:
119+
expect(metrics, hasLength(1));
120+
}
121+
});
122+
97123
test('lay out unattached paragraph', () {
98124
final CanvasParagraph paragraph = plain(EngineParagraphStyle(
99125
fontFamily: 'sans-serif',

shell/platform/darwin/macos/framework/Source/FlutterEngineTest.mm

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -501,11 +501,12 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication* _Nonnu
501501
// Verify that the engine is not retained indirectly via the binary messenger held by channels and
502502
// plugins. Previously, FlutterEngine.binaryMessenger returned the engine itself, and thus plugins
503503
// could cause a retain cycle, preventing the engine from being deallocated.
504-
// FlutterEngine.binaryMessenger now returns a FlutterBinaryMessengerRelay whose pointer back to
505-
// the engine is cleared when the engine is deallocated.
504+
// FlutterEngine.binaryMessenger now returns a FlutterBinaryMessengerRelay whose weak pointer back
505+
// to the engine is cleared when the engine is deallocated.
506506
// Issue: https://github.com/flutter/flutter/issues/116445
507-
TEST_F(FlutterEngineTest, FlutterBinaryMessengerNullsParentOnEngineRelease) {
508-
FlutterBinaryMessengerRelay* relay = nil;
507+
TEST_F(FlutterEngineTest, FlutterBinaryMessengerDoesNotRetainEngine) {
508+
__weak FlutterEngine* weakEngine;
509+
id<FlutterBinaryMessenger> binaryMessenger = nil;
509510
@autoreleasepool {
510511
// Create a test engine.
511512
NSString* fixtures = @(flutter::testing::GetFixturesPath());
@@ -515,19 +516,38 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication* _Nonnu
515516
FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"test"
516517
project:project
517518
allowHeadlessExecution:true];
519+
weakEngine = engine;
520+
binaryMessenger = engine.binaryMessenger;
521+
}
518522

519-
// Get the binary messenger for the engine.
520-
id<FlutterBinaryMessenger> binaryMessenger = engine.binaryMessenger;
521-
ASSERT_TRUE([binaryMessenger isKindOfClass:[FlutterBinaryMessengerRelay class]]);
522-
relay = (FlutterBinaryMessengerRelay*)binaryMessenger;
523+
// Once the engine has been deallocated, verify the weak engine pointer is nil, and thus not
524+
// retained by the relay.
525+
EXPECT_NE(binaryMessenger, nil);
526+
EXPECT_EQ(weakEngine, nil);
527+
}
523528

524-
// Verify the relay parent (the engine) is non-nil.
525-
EXPECT_NE(relay.parent, nil);
529+
// Verify that the engine is not retained indirectly via the texture registry held by plugins.
530+
// Issue: https://github.com/flutter/flutter/issues/116445
531+
TEST_F(FlutterEngineTest, FlutterTextureRegistryDoesNotReturnEngine) {
532+
__weak FlutterEngine* weakEngine;
533+
id<FlutterTextureRegistry> textureRegistry;
534+
@autoreleasepool {
535+
// Create a test engine.
536+
NSString* fixtures = @(flutter::testing::GetFixturesPath());
537+
FlutterDartProject* project = [[FlutterDartProject alloc]
538+
initWithAssetsPath:fixtures
539+
ICUDataPath:[fixtures stringByAppendingString:@"/icudtl.dat"]];
540+
FlutterEngine* engine = [[FlutterEngine alloc] initWithName:@"test"
541+
project:project
542+
allowHeadlessExecution:true];
543+
id<FlutterPluginRegistrar> registrar = [engine registrarForPlugin:@"MyPlugin"];
544+
textureRegistry = registrar.textures;
526545
}
527546

528-
// Once the engine has been deallocated, verify the relay parent is nil, and thus the engine is
529-
// not retained by the holder of the relay.
530-
EXPECT_EQ(relay.parent, nil);
547+
// Once the engine has been deallocated, verify the weak engine pointer is nil, and thus not
548+
// retained via the texture registry.
549+
EXPECT_NE(textureRegistry, nil);
550+
EXPECT_EQ(weakEngine, nil);
531551
}
532552

533553
// If a channel overrides a previous channel with the same name, cleaning

tools/android_sdk/create_cipd_packages.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
print_usage () {
66
echo "Usage:"
7-
echo " ./create_cipd_united_package.sh <VERSION_TAG> [PATH_TO_SDK_DIR]"
7+
echo " ./create_cipd_packages.sh <VERSION_TAG> [PATH_TO_SDK_DIR]"
88
echo " Downloads, packages, and uploads Android SDK packages where:"
99
echo " - VERSION_TAG is the tag of the cipd packages, e.g. 28r6 or 31v1"
1010
echo " - PATH_TO_SDK_DIR is the path to the sdk folder. If omitted, this defaults to"
1111
echo " your ANDROID_SDK_ROOT environment variable."
12-
echo " ./create_cipd_united_package.sh list"
12+
echo " ./create_cipd_packages.sh list"
1313
echo " Lists the available packages for use in 'packages.txt'"
1414
echo ""
1515
echo "This script downloads the packages specified in packages.txt and uploads"

0 commit comments

Comments
 (0)