5#include "flutter/shell/platform/embedder/embedder_engine.h"
7#include "flutter/fml/make_copyable.h"
8#include "flutter/shell/platform/embedder/vsync_waiter_embedder.h"
25 std::unique_ptr<EmbedderThreadHost> thread_host,
31 std::unique_ptr<EmbedderExternalTextureResolver> external_texture_resolver)
34 run_configuration_(
std::move(run_configuration)),
36 on_create_platform_view,
37 on_create_rasterizer)),
38 external_texture_resolver_(
std::move(external_texture_resolver)) {}
54 shell_args_->on_create_platform_view, shell_args_->on_create_rasterizer);
72 shell_->RunEngine(std::move(run_configuration_));
77 return static_cast<bool>(shell_);
89 shell_->GetPlatformView()->NotifyCreated();
98 shell_->GetPlatformView()->NotifyDestroyed();
118 std::unique_ptr<flutter::PointerDataPacket> packet) {
133 std::unique_ptr<PlatformMessage>
message) {
151 shell_->GetPlatformView()->RegisterTexture(
152 external_texture_resolver_->ResolveExternalTexture(
texture));
160 shell_->GetPlatformView()->UnregisterTexture(
texture);
168 shell_->GetPlatformView()->MarkTextureFrameAvailable(
texture);
219 task_runners_, baton, frame_start_time, frame_target_time);
227 return shell_->ReloadSystemFonts();
235 shell_->GetTaskRunners().GetRasterTaskRunner()->PostTask(task);
243 if (task ==
nullptr) {
246 return thread_host_->PostTask(
reinterpret_cast<int64_t
>(task->
runner),
256 const auto trampoline = [
closure](
263 const auto& task_runners = shell_->GetTaskRunners();
265 task_runners.GetRasterTaskRunner());
269 task_runners.GetPlatformTaskRunner());
272 auto vm = shell_->GetDartVM();
273 vm->GetConcurrentMessageLoop()->PostTaskToAllWorkers(
294 return *shell_.get();
bool MarkTextureFrameAvailable(int64_t texture)
bool PostTaskOnEngineManagedNativeThreads(const std::function< void(FlutterNativeThreadType)> &closure) const
EmbedderEngine(std::unique_ptr< EmbedderThreadHost > thread_host, const TaskRunners &task_runners, const Settings &settings, RunConfiguration run_configuration, const Shell::CreateCallback< PlatformView > &on_create_platform_view, const Shell::CreateCallback< Rasterizer > &on_create_rasterizer, std::unique_ptr< EmbedderExternalTextureResolver > external_texture_resolver)
bool RegisterTexture(int64_t texture)
bool PostRenderThreadTask(const fml::closure &task)
bool SetAccessibilityFeatures(int32_t flags)
bool SetViewportMetrics(int64_t view_id, const flutter::ViewportMetrics &metrics)
bool RunTask(const FlutterTask *task)
bool DispatchPointerDataPacket(std::unique_ptr< flutter::PointerDataPacket > packet)
const TaskRunners & GetTaskRunners() const
bool DispatchSemanticsAction(int node_id, flutter::SemanticsAction action, fml::MallocMapping args)
bool UnregisterTexture(int64_t texture)
bool SendPlatformMessage(std::unique_ptr< PlatformMessage > message)
bool SetSemanticsEnabled(bool enabled)
bool OnVsyncEvent(intptr_t baton, fml::TimePoint frame_start_time, fml::TimePoint frame_target_time)
Specifies all the configuration required by the runtime library to launch the root isolate....
bool IsValid() const
A valid run configuration only guarantees that the engine should be able to find the assets and the i...
static std::unique_ptr< Shell > Create(const PlatformData &platform_data, const TaskRunners &task_runners, Settings settings, const CreateCallback< PlatformView > &on_create_platform_view, const CreateCallback< Rasterizer > &on_create_rasterizer, bool is_gpu_disabled=false)
Creates a shell instance using the provided settings. The callbacks to create the various shell subco...
std::function< std::unique_ptr< T >(Shell &)> CreateCallback
static bool OnEmbedderVsync(const flutter::TaskRunners &task_runners, intptr_t baton, fml::TimePoint frame_start_time, fml::TimePoint frame_target_time)
A Mapping like NonOwnedMapping, but uses Free as its release proc.
@ kFlutterNativeThreadTypeWorker
@ kFlutterNativeThreadTypeUI
@ kFlutterNativeThreadTypePlatform
@ kFlutterNativeThreadTypeRender
TaskRunners task_runners_
FlutterSemanticsFlag flags
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
#define FML_DLOG(severity)
#define FML_DCHECK(condition)
Dart_NativeFunction function
std::function< void()> closure
Shell::CreateCallback< PlatformView > on_create_platform_view
ShellArgs(const Settings &p_settings, Shell::CreateCallback< PlatformView > p_on_create_platform_view, Shell::CreateCallback< Rasterizer > p_on_create_rasterizer)
Shell::CreateCallback< Rasterizer > on_create_rasterizer