5#define FML_USED_ON_EMBEDDER
6#define RAPIDJSON_HAS_STDSTRING 1
15#include "flutter/fml/build_config.h"
16#include "flutter/fml/closure.h"
17#include "flutter/fml/make_copyable.h"
18#include "flutter/fml/native_library.h"
19#include "flutter/fml/thread.h"
20#include "third_party/dart/runtime/bin/elf_loader.h"
21#include "third_party/dart/runtime/include/dart_native_api.h"
27#if !defined(FLUTTER_NO_EXPORT)
29#define FLUTTER_EXPORT __declspec(dllexport)
31#define FLUTTER_EXPORT __attribute__((visibility("default")))
36#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG
43#include "flutter/assets/directory_asset_bundle.h"
44#include "flutter/common/graphics/persistent_cache.h"
45#include "flutter/common/task_runners.h"
46#include "flutter/fml/command_line.h"
47#include "flutter/fml/file.h"
48#include "flutter/fml/make_copyable.h"
49#include "flutter/fml/message_loop.h"
50#include "flutter/fml/paths.h"
51#include "flutter/fml/trace_event.h"
52#include "flutter/shell/common/rasterizer.h"
53#include "flutter/shell/common/switches.h"
54#include "flutter/shell/platform/embedder/embedder.h"
55#include "flutter/shell/platform/embedder/embedder_engine.h"
56#include "flutter/shell/platform/embedder/embedder_external_texture_resolver.h"
57#include "flutter/shell/platform/embedder/embedder_platform_message_response.h"
58#include "flutter/shell/platform/embedder/embedder_render_target.h"
59#include "flutter/shell/platform/embedder/embedder_render_target_skia.h"
60#include "flutter/shell/platform/embedder/embedder_semantics_update.h"
61#include "flutter/shell/platform/embedder/embedder_struct_macros.h"
62#include "flutter/shell/platform/embedder/embedder_task_runner.h"
63#include "flutter/shell/platform/embedder/embedder_thread_host.h"
64#include "flutter/shell/platform/embedder/pixel_formats.h"
65#include "flutter/shell/platform/embedder/platform_view_embedder.h"
66#include "rapidjson/rapidjson.h"
67#include "rapidjson/writer.h"
72#include "flutter/shell/platform/embedder/embedder_external_texture_gl.h"
75#ifdef IMPELLER_SUPPORTS_RENDERING
76#include "flutter/shell/platform/embedder/embedder_render_target_impeller.h"
77#include "flutter/shell/platform/embedder/embedder_surface_gl_impeller.h"
78#include "flutter/shell/platform/embedder/embedder_surface_gl_skia.h"
87#ifdef SHELL_ENABLE_METAL
88#include "flutter/shell/platform/embedder/embedder_surface_metal_skia.h"
92#ifdef IMPELLER_SUPPORTS_RENDERING
93#include "flutter/shell/platform/embedder/embedder_render_target_impeller.h"
94#include "flutter/shell/platform/embedder/embedder_surface_metal_impeller.h"
101#ifdef SHELL_ENABLE_VULKAN
134 const char* code_name,
139 constexpr char kSeparator =
'\\';
141 constexpr char kSeparator =
'/';
143 const auto file_base =
144 (::strrchr(
file, kSeparator) ? strrchr(
file, kSeparator) + 1 :
file);
145 char error[256] = {};
146 snprintf(
error, (
sizeof(
error) /
sizeof(
char)),
147 "%s (%d): '%s' returned '%s'. %s", file_base,
line,
function,
149 std::cerr <<
error << std::endl;
153#define LOG_EMBEDDER_ERROR(code, reason) \
154 LogEmbedderError(code, reason, #code, __FUNCTION__, __FILE__, __LINE__)
166 fbo_with_frame_info_callback) ||
181 if (
SAFE_ACCESS(software_config, surface_present_callback,
nullptr) ==
198 SAFE_ACCESS(metal_config, present_command_queue,
nullptr);
200 bool present =
SAFE_ACCESS(metal_config, present_drawable_callback,
nullptr);
202 SAFE_ACCESS(metal_config, get_next_drawable_callback,
nullptr);
204 return device && command_queue && present && get_texture;
218 !
SAFE_EXISTS(vulkan_config, get_instance_proc_address_callback) ||
219 !
SAFE_EXISTS(vulkan_config, get_next_image_callback) ||
220 !
SAFE_EXISTS(vulkan_config, present_image_callback)) {
228 if (config ==
nullptr) {
232 switch (config->
type) {
248#if FML_OS_LINUX || FML_OS_WIN
249static void* DefaultGLProcResolver(
const char*
name) {
256 return static_cast<void*
>(
261#ifdef SHELL_ENABLE_GL
276 static_cast<int32_t
>(flutter_rect.
top),
277 static_cast<int32_t
>(flutter_rect.
right),
278 static_cast<int32_t
>(flutter_rect.
bottom)};
288 platform_dispatch_table,
289 std::unique_ptr<flutter::EmbedderExternalViewEmbedder>
290 external_view_embedder,
291 bool enable_impeller) {
292#ifdef SHELL_ENABLE_GL
317 std::optional<FlutterRect> frame_damage_rect;
318 if (gl_present_info.frame_damage) {
320 SkIRectToFlutterRect(*(gl_present_info.frame_damage));
322 std::optional<FlutterRect> buffer_damage_rect;
323 if (gl_present_info.buffer_damage) {
325 SkIRectToFlutterRect(*(gl_present_info.buffer_damage));
330 .num_rects = frame_damage_rect ?
size_t{1} :
size_t{0},
331 .damage = frame_damage_rect ? &frame_damage_rect.value() :
nullptr,
335 .num_rects = buffer_damage_rect ?
size_t{1} :
size_t{0},
336 .damage = buffer_damage_rect ? &buffer_damage_rect.value() :
nullptr,
342 .fbo_id = gl_present_info.fbo_id,
343 .frame_damage = frame_damage,
344 .buffer_damage = buffer_damage,
347 return present_with_info(
user_data, &present_info);
351 auto gl_fbo_callback =
353 fbo_with_frame_info_callback =
361 frame_info.
size = {gl_frame_info.
width, gl_frame_info.height};
362 return fbo_with_frame_info_callback(
user_data, &frame_info);
366 auto gl_populate_existing_damage =
371 if (!populate_existing_damage) {
373 .
fbo_id =
static_cast<uint32_t
>(
id),
374 .existing_damage = std::nullopt,
380 populate_existing_damage(
user_data,
id, &existing_damage);
382 std::optional<SkIRect> existing_damage_rect = std::nullopt;
385 if (existing_damage.
num_rects <= 0 || existing_damage.
damage ==
nullptr) {
386 FML_LOG(INFO) <<
"No damage was provided. Forcing full repaint.";
389 for (
size_t i = 0;
i < existing_damage.
num_rects;
i++) {
390 existing_damage_rect->join(
391 FlutterRectToSkIRect(existing_damage.
damage[
i]));
397 .
fbo_id =
static_cast<uint32_t
>(
id),
398 .existing_damage = existing_damage_rect,
403 std::function<bool()> gl_make_resource_current_callback =
nullptr;
404 if (
SAFE_ACCESS(open_gl_config, make_resource_current,
nullptr) !=
nullptr) {
405 gl_make_resource_current_callback =
412 if (
SAFE_ACCESS(open_gl_config, surface_transformation,
nullptr) !=
nullptr) {
413 gl_surface_transformation_callback =
417 transformation.
skewX,
419 transformation.
skewY,
422 transformation.
pers0,
423 transformation.
pers1,
430 if (external_view_embedder) {
431 external_view_embedder->SetSurfaceTransformationCallback(
432 gl_surface_transformation_callback);
437 if (
SAFE_ACCESS(open_gl_config, gl_proc_resolver,
nullptr) !=
nullptr) {
443#if FML_OS_LINUX || FML_OS_WIN
444 gl_proc_resolver = DefaultGLProcResolver;
448 bool fbo_reset_after_present =
449 SAFE_ACCESS(open_gl_config, fbo_reset_after_present,
false);
456 gl_make_resource_current_callback,
457 gl_surface_transformation_callback,
459 gl_populate_existing_damage,
463 [gl_dispatch_table, fbo_reset_after_present, platform_dispatch_table,
465 external_view_embedder =
467 std::shared_ptr<flutter::EmbedderExternalViewEmbedder> view_embedder =
468 std::move(external_view_embedder);
469 if (enable_impeller) {
470 return std::make_unique<flutter::PlatformViewEmbedder>(
472 shell.GetTaskRunners(),
473 std::make_unique<flutter::EmbedderSurfaceGLImpeller>(
474 gl_dispatch_table, fbo_reset_after_present,
476 platform_dispatch_table,
480 return std::make_unique<flutter::PlatformViewEmbedder>(
482 shell.GetTaskRunners(),
483 std::make_unique<flutter::EmbedderSurfaceGLSkia>(
484 gl_dispatch_table, fbo_reset_after_present,
486 platform_dispatch_table,
500 platform_dispatch_table,
501 std::unique_ptr<flutter::EmbedderExternalViewEmbedder>
502 external_view_embedder,
503 bool enable_impeller) {
508#ifdef SHELL_ENABLE_METAL
518 return ptr(
user_data, &embedder_texture);
520 auto metal_get_texture =
525 frame_info.
size = {
static_cast<uint32_t
>(frame_size.width()),
526 static_cast<uint32_t
>(frame_size.height())};
537 std::shared_ptr<flutter::EmbedderExternalViewEmbedder> view_embedder =
538 std::move(external_view_embedder);
540 std::unique_ptr<flutter::EmbedderSurface> embedder_surface;
542 if (enable_impeller) {
544 metal_dispatch_table = {
546 .get_texture = metal_get_texture,
548 embedder_surface = std::make_unique<flutter::EmbedderSurfaceMetalImpeller>(
552 metal_dispatch_table, view_embedder);
558 .get_texture = metal_get_texture,
560 embedder_surface = std::make_unique<flutter::EmbedderSurfaceMetalSkia>(
564 metal_dispatch_table, view_embedder);
573 [embedder_surface = std::move(embedder_surface), platform_dispatch_table,
575 return std::make_unique<flutter::PlatformViewEmbedder>(
577 shell.GetTaskRunners(),
578 std::move(embedder_surface),
579 platform_dispatch_table,
580 std::move(external_view_embedder)
593 platform_dispatch_table,
594 std::unique_ptr<flutter::EmbedderExternalViewEmbedder>
595 external_view_embedder) {
600#ifdef SHELL_ENABLE_VULKAN
602 vulkan_get_instance_proc_address =
604 VkInstance
instance,
const char* proc_name) ->
void* {
608 auto vulkan_get_next_image =
613 .
size = {
static_cast<uint32_t
>(frame_size.width()),
614 static_cast<uint32_t
>(frame_size.height())},
620 auto vulkan_present_image_callback =
626 .format =
static_cast<uint32_t
>(
format),
631 auto vk_instance =
static_cast<VkInstance
>(config->
vulkan.
instance);
633 vulkan_get_instance_proc_address(vk_instance,
"vkGetInstanceProcAddr");
638 .get_next_image = vulkan_get_next_image,
639 .present_image = vulkan_present_image_callback,
642 std::shared_ptr<flutter::EmbedderExternalViewEmbedder> view_embedder =
643 std::move(external_view_embedder);
645 std::unique_ptr<flutter::EmbedderSurfaceVulkan> embedder_surface =
646 std::make_unique<flutter::EmbedderSurfaceVulkan>(
655 static_cast<VkQueue
>(config->
vulkan.
queue), vulkan_dispatch_table,
659 [embedder_surface = std::move(embedder_surface), platform_dispatch_table,
660 external_view_embedder =
662 return std::make_unique<flutter::PlatformViewEmbedder>(
664 shell.GetTaskRunners(),
665 std::move(embedder_surface),
666 platform_dispatch_table,
667 std::move(external_view_embedder)
680 platform_dispatch_table,
681 std::unique_ptr<flutter::EmbedderExternalViewEmbedder>
682 external_view_embedder) {
687 auto software_present_backing_store =
689 const void* allocation,
size_t row_bytes,
size_t height) ->
bool {
694 software_dispatch_table = {
695 software_present_backing_store,
699 [software_dispatch_table, platform_dispatch_table,
700 external_view_embedder =
702 return std::make_unique<flutter::PlatformViewEmbedder>(
704 shell.GetTaskRunners(),
705 software_dispatch_table,
706 platform_dispatch_table,
707 std::move(external_view_embedder)
717 platform_dispatch_table,
718 std::unique_ptr<flutter::EmbedderExternalViewEmbedder>
719 external_view_embedder,
720 bool enable_impeller) {
721 if (config ==
nullptr) {
725 switch (config->
type) {
728 config,
user_data, platform_dispatch_table,
729 std::move(external_view_embedder), enable_impeller);
732 config,
user_data, platform_dispatch_table,
733 std::move(external_view_embedder));
736 config,
user_data, platform_dispatch_table,
737 std::move(external_view_embedder), enable_impeller);
740 config,
user_data, platform_dispatch_table,
741 std::move(external_view_embedder));
752#ifdef SHELL_ENABLE_GL
773 texture->destruction_callback),
778 FML_LOG(
ERROR) <<
"Could not wrap embedder supplied render texture.";
792#ifdef SHELL_ENABLE_GL
797 auto backend_render_target =
809 backend_render_target,
820 FML_LOG(
ERROR) <<
"Could not wrap embedder supplied frame-buffer.";
833 const auto image_info =
840 auto captures = std::make_unique<Captures>();
842 captures->user_data = software->
user_data;
843 auto release_proc = [](
void* pixels,
void* context) {
844 auto captures =
reinterpret_cast<Captures*
>(context);
845 if (captures->destruction_callback) {
846 captures->destruction_callback(captures->user_data);
861 <<
"Could not wrap embedder supplied software render buffer.";
889 auto captures = std::make_unique<Captures>();
891 captures->user_data = software->
user_data;
892 auto release_proc = [](
void* pixels,
void* context) {
893 auto captures =
reinterpret_cast<Captures*
>(context);
894 if (captures->destruction_callback) {
895 captures->destruction_callback(captures->user_data);
909 <<
"Could not wrap embedder supplied software render buffer.";
922#if defined(SHELL_ENABLE_METAL) && !SLIMPELLER
923 GrMtlTextureInfo texture_info;
925 FML_LOG(
ERROR) <<
"Embedder supplied null Metal texture.";
928 sk_cfp<FlutterMetalTextureHandle> mtl_texture;
930 texture_info.fTexture = mtl_texture;
954 FML_LOG(
ERROR) <<
"Could not wrap embedder supplied Metal render texture.";
964static std::unique_ptr<flutter::EmbedderRenderTarget>
968 const std::shared_ptr<impeller::AiksContext>& aiks_context,
971#if defined(SHELL_ENABLE_GL) && defined(IMPELLER_SUPPORTS_RENDERING)
973 const auto& gl_context =
988 gl_context.GetReactor(), color0_tex, framebuffer->
name);
996 depth_stencil_texture_desc.
size =
size;
1001 auto depth_stencil_tex = std::make_shared<impeller::TextureGLES>(
1002 gl_context.GetReactor(), depth_stencil_texture_desc,
1007 depth0.
texture = depth_stencil_tex;
1013 stencil0.
texture = depth_stencil_tex;
1027 return std::make_unique<flutter::EmbedderRenderTargetImpeller>(
1028 backing_store, aiks_context,
1029 std::make_unique<impeller::RenderTarget>(std::move(render_target_desc)),
1030 on_release, framebuffer_destruct);
1036static std::unique_ptr<flutter::EmbedderRenderTarget>
1040 const std::shared_ptr<impeller::AiksContext>& aiks_context,
1043#if defined(SHELL_ENABLE_METAL) && defined(IMPELLER_SUPPORTS_RENDERING)
1045 FML_LOG(
ERROR) <<
"Embedder supplied null Metal texture.";
1063 FML_LOG(
ERROR) <<
"Could not wrap embedder supplied Metal render texture.";
1066 resolve_tex->SetLabel(
"ImpellerBackingStoreResolve");
1072 msaa_tex_desc.
format = resolve_tex->GetTextureDescriptor().format;
1077 aiks_context->GetContext()->GetResourceAllocator()->CreateTexture(
1080 FML_LOG(
ERROR) <<
"Could not allocate MSAA color texture.";
1083 msaa_tex->SetLabel(
"ImpellerBackingStoreColorMSAA");
1095 return std::make_unique<flutter::EmbedderRenderTargetImpeller>(
1096 backing_store, aiks_context,
1097 std::make_unique<impeller::RenderTarget>(std::move(render_target_desc)),
1108#ifdef SHELL_ENABLE_VULKAN
1110 FML_LOG(
ERROR) <<
"Embedder supplied null Vulkan image.";
1114 .
fImage =
reinterpret_cast<VkImage
>(
vulkan->image->image),
1138 &surface_properties,
1140 vulkan->destruction_callback),
1145 FML_LOG(
ERROR) <<
"Could not wrap embedder supplied Vulkan render texture.";
1155static std::unique_ptr<flutter::EmbedderRenderTarget>
1159 if (!skia_surface) {
1162 return std::make_unique<flutter::EmbedderRenderTargetSkia>(
1163 backing_store, std::move(skia_surface), std::move(on_release));
1166static std::unique_ptr<flutter::EmbedderRenderTarget>
1171 const std::shared_ptr<impeller::AiksContext>& aiks_context,
1172 bool enable_impeller) {
1174 backing_store.
struct_size =
sizeof(backing_store);
1182 TRACE_EVENT0(
"flutter",
"FlutterCompositorCreateBackingStore");
1183 if (!c_create_callback(&config, &backing_store, compositor->
user_data)) {
1184 FML_LOG(
ERROR) <<
"Could not create the embedder backing store.";
1189 if (backing_store.
struct_size !=
sizeof(backing_store)) {
1190 FML_LOG(
ERROR) <<
"Embedder modified the backing store struct size.";
1200 TRACE_EVENT0(
"flutter",
"FlutterCompositorCollectBackingStore");
1201 c_collect_callback(&backing_store, user_data);
1207 std::unique_ptr<flutter::EmbedderRenderTarget> render_target;
1209 switch (backing_store.
type) {
1216 backing_store, std::move(skia_surface),
1221 if (enable_impeller) {
1223 backing_store, collect_callback.
Release(), aiks_context, config,
1230 backing_store, std::move(skia_surface),
1240 context, config, &backing_store.
software);
1242 backing_store, std::move(skia_surface), collect_callback.
Release());
1247 context, config, &backing_store.
software2);
1249 backing_store, std::move(skia_surface), collect_callback.
Release());
1253 if (enable_impeller) {
1255 backing_store, collect_callback.
Release(), aiks_context, config,
1256 &backing_store.
metal);
1259 &backing_store.
metal);
1261 backing_store, std::move(skia_surface), collect_callback.
Release());
1269 backing_store, std::move(skia_surface), collect_callback.
Release());
1274 if (!render_target) {
1275 FML_LOG(
ERROR) <<
"Could not create a surface from an embedder provided "
1278 return render_target;
1281static std::pair<std::unique_ptr<flutter::EmbedderExternalViewEmbedder>,
1284 bool enable_impeller) {
1285 if (compositor ==
nullptr) {
1286 return {
nullptr,
false};
1289 auto c_create_callback =
1290 SAFE_ACCESS(compositor, create_backing_store_callback,
nullptr);
1291 auto c_collect_callback =
1292 SAFE_ACCESS(compositor, collect_backing_store_callback,
nullptr);
1293 auto c_present_callback =
1294 SAFE_ACCESS(compositor, present_layers_callback,
nullptr);
1295 auto c_present_view_callback =
1296 SAFE_ACCESS(compositor, present_view_callback,
nullptr);
1297 bool avoid_backing_store_cache =
1298 SAFE_ACCESS(compositor, avoid_backing_store_cache,
false);
1301 if (!c_create_callback || !c_collect_callback) {
1302 FML_LOG(
ERROR) <<
"Required compositor callbacks absent.";
1303 return {
nullptr,
true};
1306 if ((!c_present_view_callback && !c_present_callback) ||
1307 (c_present_view_callback && c_present_callback)) {
1308 FML_LOG(
ERROR) <<
"Either present_layers_callback or present_view_callback "
1309 "must be provided but not both.";
1310 return {
nullptr,
true};
1316 create_render_target_callback =
1317 [captured_compositor, enable_impeller](
1319 const std::shared_ptr<impeller::AiksContext>& aiks_context,
1320 const auto& config) {
1322 context, aiks_context,
1327 if (c_present_callback) {
1330 TRACE_EVENT0(
"flutter",
"FlutterCompositorPresentLayers");
1331 return c_present_callback(
const_cast<const FlutterLayer**
>(layers.data()),
1335 FML_DCHECK(c_present_view_callback !=
nullptr);
1336 present_callback = [c_present_view_callback,
1339 TRACE_EVENT0(
"flutter",
"FlutterCompositorPresentLayers");
1344 .layers =
const_cast<const FlutterLayer**
>(layers.data()),
1345 .layers_count = layers.
size(),
1349 return c_present_view_callback(&
info);
1353 return {std::make_unique<flutter::EmbedderExternalViewEmbedder>(
1354 avoid_backing_store_cache, create_render_target_callback,
1360static std::variant<flutter::ViewportMetrics, std::string>
1363 if (flutter_metrics ==
nullptr) {
1364 return "Invalid metrics handle.";
1373 SAFE_ACCESS(flutter_metrics, physical_view_inset_top, 0.0);
1375 SAFE_ACCESS(flutter_metrics, physical_view_inset_right, 0.0);
1377 SAFE_ACCESS(flutter_metrics, physical_view_inset_bottom, 0.0);
1379 SAFE_ACCESS(flutter_metrics, physical_view_inset_left, 0.0);
1383 return "Device pixel ratio was invalid. It must be greater than zero.";
1390 return "Physical view insets are invalid. They must be non-negative.";
1397 return "Physical view insets are invalid. They cannot be greater than "
1398 "physical height or width.";
1405 std::unique_ptr<flutter::PlatformMessage>
message;
1431 "AOT data can only be created in AOT mode.");
1434 }
else if (!data_out) {
1442 "Invalid ELF path specified.");
1445 auto aot_data = std::make_unique<_FlutterEngineAOTData>();
1446 const char*
error =
nullptr;
1457 &aot_data->vm_snapshot_data,
1458 &aot_data->vm_snapshot_instrs,
1459 &aot_data->vm_isolate_data,
1460 &aot_data->vm_isolate_instrs
1464 if (loaded_elf ==
nullptr) {
1468 aot_data->loaded_elf.reset(loaded_elf);
1470 *data_out = aot_data.release();
1477 "Invalid FlutterEngineAOTDataSourceType type specified.");
1495 auto make_mapping_callback = [](
const char*
path,
bool executable) {
1496 return [
path, executable]() {
1507 settings.vm_snapshot_data = make_mapping_callback(
1508 reinterpret_cast<const char*
>(
args->vm_snapshot_data),
false);
1512 settings.vm_snapshot_instr = make_mapping_callback(
1513 reinterpret_cast<const char*
>(
args->vm_snapshot_instructions),
true);
1517 settings.isolate_snapshot_data = make_mapping_callback(
1518 reinterpret_cast<const char*
>(
args->isolate_snapshot_data),
false);
1522 settings.isolate_snapshot_instr = make_mapping_callback(
1523 reinterpret_cast<const char*
>(
args->isolate_snapshot_instructions),
1527#if !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG)
1528 settings.dart_library_sources_kernel = []() {
1541 auto make_mapping_callback = [](
const uint8_t* mapping,
size_t size) {
1542 return [mapping,
size]() {
1543 return std::make_unique<fml::NonOwnedMapping>(mapping,
size);
1549 make_mapping_callback(
args->aot_data->vm_snapshot_data, 0);
1552 make_mapping_callback(
args->aot_data->vm_snapshot_instrs, 0);
1555 make_mapping_callback(
args->aot_data->vm_isolate_data, 0);
1558 make_mapping_callback(
args->aot_data->vm_isolate_instrs, 0);
1562 settings.vm_snapshot_data = make_mapping_callback(
1567 settings.vm_snapshot_instr = make_mapping_callback(
1568 args->vm_snapshot_instructions,
1574 make_mapping_callback(
args->isolate_snapshot_data,
1579 settings.isolate_snapshot_instr = make_mapping_callback(
1580 args->isolate_snapshot_instructions,
1592 update_semantics_custom_action_callback,
1594 return [update_semantics_node_callback,
1595 update_semantics_custom_action_callback,
1602 if (update_semantics_node_callback !=
nullptr) {
1608 if (update_semantics_custom_action_callback !=
nullptr) {
1610 update_semantics_custom_action_callback(&update_ptr->
custom_actions[
i],
1617 if (update_semantics_node_callback !=
nullptr) {
1622 update_semantics_node_callback(&batch_end_sentinel,
user_data);
1625 if (update_semantics_custom_action_callback !=
nullptr) {
1630 update_semantics_custom_action_callback(&batch_end_sentinel,
user_data);
1641 return [update_semantics_callback,
user_data](
1656 return [update_semantics_callback,
user_data](
1676 if (
SAFE_ACCESS(
args, update_semantics_callback2,
nullptr) !=
nullptr) {
1683 if (
SAFE_ACCESS(
args, update_semantics_callback,
nullptr) !=
nullptr) {
1692 if (
SAFE_ACCESS(
args, update_semantics_node_callback,
nullptr) !=
nullptr) {
1693 update_semantics_node_callback =
args->update_semantics_node_callback;
1697 update_semantics_custom_action_callback =
nullptr;
1698 if (
SAFE_ACCESS(
args, update_semantics_custom_action_callback,
nullptr) !=
1700 update_semantics_custom_action_callback =
1701 args->update_semantics_custom_action_callback;
1704 if (update_semantics_node_callback !=
nullptr ||
1705 update_semantics_custom_action_callback !=
nullptr) {
1707 update_semantics_node_callback, update_semantics_custom_action_callback,
1741 "Flutter embedder version mismatch. There has been a breaking change. "
1742 "Please consult the changelog and update the embedder.");
1745 if (engine_out ==
nullptr) {
1747 "The engine out parameter was missing.");
1750 if (
args ==
nullptr) {
1752 "The Flutter project arguments were missing.");
1758 "The assets path in the Flutter project arguments was missing.");
1763 <<
"FlutterProjectArgs.main_path is deprecated and should be set null.";
1767 FML_LOG(WARNING) <<
"FlutterProjectArgs.packages_path is deprecated and "
1768 "should be set null.";
1773 "The renderer configuration was invalid.");
1776 std::string icu_data_path;
1783 std::string persistent_cache_path =
1810 "Multiple AOT sources specified. Embedders should provide either "
1811 "*_snapshot_* buffers or aot_data, not both.");
1821 settings.icu_data_path = icu_data_path;
1834 "Not running in AOT mode but could not resolve the kernel binary.");
1842 settings.task_observer_remove = [](intptr_t
key) {
1845 if (
SAFE_ACCESS(
args, root_isolate_create_callback,
nullptr) !=
nullptr) {
1848 settings.root_isolate_create_callback =
1855 const std::string& tag,
1864 bool has_update_semantics_2_callback =
1866 bool has_update_semantics_callback =
1868 bool has_legacy_update_semantics_callback =
1869 SAFE_ACCESS(
args, update_semantics_node_callback,
nullptr) !=
nullptr ||
1870 SAFE_ACCESS(
args, update_semantics_custom_action_callback,
nullptr) !=
1873 int semantic_callback_count = (has_update_semantics_2_callback ? 1 : 0) +
1874 (has_update_semantics_callback ? 1 : 0) +
1875 (has_legacy_update_semantics_callback ? 1 : 0);
1877 if (semantic_callback_count > 1) {
1880 "Multiple semantics update callbacks provided. "
1881 "Embedders should provide either `update_semantics_callback2`, "
1882 "`update_semantics_callback`, or both "
1883 "`update_semantics_node_callback` and "
1884 "`update_semantics_custom_action_callback`.");
1888 update_semantics_callback =
1892 platform_message_response_callback =
nullptr;
1893 if (
SAFE_ACCESS(
args, platform_message_callback,
nullptr) !=
nullptr) {
1894 platform_message_response_callback =
1895 [ptr =
args->platform_message_callback,
1905 handle->message = std::move(
message);
1906 return ptr(&incoming_message,
user_data);
1912 vsync_callback = [ptr =
args->vsync_callback,
user_data](intptr_t baton) {
1918 compute_platform_resolved_locale_callback =
nullptr;
1919 if (
SAFE_ACCESS(
args, compute_platform_resolved_locale_callback,
nullptr) !=
1921 compute_platform_resolved_locale_callback =
1922 [ptr =
args->compute_platform_resolved_locale_callback](
1923 const std::vector<std::string>& supported_locales_data) {
1924 const size_t number_of_strings_per_locale = 3;
1925 size_t locale_count =
1926 supported_locales_data.size() / number_of_strings_per_locale;
1927 std::vector<FlutterLocale> supported_locales;
1928 std::vector<const FlutterLocale*> supported_locales_ptr;
1929 for (
size_t i = 0;
i < locale_count; ++
i) {
1930 supported_locales.push_back(
1933 supported_locales_data[
i * number_of_strings_per_locale +
1937 supported_locales_data[
i * number_of_strings_per_locale +
1941 supported_locales_data[
i * number_of_strings_per_locale +
1944 .variant_code =
nullptr});
1945 supported_locales_ptr.push_back(&supported_locales[
i]);
1949 ptr(supported_locales_ptr.data(), locale_count);
1951 std::unique_ptr<std::vector<std::string>>
out =
1952 std::make_unique<std::vector<std::string>>();
1955 if (language_code !=
"") {
1956 out->push_back(language_code);
1966 on_pre_engine_restart_callback =
nullptr;
1967 if (
SAFE_ACCESS(
args, on_pre_engine_restart_callback,
nullptr) !=
nullptr) {
1968 on_pre_engine_restart_callback = [ptr =
1969 args->on_pre_engine_restart_callback,
1976 channel_update_callback = [ptr =
args->channel_update_callback,
user_data](
1977 const std::string&
name,
bool listening) {
1986 if (external_view_embedder_result.second) {
1988 "Compositor arguments were invalid.");
1993 update_semantics_callback,
1994 platform_message_response_callback,
1996 compute_platform_resolved_locale_callback,
1997 on_pre_engine_restart_callback,
1998 channel_update_callback,
2002 config,
user_data, platform_dispatch_table,
2003 std::move(external_view_embedder_result.first),
settings.enable_impeller);
2005 if (!on_create_platform_view) {
2008 "Could not infer platform view creation callback.");
2013 return std::make_unique<flutter::Rasterizer>(
shell);
2017 std::unique_ptr<ExternalTextureResolver> external_texture_resolver;
2018 external_texture_resolver = std::make_unique<ExternalTextureResolver>();
2020#ifdef SHELL_ENABLE_GL
2022 external_texture_callback;
2025 if (
SAFE_ACCESS(open_gl_config, gl_external_texture_frame_callback,
2026 nullptr) !=
nullptr) {
2027 external_texture_callback =
2029 int64_t texture_identifier,
size_t width,
2030 size_t height) -> std::unique_ptr<FlutterOpenGLTexture> {
2031 std::unique_ptr<FlutterOpenGLTexture>
texture =
2032 std::make_unique<FlutterOpenGLTexture>();
2038 external_texture_resolver =
2039 std::make_unique<ExternalTextureResolver>(external_texture_callback);
2043#ifdef SHELL_ENABLE_METAL
2045 external_texture_metal_callback;
2048 if (
SAFE_ACCESS(metal_config, external_texture_frame_callback,
nullptr)) {
2049 external_texture_metal_callback =
2051 int64_t texture_identifier,
size_t width,
2052 size_t height) -> std::unique_ptr<FlutterMetalExternalTexture> {
2053 std::unique_ptr<FlutterMetalExternalTexture>
texture =
2054 std::make_unique<FlutterMetalExternalTexture>();
2061 external_texture_resolver = std::make_unique<ExternalTextureResolver>(
2062 external_texture_metal_callback);
2066 auto custom_task_runners =
SAFE_ACCESS(
args, custom_task_runners,
nullptr);
2067 auto thread_config_callback = [&custom_task_runners](
2070 if (!custom_task_runners || !custom_task_runners->thread_priority_setter) {
2074 switch (config.priority) {
2088 custom_task_runners->thread_priority_setter(priority);
2092 custom_task_runners, thread_config_callback);
2094 if (!thread_host || !thread_host->IsValid()) {
2096 "Could not set up or infer thread configuration "
2097 "to run the Flutter engine on.");
2100 auto task_runners = thread_host->GetTaskRunners();
2102 if (!task_runners.IsValid()) {
2104 "Task runner configuration was invalid.");
2107 auto run_configuration =
2111 auto dart_entrypoint = std::string{
args->custom_dart_entrypoint};
2112 if (!dart_entrypoint.empty()) {
2113 run_configuration.SetEntrypoint(std::move(dart_entrypoint));
2120 "Could not determine Dart entrypoint arguments "
2121 "as dart_entrypoint_argc "
2122 "was set, but dart_entrypoint_argv was null.");
2124 std::vector<std::string> arguments(
args->dart_entrypoint_argc);
2125 for (
int i = 0;
i <
args->dart_entrypoint_argc; ++
i) {
2126 arguments[
i] = std::string{
args->dart_entrypoint_argv[
i]};
2128 run_configuration.SetEntrypointArgs(std::move(arguments));
2131 if (!run_configuration.IsValid()) {
2134 "Could not infer the Flutter project to run from given arguments.");
2138 auto embedder_engine = std::make_unique<flutter::EmbedderEngine>(
2139 std::move(thread_host),
2140 std::move(task_runners),
2142 std::move(run_configuration),
2143 on_create_platform_view,
2144 on_create_rasterizer,
2145 std::move(external_texture_resolver)
2150 embedder_engine.release());
2164 if (embedder_engine->IsValid()) {
2169 if (!embedder_engine->LaunchShell()) {
2171 "Could not launch the engine using supplied "
2172 "initialization arguments.");
2176 if (!embedder_engine->NotifyCreated()) {
2178 "Could not create platform view components.");
2182 if (!embedder_engine->RunRootIsolate()) {
2185 "Could not run the root isolate of the Flutter application using the "
2186 "project arguments specified.");
2199 if (!
info || !
info->view_metrics || !
info->add_view_callback) {
2201 "Add view info handle was invalid.");
2208 "Add view info was invalid. The implicit view cannot be added.");
2214 "Add view info was invalid. The info and "
2215 "window metric view IDs must match.");
2223 std::variant<flutter::ViewportMetrics, std::string> metrics_or_error =
2226 if (
const std::string*
error = std::get_if<std::string>(&metrics_or_error)) {
2230 auto metrics = std::get<flutter::ViewportMetrics>(metrics_or_error);
2234 if (!embedder_engine->IsValid()) {
2239 [c_callback =
info->add_view_callback,
2248 embedder_engine->GetShell().GetPlatformView()->AddView(view_id, metrics,
2260 if (!
info || !
info->remove_view_callback) {
2262 "Remove view info handle was invalid.");
2268 "Remove view info was invalid. The implicit view cannot be removed.");
2277 if (!embedder_engine->IsValid()) {
2282 [c_callback =
info->remove_view_callback,
2286 result.removed = removed;
2291 embedder_engine->GetShell().GetPlatformView()->RemoveView(
info->view_id,
2305 embedder_engine->CollectShell();
2316 delete embedder_engine;
2323 if (
engine ==
nullptr || flutter_metrics ==
nullptr) {
2329 std::variant<flutter::ViewportMetrics, std::string> metrics_or_error =
2331 if (
const std::string*
error = std::get_if<std::string>(&metrics_or_error)) {
2335 auto metrics = std::get<flutter::ViewportMetrics>(metrics_or_error);
2341 "Viewport metrics were invalid.");
2376 switch (device_kind) {
2432 size_t events_count) {
2437 if (pointers ==
nullptr || events_count == 0) {
2441 auto packet = std::make_unique<flutter::PointerDataPacket>(events_count);
2445 for (
size_t i = 0;
i < events_count; ++
i) {
2447 pointer_data.
Clear();
2471 if (device_kind == 0) {
2499 packet->SetPointerData(
i, pointer_data);
2501 reinterpret_cast<const uint8_t*
>(current) + current->
struct_size);
2508 "Could not dispatch pointer events to the "
2509 "running Flutter application.");
2514 switch (event_kind) {
2527 switch (event_kind) {
2547 const char* channel,
2548 const uint8_t*
data,
2578 return release_result;
2590 if (
event ==
nullptr) {
2608 auto packet = std::make_unique<flutter::KeyDataPacket>(key_data,
character);
2610 struct MessageData {
2615 MessageData* message_data =
2620 packet->data().size(),
2622 auto message_data = std::unique_ptr<MessageData>(
2623 reinterpret_cast<MessageData*>(user_data));
2624 if (message_data->callback == nullptr) {
2627 bool handled =
false;
2629 handled = *
data != 0;
2631 message_data->callback(handled, message_data->user_data);
2643 if (flutter_message ==
nullptr) {
2647 if (
SAFE_ACCESS(flutter_message, channel,
nullptr) ==
nullptr) {
2652 size_t message_size =
SAFE_ACCESS(flutter_message, message_size, 0);
2655 if (message_size != 0 && message_data ==
nullptr) {
2658 "Message size was non-zero but the message data was nullptr.");
2662 SAFE_ACCESS(flutter_message, response_handle,
nullptr);
2665 if (response_handle && response_handle->
message) {
2666 response = response_handle->
message->response();
2669 std::unique_ptr<flutter::PlatformMessage>
message;
2670 if (message_size == 0) {
2671 message = std::make_unique<flutter::PlatformMessage>(
2672 flutter_message->
channel, response);
2674 message = std::make_unique<flutter::PlatformMessage>(
2680 ->SendPlatformMessage(std::move(
message))
2683 "Could not send a message to the running "
2684 "Flutter application.");
2696 if (data_callback ==
nullptr || response_out ==
nullptr) {
2708 .GetPlatformTaskRunner();
2712 handle->message = std::make_unique<flutter::PlatformMessage>(
2716 fml::MakeRefCounted<flutter::EmbedderPlatformMessageResponse>(
2717 std::move(platform_task_runner), response_callback));
2718 *response_out = handle;
2729 if (response ==
nullptr) {
2740 const uint8_t*
data,
2741 size_t data_length) {
2742 if (data_length != 0 &&
data ==
nullptr) {
2745 "Data size was non zero but the pointer to the data was null.");
2748 auto response = handle->
message->response();
2751 if (data_length == 0) {
2752 response->CompleteEmpty();
2754 response->Complete(std::make_unique<fml::DataMapping>(
2755 std::vector<uint8_t>({
data,
data + data_length})));
2771 int64_t texture_identifier) {
2776 if (texture_identifier == 0) {
2778 "Texture identifier was invalid.");
2781 texture_identifier)) {
2783 "Could not register the specified texture.");
2790 int64_t texture_identifier) {
2795 if (texture_identifier == 0) {
2797 "Texture identifier was invalid.");
2801 texture_identifier)) {
2803 "Could not un-register the specified texture.");
2811 int64_t texture_identifier) {
2815 if (texture_identifier == 0) {
2822 "Could not mark the texture frame as being available.");
2836 "Could not update semantics state.");
2850 "Could not update accessibility features.");
2859 const uint8_t*
data,
2860 size_t data_length) {
2867 node_id, engine_action,
2870 "Could not dispatch semantics action.");
2878 uint64_t frame_start_time_nanos,
2879 uint64_t frame_target_time_nanos) {
2893 baton, start_time, target_time)) {
2896 "Could not notify the running engine instance of a Vsync event.");
2908 TRACE_EVENT0(
"flutter",
"FlutterEngineReloadSystemFonts");
2911 ->ReloadSystemFonts()) {
2913 "Could not reload system fonts.");
2943 "Render thread callback was null.");
2949 ->PostRenderThreadTask(task)
2952 "Could not post the render thread task.");
2969 "Could not run the specified task.");
2974 const rapidjson::Document& document,
2975 const std::string& channel_name) {
2976 if (channel_name.empty()) {
2980 rapidjson::StringBuffer
buffer;
2981 rapidjson::Writer<rapidjson::StringBuffer> writer(
buffer);
2983 if (!document.Accept(writer)) {
2993 auto platform_message = std::make_unique<flutter::PlatformMessage>(
2994 channel_name.c_str(),
3001 ->SendPlatformMessage(std::move(platform_message));
3007 size_t locales_count) {
3012 if (locales_count == 0) {
3016 if (locales ==
nullptr) {
3020 rapidjson::Document document;
3021 auto& allocator = document.GetAllocator();
3023 document.SetObject();
3024 document.AddMember(
"method",
"setLocale", allocator);
3026 rapidjson::Value
args(rapidjson::kArrayType);
3027 args.Reserve(locales_count * 4, allocator);
3028 for (
size_t i = 0;
i < locales_count; ++
i) {
3030 const char* language_code_str =
SAFE_ACCESS(locale, language_code,
nullptr);
3031 if (language_code_str ==
nullptr || ::strlen(language_code_str) == 0) {
3034 "Language code is required but not present in FlutterLocale.");
3037 const char* country_code_str =
SAFE_ACCESS(locale, country_code,
"");
3038 const char* script_code_str =
SAFE_ACCESS(locale, script_code,
"");
3039 const char* variant_code_str =
SAFE_ACCESS(locale, variant_code,
"");
3041 rapidjson::Value language_code, country_code, script_code, variant_code;
3043 language_code.SetString(language_code_str, allocator);
3044 country_code.SetString(country_code_str ? country_code_str :
"", allocator);
3045 script_code.SetString(script_code_str ? script_code_str :
"", allocator);
3046 variant_code.SetString(variant_code_str ? variant_code_str :
"", allocator);
3049 args.PushBack(language_code, allocator);
3050 args.PushBack(country_code, allocator);
3051 args.PushBack(script_code, allocator);
3052 args.PushBack(variant_code, allocator);
3054 document.AddMember(
"args",
args, allocator);
3059 "Could not send message to update locale of "
3060 "a running Flutter application.");
3081 "Attempted to post to an illegal port.");
3084 if (
object ==
nullptr) {
3086 "Invalid Dart object to post.");
3092 switch (object->
type) {
3115 "kFlutterEngineDartObjectTypeString must be "
3116 "a null terminated string but was null.");
3119 dart_object.
value.
as_string =
const_cast<char*
>(
object->string_value);
3125 "kFlutterEngineDartObjectTypeBuffer must "
3126 "specify a buffer but found nullptr.");
3142 struct ExternalTypedDataPeer {
3146 auto peer =
new ExternalTypedDataPeer();
3167 +[](
void* unused_isolate_callback_data,
void* peer) {
3168 auto typed_peer =
reinterpret_cast<ExternalTypedDataPeer*
>(peer);
3169 typed_peer->trampoline(typed_peer->user_data);
3177 "Invalid FlutterEngineDartObjectType type specified.");
3182 "Could not post the object to the Dart VM.");
3187 typed_data_finalizer.
Release();
3198 engine->GetShell().NotifyLowMemoryWarning();
3200 rapidjson::Document document;
3201 auto& allocator = document.GetAllocator();
3203 document.SetObject();
3204 document.AddMember(
"type",
"memoryPressure", allocator);
3210 "Could not dispatch the low memory notification message.");
3223 "Invalid native thread callback.");
3227 ->PostTaskOnEngineManagedNativeThreads(
3233 "Internal error while attempting to post "
3234 "tasks to all threads.");
3239 size_t display_count) {
3240 std::set<FlutterEngineDisplayId> display_ids;
3241 for (
size_t i = 0;
i < display_count;
i++) {
3242 if (displays[
i].single_display && display_count != 1) {
3245 display_ids.insert(displays[
i].display_id);
3248 return display_ids.size() == display_count;
3256 size_t display_count) {
3257 if (raw_engine ==
nullptr) {
3261 if (!ValidDisplayConfiguration(embedder_displays, display_count)) {
3264 "Invalid FlutterEngineDisplay configuration specified.");
3269 switch (update_type) {
3271 std::vector<std::unique_ptr<flutter::Display>> displays;
3272 const auto* display = embedder_displays;
3273 for (
size_t i = 0;
i < display_count;
i++) {
3274 displays.push_back(std::make_unique<flutter::Display>(
3281 reinterpret_cast<const uint8_t*
>(display) + display->struct_size);
3283 engine->GetShell().OnDisplayUpdates(std::move(displays));
3289 "Invalid FlutterEngineDisplaysUpdateType type specified.");
3302 "Could not schedule frame.");
3315 "Next frame callback was null.");
3324 if (!weak_platform_view) {
3326 "Platform view unavailable.");
3340#define SET_PROC(member, function) \
3341 if (STRUCT_HAS_MEMBER(table, member)) { \
3342 table->member = &function; \
3356 SET_PROC(PlatformMessageCreateResponseHandle,
3358 SET_PROC(PlatformMessageReleaseResponseHandle,
3360 SET_PROC(SendPlatformMessageResponse,
3364 SET_PROC(MarkExternalTextureFrameAvailable,
3367 SET_PROC(UpdateAccessibilityFeatures,
3382 SET_PROC(PostCallbackOnAllNativeThreads,
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
static uint32_t buffer_size(uint32_t offset, uint32_t maxAlignment)
@ kBottomLeft_GrSurfaceOrigin
@ kTopLeft_GrSurfaceOrigin
@ kBGRA_8888_SkColorType
pixel with 8 bits for blue, green, red, alpha; in 32-bit word
@ kUnknown_SkPixelGeometry
static sk_sp< SkColorSpace > MakeSRGB()
static SkMatrix MakeAll(SkScalar scaleX, SkScalar skewX, SkScalar transX, SkScalar skewY, SkScalar scaleY, SkScalar transY, SkScalar pers0, SkScalar pers1, SkScalar pers2)
static bool IsRunningPrecompiledCode()
Checks if VM instances in the process can run precompiled code. This call can be made at any time and...
bool DispatchSemanticsAction(int node_id, flutter::SemanticsAction action, fml::MallocMapping args)
std::function< std::unique_ptr< FlutterOpenGLTexture >(int64_t, size_t, size_t)> ExternalTextureCallback
std::function< std::unique_ptr< FlutterMetalExternalTexture >(int64_t, size_t, size_t)> ExternalTextureCallback
std::function< bool(FlutterViewId view_id, const std::vector< const FlutterLayer * > &layers)> PresentCallback
std::function< std::unique_ptr< EmbedderRenderTarget >(GrDirectContext *context, const std::shared_ptr< impeller::AiksContext > &aiks_context, const FlutterBackingStoreConfig &config)> CreateRenderTargetCallback
static std::unique_ptr< EmbedderThreadHost > CreateEmbedderOrEngineManagedThreadHost(const FlutterCustomTaskRunners *custom_task_runners, const flutter::ThreadConfigSetter &config_setter=fml::Thread::SetCurrentThreadName)
std::function< void *(const char *)> GLProcResolver
static SkColorType ColorTypeFromFormat(const VkFormat format)
static void SetCacheDirectoryPath(std::string path)
static RunConfiguration InferFromSettings(const Settings &settings, const fml::RefPtr< fml::TaskRunner > &io_worker=nullptr, IsolateLaunchType launch_type=IsolateLaunchType::kNewGroup)
Attempts to infer a run configuration from the settings object. This tries to create a run configurat...
std::function< std::unique_ptr< T >(Shell &)> CreateCallback
fml::WeakPtr< PlatformView > GetPlatformView()
Platform views may only be accessed on the platform task runner.
std::function< void(intptr_t)> VsyncCallback
static std::unique_ptr< FileMapping > CreateReadExecute(const std::string &path)
static std::unique_ptr< FileMapping > CreateReadOnly(const std::string &path)
static MallocMapping Copy(const T *begin, const T *end)
void RemoveTaskObserver(intptr_t key)
void AddTaskObserver(intptr_t key, const fml::closure &callback)
static FML_EMBEDDER_ONLY MessageLoop & GetCurrent()
void RunExpiredTasksNow()
static fml::RefPtr< NativeLibrary > CreateForCurrentProcess()
static fml::RefPtr< NativeLibrary > Create(const char *path)
const uint8_t * ResolveSymbol(const char *symbol)
Wraps a closure that is invoked in the destructor unless released by the caller.
fml::closure SetClosure(const fml::closure &closure)
@ kNormal
Default priority level.
@ kRaster
Suitable for thread which raster data.
@ kBackground
Suitable for threads that shouldn't disrupt high priority work.
@ kDisplay
Suitable for threads which generate data for the display.
static void SetCurrentThreadName(const ThreadConfig &config)
static constexpr TimeDelta FromNanoseconds(int64_t nanos)
constexpr int64_t ToNanoseconds() const
TimeDelta ToEpochDelta() const
static constexpr TimePoint FromEpochDelta(TimeDelta ticks)
static ContextGLES & Cast(Context &base)
RenderTarget & SetColorAttachment(const ColorAttachment &attachment, size_t index)
RenderTarget & SetDepthAttachment(std::optional< DepthAttachment > attachment)
RenderTarget & SetStencilAttachment(std::optional< StencilAttachment > attachment)
static std::shared_ptr< TextureGLES > WrapFBO(ReactorGLES::Ref reactor, TextureDescriptor desc, GLuint fbo)
@ Dart_CObject_kTypedData
@ Dart_CObject_kExternalTypedData
DART_EXPORT bool Dart_PostCObject(Dart_Port port_id, Dart_CObject *message)
#define SET_PROC(member, function)
void FlutterEngineTraceEventInstant(const char *name)
A profiling utility. Logs a trace duration instant event to the timeline. If the timeline is unavaila...
static FlutterEngineResult InternalSendPlatformMessage(FLUTTER_API_SYMBOL(FlutterEngine) engine, const char *channel, const uint8_t *data, size_t size, FlutterDataCallback data_callback, void *user_data)
FlutterEngineResult FlutterEngineMarkExternalTextureFrameAvailable(FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
Mark that a new texture frame is available for a given texture identifier.
FlutterEngineResult FlutterEngineRunTask(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterTask *task)
Inform the engine to run the specified task. This task has been given to the engine via the FlutterTa...
FlutterEngineResult FlutterEngineOnVsync(FLUTTER_API_SYMBOL(FlutterEngine) engine, intptr_t baton, uint64_t frame_start_time_nanos, uint64_t frame_target_time_nanos)
Notify the engine that a vsync event occurred. A baton passed to the platform via the vsync callback ...
const int32_t kFlutterSemanticsNodeIdBatchEnd
const int32_t kFlutterSemanticsCustomActionIdBatchEnd
static bool IsMetalRendererConfigValid(const FlutterRendererConfig *config)
FlutterEngineResult FlutterEngineRun(size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)
Initialize and run a Flutter engine instance and return a handle to it. This is a convenience method ...
FlutterEngineResult FlutterEngineRegisterExternalTexture(FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
Register an external texture with a unique (per engine) identifier. Only rendering backends that supp...
FlutterEngineResult FlutterEngineUpdateLocales(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterLocale **locales, size_t locales_count)
Notify a running engine instance that the locale has been updated. The preferred locale must be the f...
const uint8_t kPlatformStrongDill[]
static flutter::Shell::CreateCallback< flutter::PlatformView > InferPlatformViewCreationCallback(const FlutterRendererConfig *config, void *user_data, const flutter::PlatformViewEmbedder::PlatformDispatchTable &platform_dispatch_table, std::unique_ptr< flutter::EmbedderExternalViewEmbedder > external_view_embedder, bool enable_impeller)
FlutterEngineResult FlutterEngineGetProcAddresses(FlutterEngineProcTable *table)
Gets the table of engine function pointers.
static flutter::Shell::CreateCallback< flutter::PlatformView > InferVulkanPlatformViewCreationCallback(const FlutterRendererConfig *config, void *user_data, const flutter::PlatformViewEmbedder::PlatformDispatchTable &platform_dispatch_table, std::unique_ptr< flutter::EmbedderExternalViewEmbedder > external_view_embedder)
static bool DispatchJSONPlatformMessage(FLUTTER_API_SYMBOL(FlutterEngine) engine, const rapidjson::Document &document, const std::string &channel_name)
FlutterEngineResult FlutterEngineScheduleFrame(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Schedule a new frame to redraw the content.
void FlutterEngineTraceEventDurationBegin(const char *name)
A profiling utility. Logs a trace duration begin event to the timeline. If the timeline is unavailabl...
FlutterEngineResult FlutterEngineSendWindowMetricsEvent(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterWindowMetricsEvent *flutter_metrics)
flutter::PointerData::SignalKind ToPointerDataSignalKind(FlutterPointerSignalKind kind)
static std::pair< std::unique_ptr< flutter::EmbedderExternalViewEmbedder >, bool > InferExternalViewEmbedderFromArgs(const FlutterCompositor *compositor, bool enable_impeller)
uint64_t FlutterEngineGetCurrentTime()
Get the current time in nanoseconds from the clock used by the flutter engine. This is the system mon...
static bool IsOpenGLRendererConfigValid(const FlutterRendererConfig *config)
FlutterEngineResult FlutterEngineSetNextFrameCallback(FLUTTER_API_SYMBOL(FlutterEngine) engine, VoidCallback callback, void *user_data)
Schedule a callback to be called after the next frame is drawn. This must be called from the platform...
FlutterEngineResult __FlutterEngineFlushPendingTasksNow()
This API is only meant to be used by platforms that need to flush tasks on a message loop not control...
#define LOG_EMBEDDER_ERROR(code, reason)
FlutterEngineResult FlutterEnginePostRenderThreadTask(FLUTTER_API_SYMBOL(FlutterEngine) engine, VoidCallback callback, void *baton)
Posts a task onto the Flutter render thread. Typically, this may be called from any thread as long as...
static flutter::KeyEventDeviceType MapKeyEventDeviceType(FlutterKeyEventDeviceType event_kind)
static bool IsRendererValid(const FlutterRendererConfig *config)
static std::unique_ptr< flutter::EmbedderRenderTarget > MakeRenderTargetFromBackingStoreImpeller(FlutterBackingStore backing_store, const fml::closure &on_release, const std::shared_ptr< impeller::AiksContext > &aiks_context, const FlutterBackingStoreConfig &config, const FlutterOpenGLFramebuffer *framebuffer)
std::unique_ptr< Dart_LoadedElf, LoadedElfDeleter > UniqueLoadedElf
FlutterEngineResult FlutterEngineDispatchSemanticsAction(FLUTTER_API_SYMBOL(FlutterEngine) engine, uint64_t node_id, FlutterSemanticsAction action, const uint8_t *data, size_t data_length)
Dispatch a semantics action to the specified semantics node.
FlutterEngineResult FlutterEnginePostDartObject(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterEngineDartPort port, const FlutterEngineDartObject *object)
Posts a Dart object to specified send port. The corresponding receive port for send port can be in an...
flutter::PointerData::DeviceKind ToPointerDataKind(FlutterPointerDeviceKind device_kind)
FLUTTER_EXPORT FlutterEngineResult FlutterEngineDeinitialize(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Stops running the Flutter engine instance. After this call, the embedder is also guaranteed that no m...
static sk_sp< SkSurface > MakeSkSurfaceFromBackingStore(GrDirectContext *context, const FlutterBackingStoreConfig &config, const FlutterOpenGLTexture *texture)
flutter::PointerData::Change ToPointerDataChange(FlutterPointerPhase phase)
static constexpr FlutterViewId kFlutterImplicitViewId
FlutterEngineResult FlutterEnginePostCallbackOnAllNativeThreads(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterNativeThreadCallback callback, void *user_data)
Schedule a callback to be run on all engine managed threads. The engine will attempt to service this ...
FLUTTER_EXPORT FlutterEngineResult FlutterEngineAddView(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterAddViewInfo *info)
Adds a view.
FlutterEngineResult FlutterEngineInitialize(size_t version, const FlutterRendererConfig *config, const FlutterProjectArgs *args, void *user_data, FLUTTER_API_SYMBOL(FlutterEngine) *engine_out)
Initialize a Flutter engine instance. This does not run the Flutter application code till the Flutter...
static std::unique_ptr< flutter::EmbedderRenderTarget > CreateEmbedderRenderTarget(const FlutterCompositor *compositor, const FlutterBackingStoreConfig &config, GrDirectContext *context, const std::shared_ptr< impeller::AiksContext > &aiks_context, bool enable_impeller)
flutter::PlatformViewEmbedder::UpdateSemanticsCallback CreateEmbedderSemanticsUpdateCallbackV3(FlutterUpdateSemanticsCallback2 update_semantics_callback, void *user_data)
FlutterEngineResult FlutterEngineUpdateAccessibilityFeatures(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterAccessibilityFeature flags)
Sets additional accessibility features.
FlutterEngineResult FlutterEngineShutdown(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Shuts down a Flutter engine instance. The engine handle is no longer valid for any calls in the embed...
static std::unique_ptr< flutter::EmbedderRenderTarget > MakeRenderTargetFromSkSurface(FlutterBackingStore backing_store, sk_sp< SkSurface > skia_surface, fml::closure on_release)
FlutterEngineResult FlutterPlatformMessageCreateResponseHandle(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterDataCallback data_callback, void *user_data, FlutterPlatformMessageResponseHandle **response_out)
Creates a platform message response handle that allows the embedder to set a native callback for a re...
FlutterEngineResult FlutterEngineCollectAOTData(FlutterEngineAOTData data)
Collects the AOT data.
FlutterEngineResult FlutterEngineNotifyDisplayUpdate(FLUTTER_API_SYMBOL(FlutterEngine) raw_engine, const FlutterEngineDisplaysUpdateType update_type, const FlutterEngineDisplay *embedder_displays, size_t display_count)
Posts updates corresponding to display changes to a running engine instance.
FlutterEngineResult FlutterEngineSendPlatformMessage(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessage *flutter_message)
bool FlutterEngineRunsAOTCompiledDartCode(void)
Returns if the Flutter engine instance will run AOT compiled Dart code. This call has no threading re...
FlutterEngineResult FlutterEngineReloadSystemFonts(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Reloads the system fonts in engine.
static flutter::KeyEventType MapKeyEventType(FlutterKeyEventType event_kind)
flutter::PlatformViewEmbedder::UpdateSemanticsCallback CreateEmbedderSemanticsUpdateCallback(const FlutterProjectArgs *args, void *user_data)
static flutter::Shell::CreateCallback< flutter::PlatformView > InferSoftwarePlatformViewCreationCallback(const FlutterRendererConfig *config, void *user_data, const flutter::PlatformViewEmbedder::PlatformDispatchTable &platform_dispatch_table, std::unique_ptr< flutter::EmbedderExternalViewEmbedder > external_view_embedder)
const intptr_t kPlatformStrongDillSize
flutter::PlatformViewEmbedder::UpdateSemanticsCallback CreateEmbedderSemanticsUpdateCallbackV1(FlutterUpdateSemanticsNodeCallback update_semantics_node_callback, FlutterUpdateSemanticsCustomActionCallback update_semantics_custom_action_callback, void *user_data)
FlutterEngineResult FlutterEngineSendPointerEvent(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPointerEvent *pointers, size_t events_count)
FlutterEngineResult FlutterEngineRunInitialized(FLUTTER_API_SYMBOL(FlutterEngine) engine)
Runs an initialized engine instance. An engine can be initialized via FlutterEngineInitialize....
static bool IsSoftwareRendererConfigValid(const FlutterRendererConfig *config)
static flutter::Shell::CreateCallback< flutter::PlatformView > InferOpenGLPlatformViewCreationCallback(const FlutterRendererConfig *config, void *user_data, const flutter::PlatformViewEmbedder::PlatformDispatchTable &platform_dispatch_table, std::unique_ptr< flutter::EmbedderExternalViewEmbedder > external_view_embedder, bool enable_impeller)
void PopulateJITSnapshotMappingCallbacks(const FlutterProjectArgs *args, flutter::Settings &settings)
static bool IsVulkanRendererConfigValid(const FlutterRendererConfig *config)
FlutterEngineResult FlutterEngineNotifyLowMemoryWarning(FLUTTER_API_SYMBOL(FlutterEngine) raw_engine)
Posts a low memory notification to a running engine instance. The engine will do its best to release ...
FlutterEngineResult FlutterEngineUnregisterExternalTexture(FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier)
Unregister a previous texture registration.
FlutterEngineResult FlutterEngineUpdateSemanticsEnabled(FLUTTER_API_SYMBOL(FlutterEngine) engine, bool enabled)
Enable or disable accessibility semantics.
FlutterEngineResult FlutterEngineSendKeyEvent(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterKeyEvent *event, FlutterKeyEventCallback callback, void *user_data)
Sends a key event to the engine. The framework will decide whether to handle this event in a synchron...
static flutter::Shell::CreateCallback< flutter::PlatformView > InferMetalPlatformViewCreationCallback(const FlutterRendererConfig *config, void *user_data, const flutter::PlatformViewEmbedder::PlatformDispatchTable &platform_dispatch_table, std::unique_ptr< flutter::EmbedderExternalViewEmbedder > external_view_embedder, bool enable_impeller)
static FlutterEngineResult LogEmbedderError(FlutterEngineResult code, const char *reason, const char *code_name, const char *function, const char *file, int line)
void FlutterEngineTraceEventDurationEnd(const char *name)
A profiling utility. Logs a trace duration end event to the timeline. If the timeline is unavailable ...
FlutterEngineResult FlutterEngineSendPlatformMessageResponse(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessageResponseHandle *handle, const uint8_t *data, size_t data_length)
Send a response from the native side to a platform message from the Dart Flutter application.
const char * kFlutterKeyDataChannel
FLUTTER_EXPORT FlutterEngineResult FlutterEngineRemoveView(FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterRemoveViewInfo *info)
Removes a view.
int64_t PointerDataButtonsForLegacyEvent(flutter::PointerData::Change change)
void PopulateAOTSnapshotMappingCallbacks(const FlutterProjectArgs *args, flutter::Settings &settings)
FlutterEngineResult FlutterPlatformMessageReleaseResponseHandle(FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterPlatformMessageResponseHandle *response)
Collects the handle created using FlutterPlatformMessageCreateResponseHandle.
flutter::PlatformViewEmbedder::UpdateSemanticsCallback CreateEmbedderSemanticsUpdateCallbackV2(FlutterUpdateSemanticsCallback update_semantics_callback, void *user_data)
static std::variant< flutter::ViewportMetrics, std::string > MakeViewportMetricsFromWindowMetrics(const FlutterWindowMetricsEvent *flutter_metrics)
FlutterEngineResult FlutterEngineCreateAOTData(const FlutterEngineAOTDataSource *source, FlutterEngineAOTData *data_out)
Creates the necessary data structures to launch a Flutter Dart application in AOT mode....
FlutterKeyEventDeviceType
@ kFlutterKeyEventDeviceTypeKeyboard
@ kFlutterKeyEventDeviceTypeDirectionalPad
@ kFlutterKeyEventDeviceTypeHdmi
@ kFlutterKeyEventDeviceTypeJoystick
@ kFlutterKeyEventDeviceTypeGamepad
void(* FlutterUpdateSemanticsCustomActionCallback)(const FlutterSemanticsCustomAction *, void *)
void(* FlutterUpdateSemanticsCallback)(const FlutterSemanticsUpdate *, void *)
@ kFlutterEngineAOTDataSourceTypeElfPath
struct _FlutterPlatformMessageResponseHandle FlutterPlatformMessageResponseHandle
struct _FlutterEngine * FLUTTER_API_SYMBOL(FlutterEngine)
void(* FlutterDataCallback)(const uint8_t *, size_t, void *)
FlutterPointerPhase
The phase of the pointer event.
@ kPanZoomUpdate
The pan/zoom updated.
@ kHover
The pointer moved while up.
@ kPanZoomStart
A pan/zoom started on this pointer.
@ kPanZoomEnd
The pan/zoom ended.
FlutterAccessibilityFeature
void(* FlutterNativeThreadCallback)(FlutterNativeThreadType type, void *user_data)
@ kFlutterEngineDartObjectTypeString
@ kFlutterEngineDartObjectTypeBool
@ kFlutterEngineDartObjectTypeDouble
@ kFlutterEngineDartObjectTypeInt32
@ kFlutterEngineDartObjectTypeBuffer
@ kFlutterEngineDartObjectTypeInt64
@ kFlutterEngineDartObjectTypeNull
void(* FlutterLogMessageCallback)(const char *, const char *, void *)
FlutterPointerSignalKind
The type of a pointer signal.
@ kFlutterPointerSignalKindScale
@ kFlutterPointerSignalKindScrollInertiaCancel
@ kFlutterPointerSignalKindScroll
@ kFlutterPointerSignalKindNone
void(* FlutterUpdateSemanticsNodeCallback)(const FlutterSemanticsNode *, void *)
FlutterEngineDisplaysUpdateType
@ kFlutterEngineDisplaysUpdateTypeStartup
FlutterThreadPriority
Valid values for priority of Thread.
@ kBackground
Suitable for threads that shouldn't disrupt high priority work.
@ kDisplay
Suitable for threads which generate data for the display.
@ kNormal
Default priority level.
@ kRaster
Suitable for thread which raster data.
void(* FlutterKeyEventCallback)(bool, void *)
@ kFlutterKeyEventTypeDown
@ kFlutterKeyEventTypeRepeat
void(* FlutterUpdateSemanticsCallback2)(const FlutterSemanticsUpdate2 *, void *)
int64_t FlutterEngineDartPort
@ kFlutterOpenGLTargetTypeFramebuffer
@ kFlutterOpenGLTargetTypeTexture
@ kFlutterBackingStoreTypeSoftware2
@ kFlutterBackingStoreTypeMetal
Specifies a Metal backing store. This is backed by a Metal texture.
@ kFlutterBackingStoreTypeVulkan
Specifies a Vulkan backing store. This is backed by a Vulkan VkImage.
@ kFlutterBackingStoreTypeSoftware
Specified an software allocation for Flutter to render into using the CPU.
@ kFlutterBackingStoreTypeOpenGL
#define FLUTTER_ENGINE_VERSION
FlutterPointerDeviceKind
The device type that created a pointer event.
@ kFlutterPointerDeviceKindTouch
@ kFlutterPointerDeviceKindTrackpad
@ kFlutterPointerDeviceKindStylus
@ kFlutterPointerDeviceKindMouse
#define SAFE_EXISTS(pointer, member)
Checks if the member exists and is non-null.
#define SAFE_ACCESS(pointer, member, default_value)
#define SAFE_EXISTS_ONE_OF(pointer, member1, member2)
Checks if exactly one of member1 or member2 exists and is non-null.
VkPhysicalDevice physical_device
FlutterSemanticsFlag flags
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
const uint8_t uint32_t uint32_t GError ** error
uint32_t uint32_t * format
#define FML_LOG(severity)
#define FML_DCHECK(condition)
Dart_NativeFunction function
static const char * kApplicationKernelSnapshotFileName
SK_API GrBackendRenderTarget MakeGL(int width, int height, int sampleCnt, int stencilBits, const GrGLFramebufferInfo &glInfo)
SK_API GrBackendTexture MakeGL(int width, int height, skgpu::Mipmapped, const GrGLTextureInfo &glInfo, std::string_view label={})
SK_API GrBackendTexture MakeMtl(int width, int height, skgpu::Mipmapped, const GrMtlTextureInfo &mtlInfo, std::string_view label={})
SK_API GrBackendTexture MakeVk(int width, int height, const GrVkImageInfo &, std::string_view label={})
sk_sp< const SkImage > image
sk_sp< SkBlender > blender SkRect rect
SK_API sk_sp< SkSurface > WrapPixels(const SkImageInfo &imageInfo, void *pixels, size_t rowBytes, const SkSurfaceProps *surfaceProps=nullptr)
SK_API sk_sp< SkSurface > WrapBackendRenderTarget(GrRecordingContext *context, const GrBackendRenderTarget &backendRenderTarget, GrSurfaceOrigin origin, SkColorType colorType, sk_sp< SkColorSpace > colorSpace, const SkSurfaceProps *surfaceProps, RenderTargetReleaseProc releaseProc=nullptr, ReleaseContext releaseContext=nullptr)
void(*)(ReleaseContext) RenderTargetReleaseProc
SK_API sk_sp< SkSurface > WrapBackendTexture(GrRecordingContext *context, const GrBackendTexture &backendTexture, GrSurfaceOrigin origin, int sampleCnt, SkColorType colorType, sk_sp< SkColorSpace > colorSpace, const SkSurfaceProps *surfaceProps, TextureReleaseProc textureReleaseProc=nullptr, ReleaseContext releaseContext=nullptr)
void(*)(ReleaseContext) TextureReleaseProc
const uint8_t * isolate_snapshot_data
const uint8_t * vm_snapshot_data
const uint8_t * vm_snapshot_instructions
static void Shutdown(Dart_NativeArguments args)
const uint8_t * isolate_snapshot_instructions
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service port
void * GPUMTLDeviceHandle
static void DispatchPointerDataPacket(JNIEnv *env, jobject jcaller, jlong shell_holder, jobject buffer, jint position)
std::unordered_map< int32_t, SemanticsNode > SemanticsNodeUpdates
std::unordered_map< int32_t, CustomAccessibilityAction > CustomAccessibilityActionUpdates
Settings SettingsFromCommandLine(const fml::CommandLine &command_line)
@ kPointerButtonMousePrimary
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
static void DispatchSemanticsAction(JNIEnv *env, jobject jcaller, jlong shell_holder, jint id, jint action, jobject args, jint args_position)
static void MarkTextureFrameAvailable(JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id)
DEF_SWITCHES_START aot vmservice shared library name
static void SetSemanticsEnabled(JNIEnv *env, jobject jcaller, jlong shell_holder, jboolean enabled)
@ kPointerButtonTouchContact
static void NotifyLowMemoryWarning(JNIEnv *env, jobject obj, jlong shell_holder)
static void SetViewportMetrics(JNIEnv *env, jobject jcaller, jlong shell_holder, jfloat devicePixelRatio, jint physicalWidth, jint physicalHeight, jint physicalPaddingTop, jint physicalPaddingRight, jint physicalPaddingBottom, jint physicalPaddingLeft, jint physicalViewInsetTop, jint physicalViewInsetRight, jint physicalViewInsetBottom, jint physicalViewInsetLeft, jint systemGestureInsetTop, jint systemGestureInsetRight, jint systemGestureInsetBottom, jint systemGestureInsetLeft, jint physicalTouchSlop, jintArray javaDisplayFeaturesBounds, jintArray javaDisplayFeaturesType, jintArray javaDisplayFeaturesState)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
static void ScheduleFrame(JNIEnv *env, jobject jcaller, jlong shell_holder)
static void SetAccessibilityFeatures(JNIEnv *env, jobject jcaller, jlong shell_holder, jint flags)
void * GPUMTLCommandQueueHandle
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
static void UnregisterTexture(JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id)
static void RegisterTexture(JNIEnv *env, jobject jcaller, jlong shell_holder, jlong texture_id, jobject surface_texture)
std::string JoinPaths(std::initializer_list< std::string > components)
void TraceEventInstant0(TraceArg category_group, TraceArg name, size_t flow_id_count, const uint64_t *flow_ids)
void TraceEvent0(TraceArg category_group, TraceArg name, size_t flow_id_count, const uint64_t *flow_ids)
void TraceEventEnd(TraceArg name)
CommandLine CommandLineFromArgcArgv(int argc, const char *const *argv)
internal::CopyableLambda< T > MakeCopyable(T lambda)
bool IsFile(const std::string &path)
std::function< void()> closure
void Initialize(zx::channel directory_request, std::optional< zx::eventpair > view_ref)
Initializes Dart bindings for the Fuchsia application model.
std::shared_ptr< Texture > WrapTextureMTL(TextureDescriptor desc, const void *mtl_texture, std::function< void()> deletion_proc=nullptr)
FlutterSize size
The size of the render target the engine expects to render into.
FlutterVulkanBackingStore vulkan
FlutterMetalBackingStore metal
FlutterBackingStoreType type
Specifies the type of backing store.
FlutterOpenGLBackingStore open_gl
The description of the OpenGL backing store.
FlutterSoftwareBackingStore software
The description of the software backing store.
FlutterSoftwareBackingStore2 software2
The description of the software backing store.
size_t struct_size
The size of this struct. Must be sizeof(FlutterBackingStore).
An update to whether a message channel has a listener set or not.
FlutterBackingStoreCreateCallback create_backing_store_callback
FlutterBackingStoreCollectCallback collect_backing_store_callback
A structure to represent a damage region.
size_t num_rects
The number of rectangles within the damage region.
size_t struct_size
The size of this struct. Must be sizeof(FlutterDamage).
FlutterRect * damage
The actual damage region(s) in question.
FlutterEngineDartObjectType type
const char * string_value
const FlutterEngineDartBuffer * buffer_value
Function-pointer-based versions of the APIs above.
size_t struct_size
The size of this struct. Must be sizeof(FlutterFrameInfo).
FlutterUIntSize size
The size of the surface that will be backed by the fbo.
FlutterSize size
The size of the layer (in physical pixels).
FlutterMetalTextureHandle texture
size_t struct_size
The size of this struct. Must be sizeof(FlutterMetalTexture).
VoidCallback destruction_callback
FlutterOpenGLTexture texture
A texture for Flutter to render into.
FlutterOpenGLTargetType type
FlutterOpenGLFramebuffer framebuffer
uint32_t name
The name of the framebuffer.
VoidCallback destruction_callback
void * user_data
User data to be returned on the invocation of the destruction callback.
ProcResolver gl_proc_resolver
BoolCallback make_current
BoolPresentInfoCallback present_with_info
UIntCallback fbo_callback
TextureFrameCallback gl_external_texture_frame_callback
FlutterFrameBufferWithDamageCallback populate_existing_damage
TransformationCallback surface_transformation
BoolCallback make_resource_current
UIntFrameInfoCallback fbo_with_frame_info_callback
BoolCallback clear_current
size_t struct_size
The size of this struct. Must be sizeof(FlutterPointerEvent).
size_t struct_size
The size of this struct. Must be sizeof(FlutterPresentInfo).
A structure to represent a rectangle.
FlutterVulkanRendererConfig vulkan
FlutterMetalRendererConfig metal
FlutterSoftwareRendererConfig software
FlutterOpenGLRendererConfig open_gl
FlutterSemanticsNode * nodes
size_t nodes_count
The number of semantics node updates.
size_t custom_actions_count
The number of semantics custom action updates.
FlutterSemanticsCustomAction * custom_actions
Array of semantics custom actions. Has length custom_actions_count.
VoidCallback destruction_callback
size_t row_bytes
The number of bytes in a single row of the allocation.
FlutterSoftwarePixelFormat pixel_format
VoidCallback destruction_callback
size_t row_bytes
The number of bytes in a single row of the allocation.
SoftwareSurfacePresentCallback surface_present_callback
size_t struct_size
The size of this struct. Must be sizeof(FlutterVulkanImage).
FlutterVulkanQueueHandle queue
FlutterVulkanDeviceHandle device
FlutterVulkanInstanceProcAddressCallback get_instance_proc_address_callback
size_t enabled_instance_extension_count
uint32_t queue_family_index
The queue family index of the VkQueue supplied in the next field.
FlutterVulkanImageCallback get_next_image_callback
const char ** enabled_instance_extensions
const char ** enabled_device_extensions
size_t enabled_device_extension_count
FlutterVulkanInstanceHandle instance
FlutterVulkanPresentCallback present_image_callback
FlutterVulkanPhysicalDeviceHandle physical_device
VkPhysicalDevice handle.
void operator()(Dart_LoadedElf *elf)
static constexpr SkIRect MakeEmpty()