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

Commit 1d6666d

Browse files
author
Chris Yang
committed
move cleanup code to EndFrame
1 parent 9edd34d commit 1d6666d

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

shell/common/rasterizer.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,7 @@ void Rasterizer::Draw(fml::RefPtr<Pipeline<flutter::LayerTree>> pipeline,
190190
consume_result = PipelineConsumeResult::MoreAvailable;
191191
}
192192

193-
// Merging the thread as we know the next `Draw` should be run on the platform
194-
// thread.
193+
// EndFrame should perform cleanups for the external_view_embedder.
195194
if (surface_ != nullptr && surface_->GetExternalViewEmbedder() != nullptr) {
196195
surface_->GetExternalViewEmbedder()->EndFrame(should_resubmit_frame,
197196
raster_thread_merger_);

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,8 +554,6 @@
554554
BringLayersIntoView(platform_view_layers);
555555
// Mark all layers as available, so they can be used in the next frame.
556556
layer_pool_->RecycleLayers();
557-
// Reset the composition order, so next frame starts empty.
558-
composition_order_.clear();
559557

560558
did_submit &= frame->Submit();
561559

@@ -595,7 +593,10 @@
595593

596594
void FlutterPlatformViewsController::EndFrame(
597595
bool should_resubmit_frame,
598-
fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) {}
596+
fml::RefPtr<fml::RasterThreadMerger> raster_thread_merger) {
597+
// Reset the composition order, so next frame starts empty.
598+
composition_order_.clear();
599+
}
599600

600601
std::shared_ptr<FlutterPlatformViewLayer> FlutterPlatformViewsController::GetLayer(
601602
GrDirectContext* gr_context,

0 commit comments

Comments
 (0)