5#include "flutter/shell/platform/embedder/platform_view_embedder.h"
9#include "flutter/fml/make_copyable.h"
19 : parent_(
std::move(parent)),
20 platform_task_runner_(
std::move(platform_task_runner)) {}
26 parent->HandlePlatformMessage(std::move(
message));
28 FML_DLOG(WARNING) <<
"Deleted engine dropping message on channel "
40 std::unique_ptr<fml::Mapping> mapping) {}
52 software_dispatch_table,
54 std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder)
56 external_view_embedder_(
std::move(external_view_embedder)),
59 external_view_embedder_)),
62 task_runners.GetPlatformTaskRunner())),
63 platform_dispatch_table_(
std::move(platform_dispatch_table)) {}
69 std::unique_ptr<EmbedderSurface> embedder_surface,
70 PlatformDispatchTable platform_dispatch_table,
71 std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder)
73 external_view_embedder_(
std::move(external_view_embedder)),
74 embedder_surface_(
std::move(embedder_surface)),
75 platform_message_handler_(new EmbedderPlatformMessageHandler(
77 task_runners.GetPlatformTaskRunner())),
78 platform_dispatch_table_(
std::move(platform_dispatch_table)) {}
81#ifdef SHELL_ENABLE_METAL
83 PlatformView::Delegate& delegate,
85 std::unique_ptr<EmbedderSurface> embedder_surface,
86 PlatformDispatchTable platform_dispatch_table,
87 std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder)
88 : PlatformView(delegate, task_runners),
89 external_view_embedder_(
std::move(external_view_embedder)),
90 embedder_surface_(
std::move(embedder_surface)),
91 platform_message_handler_(new EmbedderPlatformMessageHandler(
93 task_runners.GetPlatformTaskRunner())),
94 platform_dispatch_table_(
std::move(platform_dispatch_table)) {}
97#ifdef SHELL_ENABLE_VULKAN
99 PlatformView::Delegate& delegate,
101 std::unique_ptr<EmbedderSurfaceVulkan> embedder_surface,
102 PlatformDispatchTable platform_dispatch_table,
103 std::shared_ptr<EmbedderExternalViewEmbedder> external_view_embedder)
104 : PlatformView(delegate, task_runners),
105 external_view_embedder_(
std::move(external_view_embedder)),
106 embedder_surface_(
std::move(embedder_surface)),
107 platform_message_handler_(new EmbedderPlatformMessageHandler(
109 task_runners.GetPlatformTaskRunner())),
110 platform_dispatch_table_(
std::move(platform_dispatch_table)) {}
125 std::unique_ptr<flutter::PlatformMessage>
message) {
132 message->response()->CompleteEmpty();
142std::unique_ptr<Surface> PlatformViewEmbedder::CreateRenderingSurface() {
143 if (embedder_surface_ ==
nullptr) {
147 return embedder_surface_->CreateGPUSurface();
151std::shared_ptr<ExternalViewEmbedder>
152PlatformViewEmbedder::CreateExternalViewEmbedder() {
153 return external_view_embedder_;
156std::shared_ptr<impeller::Context> PlatformViewEmbedder::GetImpellerContext()
158 return embedder_surface_->CreateImpellerContext();
163 if (embedder_surface_ ==
nullptr) {
167 return embedder_surface_->CreateResourceContext();
171std::unique_ptr<VsyncWaiter> PlatformViewEmbedder::CreateVSyncWaiter() {
177 return std::make_unique<VsyncWaiterEmbedder>(
182std::unique_ptr<std::vector<std::string>>
183PlatformViewEmbedder::ComputePlatformResolvedLocales(
184 const std::vector<std::string>& supported_locale_data) {
188 supported_locale_data);
190 std::unique_ptr<std::vector<std::string>>
out =
191 std::make_unique<std::vector<std::string>>();
196void PlatformViewEmbedder::OnPreEngineRestart()
const {
203void PlatformViewEmbedder::SendChannelUpdate(
const std::string&
name,
210std::shared_ptr<PlatformMessageHandler>
212 return platform_message_handler_;
virtual void PostTask(const fml::closure &task) override
#define FML_DLOG(severity)
#define FML_LOG(severity)
std::unordered_map< int32_t, SemanticsNode > SemanticsNodeUpdates
std::unordered_map< int32_t, CustomAccessibilityAction > CustomAccessibilityActionUpdates
DEF_SWITCHES_START aot vmservice shared library name
internal::CopyableLambda< T > MakeCopyable(T lambda)