Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Futurize EnginePlatformDispatcher.render
  • Loading branch information
harryterkelsen committed Dec 19, 2023
commit d5e1fc1d91658aee724ae5df4ee72d79c7d223db
2 changes: 1 addition & 1 deletion lib/web_ui/lib/platform_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ abstract class PlatformDispatcher {

void scheduleFrame();

void render(Scene scene, [FlutterView view]);
Future<void> render(Scene scene, [FlutterView view]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the mobile version no longer has this method.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agh shoot, forgot to remove it from our interface 🤦


AccessibilityFeatures get accessibilityFeatures;

Expand Down
4 changes: 2 additions & 2 deletions lib/web_ui/lib/src/engine/platform_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher {
/// * [RendererBinding], the Flutter framework class which manages layout and
/// painting.
@override
void render(ui.Scene scene, [ui.FlutterView? view]) {
Future<void> render(ui.Scene scene, [ui.FlutterView? view]) async {
assert(view != null || implicitView != null,
'Calling render without a FlutterView');
if (view == null && implicitView == null) {
Expand All @@ -776,7 +776,7 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher {
final bool shouldRender =
_viewsRenderedInCurrentFrame?.add(viewToRender) ?? false;
if (shouldRender) {
renderer.renderScene(scene, view ?? implicitView!);
await renderer.renderScene(scene, view ?? implicitView!);
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/web_ui/test/canvaskit/canvas_golden_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void testMain() {
builder.pushOffset(0, 0);
builder.addPicture(ui.Offset.zero, picture);
final LayerScene scene = builder.build();
renderScene(scene);
await renderScene(scene);

// Now draw an empty layer tree and confirm that the red rectangle is
// no longer drawn.
Expand Down
4 changes: 2 additions & 2 deletions lib/web_ui/test/canvaskit/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Future<void> matchSceneGolden(
ui.Scene scene, {
required ui.Rect region,
}) async {
renderScene(scene);
await renderScene(scene);
await matchGoldenFile(goldenFile, region: region);
}

Expand All @@ -63,7 +63,7 @@ Future<void> matchPictureGolden(String goldenFile, CkPicture picture,
final LayerSceneBuilder sb = LayerSceneBuilder();
sb.pushOffset(0, 0);
sb.addPicture(ui.Offset.zero, picture);
renderScene(sb.build());
await renderScene(sb.build());
await matchGoldenFile(goldenFile, region: region);
}

Expand Down
Loading