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"
86#ifdef SHELL_ENABLE_METAL
87#include "flutter/shell/platform/embedder/embedder_surface_metal.h"
91#ifdef IMPELLER_SUPPORTS_RENDERING
92#include "flutter/shell/platform/embedder/embedder_render_target_impeller.h"
93#include "flutter/shell/platform/embedder/embedder_surface_metal_impeller.h"
100#ifdef SHELL_ENABLE_VULKAN
133 const char* code_name,
138 constexpr char kSeparator =
'\\';
140 constexpr char kSeparator =
'/';
142 const auto file_base =
143 (::strrchr(file, kSeparator) ? strrchr(file, kSeparator) + 1 : file);
144 char error[256] = {};
145 snprintf(
error, (
sizeof(
error) /
sizeof(
char)),
146 "%s (%d): '%s' returned '%s'. %s", file_base, line,
function,
148 std::cerr <<
error << std::endl;
152#define LOG_EMBEDDER_ERROR(code, reason) \
153 LogEmbedderError(code, reason, #code, __FUNCTION__, __FILE__, __LINE__)
165 fbo_with_frame_info_callback) ||
180 if (
SAFE_ACCESS(software_config, surface_present_callback,
nullptr) ==
197 SAFE_ACCESS(metal_config, present_command_queue,
nullptr);
199 bool present =
SAFE_ACCESS(metal_config, present_drawable_callback,
nullptr);
201 SAFE_ACCESS(metal_config, get_next_drawable_callback,
nullptr);
203 return device && command_queue && present && get_texture;
217 !
SAFE_EXISTS(vulkan_config, get_instance_proc_address_callback) ||
218 !
SAFE_EXISTS(vulkan_config, get_next_image_callback) ||
219 !
SAFE_EXISTS(vulkan_config, present_image_callback)) {
227 if (config ==
nullptr) {
231 switch (config->
type) {
247#if FML_OS_LINUX || FML_OS_WIN
248static void* DefaultGLProcResolver(
const char*
name) {
255 return static_cast<void*
>(
256 const_cast<uint8_t*
>(proc_library->ResolveSymbol(
name)));
260#ifdef SHELL_ENABLE_GL
275 static_cast<int32_t
>(flutter_rect.
top),
276 static_cast<int32_t
>(flutter_rect.
right),
277 static_cast<int32_t
>(flutter_rect.
bottom)};
287 platform_dispatch_table,
288 std::unique_ptr<flutter::EmbedderExternalViewEmbedder>
289 external_view_embedder,
290 bool enable_impeller) {
291#ifdef SHELL_ENABLE_GL
316 std::optional<FlutterRect> frame_damage_rect;
317 if (gl_present_info.frame_damage) {
319 SkIRectToFlutterRect(*(gl_present_info.frame_damage));
321 std::optional<FlutterRect> buffer_damage_rect;
322 if (gl_present_info.buffer_damage) {
324 SkIRectToFlutterRect(*(gl_present_info.buffer_damage));
329 .num_rects = frame_damage_rect ?
size_t{1} :
size_t{0},
330 .damage = frame_damage_rect ? &frame_damage_rect.value() :
nullptr,
334 .num_rects = buffer_damage_rect ?
size_t{1} :
size_t{0},
335 .damage = buffer_damage_rect ? &buffer_damage_rect.value() :
nullptr,
341 .fbo_id = gl_present_info.fbo_id,
342 .frame_damage = frame_damage,
343 .buffer_damage = buffer_damage,
346 return present_with_info(
user_data, &present_info);
350 auto gl_fbo_callback =
352 fbo_with_frame_info_callback =
360 frame_info.
size = {gl_frame_info.
width, gl_frame_info.height};
361 return fbo_with_frame_info_callback(
user_data, &frame_info);
365 auto gl_populate_existing_damage =
370 if (!populate_existing_damage) {
372 .
fbo_id =
static_cast<uint32_t
>(
id),
373 .existing_damage = std::nullopt,
379 populate_existing_damage(
user_data,
id, &existing_damage);
381 std::optional<SkIRect> existing_damage_rect = std::nullopt;
384 if (existing_damage.
num_rects <= 0 || existing_damage.
damage ==
nullptr) {
385 FML_LOG(INFO) <<
"No damage was provided. Forcing full repaint.";
388 for (
size_t i = 0; i < existing_damage.
num_rects; i++) {
389 existing_damage_rect->join(
390 FlutterRectToSkIRect(existing_damage.
damage[i]));
396 .
fbo_id =
static_cast<uint32_t
>(
id),
397 .existing_damage = existing_damage_rect,
402 std::function<bool()> gl_make_resource_current_callback =
nullptr;
403 if (
SAFE_ACCESS(open_gl_config, make_resource_current,
nullptr) !=
nullptr) {
404 gl_make_resource_current_callback =
410 std::function<
SkMatrix(
void)> gl_surface_transformation_callback =
nullptr;
411 if (
SAFE_ACCESS(open_gl_config, surface_transformation,
nullptr) !=
nullptr) {
412 gl_surface_transformation_callback =
416 transformation.
skewX,
418 transformation.
skewY,
421 transformation.
pers0,
422 transformation.
pers1,
429 if (external_view_embedder) {
430 external_view_embedder->SetSurfaceTransformationCallback(
431 gl_surface_transformation_callback);
436 if (
SAFE_ACCESS(open_gl_config, gl_proc_resolver,
nullptr) !=
nullptr) {
442#if FML_OS_LINUX || FML_OS_WIN
443 gl_proc_resolver = DefaultGLProcResolver;
447 bool fbo_reset_after_present =
448 SAFE_ACCESS(open_gl_config, fbo_reset_after_present,
false);
455 gl_make_resource_current_callback,
456 gl_surface_transformation_callback,
458 gl_populate_existing_damage,
462 [gl_dispatch_table, fbo_reset_after_present, platform_dispatch_table,
464 external_view_embedder =
465 std::move(external_view_embedder)](
flutter::Shell& shell)
mutable {
466 std::shared_ptr<flutter::EmbedderExternalViewEmbedder> view_embedder =
467 std::move(external_view_embedder);
468 if (enable_impeller) {
469 return std::make_unique<flutter::PlatformViewEmbedder>(
471 shell.GetTaskRunners(),
472 std::make_unique<flutter::EmbedderSurfaceGLImpeller>(
473 gl_dispatch_table, fbo_reset_after_present,
475 platform_dispatch_table,
479 return std::make_unique<flutter::PlatformViewEmbedder>(
481 shell.GetTaskRunners(),
482 std::make_unique<flutter::EmbedderSurfaceGL>(
483 gl_dispatch_table, fbo_reset_after_present,
485 platform_dispatch_table,
499 platform_dispatch_table,
500 std::unique_ptr<flutter::EmbedderExternalViewEmbedder>
501 external_view_embedder,
502 bool enable_impeller) {
507#ifdef SHELL_ENABLE_METAL
517 return ptr(
user_data, &embedder_texture);
519 auto metal_get_texture =
524 frame_info.
size = {
static_cast<uint32_t
>(frame_size.width()),
525 static_cast<uint32_t
>(frame_size.height())};
536 std::shared_ptr<flutter::EmbedderExternalViewEmbedder> view_embedder =
537 std::move(external_view_embedder);
539 std::unique_ptr<flutter::EmbedderSurface> embedder_surface;
541 if (enable_impeller) {
543 metal_dispatch_table = {
545 .get_texture = metal_get_texture,
547 embedder_surface = std::make_unique<flutter::EmbedderSurfaceMetalImpeller>(
551 metal_dispatch_table, view_embedder);
555 .get_texture = metal_get_texture,
557 embedder_surface = std::make_unique<flutter::EmbedderSurfaceMetal>(
561 metal_dispatch_table, view_embedder);
567 [embedder_surface = std::move(embedder_surface), platform_dispatch_table,
568 external_view_embedder = view_embedder](
flutter::Shell& shell)
mutable {
569 return std::make_unique<flutter::PlatformViewEmbedder>(
571 shell.GetTaskRunners(),
572 std::move(embedder_surface),
573 platform_dispatch_table,
574 std::move(external_view_embedder)
587 platform_dispatch_table,
588 std::unique_ptr<flutter::EmbedderExternalViewEmbedder>
589 external_view_embedder) {
594#ifdef SHELL_ENABLE_VULKAN
595 std::function<
void*(VkInstance,
const char*)>
596 vulkan_get_instance_proc_address =
598 VkInstance
instance,
const char* proc_name) ->
void* {
602 auto vulkan_get_next_image =
607 .size = {
static_cast<uint32_t
>(frame_size.width()),
608 static_cast<uint32_t
>(frame_size.height())},
614 auto vulkan_present_image_callback =
620 .format =
static_cast<uint32_t
>(
format),
625 auto vk_instance =
static_cast<VkInstance
>(config->
vulkan.
instance);
627 vulkan_get_instance_proc_address(vk_instance,
"vkGetInstanceProcAddr");
632 .get_next_image = vulkan_get_next_image,
633 .present_image = vulkan_present_image_callback,
636 std::shared_ptr<flutter::EmbedderExternalViewEmbedder> view_embedder =
637 std::move(external_view_embedder);
639 std::unique_ptr<flutter::EmbedderSurfaceVulkan> embedder_surface =
640 std::make_unique<flutter::EmbedderSurfaceVulkan>(
649 static_cast<VkQueue
>(config->
vulkan.
queue), vulkan_dispatch_table,
653 [embedder_surface = std::move(embedder_surface), platform_dispatch_table,
654 external_view_embedder =
656 return std::make_unique<flutter::PlatformViewEmbedder>(
658 shell.GetTaskRunners(),
659 std::move(embedder_surface),
660 platform_dispatch_table,
661 std::move(external_view_embedder)
674 platform_dispatch_table,
675 std::unique_ptr<flutter::EmbedderExternalViewEmbedder>
676 external_view_embedder) {
681 auto software_present_backing_store =
683 const void* allocation,
size_t row_bytes,
size_t height) ->
bool {
688 software_dispatch_table = {
689 software_present_backing_store,
693 [software_dispatch_table, platform_dispatch_table,
694 external_view_embedder =
695 std::move(external_view_embedder)](
flutter::Shell& shell)
mutable {
696 return std::make_unique<flutter::PlatformViewEmbedder>(
698 shell.GetTaskRunners(),
699 software_dispatch_table,
700 platform_dispatch_table,
701 std::move(external_view_embedder)
711 platform_dispatch_table,
712 std::unique_ptr<flutter::EmbedderExternalViewEmbedder>
713 external_view_embedder,
714 bool enable_impeller) {
715 if (config ==
nullptr) {
719 switch (config->
type) {
722 config,
user_data, platform_dispatch_table,
723 std::move(external_view_embedder), enable_impeller);
726 config,
user_data, platform_dispatch_table,
727 std::move(external_view_embedder));
730 config,
user_data, platform_dispatch_table,
731 std::move(external_view_embedder), enable_impeller);
734 config,
user_data, platform_dispatch_table,
735 std::move(external_view_embedder));
746#ifdef SHELL_ENABLE_GL
754 skgpu::Mipmapped::kNo, texture_info);
767 texture->destruction_callback),
772 FML_LOG(
ERROR) <<
"Could not wrap embedder supplied render texture.";
786#ifdef SHELL_ENABLE_GL
791 auto backend_render_target =
803 backend_render_target,
814 FML_LOG(
ERROR) <<
"Could not wrap embedder supplied frame-buffer.";
827 const auto image_info =
834 auto captures = std::make_unique<Captures>();
836 captures->user_data = software->
user_data;
837 auto release_proc = [](
void* pixels,
void* context) {
838 auto captures =
reinterpret_cast<Captures*
>(context);
839 if (captures->destruction_callback) {
840 captures->destruction_callback(captures->user_data);
855 <<
"Could not wrap embedder supplied software render buffer.";
883 auto captures = std::make_unique<Captures>();
885 captures->user_data = software->
user_data;
886 auto release_proc = [](
void* pixels,
void* context) {
887 auto captures =
reinterpret_cast<Captures*
>(context);
888 if (captures->destruction_callback) {
889 captures->destruction_callback(captures->user_data);
903 <<
"Could not wrap embedder supplied software render buffer.";
916#ifdef SHELL_ENABLE_METAL
917 GrMtlTextureInfo texture_info;
919 FML_LOG(
ERROR) <<
"Embedder supplied null Metal texture.";
922 sk_cfp<FlutterMetalTextureHandle> mtl_texture;
924 texture_info.fTexture = mtl_texture;
928 skgpu::Mipmapped::kNo,
950 FML_LOG(
ERROR) <<
"Could not wrap embedder supplied Metal render texture.";
960static std::unique_ptr<flutter::EmbedderRenderTarget>
964 const std::shared_ptr<impeller::AiksContext>& aiks_context,
967#if defined(SHELL_ENABLE_GL) && defined(IMPELLER_SUPPORTS_RENDERING)
969 const auto& gl_context =
976 color0_tex.
size = size;
984 gl_context.GetReactor(), color0_tex, framebuffer->
name);
992 depth_stencil_texture_desc.
size = size;
997 auto depth_stencil_tex = std::make_shared<impeller::TextureGLES>(
998 gl_context.GetReactor(), depth_stencil_texture_desc,
1003 depth0.
texture = depth_stencil_tex;
1009 stencil0.
texture = depth_stencil_tex;
1023 return std::make_unique<flutter::EmbedderRenderTargetImpeller>(
1024 backing_store, aiks_context,
1025 std::make_unique<impeller::RenderTarget>(std::move(render_target_desc)),
1026 on_release, framebuffer_destruct);
1032static std::unique_ptr<flutter::EmbedderRenderTarget>
1036 const std::shared_ptr<impeller::AiksContext>& aiks_context,
1039#if defined(SHELL_ENABLE_METAL) && defined(IMPELLER_SUPPORTS_RENDERING)
1041 FML_LOG(
ERROR) <<
"Embedder supplied null Metal texture.";
1048 resolve_tex_desc.
size = size;
1059 FML_LOG(
ERROR) <<
"Could not wrap embedder supplied Metal render texture.";
1062 resolve_tex->SetLabel(
"ImpellerBackingStoreResolve");
1068 msaa_tex_desc.
format = resolve_tex->GetTextureDescriptor().format;
1069 msaa_tex_desc.
size = size;
1073 aiks_context->GetContext()->GetResourceAllocator()->CreateTexture(
1076 FML_LOG(
ERROR) <<
"Could not allocate MSAA color texture.";
1079 msaa_tex->SetLabel(
"ImpellerBackingStoreColorMSAA");
1091 return std::make_unique<flutter::EmbedderRenderTargetImpeller>(
1092 backing_store, aiks_context,
1093 std::make_unique<impeller::RenderTarget>(std::move(render_target_desc)),
1104#ifdef SHELL_ENABLE_VULKAN
1106 FML_LOG(
ERROR) <<
"Embedder supplied null Vulkan image.";
1110 .
fImage =
reinterpret_cast<VkImage
>(
vulkan->image->image),
1134 &surface_properties,
1136 vulkan->destruction_callback),
1141 FML_LOG(
ERROR) <<
"Could not wrap embedder supplied Vulkan render texture.";
1151static std::unique_ptr<flutter::EmbedderRenderTarget>
1155 if (!skia_surface) {
1158 return std::make_unique<flutter::EmbedderRenderTargetSkia>(
1159 backing_store, std::move(skia_surface), std::move(on_release));
1162static std::unique_ptr<flutter::EmbedderRenderTarget>
1167 const std::shared_ptr<impeller::AiksContext>& aiks_context,
1168 bool enable_impeller) {
1170 backing_store.
struct_size =
sizeof(backing_store);
1178 TRACE_EVENT0(
"flutter",
"FlutterCompositorCreateBackingStore");
1179 if (!c_create_callback(&config, &backing_store, compositor->
user_data)) {
1180 FML_LOG(
ERROR) <<
"Could not create the embedder backing store.";
1185 if (backing_store.
struct_size !=
sizeof(backing_store)) {
1186 FML_LOG(
ERROR) <<
"Embedder modified the backing store struct size.";
1196 TRACE_EVENT0(
"flutter",
"FlutterCompositorCollectBackingStore");
1197 c_collect_callback(&backing_store, user_data);
1203 std::unique_ptr<flutter::EmbedderRenderTarget> render_target;
1205 switch (backing_store.
type) {
1212 backing_store, std::move(skia_surface),
1217 if (enable_impeller) {
1219 backing_store, collect_callback.
Release(), aiks_context, config,
1226 backing_store, std::move(skia_surface),
1236 context, config, &backing_store.
software);
1238 backing_store, std::move(skia_surface), collect_callback.
Release());
1243 context, config, &backing_store.
software2);
1245 backing_store, std::move(skia_surface), collect_callback.
Release());
1249 if (enable_impeller) {
1251 backing_store, collect_callback.
Release(), aiks_context, config,
1252 &backing_store.
metal);
1255 &backing_store.
metal);
1257 backing_store, std::move(skia_surface), collect_callback.
Release());
1265 backing_store, std::move(skia_surface), collect_callback.
Release());
1270 if (!render_target) {
1271 FML_LOG(
ERROR) <<
"Could not create a surface from an embedder provided "
1274 return render_target;
1277static std::pair<std::unique_ptr<flutter::EmbedderExternalViewEmbedder>,
1280 bool enable_impeller) {
1281 if (compositor ==
nullptr) {
1282 return {
nullptr,
false};
1285 auto c_create_callback =
1286 SAFE_ACCESS(compositor, create_backing_store_callback,
nullptr);
1287 auto c_collect_callback =
1288 SAFE_ACCESS(compositor, collect_backing_store_callback,
nullptr);
1289 auto c_present_callback =
1290 SAFE_ACCESS(compositor, present_layers_callback,
nullptr);
1291 auto c_present_view_callback =
1292 SAFE_ACCESS(compositor, present_view_callback,
nullptr);
1293 bool avoid_backing_store_cache =
1294 SAFE_ACCESS(compositor, avoid_backing_store_cache,
false);
1297 if (!c_create_callback || !c_collect_callback) {
1298 FML_LOG(
ERROR) <<
"Required compositor callbacks absent.";
1299 return {
nullptr,
true};
1302 if ((!c_present_view_callback && !c_present_callback) ||
1303 (c_present_view_callback && c_present_callback)) {
1304 FML_LOG(
ERROR) <<
"Either present_layers_callback or present_view_callback "
1305 "must be provided but not both.";
1306 return {
nullptr,
true};
1312 create_render_target_callback =
1313 [captured_compositor, enable_impeller](
1315 const std::shared_ptr<impeller::AiksContext>& aiks_context,
1316 const auto& config) {
1318 context, aiks_context,
1323 if (c_present_callback) {
1326 TRACE_EVENT0(
"flutter",
"FlutterCompositorPresentLayers");
1327 return c_present_callback(
const_cast<const FlutterLayer**
>(layers.data()),
1331 FML_DCHECK(c_present_view_callback !=
nullptr);
1332 present_callback = [c_present_view_callback,
1335 TRACE_EVENT0(
"flutter",
"FlutterCompositorPresentLayers");
1340 .layers =
const_cast<const FlutterLayer**
>(layers.data()),
1341 .layers_count = layers.
size(),
1345 return c_present_view_callback(&
info);
1349 return {std::make_unique<flutter::EmbedderExternalViewEmbedder>(
1350 avoid_backing_store_cache, create_render_target_callback,
1356static std::variant<flutter::ViewportMetrics, std::string>
1359 if (flutter_metrics ==
nullptr) {
1360 return "Invalid metrics handle.";
1369 SAFE_ACCESS(flutter_metrics, physical_view_inset_top, 0.0);
1371 SAFE_ACCESS(flutter_metrics, physical_view_inset_right, 0.0);
1373 SAFE_ACCESS(flutter_metrics, physical_view_inset_bottom, 0.0);
1375 SAFE_ACCESS(flutter_metrics, physical_view_inset_left, 0.0);
1379 return "Device pixel ratio was invalid. It must be greater than zero.";
1386 return "Physical view insets are invalid. They must be non-negative.";
1393 return "Physical view insets are invalid. They cannot be greater than "
1394 "physical height or width.";
1401 std::unique_ptr<flutter::PlatformMessage>
message;
1427 "AOT data can only be created in AOT mode.");
1430 }
else if (!data_out) {
1438 "Invalid ELF path specified.");
1441 auto aot_data = std::make_unique<_FlutterEngineAOTData>();
1442 const char*
error =
nullptr;
1453 &aot_data->vm_snapshot_data,
1454 &aot_data->vm_snapshot_instrs,
1455 &aot_data->vm_isolate_data,
1456 &aot_data->vm_isolate_instrs
1460 if (loaded_elf ==
nullptr) {
1464 aot_data->loaded_elf.reset(loaded_elf);
1466 *data_out = aot_data.release();
1473 "Invalid FlutterEngineAOTDataSourceType type specified.");
1491 auto make_mapping_callback = [](
const char* path,
bool executable) {
1492 return [path, executable]() {
1503 settings.vm_snapshot_data = make_mapping_callback(
1504 reinterpret_cast<const char*
>(
args->vm_snapshot_data),
false);
1507 if (
SAFE_ACCESS(
args, vm_snapshot_instructions,
nullptr) !=
nullptr) {
1508 settings.vm_snapshot_instr = make_mapping_callback(
1509 reinterpret_cast<const char*
>(
args->vm_snapshot_instructions),
true);
1513 settings.isolate_snapshot_data = make_mapping_callback(
1514 reinterpret_cast<const char*
>(
args->isolate_snapshot_data),
false);
1517 if (
SAFE_ACCESS(
args, isolate_snapshot_instructions,
nullptr) !=
nullptr) {
1518 settings.isolate_snapshot_instr = make_mapping_callback(
1519 reinterpret_cast<const char*
>(
args->isolate_snapshot_instructions),
1523#if !OS_FUCHSIA && (FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG)
1524 settings.dart_library_sources_kernel = []() {
1537 auto make_mapping_callback = [](
const uint8_t* mapping,
size_t size) {
1538 return [mapping, size]() {
1539 return std::make_unique<fml::NonOwnedMapping>(mapping, size);
1544 settings.vm_snapshot_data =
1545 make_mapping_callback(
args->aot_data->vm_snapshot_data, 0);
1547 settings.vm_snapshot_instr =
1548 make_mapping_callback(
args->aot_data->vm_snapshot_instrs, 0);
1550 settings.isolate_snapshot_data =
1551 make_mapping_callback(
args->aot_data->vm_isolate_data, 0);
1553 settings.isolate_snapshot_instr =
1554 make_mapping_callback(
args->aot_data->vm_isolate_instrs, 0);
1558 settings.vm_snapshot_data = make_mapping_callback(
1562 if (
SAFE_ACCESS(
args, vm_snapshot_instructions,
nullptr) !=
nullptr) {
1563 settings.vm_snapshot_instr = make_mapping_callback(
1564 args->vm_snapshot_instructions,
1569 settings.isolate_snapshot_data =
1570 make_mapping_callback(
args->isolate_snapshot_data,
1574 if (
SAFE_ACCESS(
args, isolate_snapshot_instructions,
nullptr) !=
nullptr) {
1575 settings.isolate_snapshot_instr = make_mapping_callback(
1576 args->isolate_snapshot_instructions,
1588 update_semantics_custom_action_callback,
1590 return [update_semantics_node_callback,
1591 update_semantics_custom_action_callback,
1598 if (update_semantics_node_callback !=
nullptr) {
1599 for (
size_t i = 0; i < update_ptr->
nodes_count; i++) {
1600 update_semantics_node_callback(&update_ptr->
nodes[i],
user_data);
1604 if (update_semantics_custom_action_callback !=
nullptr) {
1606 update_semantics_custom_action_callback(&update_ptr->
custom_actions[i],
1613 if (update_semantics_node_callback !=
nullptr) {
1618 update_semantics_node_callback(&batch_end_sentinel,
user_data);
1621 if (update_semantics_custom_action_callback !=
nullptr) {
1626 update_semantics_custom_action_callback(&batch_end_sentinel,
user_data);
1637 return [update_semantics_callback,
user_data](
1652 return [update_semantics_callback,
user_data](
1672 if (
SAFE_ACCESS(
args, update_semantics_callback2,
nullptr) !=
nullptr) {
1679 if (
SAFE_ACCESS(
args, update_semantics_callback,
nullptr) !=
nullptr) {
1688 if (
SAFE_ACCESS(
args, update_semantics_node_callback,
nullptr) !=
nullptr) {
1689 update_semantics_node_callback =
args->update_semantics_node_callback;
1693 update_semantics_custom_action_callback =
nullptr;
1694 if (
SAFE_ACCESS(
args, update_semantics_custom_action_callback,
nullptr) !=
1696 update_semantics_custom_action_callback =
1697 args->update_semantics_custom_action_callback;
1700 if (update_semantics_node_callback !=
nullptr ||
1701 update_semantics_custom_action_callback !=
nullptr) {
1703 update_semantics_node_callback, update_semantics_custom_action_callback,
1737 "Flutter embedder version mismatch. There has been a breaking change. "
1738 "Please consult the changelog and update the embedder.");
1741 if (engine_out ==
nullptr) {
1743 "The engine out parameter was missing.");
1746 if (
args ==
nullptr) {
1748 "The Flutter project arguments were missing.");
1754 "The assets path in the Flutter project arguments was missing.");
1759 <<
"FlutterProjectArgs.main_path is deprecated and should be set null.";
1763 FML_LOG(WARNING) <<
"FlutterProjectArgs.packages_path is deprecated and "
1764 "should be set null.";
1769 "The renderer configuration was invalid.");
1772 std::string icu_data_path;
1778 std::string persistent_cache_path =
1804 "Multiple AOT sources specified. Embedders should provide either "
1805 "*_snapshot_* buffers or aot_data, not both.");
1815 settings.icu_data_path = icu_data_path;
1816 settings.assets_path =
args->assets_path;
1817 settings.leak_vm = !
SAFE_ACCESS(
args, shutdown_dart_vm_when_done,
false);
1818 settings.old_gen_heap_size =
SAFE_ACCESS(
args, dart_old_gen_heap_size, -1);
1828 "Not running in AOT mode but could not resolve the kernel binary.");
1836 settings.task_observer_remove = [](intptr_t
key) {
1839 if (
SAFE_ACCESS(
args, root_isolate_create_callback,
nullptr) !=
nullptr) {
1842 settings.root_isolate_create_callback =
1849 const std::string& tag,
1858 bool has_update_semantics_2_callback =
1860 bool has_update_semantics_callback =
1862 bool has_legacy_update_semantics_callback =
1863 SAFE_ACCESS(
args, update_semantics_node_callback,
nullptr) !=
nullptr ||
1864 SAFE_ACCESS(
args, update_semantics_custom_action_callback,
nullptr) !=
1867 int semantic_callback_count = (has_update_semantics_2_callback ? 1 : 0) +
1868 (has_update_semantics_callback ? 1 : 0) +
1869 (has_legacy_update_semantics_callback ? 1 : 0);
1871 if (semantic_callback_count > 1) {
1874 "Multiple semantics update callbacks provided. "
1875 "Embedders should provide either `update_semantics_callback2`, "
1876 "`update_semantics_callback`, or both "
1877 "`update_semantics_node_callback` and "
1878 "`update_semantics_custom_action_callback`.");
1882 update_semantics_callback =
1886 platform_message_response_callback =
nullptr;
1887 if (
SAFE_ACCESS(
args, platform_message_callback,
nullptr) !=
nullptr) {
1888 platform_message_response_callback =
1889 [ptr =
args->platform_message_callback,
1899 handle->message = std::move(
message);
1900 return ptr(&incoming_message,
user_data);
1906 vsync_callback = [ptr =
args->vsync_callback,
user_data](intptr_t baton) {
1912 compute_platform_resolved_locale_callback =
nullptr;
1913 if (
SAFE_ACCESS(
args, compute_platform_resolved_locale_callback,
nullptr) !=
1915 compute_platform_resolved_locale_callback =
1916 [ptr =
args->compute_platform_resolved_locale_callback](
1917 const std::vector<std::string>& supported_locales_data) {
1918 const size_t number_of_strings_per_locale = 3;
1919 size_t locale_count =
1920 supported_locales_data.size() / number_of_strings_per_locale;
1921 std::vector<FlutterLocale> supported_locales;
1922 std::vector<const FlutterLocale*> supported_locales_ptr;
1923 for (
size_t i = 0; i < locale_count; ++i) {
1924 supported_locales.push_back(
1927 supported_locales_data[i * number_of_strings_per_locale +
1931 supported_locales_data[i * number_of_strings_per_locale +
1935 supported_locales_data[i * number_of_strings_per_locale +
1938 .variant_code =
nullptr});
1939 supported_locales_ptr.push_back(&supported_locales[i]);
1943 ptr(supported_locales_ptr.data(), locale_count);
1945 std::unique_ptr<std::vector<std::string>> out =
1946 std::make_unique<std::vector<std::string>>();
1949 if (language_code !=
"") {
1950 out->push_back(language_code);
1960 on_pre_engine_restart_callback =
nullptr;
1961 if (
SAFE_ACCESS(
args, on_pre_engine_restart_callback,
nullptr) !=
nullptr) {
1962 on_pre_engine_restart_callback = [ptr =
1963 args->on_pre_engine_restart_callback,
1970 channel_update_callback = [ptr =
args->channel_update_callback,
user_data](
1971 const std::string&
name,
bool listening) {
1980 if (external_view_embedder_result.second) {
1982 "Compositor arguments were invalid.");
1987 update_semantics_callback,
1988 platform_message_response_callback,
1990 compute_platform_resolved_locale_callback,
1991 on_pre_engine_restart_callback,
1992 channel_update_callback,
1996 config,
user_data, platform_dispatch_table,
1997 std::move(external_view_embedder_result.first), settings.enable_impeller);
1999 if (!on_create_platform_view) {
2002 "Could not infer platform view creation callback.");
2007 return std::make_unique<flutter::Rasterizer>(shell);
2011 std::unique_ptr<ExternalTextureResolver> external_texture_resolver;
2012 external_texture_resolver = std::make_unique<ExternalTextureResolver>();
2014#ifdef SHELL_ENABLE_GL
2016 external_texture_callback;
2019 if (
SAFE_ACCESS(open_gl_config, gl_external_texture_frame_callback,
2020 nullptr) !=
nullptr) {
2021 external_texture_callback =
2023 int64_t texture_identifier,
size_t width,
2024 size_t height) -> std::unique_ptr<FlutterOpenGLTexture> {
2025 std::unique_ptr<FlutterOpenGLTexture>
texture =
2026 std::make_unique<FlutterOpenGLTexture>();
2032 external_texture_resolver =
2033 std::make_unique<ExternalTextureResolver>(external_texture_callback);
2037#ifdef SHELL_ENABLE_METAL
2039 external_texture_metal_callback;
2042 if (
SAFE_ACCESS(metal_config, external_texture_frame_callback,
nullptr)) {
2043 external_texture_metal_callback =
2045 int64_t texture_identifier,
size_t width,
2046 size_t height) -> std::unique_ptr<FlutterMetalExternalTexture> {
2047 std::unique_ptr<FlutterMetalExternalTexture>
texture =
2048 std::make_unique<FlutterMetalExternalTexture>();
2055 external_texture_resolver = std::make_unique<ExternalTextureResolver>(
2056 external_texture_metal_callback);
2060 auto custom_task_runners =
SAFE_ACCESS(
args, custom_task_runners,
nullptr);
2061 auto thread_config_callback = [&custom_task_runners](
2064 if (!custom_task_runners || !custom_task_runners->thread_priority_setter) {
2068 switch (config.priority) {
2082 custom_task_runners->thread_priority_setter(priority);
2086 custom_task_runners, thread_config_callback);
2088 if (!thread_host || !thread_host->IsValid()) {
2090 "Could not set up or infer thread configuration "
2091 "to run the Flutter engine on.");
2094 auto task_runners = thread_host->GetTaskRunners();
2096 if (!task_runners.IsValid()) {
2098 "Task runner configuration was invalid.");
2101 auto run_configuration =
2105 auto dart_entrypoint = std::string{
args->custom_dart_entrypoint};
2106 if (!dart_entrypoint.empty()) {
2107 run_configuration.SetEntrypoint(std::move(dart_entrypoint));
2114 "Could not determine Dart entrypoint arguments "
2115 "as dart_entrypoint_argc "
2116 "was set, but dart_entrypoint_argv was null.");
2118 std::vector<std::string> arguments(
args->dart_entrypoint_argc);
2119 for (
int i = 0; i <
args->dart_entrypoint_argc; ++i) {
2120 arguments[i] = std::string{
args->dart_entrypoint_argv[i]};
2122 run_configuration.SetEntrypointArgs(std::move(arguments));
2125 if (!run_configuration.IsValid()) {
2128 "Could not infer the Flutter project to run from given arguments.");
2132 auto embedder_engine = std::make_unique<flutter::EmbedderEngine>(
2133 std::move(thread_host),
2134 std::move(task_runners),
2135 std::move(settings),
2136 std::move(run_configuration),
2137 on_create_platform_view,
2138 on_create_rasterizer,
2139 std::move(external_texture_resolver)
2144 embedder_engine.release());
2158 if (embedder_engine->IsValid()) {
2163 if (!embedder_engine->LaunchShell()) {
2165 "Could not launch the engine using supplied "
2166 "initialization arguments.");
2170 if (!embedder_engine->NotifyCreated()) {
2172 "Could not create platform view components.");
2176 if (!embedder_engine->RunRootIsolate()) {
2179 "Could not run the root isolate of the Flutter application using the "
2180 "project arguments specified.");
2193 if (!
info || !
info->view_metrics || !
info->add_view_callback) {
2195 "Add view info handle was invalid.");
2202 "Add view info was invalid. The implicit view cannot be added.");
2208 "Add view info was invalid. The info and "
2209 "window metric view IDs must match.");
2217 std::variant<flutter::ViewportMetrics, std::string> metrics_or_error =
2220 if (
const std::string*
error = std::get_if<std::string>(&metrics_or_error)) {
2224 auto metrics = std::get<flutter::ViewportMetrics>(metrics_or_error);
2228 if (!embedder_engine->IsValid()) {
2233 [c_callback =
info->add_view_callback,
2242 embedder_engine->GetShell().GetPlatformView()->AddView(view_id, metrics,
2254 if (!
info || !
info->remove_view_callback) {
2256 "Remove view info handle was invalid.");
2262 "Remove view info was invalid. The implicit view cannot be removed.");
2271 if (!embedder_engine->IsValid()) {
2276 [c_callback =
info->remove_view_callback,
2280 result.removed = removed;
2285 embedder_engine->GetShell().GetPlatformView()->RemoveView(
info->view_id,
2299 embedder_engine->CollectShell();
2310 delete embedder_engine;
2317 if (
engine ==
nullptr || flutter_metrics ==
nullptr) {
2323 std::variant<flutter::ViewportMetrics, std::string> metrics_or_error =
2325 if (
const std::string*
error = std::get_if<std::string>(&metrics_or_error)) {
2329 auto metrics = std::get<flutter::ViewportMetrics>(metrics_or_error);
2335 "Viewport metrics were invalid.");
2370 switch (device_kind) {
2426 size_t events_count) {
2431 if (pointers ==
nullptr || events_count == 0) {
2435 auto packet = std::make_unique<flutter::PointerDataPacket>(events_count);
2439 for (
size_t i = 0; i < events_count; ++i) {
2441 pointer_data.
Clear();
2465 if (device_kind == 0) {
2493 packet->SetPointerData(i, pointer_data);
2495 reinterpret_cast<const uint8_t*
>(current) + current->
struct_size);
2499 ->DispatchPointerDataPacket(std::move(packet))
2502 "Could not dispatch pointer events to the "
2503 "running Flutter application.");
2508 switch (event_kind) {
2521 switch (event_kind) {
2541 const char* channel,
2542 const uint8_t* data,
2572 return release_result;
2584 if (
event ==
nullptr) {
2602 auto packet = std::make_unique<flutter::KeyDataPacket>(key_data,
character);
2604 struct MessageData {
2609 MessageData* message_data =
2614 packet->data().size(),
2615 [](
const uint8_t* data,
size_t size,
void*
user_data) {
2616 auto message_data = std::unique_ptr<MessageData>(
2617 reinterpret_cast<MessageData*>(user_data));
2618 if (message_data->callback == nullptr) {
2621 bool handled =
false;
2623 handled = *data != 0;
2625 message_data->callback(handled, message_data->user_data);
2637 if (flutter_message ==
nullptr) {
2641 if (
SAFE_ACCESS(flutter_message, channel,
nullptr) ==
nullptr) {
2646 size_t message_size =
SAFE_ACCESS(flutter_message, message_size, 0);
2649 if (message_size != 0 && message_data ==
nullptr) {
2652 "Message size was non-zero but the message data was nullptr.");
2656 SAFE_ACCESS(flutter_message, response_handle,
nullptr);
2659 if (response_handle && response_handle->
message) {
2660 response = response_handle->
message->response();
2663 std::unique_ptr<flutter::PlatformMessage>
message;
2664 if (message_size == 0) {
2665 message = std::make_unique<flutter::PlatformMessage>(
2666 flutter_message->
channel, response);
2668 message = std::make_unique<flutter::PlatformMessage>(
2674 ->SendPlatformMessage(std::move(
message))
2677 "Could not send a message to the running "
2678 "Flutter application.");
2690 if (data_callback ==
nullptr || response_out ==
nullptr) {
2696 [
user_data, data_callback](
const uint8_t* data,
size_t size) {
2702 .GetPlatformTaskRunner();
2706 handle->message = std::make_unique<flutter::PlatformMessage>(
2710 fml::MakeRefCounted<flutter::EmbedderPlatformMessageResponse>(
2711 std::move(platform_task_runner), response_callback));
2712 *response_out = handle;
2723 if (response ==
nullptr) {
2734 const uint8_t* data,
2735 size_t data_length) {
2736 if (data_length != 0 && data ==
nullptr) {
2739 "Data size was non zero but the pointer to the data was null.");
2742 auto response = handle->
message->response();
2745 if (data_length == 0) {
2746 response->CompleteEmpty();
2748 response->Complete(std::make_unique<fml::DataMapping>(
2749 std::vector<uint8_t>({data, data + data_length})));
2765 int64_t texture_identifier) {
2770 if (texture_identifier == 0) {
2772 "Texture identifier was invalid.");
2775 texture_identifier)) {
2777 "Could not register the specified texture.");
2784 int64_t texture_identifier) {
2789 if (texture_identifier == 0) {
2791 "Texture identifier was invalid.");
2795 texture_identifier)) {
2797 "Could not un-register the specified texture.");
2805 int64_t texture_identifier) {
2809 if (texture_identifier == 0) {
2813 ->MarkTextureFrameAvailable(texture_identifier)) {
2816 "Could not mark the texture frame as being available.");
2830 "Could not update semantics state.");
2842 ->SetAccessibilityFeatures(
flags)) {
2844 "Could not update accessibility features.");
2853 const uint8_t* data,
2854 size_t data_length) {
2861 node_id, engine_action,
2864 "Could not dispatch semantics action.");
2872 uint64_t frame_start_time_nanos,
2873 uint64_t frame_target_time_nanos) {
2887 baton, start_time, target_time)) {
2890 "Could not notify the running engine instance of a Vsync event.");
2902 TRACE_EVENT0(
"flutter",
"FlutterEngineReloadSystemFonts");
2905 ->ReloadSystemFonts()) {
2907 "Could not reload system fonts.");
2937 "Render thread callback was null.");
2943 ->PostRenderThreadTask(task)
2946 "Could not post the render thread task.");
2963 "Could not run the specified task.");
2968 const rapidjson::Document& document,
2969 const std::string& channel_name) {
2970 if (channel_name.empty()) {
2974 rapidjson::StringBuffer
buffer;
2975 rapidjson::Writer<rapidjson::StringBuffer> writer(
buffer);
2977 if (!document.Accept(writer)) {
2987 auto platform_message = std::make_unique<flutter::PlatformMessage>(
2988 channel_name.c_str(),
2995 ->SendPlatformMessage(std::move(platform_message));
3001 size_t locales_count) {
3006 if (locales_count == 0) {
3010 if (locales ==
nullptr) {
3014 rapidjson::Document document;
3015 auto& allocator = document.GetAllocator();
3017 document.SetObject();
3018 document.AddMember(
"method",
"setLocale", allocator);
3020 rapidjson::Value
args(rapidjson::kArrayType);
3021 args.Reserve(locales_count * 4, allocator);
3022 for (
size_t i = 0; i < locales_count; ++i) {
3024 const char* language_code_str =
SAFE_ACCESS(locale, language_code,
nullptr);
3025 if (language_code_str ==
nullptr || ::strlen(language_code_str) == 0) {
3028 "Language code is required but not present in FlutterLocale.");
3031 const char* country_code_str =
SAFE_ACCESS(locale, country_code,
"");
3032 const char* script_code_str =
SAFE_ACCESS(locale, script_code,
"");
3033 const char* variant_code_str =
SAFE_ACCESS(locale, variant_code,
"");
3035 rapidjson::Value language_code, country_code, script_code, variant_code;
3037 language_code.SetString(language_code_str, allocator);
3038 country_code.SetString(country_code_str ? country_code_str :
"", allocator);
3039 script_code.SetString(script_code_str ? script_code_str :
"", allocator);
3040 variant_code.SetString(variant_code_str ? variant_code_str :
"", allocator);
3043 args.PushBack(language_code, allocator);
3044 args.PushBack(country_code, allocator);
3045 args.PushBack(script_code, allocator);
3046 args.PushBack(variant_code, allocator);
3048 document.AddMember(
"args",
args, allocator);
3053 "Could not send message to update locale of "
3054 "a running Flutter application.");
3075 "Attempted to post to an illegal port.");
3078 if (
object ==
nullptr) {
3080 "Invalid Dart object to post.");
3086 switch (object->
type) {
3109 "kFlutterEngineDartObjectTypeString must be "
3110 "a null terminated string but was null.");
3113 dart_object.
value.
as_string =
const_cast<char*
>(
object->string_value);
3119 "kFlutterEngineDartObjectTypeBuffer must "
3120 "specify a buffer but found nullptr.");
3136 struct ExternalTypedDataPeer {
3140 auto peer =
new ExternalTypedDataPeer();
3161 +[](
void* unused_isolate_callback_data,
void* peer) {
3162 auto typed_peer =
reinterpret_cast<ExternalTypedDataPeer*
>(peer);
3163 typed_peer->trampoline(typed_peer->user_data);
3171 "Invalid FlutterEngineDartObjectType type specified.");
3176 "Could not post the object to the Dart VM.");
3181 typed_data_finalizer.
Release();
3192 engine->GetShell().NotifyLowMemoryWarning();
3194 rapidjson::Document document;
3195 auto& allocator = document.GetAllocator();
3197 document.SetObject();
3198 document.AddMember(
"type",
"memoryPressure", allocator);
3204 "Could not dispatch the low memory notification message.");
3217 "Invalid native thread callback.");
3221 ->PostTaskOnEngineManagedNativeThreads(
3227 "Internal error while attempting to post "
3228 "tasks to all threads.");
3233 size_t display_count) {
3234 std::set<FlutterEngineDisplayId> display_ids;
3235 for (
size_t i = 0; i < display_count; i++) {
3236 if (displays[i].single_display && display_count != 1) {
3239 display_ids.insert(displays[i].display_id);
3242 return display_ids.size() == display_count;
3250 size_t display_count) {
3251 if (raw_engine ==
nullptr) {
3255 if (!ValidDisplayConfiguration(embedder_displays, display_count)) {
3258 "Invalid FlutterEngineDisplay configuration specified.");
3263 switch (update_type) {
3265 std::vector<std::unique_ptr<flutter::Display>> displays;
3266 const auto* display = embedder_displays;
3267 for (
size_t i = 0; i < display_count; i++) {
3268 displays.push_back(std::make_unique<flutter::Display>(
3275 reinterpret_cast<const uint8_t*
>(display) + display->struct_size);
3277 engine->GetShell().OnDisplayUpdates(std::move(displays));
3283 "Invalid FlutterEngineDisplaysUpdateType type specified.");
3296 "Could not schedule frame.");
3309 "Next frame callback was null.");
3318 if (!weak_platform_view) {
3320 "Platform view unavailable.");
3323 weak_platform_view->SetNextFrameCallback(
3334#define SET_PROC(member, function) \
3335 if (STRUCT_HAS_MEMBER(table, member)) { \
3336 table->member = &function; \
3350 SET_PROC(PlatformMessageCreateResponseHandle,
3352 SET_PROC(PlatformMessageReleaseResponseHandle,
3354 SET_PROC(SendPlatformMessageResponse,
3358 SET_PROC(MarkExternalTextureFrameAvailable,
3361 SET_PROC(UpdateAccessibilityFeatures,
3376 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)
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....
#define FLUTTER_API_SYMBOL(symbol)
FlutterKeyEventDeviceType
@ kFlutterKeyEventDeviceTypeKeyboard
@ kFlutterKeyEventDeviceTypeDirectionalPad
@ kFlutterKeyEventDeviceTypeHdmi
@ kFlutterKeyEventDeviceTypeJoystick
@ kFlutterKeyEventDeviceTypeGamepad
void(* FlutterUpdateSemanticsCustomActionCallback)(const FlutterSemanticsCustomAction *, void *)
void(* FlutterUpdateSemanticsCallback)(const FlutterSemanticsUpdate *, void *)
@ kFlutterEngineAOTDataSourceTypeElfPath
struct _FlutterPlatformMessageResponseHandle FlutterPlatformMessageResponseHandle
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
static const uint8_t buffer[]
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< 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
void * GPUMTLDeviceHandle
std::unordered_map< int32_t, SemanticsNode > SemanticsNodeUpdates
std::unordered_map< int32_t, CustomAccessibilityAction > CustomAccessibilityActionUpdates
Settings SettingsFromCommandLine(const fml::CommandLine &command_line)
@ kPointerButtonMousePrimary
@ kPointerButtonTouchContact
void * GPUMTLCommandQueueHandle
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
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()
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo MakeN32Premul(int width, int height)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
SkScalar fBottom
larger y-axis bounds
SkScalar fLeft
smaller x-axis bounds
SkScalar fRight
larger x-axis bounds
SkScalar fTop
smaller y-axis bounds
Dart_HandleFinalizer callback
union _Dart_CObject::@86 value
struct _Dart_CObject::@86::@90 as_typed_data
struct _Dart_CObject::@86::@91 as_external_typed_data
struct _Dart_CObject ** values
UniqueLoadedElf loaded_elf
const uint8_t * vm_isolate_instrs
const uint8_t * vm_snapshot_instrs
const uint8_t * vm_snapshot_data
const uint8_t * vm_isolate_data
PFN_vkGetInstanceProcAddr get_instance_proc_address
void * destruction_context
GPUMTLDestructionCallback destruction_callback
GPUMTLTextureHandle texture
KeyEventDeviceType device_type
int64_t pointer_identifier
double device_pixel_ratio
double physical_view_inset_bottom
double physical_view_inset_right
double physical_view_inset_top
double physical_view_inset_left
The ThreadConfig is the thread info include thread name, thread priority.
std::shared_ptr< Texture > resolve_texture
std::shared_ptr< Texture > texture
static constexpr Color DarkSlateGray()
A lightweight object that describes the attributes of a texture that can then used an allocator to cr...
DART_EXPORT Dart_LoadedElf * Dart_LoadELF(const char *filename, uint64_t file_offset, const char **error, const uint8_t **vm_snapshot_data, const uint8_t **vm_snapshot_instrs, const uint8_t **vm_isolate_data, const uint8_t **vm_isolate_instrs)
Please see documentation for Dart_LoadElf_Fd.
DART_EXPORT void Dart_UnloadELF(Dart_LoadedElf *loaded)
#define TRACE_EVENT0(category_group, name)
@ VK_IMAGE_LAYOUT_UNDEFINED
@ VK_IMAGE_TILING_OPTIMAL
@ VK_IMAGE_USAGE_TRANSFER_DST_BIT
@ VK_IMAGE_USAGE_SAMPLED_BIT
@ VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
@ VK_IMAGE_USAGE_TRANSFER_SRC_BIT
PFN_vkVoidFunction(VKAPI_PTR * PFN_vkGetInstanceProcAddr)(VkInstance instance, const char *pName)