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

Commit cf4e169

Browse files
committed
[iOS] Create Explicit Transation Avoid Implicit Cheker (#103390)
1 parent 0b5a6a9 commit cf4e169

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

shell/platform/darwin/ios/ios_external_view_embedder.mm

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
TRACE_EVENT0("flutter", "IOSExternalViewEmbedder::CancelFrame");
2828
FML_CHECK(platform_views_controller_);
2929
platform_views_controller_->CancelFrame();
30+
[CATransaction commit];
3031
}
3132

3233
// |ExternalViewEmbedder|
@@ -38,6 +39,7 @@
3839
TRACE_EVENT0("flutter", "IOSExternalViewEmbedder::BeginFrame");
3940
FML_CHECK(platform_views_controller_);
4041
platform_views_controller_->BeginFrame(frame_size);
42+
[CATransaction begin];
4143
}
4244

4345
// |ExternalViewEmbedder|
@@ -55,6 +57,9 @@
5557
TRACE_EVENT0("flutter", "IOSExternalViewEmbedder::PostPrerollAction");
5658
FML_CHECK(platform_views_controller_);
5759
PostPrerollResult result = platform_views_controller_->PostPrerollAction(raster_thread_merger);
60+
if (result == PostPrerollResult::kSkipAndRetryFrame) {
61+
[CATransaction commit];
62+
}
5863
return result;
5964
}
6065

@@ -76,7 +81,10 @@
7681
std::unique_ptr<SurfaceFrame> frame) {
7782
TRACE_EVENT0("flutter", "IOSExternalViewEmbedder::SubmitFrame");
7883
FML_CHECK(platform_views_controller_);
79-
platform_views_controller_->SubmitFrame(std::move(context), ios_context_, std::move(frame));
84+
bool submitted = platform_views_controller_->SubmitFrame(std::move(context), ios_context_, std::move(frame));
85+
if (submitted) {
86+
[CATransaction commit];
87+
}
8088
TRACE_EVENT0("flutter", "IOSExternalViewEmbedder::DidSubmitFrame");
8189
}
8290

0 commit comments

Comments
 (0)