Flutter Engine
 
Loading...
Searching...
No Matches
embedder_engine.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_
6#define FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_
7
8#include <memory>
9#include <unordered_map>
10
11#include "flutter/fml/macros.h"
17namespace flutter {
18
19struct ShellArgs;
20
21// The object that is returned to the embedder as an opaque pointer to the
22// instance of the Flutter engine.
24 public:
26 std::unique_ptr<EmbedderThreadHost> thread_host,
27 const TaskRunners& task_runners,
28 const Settings& settings,
29 RunConfiguration run_configuration,
30 const Shell::CreateCallback<PlatformView>& on_create_platform_view,
31 const Shell::CreateCallback<Rasterizer>& on_create_rasterizer,
32 std::unique_ptr<EmbedderExternalTextureResolver>
33 external_texture_resolver);
34
36
37 bool LaunchShell();
38
39 bool CollectShell();
40
41 void CollectThreadHost();
42
43 const TaskRunners& GetTaskRunners() const;
44
45 bool NotifyCreated();
46
47 bool NotifyDestroyed();
48
49 bool RunRootIsolate();
50
51 bool IsValid() const;
52
53 bool SetViewportMetrics(int64_t view_id,
54 const flutter::ViewportMetrics& metrics);
55
57 std::unique_ptr<flutter::PointerDataPacket> packet);
58
59 bool SendPlatformMessage(std::unique_ptr<PlatformMessage> message);
60
61 bool RegisterTexture(int64_t texture);
62
63 bool UnregisterTexture(int64_t texture);
64
66
67 bool SetSemanticsEnabled(bool enabled);
68
69 bool SetAccessibilityFeatures(int32_t flags);
70
72 int node_id,
75
76 bool OnVsyncEvent(intptr_t baton,
77 fml::TimePoint frame_start_time,
78 fml::TimePoint frame_target_time);
79
80 bool ReloadSystemFonts();
81
82 bool PostRenderThreadTask(const fml::closure& task);
83
84 bool RunTask(const FlutterTask* task);
85
87 const std::function<void(FlutterNativeThreadType)>& closure) const;
88
89 bool ScheduleFrame();
90
91 Shell& GetShell();
92
93 private:
94 std::unique_ptr<EmbedderThreadHost> thread_host_;
95 TaskRunners task_runners_;
96 RunConfiguration run_configuration_;
97 std::unique_ptr<ShellArgs> shell_args_;
98 std::unique_ptr<Shell> shell_;
99 std::unique_ptr<EmbedderExternalTextureResolver> external_texture_resolver_;
100
102};
103
104} // namespace flutter
105
106#endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_EMBEDDER_ENGINE_H_
bool MarkTextureFrameAvailable(int64_t texture)
bool PostTaskOnEngineManagedNativeThreads(const std::function< void(FlutterNativeThreadType)> &closure) const
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 DispatchSemanticsAction(int64_t view_id, int node_id, flutter::SemanticsAction action, fml::MallocMapping args)
bool RunTask(const FlutterTask *task)
bool DispatchPointerDataPacket(std::unique_ptr< flutter::PointerDataPacket > packet)
const TaskRunners & GetTaskRunners() const
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....
std::function< std::unique_ptr< T >(Shell &)> CreateCallback
Definition shell.h:121
A Mapping like NonOwnedMapping, but uses Free as its release proc.
Definition mapping.h:144
FlutterNativeThreadType
Definition embedder.h:2404
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
G_BEGIN_DECLS GBytes * message
G_BEGIN_DECLS FlutterViewId view_id
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
FlTexture * texture
std::function< void()> closure
Definition closure.h:14