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

Commit d56f9ef

Browse files
authored
[Embedder API] Fix test helper's present callback registration (#51560)
#51293 added a new present callback that supports multiple views. However, the test helper incorrectly inversed the single-view and multi-view present callbacks. This didn't affect the existing tests as we don't any multi-view tests yet. Prepares for flutter/flutter#144810 [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
1 parent 1b842ae commit d56f9ef

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

shell/platform/embedder/tests/embedder_config_builder.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -377,14 +377,6 @@ void EmbedderConfigBuilder::SetCompositor(bool avoid_backing_store_cache,
377377
->CollectBackingStore(backing_store);
378378
};
379379
if (use_present_layers_callback) {
380-
compositor_.present_view_callback = [](const FlutterPresentViewInfo* info) {
381-
auto compositor =
382-
reinterpret_cast<EmbedderTestCompositor*>(info->user_data);
383-
384-
return compositor->Present(info->view_id, info->layers,
385-
info->layers_count);
386-
};
387-
} else {
388380
compositor_.present_layers_callback = [](const FlutterLayer** layers,
389381
size_t layers_count,
390382
void* user_data) {
@@ -394,6 +386,14 @@ void EmbedderConfigBuilder::SetCompositor(bool avoid_backing_store_cache,
394386
// it can only be used to render the implicit view.
395387
return compositor->Present(kFlutterImplicitViewId, layers, layers_count);
396388
};
389+
} else {
390+
compositor_.present_view_callback = [](const FlutterPresentViewInfo* info) {
391+
auto compositor =
392+
reinterpret_cast<EmbedderTestCompositor*>(info->user_data);
393+
394+
return compositor->Present(info->view_id, info->layers,
395+
info->layers_count);
396+
};
397397
}
398398
compositor_.avoid_backing_store_cache = avoid_backing_store_cache;
399399
project_args_.compositor = &compositor_;

0 commit comments

Comments
 (0)