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

Commit 744e93f

Browse files
author
Chris Yang
committed
add comments
1 parent e97d426 commit 744e93f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,10 @@
279279
CancelFrame();
280280
return PostPrerollResult::kSkipAndRetryFrame;
281281
}
282+
// If the post preroll action is successful, we will display platform views in the current frame.
283+
// In order to sync the rendering of the platform views (quartz) with skia's rendering,
284+
// We need to begin an explicit CATransaction. This transaction needs to be submitted
285+
// after the current frame is submitted.
282286
[CATransaction begin];
283287
raster_thread_merger->ExtendLeaseTo(kDefaultMergedLeaseDuration);
284288
return PostPrerollResult::kSuccess;
@@ -548,6 +552,10 @@
548552
composition_order_.clear();
549553

550554
did_submit &= frame->Submit();
555+
556+
// The frame is submitted with embedded platform views.
557+
// There should be a |[CATransaction begin]| call in this frame prior to all the drawing.
558+
// Now we need to commit the transaction.
551559
[CATransaction commit];
552560
return did_submit;
553561
}

0 commit comments

Comments
 (0)