6 #include "fml/task_runner.h"
8 #include "flutter/common/constants.h"
15 const std::shared_ptr<PlatformViewsController>& platform_views_controller,
16 const std::shared_ptr<IOSContext>& context)
17 : platform_views_controller_(platform_views_controller), ios_context_(context) {
18 FML_CHECK(ios_context_);
24 DlCanvas* IOSExternalViewEmbedder::GetRootCanvas() {
31 void IOSExternalViewEmbedder::CancelFrame() {
32 TRACE_EVENT0(
"flutter",
"IOSExternalViewEmbedder::CancelFrame");
33 FML_CHECK(platform_views_controller_);
34 platform_views_controller_->CancelFrame();
38 void IOSExternalViewEmbedder::BeginFrame(
39 GrDirectContext* context,
40 const fml::RefPtr<fml::RasterThreadMerger>& raster_thread_merger) {}
43 void IOSExternalViewEmbedder::PrepareFlutterView(SkISize frame_size,
double device_pixel_ratio) {
44 FML_CHECK(platform_views_controller_);
45 platform_views_controller_->BeginFrame(frame_size);
49 void IOSExternalViewEmbedder::PrerollCompositeEmbeddedView(
51 std::unique_ptr<EmbeddedViewParams> params) {
52 TRACE_EVENT0(
"flutter",
"IOSExternalViewEmbedder::PrerollCompositeEmbeddedView");
53 FML_CHECK(platform_views_controller_);
54 platform_views_controller_->PrerollCompositeEmbeddedView(view_id, std::move(params));
58 PostPrerollResult IOSExternalViewEmbedder::PostPrerollAction(
59 const fml::RefPtr<fml::RasterThreadMerger>& raster_thread_merger) {
60 TRACE_EVENT0(
"flutter",
"IOSExternalViewEmbedder::PostPrerollAction");
61 FML_CHECK(platform_views_controller_);
62 PostPrerollResult result = platform_views_controller_->PostPrerollAction(
68 DlCanvas* IOSExternalViewEmbedder::CompositeEmbeddedView(int64_t view_id) {
69 TRACE_EVENT0(
"flutter",
"IOSExternalViewEmbedder::CompositeEmbeddedView");
70 FML_CHECK(platform_views_controller_);
71 return platform_views_controller_->CompositeEmbeddedView(view_id);
75 void IOSExternalViewEmbedder::SubmitFlutterView(
76 int64_t flutter_view_id,
77 GrDirectContext* context,
78 const std::shared_ptr<impeller::AiksContext>& aiks_context,
79 std::unique_ptr<SurfaceFrame> frame) {
80 TRACE_EVENT0(
"flutter",
"IOSExternalViewEmbedder::SubmitFlutterView");
84 FML_DCHECK(flutter_view_id == kFlutterImplicitViewId);
85 FML_CHECK(platform_views_controller_);
86 platform_views_controller_->SubmitFrame(context, ios_context_, std::move(frame));
87 TRACE_EVENT0(
"flutter",
"IOSExternalViewEmbedder::DidSubmitFrame");
91 void IOSExternalViewEmbedder::EndFrame(
92 bool should_resubmit_frame,
93 const fml::RefPtr<fml::RasterThreadMerger>& raster_thread_merger) {
94 TRACE_EVENT0(
"flutter",
"IOSExternalViewEmbedder::EndFrame");
95 platform_views_controller_->EndFrame(should_resubmit_frame, raster_thread_merger,
100 bool IOSExternalViewEmbedder::SupportsDynamicThreadMerging() {
102 #if FML_OS_IOS_SIMULATOR
106 #endif // FML_OS_IOS_SIMULATOR
110 void IOSExternalViewEmbedder::PushFilterToVisitedPlatformViews(
111 const std::shared_ptr<const DlImageFilter>& filter,
112 const SkRect& filter_rect) {
113 platform_views_controller_->PushFilterToVisitedPlatformViews(filter, filter_rect);
117 void IOSExternalViewEmbedder::PushVisitedPlatformView(int64_t view_id) {
118 platform_views_controller_->PushVisitedPlatformView(view_id);