Flutter Engine
The Flutter Engine
fl_engine.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "flutter/shell/platform/linux/public/flutter_linux/fl_engine.h"
6
7#include <gmodule.h>
8
9#include <cstring>
10#include <string>
11#include <vector>
12
13#include "flutter/common/constants.h"
14#include "flutter/shell/platform/common/app_lifecycle_state.h"
15#include "flutter/shell/platform/common/engine_switches.h"
16#include "flutter/shell/platform/embedder/embedder.h"
17#include "flutter/shell/platform/linux/fl_binary_messenger_private.h"
18#include "flutter/shell/platform/linux/fl_dart_project_private.h"
19#include "flutter/shell/platform/linux/fl_engine_private.h"
20#include "flutter/shell/platform/linux/fl_pixel_buffer_texture_private.h"
21#include "flutter/shell/platform/linux/fl_plugin_registrar_private.h"
22#include "flutter/shell/platform/linux/fl_renderer.h"
23#include "flutter/shell/platform/linux/fl_renderer_headless.h"
24#include "flutter/shell/platform/linux/fl_settings_plugin.h"
25#include "flutter/shell/platform/linux/fl_texture_gl_private.h"
26#include "flutter/shell/platform/linux/fl_texture_registrar_private.h"
27#include "flutter/shell/platform/linux/public/flutter_linux/fl_plugin_registry.h"
28#include "flutter/shell/platform/linux/public/flutter_linux/fl_string_codec.h"
29
30// Unique number associated with platform tasks.
31static constexpr size_t kPlatformTaskRunnerIdentifier = 1;
32
33// Use different device ID for mouse and pan/zoom events, since we can't
34// differentiate the actual device (mouse v.s. trackpad)
35static constexpr int32_t kMousePointerDeviceId = 0;
36static constexpr int32_t kPointerPanZoomDeviceId = 1;
37
38static constexpr const char* kFlutterLifecycleChannel = "flutter/lifecycle";
39
40struct _FlEngine {
42
43 // Thread the GLib main loop is running on.
44 GThread* thread;
45
46 FlDartProject* project;
47 FlRenderer* renderer;
48 FlBinaryMessenger* binary_messenger;
49 FlSettingsPlugin* settings_plugin;
50 FlTextureRegistrar* texture_registrar;
51 FlTaskRunner* task_runner;
55
56 // Function to call when a platform message is received.
60
61 // Function to call when a semantic node is received.
65
66 // Function to call right before the engine is restarted.
70};
71
73
75 FlPluginRegistryInterface* iface);
76
78 FlEngine,
79 fl_engine,
80 G_TYPE_OBJECT,
81 G_IMPLEMENT_INTERFACE(fl_plugin_registry_get_type(),
83
84enum { kProp0, kPropBinaryMessenger, kPropLast };
85
86// Parse a locale into its components.
87static void parse_locale(const gchar* locale,
88 gchar** language,
89 gchar** territory,
90 gchar** codeset,
91 gchar** modifier) {
92 gchar* l = g_strdup(locale);
93
94 // Locales are in the form "language[_territory][.codeset][@modifier]"
95 gchar* match = strrchr(l, '@');
96 if (match != nullptr) {
97 if (modifier != nullptr) {
98 *modifier = g_strdup(match + 1);
99 }
100 *match = '\0';
101 } else if (modifier != nullptr) {
102 *modifier = nullptr;
103 }
104
105 match = strrchr(l, '.');
106 if (match != nullptr) {
107 if (codeset != nullptr) {
108 *codeset = g_strdup(match + 1);
109 }
110 *match = '\0';
111 } else if (codeset != nullptr) {
112 *codeset = nullptr;
113 }
114
115 match = strrchr(l, '_');
116 if (match != nullptr) {
117 if (territory != nullptr) {
118 *territory = g_strdup(match + 1);
119 }
120 *match = '\0';
121 } else if (territory != nullptr) {
122 *territory = nullptr;
123 }
124
125 if (language != nullptr) {
126 *language = l;
127 }
128}
129
130static void set_app_lifecycle_state(FlEngine* self,
132 FlBinaryMessenger* binary_messenger = fl_engine_get_binary_messenger(self);
133
134 g_autoptr(FlValue) value =
136 g_autoptr(FlStringCodec) codec = fl_string_codec_new();
137 g_autoptr(GBytes) message =
138 fl_message_codec_encode_message(FL_MESSAGE_CODEC(codec), value, nullptr);
139
140 if (message == nullptr) {
141 return;
142 }
143
146 nullptr, nullptr, nullptr);
147}
148
149// Passes locale information to the Flutter engine.
150static void setup_locales(FlEngine* self) {
151 const gchar* const* languages = g_get_language_names();
152 g_autoptr(GPtrArray) locales_array = g_ptr_array_new_with_free_func(g_free);
153 // Helper array to take ownership of the strings passed to Flutter.
154 g_autoptr(GPtrArray) locale_strings = g_ptr_array_new_with_free_func(g_free);
155 for (int i = 0; languages[i] != nullptr; i++) {
156 gchar *language, *territory;
157 parse_locale(languages[i], &language, &territory, nullptr, nullptr);
158 if (language != nullptr) {
159 g_ptr_array_add(locale_strings, language);
160 }
161 if (territory != nullptr) {
162 g_ptr_array_add(locale_strings, territory);
163 }
164
165 FlutterLocale* locale =
166 static_cast<FlutterLocale*>(g_malloc0(sizeof(FlutterLocale)));
167 g_ptr_array_add(locales_array, locale);
168 locale->struct_size = sizeof(FlutterLocale);
169 locale->language_code = language;
170 locale->country_code = territory;
171 locale->script_code = nullptr;
172 locale->variant_code = nullptr;
173 }
174 FlutterLocale** locales =
175 reinterpret_cast<FlutterLocale**>(locales_array->pdata);
176 FlutterEngineResult result = self->embedder_api.UpdateLocales(
177 self->engine, const_cast<const FlutterLocale**>(locales),
178 locales_array->len);
179 if (result != kSuccess) {
180 g_warning("Failed to set up Flutter locales");
181 }
182}
183
184// Called when engine needs a backing store for a specific #FlutterLayer.
186 const FlutterBackingStoreConfig* config,
187 FlutterBackingStore* backing_store_out,
188 void* user_data) {
189 g_return_val_if_fail(FL_IS_RENDERER(user_data), false);
190 return fl_renderer_create_backing_store(FL_RENDERER(user_data), config,
191 backing_store_out);
192}
193
194// Called when the backing store is to be released.
197 void* user_data) {
198 g_return_val_if_fail(FL_IS_RENDERER(user_data), false);
200}
201
202// Called when embedder should composite contents of each layer onto the screen.
204 size_t layers_count,
205 void* user_data) {
206 g_return_val_if_fail(FL_IS_RENDERER(user_data), false);
207 return fl_renderer_present_layers(FL_RENDERER(user_data), layers,
208 layers_count);
209}
210
211// Flutter engine rendering callbacks.
212
213static void* fl_engine_gl_proc_resolver(void* user_data, const char* name) {
214 FlEngine* self = static_cast<FlEngine*>(user_data);
215 return fl_renderer_get_proc_address(self->renderer, name);
216}
217
219 FlEngine* self = static_cast<FlEngine*>(user_data);
221 return true;
222}
223
225 FlEngine* self = static_cast<FlEngine*>(user_data);
227 return true;
228}
229
230static uint32_t fl_engine_gl_get_fbo(void* user_data) {
231 FlEngine* self = static_cast<FlEngine*>(user_data);
232 return fl_renderer_get_fbo(self->renderer);
233}
234
235static bool fl_engine_gl_present(void* user_data) {
236 // No action required, as this is handled in
237 // compositor_present_layers_callback.
238 return true;
239}
240
242 FlEngine* self = static_cast<FlEngine*>(user_data);
244 return true;
245}
246
247// Called by the engine to retrieve an external texture.
249 void* user_data,
250 int64_t texture_id,
251 size_t width,
252 size_t height,
253 FlutterOpenGLTexture* opengl_texture) {
254 FlEngine* self = static_cast<FlEngine*>(user_data);
255 if (!self->texture_registrar) {
256 return false;
257 }
258
259 FlTexture* texture =
261 if (texture == nullptr) {
262 g_warning("Unable to find texture %" G_GINT64_FORMAT, texture_id);
263 return false;
264 }
265
266 gboolean result;
267 g_autoptr(GError) error = nullptr;
268 if (FL_IS_TEXTURE_GL(texture)) {
270 opengl_texture, &error);
271 } else if (FL_IS_PIXEL_BUFFER_TEXTURE(texture)) {
272 result =
273 fl_pixel_buffer_texture_populate(FL_PIXEL_BUFFER_TEXTURE(texture),
274 width, height, opengl_texture, &error);
275 } else {
276 g_warning("Unsupported texture type %" G_GINT64_FORMAT, texture_id);
277 return false;
278 }
279
280 if (!result) {
281 g_warning("%s", error->message);
282 return false;
283 }
284
285 return true;
286}
287
288// Called by the engine to determine if it is on the GTK thread.
290 FlEngine* self = static_cast<FlEngine*>(user_data);
291 return self->thread == g_thread_self();
292}
293
294// Called when the engine has a task to perform in the GTK thread.
296 uint64_t target_time_nanos,
297 void* user_data) {
298 FlEngine* self = static_cast<FlEngine*>(user_data);
299
300 fl_task_runner_post_task(self->task_runner, task, target_time_nanos);
301}
302
303// Called when a platform message is received from the engine.
305 void* user_data) {
306 FlEngine* self = FL_ENGINE(user_data);
307
308 gboolean handled = FALSE;
309 if (self->platform_message_handler != nullptr) {
310 g_autoptr(GBytes) data =
311 g_bytes_new(message->message, message->message_size);
312 handled = self->platform_message_handler(
313 self, message->channel, data, message->response_handle,
314 self->platform_message_handler_data);
315 }
316
317 if (!handled) {
319 nullptr, nullptr);
320 }
321}
322
323// Called when a semantic node update is received from the engine.
325 void* user_data) {
326 FlEngine* self = FL_ENGINE(user_data);
327
328 if (self->update_semantics_handler != nullptr) {
329 self->update_semantics_handler(self, update,
330 self->update_semantics_handler_data);
331 }
332}
333
334// Called right before the engine is restarted.
335//
336// This method should reset states to as if the engine has just been started,
337// which usually indicates the user has requested a hot restart (Shift-R in the
338// Flutter CLI.)
340 FlEngine* self = FL_ENGINE(user_data);
341
342 if (self->on_pre_engine_restart_handler != nullptr) {
343 self->on_pre_engine_restart_handler(
344 self, self->on_pre_engine_restart_handler_data);
345 }
346}
347
348// Called when a response to a sent platform message is received from the
349// engine.
351 size_t data_length,
352 void* user_data) {
353 g_autoptr(GTask) task = G_TASK(user_data);
354 g_task_return_pointer(task, g_bytes_new(data, data_length),
355 reinterpret_cast<GDestroyNotify>(g_bytes_unref));
356}
357
358// Implements FlPluginRegistry::get_registrar_for_plugin.
359static FlPluginRegistrar* fl_engine_get_registrar_for_plugin(
360 FlPluginRegistry* registry,
361 const gchar* name) {
362 FlEngine* self = FL_ENGINE(registry);
363
364 return fl_plugin_registrar_new(nullptr, self->binary_messenger,
365 self->texture_registrar);
366}
367
369 FlPluginRegistryInterface* iface) {
370 iface->get_registrar_for_plugin = fl_engine_get_registrar_for_plugin;
371}
372
373static void fl_engine_set_property(GObject* object,
374 guint prop_id,
375 const GValue* value,
376 GParamSpec* pspec) {
377 FlEngine* self = FL_ENGINE(object);
378 switch (prop_id) {
379 case kPropBinaryMessenger:
380 g_set_object(&self->binary_messenger,
381 FL_BINARY_MESSENGER(g_value_get_object(value)));
382 break;
383 default:
384 G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
385 break;
386 }
387}
388
389static void fl_engine_dispose(GObject* object) {
390 FlEngine* self = FL_ENGINE(object);
391
392 if (self->engine != nullptr) {
393 self->embedder_api.Shutdown(self->engine);
394 self->engine = nullptr;
395 }
396
397 if (self->aot_data != nullptr) {
398 self->embedder_api.CollectAOTData(self->aot_data);
399 self->aot_data = nullptr;
400 }
401
402 g_clear_object(&self->project);
403 g_clear_object(&self->renderer);
404 g_clear_object(&self->texture_registrar);
405 g_clear_object(&self->binary_messenger);
406 g_clear_object(&self->settings_plugin);
407 g_clear_object(&self->task_runner);
408
409 if (self->platform_message_handler_destroy_notify) {
410 self->platform_message_handler_destroy_notify(
411 self->platform_message_handler_data);
412 }
413 self->platform_message_handler_data = nullptr;
414 self->platform_message_handler_destroy_notify = nullptr;
415
416 if (self->update_semantics_handler_destroy_notify) {
417 self->update_semantics_handler_destroy_notify(
418 self->update_semantics_handler_data);
419 }
420 self->update_semantics_handler_data = nullptr;
421 self->update_semantics_handler_destroy_notify = nullptr;
422
423 if (self->on_pre_engine_restart_handler_destroy_notify) {
424 self->on_pre_engine_restart_handler_destroy_notify(
425 self->on_pre_engine_restart_handler_data);
426 }
427 self->on_pre_engine_restart_handler_data = nullptr;
428 self->on_pre_engine_restart_handler_destroy_notify = nullptr;
429
430 G_OBJECT_CLASS(fl_engine_parent_class)->dispose(object);
431}
432
433static void fl_engine_class_init(FlEngineClass* klass) {
434 G_OBJECT_CLASS(klass)->dispose = fl_engine_dispose;
435 G_OBJECT_CLASS(klass)->set_property = fl_engine_set_property;
436
437 g_object_class_install_property(
438 G_OBJECT_CLASS(klass), kPropBinaryMessenger,
439 g_param_spec_object(
440 "binary-messenger", "messenger", "Binary messenger",
441 fl_binary_messenger_get_type(),
442 static_cast<GParamFlags>(G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY |
443 G_PARAM_STATIC_STRINGS)));
444}
445
446static void fl_engine_init(FlEngine* self) {
447 self->thread = g_thread_self();
448
449 self->embedder_api.struct_size = sizeof(FlutterEngineProcTable);
450 FlutterEngineGetProcAddresses(&self->embedder_api);
451
452 self->texture_registrar = fl_texture_registrar_new(self);
453}
454
455FlEngine* fl_engine_new(FlDartProject* project, FlRenderer* renderer) {
456 g_return_val_if_fail(FL_IS_DART_PROJECT(project), nullptr);
457 g_return_val_if_fail(FL_IS_RENDERER(renderer), nullptr);
458
459 FlEngine* self = FL_ENGINE(g_object_new(fl_engine_get_type(), nullptr));
460 self->project = FL_DART_PROJECT(g_object_ref(project));
461 self->renderer = FL_RENDERER(g_object_ref(renderer));
462 self->binary_messenger = fl_binary_messenger_new(self);
463 return self;
464}
465
466G_MODULE_EXPORT FlEngine* fl_engine_new_headless(FlDartProject* project) {
467 g_autoptr(FlRendererHeadless) renderer = fl_renderer_headless_new();
468 return fl_engine_new(project, FL_RENDERER(renderer));
469}
470
471gboolean fl_engine_start(FlEngine* self, GError** error) {
472 g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
473
474 self->task_runner = fl_task_runner_new(self);
475
476 FlutterRendererConfig config = {};
477 config.type = kOpenGL;
487
488 FlutterTaskRunnerDescription platform_task_runner = {};
489 platform_task_runner.struct_size = sizeof(FlutterTaskRunnerDescription);
490 platform_task_runner.user_data = self;
491 platform_task_runner.runs_task_on_current_thread_callback =
493 platform_task_runner.post_task_callback = fl_engine_post_task;
494 platform_task_runner.identifier = kPlatformTaskRunnerIdentifier;
495
496 FlutterCustomTaskRunners custom_task_runners = {};
497 custom_task_runners.struct_size = sizeof(FlutterCustomTaskRunners);
498 custom_task_runners.platform_task_runner = &platform_task_runner;
499 custom_task_runners.render_task_runner = &platform_task_runner;
500
501 g_autoptr(GPtrArray) command_line_args = fl_engine_get_switches(self);
502 // FlutterProjectArgs expects a full argv, so when processing it for flags
503 // the first item is treated as the executable and ignored. Add a dummy value
504 // so that all switches are used.
505 g_ptr_array_insert(command_line_args, 0, g_strdup("flutter"));
506
507 gchar** dart_entrypoint_args =
509
511 args.struct_size = sizeof(FlutterProjectArgs);
512 args.assets_path = fl_dart_project_get_assets_path(self->project);
513 args.icu_data_path = fl_dart_project_get_icu_data_path(self->project);
514 args.command_line_argc = command_line_args->len;
515 args.command_line_argv =
516 reinterpret_cast<const char* const*>(command_line_args->pdata);
517 args.platform_message_callback = fl_engine_platform_message_cb;
518 args.update_semantics_callback2 = fl_engine_update_semantics_cb;
519 args.custom_task_runners = &custom_task_runners;
520 args.shutdown_dart_vm_when_done = true;
521 args.on_pre_engine_restart_callback = fl_engine_on_pre_engine_restart_cb;
522 args.dart_entrypoint_argc =
523 dart_entrypoint_args != nullptr ? g_strv_length(dart_entrypoint_args) : 0;
524 args.dart_entrypoint_argv =
525 reinterpret_cast<const char* const*>(dart_entrypoint_args);
526
527 FlutterCompositor compositor = {};
528 compositor.struct_size = sizeof(FlutterCompositor);
529 compositor.user_data = self->renderer;
535 args.compositor = &compositor;
536
537 if (self->embedder_api.RunsAOTCompiledDartCode()) {
541 if (self->embedder_api.CreateAOTData(&source, &self->aot_data) !=
542 kSuccess) {
544 "Failed to create AOT data");
545 return FALSE;
546 }
547 args.aot_data = self->aot_data;
548 }
549
550 FlutterEngineResult result = self->embedder_api.Initialize(
551 FLUTTER_ENGINE_VERSION, &config, &args, self, &self->engine);
552 if (result != kSuccess) {
554 "Failed to initialize Flutter engine");
555 return FALSE;
556 }
557
558 result = self->embedder_api.RunInitialized(self->engine);
559 if (result != kSuccess) {
561 "Failed to run Flutter engine");
562 return FALSE;
563 }
564
566
567 g_autoptr(FlSettings) settings = fl_settings_new();
568 self->settings_plugin = fl_settings_plugin_new(self);
569 fl_settings_plugin_start(self->settings_plugin, settings);
570
571 result = self->embedder_api.UpdateSemanticsEnabled(self->engine, TRUE);
572 if (result != kSuccess) {
573 g_warning("Failed to enable accessibility features on Flutter engine");
574 }
575
576 gdouble refresh_rate = fl_renderer_get_refresh_rate(self->renderer);
577 // FlutterEngineDisplay::refresh_rate expects 0 if the refresh rate is
578 // unknown.
579 if (refresh_rate <= 0.0) {
580 refresh_rate = 0.0;
581 }
582 FlutterEngineDisplay display = {};
583 display.struct_size = sizeof(FlutterEngineDisplay);
584 display.display_id = 0;
585 display.single_display = true;
586 display.refresh_rate = refresh_rate;
587
588 std::vector displays = {display};
589 result = self->embedder_api.NotifyDisplayUpdate(
590 self->engine, kFlutterEngineDisplaysUpdateTypeStartup, displays.data(),
591 displays.size());
592 if (result != kSuccess) {
593 g_warning("Failed to notify display update to Flutter engine: %d", result);
594 }
595
596 return TRUE;
597}
598
600 return &(self->embedder_api);
601}
602
604 FlEngine* self,
606 gpointer user_data,
607 GDestroyNotify destroy_notify) {
608 g_return_if_fail(FL_IS_ENGINE(self));
609 g_return_if_fail(handler != nullptr);
610
611 if (self->platform_message_handler_destroy_notify) {
612 self->platform_message_handler_destroy_notify(
613 self->platform_message_handler_data);
614 }
615
616 self->platform_message_handler = handler;
617 self->platform_message_handler_data = user_data;
618 self->platform_message_handler_destroy_notify = destroy_notify;
619}
620
622 FlEngine* self,
624 gpointer user_data,
625 GDestroyNotify destroy_notify) {
626 g_return_if_fail(FL_IS_ENGINE(self));
627
628 if (self->update_semantics_handler_destroy_notify) {
629 self->update_semantics_handler_destroy_notify(
630 self->update_semantics_handler_data);
631 }
632
633 self->update_semantics_handler = handler;
634 self->update_semantics_handler_data = user_data;
635 self->update_semantics_handler_destroy_notify = destroy_notify;
636}
637
639 FlEngine* self,
641 gpointer user_data,
642 GDestroyNotify destroy_notify) {
643 g_return_if_fail(FL_IS_ENGINE(self));
644
645 if (self->on_pre_engine_restart_handler_destroy_notify) {
646 self->on_pre_engine_restart_handler_destroy_notify(
647 self->on_pre_engine_restart_handler_data);
648 }
649
650 self->on_pre_engine_restart_handler = handler;
651 self->on_pre_engine_restart_handler_data = user_data;
652 self->on_pre_engine_restart_handler_destroy_notify = destroy_notify;
653}
654
655// Note: This function can be called from any thread.
657 FlEngine* self,
659 GBytes* response,
660 GError** error) {
661 g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
662 g_return_val_if_fail(handle != nullptr, FALSE);
663
664 if (self->engine == nullptr) {
666 "No engine to send response to");
667 return FALSE;
668 }
669
670 gsize data_length = 0;
671 const uint8_t* data = nullptr;
672 if (response != nullptr) {
673 data =
674 static_cast<const uint8_t*>(g_bytes_get_data(response, &data_length));
675 }
676 FlutterEngineResult result = self->embedder_api.SendPlatformMessageResponse(
677 self->engine, handle, data, data_length);
678
679 if (result != kSuccess) {
681 "Failed to send platform message response");
682 return FALSE;
683 }
684
685 return TRUE;
686}
687
689 const gchar* channel,
690 GBytes* message,
691 GCancellable* cancellable,
692 GAsyncReadyCallback callback,
693 gpointer user_data) {
694 g_return_if_fail(FL_IS_ENGINE(self));
695
696 GTask* task = nullptr;
697 FlutterPlatformMessageResponseHandle* response_handle = nullptr;
698 if (callback != nullptr) {
699 task = g_task_new(self, cancellable, callback, user_data);
700
701 if (self->engine == nullptr) {
702 g_task_return_new_error(task, fl_engine_error_quark(),
703 FL_ENGINE_ERROR_FAILED, "No engine to send to");
704 return;
705 }
706
708 self->embedder_api.PlatformMessageCreateResponseHandle(
710 &response_handle);
711 if (result != kSuccess) {
712 g_task_return_new_error(task, fl_engine_error_quark(),
714 "Failed to create response handle");
715 g_object_unref(task);
716 return;
717 }
718 } else if (self->engine == nullptr) {
719 return;
720 }
721
722 FlutterPlatformMessage fl_message = {};
723 fl_message.struct_size = sizeof(fl_message);
724 fl_message.channel = channel;
725 fl_message.message =
726 message != nullptr
727 ? static_cast<const uint8_t*>(g_bytes_get_data(message, nullptr))
728 : nullptr;
729 fl_message.message_size = message != nullptr ? g_bytes_get_size(message) : 0;
730 fl_message.response_handle = response_handle;
732 self->embedder_api.SendPlatformMessage(self->engine, &fl_message);
733
734 if (result != kSuccess && task != nullptr) {
735 g_task_return_new_error(task, fl_engine_error_quark(),
737 "Failed to send platform messages");
738 g_object_unref(task);
739 }
740
741 if (response_handle != nullptr) {
742 self->embedder_api.PlatformMessageReleaseResponseHandle(self->engine,
743 response_handle);
744 }
745}
746
748 GAsyncResult* result,
749 GError** error) {
750 g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
751 g_return_val_if_fail(g_task_is_valid(result, self), FALSE);
752
753 return static_cast<GBytes*>(g_task_propagate_pointer(G_TASK(result), error));
754}
755
757 gboolean visible,
758 gboolean focused) {
759 if (visible && focused) {
761 } else if (visible) {
763 } else {
765 }
766}
767
769 size_t width,
770 size_t height,
771 double pixel_ratio) {
772 g_return_if_fail(FL_IS_ENGINE(self));
773
774 if (self->engine == nullptr) {
775 return;
776 }
777
778 FlutterWindowMetricsEvent event = {};
780 event.width = width;
781 event.height = height;
782 event.pixel_ratio = pixel_ratio;
783 // TODO(dkwingsmt): Assign the correct view ID once the Linux embedder
784 // supports multiple views.
785 // https://github.com/flutter/flutter/issues/138178
786 event.view_id = flutter::kFlutterImplicitViewId;
787 self->embedder_api.SendWindowMetricsEvent(self->engine, &event);
788}
789
792 size_t timestamp,
793 double x,
794 double y,
795 FlutterPointerDeviceKind device_kind,
796 double scroll_delta_x,
797 double scroll_delta_y,
798 int64_t buttons) {
799 g_return_if_fail(FL_IS_ENGINE(self));
800
801 if (self->engine == nullptr) {
802 return;
803 }
804
805 FlutterPointerEvent fl_event = {};
806 fl_event.struct_size = sizeof(fl_event);
807 fl_event.phase = phase;
808 fl_event.timestamp = timestamp;
809 fl_event.x = x;
810 fl_event.y = y;
811 if (scroll_delta_x != 0 || scroll_delta_y != 0) {
813 }
814 fl_event.scroll_delta_x = scroll_delta_x;
815 fl_event.scroll_delta_y = scroll_delta_y;
816 fl_event.device_kind = device_kind;
817 fl_event.buttons = buttons;
818 fl_event.device = kMousePointerDeviceId;
819 // TODO(dkwingsmt): Assign the correct view ID once the Linux embedder
820 // supports multiple views.
821 // https://github.com/flutter/flutter/issues/138178
823 self->embedder_api.SendPointerEvent(self->engine, &fl_event, 1);
824}
825
827 size_t timestamp,
828 double x,
829 double y,
831 double pan_x,
832 double pan_y,
833 double scale,
834 double rotation) {
835 g_return_if_fail(FL_IS_ENGINE(self));
836
837 if (self->engine == nullptr) {
838 return;
839 }
840
841 FlutterPointerEvent fl_event = {};
842 fl_event.struct_size = sizeof(fl_event);
843 fl_event.timestamp = timestamp;
844 fl_event.x = x;
845 fl_event.y = y;
846 fl_event.phase = phase;
847 fl_event.pan_x = pan_x;
848 fl_event.pan_y = pan_y;
849 fl_event.scale = scale;
850 fl_event.rotation = rotation;
853 // TODO(dkwingsmt): Assign the correct view ID once the Linux embedder
854 // supports multiple views.
855 // https://github.com/flutter/flutter/issues/138178
857 self->embedder_api.SendPointerEvent(self->engine, &fl_event, 1);
858}
859
861 const FlutterKeyEvent* event,
863 void* user_data) {
864 g_return_if_fail(FL_IS_ENGINE(self));
865
866 if (self->engine == nullptr) {
867 return;
868 }
869
870 self->embedder_api.SendKeyEvent(self->engine, event, callback, user_data);
871}
872
874 uint64_t id,
876 GBytes* data) {
877 g_return_if_fail(FL_IS_ENGINE(self));
878
879 if (self->engine == nullptr) {
880 return;
881 }
882
883 const uint8_t* action_data = nullptr;
884 size_t action_data_length = 0;
885 if (data != nullptr) {
886 action_data = static_cast<const uint8_t*>(
887 g_bytes_get_data(data, &action_data_length));
888 }
889
890 self->embedder_api.DispatchSemanticsAction(self->engine, id, action,
891 action_data, action_data_length);
892}
893
895 int64_t texture_id) {
896 g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
897 return self->embedder_api.MarkExternalTextureFrameAvailable(
898 self->engine, texture_id) == kSuccess;
899}
900
902 int64_t texture_id) {
903 g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
904 return self->embedder_api.RegisterExternalTexture(self->engine, texture_id) ==
905 kSuccess;
906}
907
909 int64_t texture_id) {
910 g_return_val_if_fail(FL_IS_ENGINE(self), FALSE);
911 return self->embedder_api.UnregisterExternalTexture(self->engine,
913}
914
915G_MODULE_EXPORT FlBinaryMessenger* fl_engine_get_binary_messenger(
916 FlEngine* self) {
917 g_return_val_if_fail(FL_IS_ENGINE(self), nullptr);
918 return self->binary_messenger;
919}
920
921FlTaskRunner* fl_engine_get_task_runner(FlEngine* self) {
922 g_return_val_if_fail(FL_IS_ENGINE(self), nullptr);
923 return self->task_runner;
924}
925
927 g_return_if_fail(FL_IS_ENGINE(self));
928 self->embedder_api.RunTask(self->engine, task);
929}
930
931G_MODULE_EXPORT FlTextureRegistrar* fl_engine_get_texture_registrar(
932 FlEngine* self) {
933 g_return_val_if_fail(FL_IS_ENGINE(self), nullptr);
934 return self->texture_registrar;
935}
936
938 g_return_if_fail(FL_IS_ENGINE(self));
939
940 if (self->engine == nullptr) {
941 return;
942 }
943
944 self->embedder_api.UpdateAccessibilityFeatures(
945 self->engine, static_cast<FlutterAccessibilityFeature>(flags));
946}
947
948GPtrArray* fl_engine_get_switches(FlEngine* self) {
949 GPtrArray* switches = g_ptr_array_new_with_free_func(g_free);
950 for (const auto& env_switch : flutter::GetSwitchesFromEnvironment()) {
951 g_ptr_array_add(switches, g_strdup(env_switch.c_str()));
952 }
953 return switches;
954}
FlutterEngineResult FlutterEngineGetProcAddresses(FlutterEngineProcTable *table)
Gets the table of engine function pointers.
Definition: embedder.cc:3335
@ kFlutterEngineAOTDataSourceTypeElfPath
Definition: embedder.h:2110
@ kOpenGL
Definition: embedder.h:80
FlutterPointerPhase
The phase of the pointer event.
Definition: embedder.h:965
FlutterAccessibilityFeature
Definition: embedder.h:91
FlutterEngineResult
Definition: embedder.h:72
@ kSuccess
Definition: embedder.h:73
@ kFlutterPointerSignalKindScroll
Definition: embedder.h:1029
@ kFlutterEngineDisplaysUpdateTypeStartup
Definition: embedder.h:2006
FlutterSemanticsAction
Definition: embedder.h:113
void(* FlutterKeyEventCallback)(bool, void *)
Definition: embedder.h:1155
#define FLUTTER_ENGINE_VERSION
Definition: embedder.h:70
FlutterPointerDeviceKind
The device type that created a pointer event.
Definition: embedder.h:1007
@ kFlutterPointerDeviceKindTrackpad
Definition: embedder.h:1011
FlutterEngine engine
Definition: main.cc:68
SkBitmap source
Definition: examples.cpp:28
@ kPropLast
@ kProp0
AtkStateType state
FlutterSemanticsFlag flags
G_DEFINE_QUARK(fl_binary_messenger_codec_error_quark, fl_binary_messenger_codec_error) G_DECLARE_FINAL_TYPE(FlBinaryMessengerImpl
G_MODULE_EXPORT void fl_binary_messenger_send_on_channel(FlBinaryMessenger *self, const gchar *channel, GBytes *message, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
FlBinaryMessenger * fl_binary_messenger_new(FlEngine *engine)
G_MODULE_EXPORT const gchar * fl_dart_project_get_assets_path(FlDartProject *self)
G_MODULE_EXPORT const gchar * fl_dart_project_get_aot_library_path(FlDartProject *self)
G_MODULE_EXPORT const gchar * fl_dart_project_get_icu_data_path(FlDartProject *self)
G_MODULE_EXPORT gchar ** fl_dart_project_get_dart_entrypoint_arguments(FlDartProject *self)
static bool fl_engine_gl_external_texture_frame_callback(void *user_data, int64_t texture_id, size_t width, size_t height, FlutterOpenGLTexture *opengl_texture)
Definition: fl_engine.cc:248
void fl_engine_send_key_event(FlEngine *self, const FlutterKeyEvent *event, FlutterKeyEventCallback callback, void *user_data)
Definition: fl_engine.cc:860
static bool fl_engine_runs_task_on_current_thread(void *user_data)
Definition: fl_engine.cc:289
FlTaskRunner * fl_engine_get_task_runner(FlEngine *self)
Definition: fl_engine.cc:921
static void fl_engine_on_pre_engine_restart_cb(void *user_data)
Definition: fl_engine.cc:339
void fl_engine_set_platform_message_handler(FlEngine *self, FlEnginePlatformMessageHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
Definition: fl_engine.cc:603
G_DEFINE_TYPE_WITH_CODE(FlEngine, fl_engine, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE(fl_plugin_registry_get_type(), fl_engine_plugin_registry_iface_init)) enum
Definition: fl_engine.cc:77
static bool compositor_create_backing_store_callback(const FlutterBackingStoreConfig *config, FlutterBackingStore *backing_store_out, void *user_data)
Definition: fl_engine.cc:185
static bool fl_engine_gl_make_current(void *user_data)
Definition: fl_engine.cc:218
static void parse_locale(const gchar *locale, gchar **language, gchar **territory, gchar **codeset, gchar **modifier)
Definition: fl_engine.cc:87
static void * fl_engine_gl_proc_resolver(void *user_data, const char *name)
Definition: fl_engine.cc:213
FlEngine * fl_engine_new(FlDartProject *project, FlRenderer *renderer)
Definition: fl_engine.cc:455
void fl_engine_send_pointer_pan_zoom_event(FlEngine *self, size_t timestamp, double x, double y, FlutterPointerPhase phase, double pan_x, double pan_y, double scale, double rotation)
Definition: fl_engine.cc:826
static void fl_engine_dispose(GObject *object)
Definition: fl_engine.cc:389
gboolean fl_engine_mark_texture_frame_available(FlEngine *self, int64_t texture_id)
Definition: fl_engine.cc:894
static constexpr const char * kFlutterLifecycleChannel
Definition: fl_engine.cc:38
static FlPluginRegistrar * fl_engine_get_registrar_for_plugin(FlPluginRegistry *registry, const gchar *name)
Definition: fl_engine.cc:359
static void fl_engine_platform_message_response_cb(const uint8_t *data, size_t data_length, void *user_data)
Definition: fl_engine.cc:350
gboolean fl_engine_send_platform_message_response(FlEngine *self, const FlutterPlatformMessageResponseHandle *handle, GBytes *response, GError **error)
Definition: fl_engine.cc:656
static void fl_engine_init(FlEngine *self)
Definition: fl_engine.cc:446
static void fl_engine_post_task(FlutterTask task, uint64_t target_time_nanos, void *user_data)
Definition: fl_engine.cc:295
void fl_engine_set_on_pre_engine_restart_handler(FlEngine *self, FlEngineOnPreEngineRestartHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
Definition: fl_engine.cc:638
static uint32_t fl_engine_gl_get_fbo(void *user_data)
Definition: fl_engine.cc:230
gboolean fl_engine_unregister_external_texture(FlEngine *self, int64_t texture_id)
Definition: fl_engine.cc:908
void fl_engine_send_platform_message(FlEngine *self, const gchar *channel, GBytes *message, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
Definition: fl_engine.cc:688
gboolean fl_engine_register_external_texture(FlEngine *self, int64_t texture_id)
Definition: fl_engine.cc:901
G_MODULE_EXPORT FlEngine * fl_engine_new_headless(FlDartProject *project)
Definition: fl_engine.cc:466
static void fl_engine_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
Definition: fl_engine.cc:373
G_MODULE_EXPORT FlTextureRegistrar * fl_engine_get_texture_registrar(FlEngine *self)
Definition: fl_engine.cc:931
static bool fl_engine_gl_present(void *user_data)
Definition: fl_engine.cc:235
void fl_engine_set_update_semantics_handler(FlEngine *self, FlEngineUpdateSemanticsHandler handler, gpointer user_data, GDestroyNotify destroy_notify)
Definition: fl_engine.cc:621
static void set_app_lifecycle_state(FlEngine *self, const flutter::AppLifecycleState state)
Definition: fl_engine.cc:130
void fl_engine_dispatch_semantics_action(FlEngine *self, uint64_t id, FlutterSemanticsAction action, GBytes *data)
Definition: fl_engine.cc:873
GPtrArray * fl_engine_get_switches(FlEngine *self)
Definition: fl_engine.cc:948
static void setup_locales(FlEngine *self)
Definition: fl_engine.cc:150
void fl_engine_send_window_state_event(FlEngine *self, gboolean visible, gboolean focused)
Definition: fl_engine.cc:756
static bool compositor_present_layers_callback(const FlutterLayer **layers, size_t layers_count, void *user_data)
Definition: fl_engine.cc:203
static void fl_engine_update_semantics_cb(const FlutterSemanticsUpdate2 *update, void *user_data)
Definition: fl_engine.cc:324
static bool fl_engine_gl_make_resource_current(void *user_data)
Definition: fl_engine.cc:241
FlutterEngineProcTable * fl_engine_get_embedder_api(FlEngine *self)
Definition: fl_engine.cc:599
void fl_engine_update_accessibility_features(FlEngine *self, int32_t flags)
Definition: fl_engine.cc:937
static void fl_engine_platform_message_cb(const FlutterPlatformMessage *message, void *user_data)
Definition: fl_engine.cc:304
void fl_engine_execute_task(FlEngine *self, FlutterTask *task)
Definition: fl_engine.cc:926
static bool compositor_collect_backing_store_callback(const FlutterBackingStore *renderer, void *user_data)
Definition: fl_engine.cc:195
void fl_engine_send_window_metrics_event(FlEngine *self, size_t width, size_t height, double pixel_ratio)
Definition: fl_engine.cc:768
G_MODULE_EXPORT FlBinaryMessenger * fl_engine_get_binary_messenger(FlEngine *self)
Definition: fl_engine.cc:915
gboolean fl_engine_start(FlEngine *self, GError **error)
Definition: fl_engine.cc:471
void fl_engine_send_mouse_pointer_event(FlEngine *self, FlutterPointerPhase phase, size_t timestamp, double x, double y, FlutterPointerDeviceKind device_kind, double scroll_delta_x, double scroll_delta_y, int64_t buttons)
Definition: fl_engine.cc:790
static constexpr size_t kPlatformTaskRunnerIdentifier
Definition: fl_engine.cc:31
static constexpr int32_t kPointerPanZoomDeviceId
Definition: fl_engine.cc:36
static constexpr int32_t kMousePointerDeviceId
Definition: fl_engine.cc:35
static void fl_engine_class_init(FlEngineClass *klass)
Definition: fl_engine.cc:433
static bool fl_engine_gl_clear_current(void *user_data)
Definition: fl_engine.cc:224
static void fl_engine_plugin_registry_iface_init(FlPluginRegistryInterface *iface)
Definition: fl_engine.cc:368
GBytes * fl_engine_send_platform_message_finish(FlEngine *self, GAsyncResult *result, GError **error)
Definition: fl_engine.cc:747
void(* FlEngineOnPreEngineRestartHandler)(FlEngine *engine, gpointer user_data)
void(* FlEngineUpdateSemanticsHandler)(FlEngine *engine, const FlutterSemanticsUpdate2 *update, gpointer user_data)
GQuark fl_engine_error_quark(void) G_GNUC_CONST
@ FL_ENGINE_ERROR_FAILED
gboolean(* FlEnginePlatformMessageHandler)(FlEngine *engine, const gchar *channel, GBytes *message, const FlutterPlatformMessageResponseHandle *response_handle, gpointer user_data)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
FlKeyEvent * event
G_MODULE_EXPORT GBytes * fl_message_codec_encode_message(FlMessageCodec *self, FlValue *message, GError **error)
gboolean fl_pixel_buffer_texture_populate(FlPixelBufferTexture *texture, uint32_t width, uint32_t height, FlutterOpenGLTexture *opengl_texture, GError **error)
const uint8_t uint32_t uint32_t GError ** error
FlPluginRegistrar * fl_plugin_registrar_new(FlView *view, FlBinaryMessenger *messenger, FlTextureRegistrar *texture_registrar)
guint32 fl_renderer_get_fbo(FlRenderer *self)
Definition: fl_renderer.cc:161
gboolean fl_renderer_present_layers(FlRenderer *self, const FlutterLayer **layers, size_t layers_count)
Definition: fl_renderer.cc:226
void fl_renderer_make_resource_current(FlRenderer *self)
Definition: fl_renderer.cc:146
void fl_renderer_make_current(FlRenderer *self)
Definition: fl_renderer.cc:141
gdouble fl_renderer_get_refresh_rate(FlRenderer *self)
Definition: fl_renderer.cc:156
void fl_renderer_clear_current(FlRenderer *self)
Definition: fl_renderer.cc:151
gboolean fl_renderer_create_backing_store(FlRenderer *renderer, const FlutterBackingStoreConfig *config, FlutterBackingStore *backing_store_out)
Definition: fl_renderer.cc:168
void * fl_renderer_get_proc_address(FlRenderer *self, const char *name)
Definition: fl_renderer.cc:135
gboolean fl_renderer_collect_backing_store(FlRenderer *self, const FlutterBackingStore *backing_store)
Definition: fl_renderer.cc:197
FlRendererHeadless * fl_renderer_headless_new()
FlSettings * fl_settings_new()
Definition: fl_settings.cc:55
FlSettingsPlugin * fl_settings_plugin_new(FlEngine *engine)
void fl_settings_plugin_start(FlSettingsPlugin *self, FlSettings *settings)
uint8_t value
guint prop_id
guint const GValue GParamSpec * pspec
G_MODULE_EXPORT FlStringCodec * fl_string_codec_new()
FlTaskRunner * fl_task_runner_new(FlEngine *engine)
void fl_task_runner_post_task(FlTaskRunner *self, FlutterTask task, uint64_t target_time_nanos)
GAsyncResult * result
gboolean fl_texture_gl_populate(FlTextureGL *self, uint32_t width, uint32_t height, FlutterOpenGLTexture *opengl_texture, GError **error)
FlTexture * fl_texture_registrar_lookup_texture(FlTextureRegistrar *self, int64_t texture_id)
FlTextureRegistrar * fl_texture_registrar_new(FlEngine *engine)
G_MODULE_EXPORT FlValue * fl_value_new_string(const gchar *value)
Definition: fl_value.cc:276
typedefG_BEGIN_DECLS struct _FlValue FlValue
Definition: fl_value.h:42
Win32Message message
return FALSE
FlTexture * texture
double y
double x
def match(bench, filt)
Definition: benchmark.py:23
constexpr int64_t kFlutterImplicitViewId
Definition: constants.h:35
constexpr const char * AppLifecycleStateToString(AppLifecycleState state)
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
std::vector< std::string > GetSwitchesFromEnvironment()
Definition: update.py:1
int32_t height
int32_t width
const Scalar scale
FlutterBackingStoreCreateCallback create_backing_store_callback
Definition: embedder.h:1903
FlutterLayersPresentCallback present_layers_callback
Definition: embedder.h:1921
size_t struct_size
This size of this struct. Must be sizeof(FlutterCompositor).
Definition: embedder.h:1887
FlutterBackingStoreCollectCallback collect_backing_store_callback
Definition: embedder.h:1908
const FlutterTaskRunnerDescription * render_task_runner
Definition: embedder.h:1601
const FlutterTaskRunnerDescription * platform_task_runner
Definition: embedder.h:1596
size_t struct_size
The size of this struct. Must be sizeof(FlutterCustomTaskRunners).
Definition: embedder.h:1591
size_t struct_size
This size of this struct. Must be sizeof(FlutterDisplay).
Definition: embedder.h:1973
FlutterEngineDisplayId display_id
Definition: embedder.h:1975
Function-pointer-based versions of the APIs above.
Definition: embedder.h:3319
const char * language_code
Definition: embedder.h:1941
size_t struct_size
This size of this struct. Must be sizeof(FlutterLocale).
Definition: embedder.h:1937
const char * script_code
Definition: embedder.h:1951
const char * country_code
Definition: embedder.h:1946
const char * variant_code
Definition: embedder.h:1956
ProcResolver gl_proc_resolver
Definition: embedder.h:554
BoolCallback make_current
Definition: embedder.h:516
UIntCallback fbo_callback
Definition: embedder.h:530
size_t struct_size
The size of this struct. Must be sizeof(FlutterOpenGLRendererConfig).
Definition: embedder.h:515
TextureFrameCallback gl_external_texture_frame_callback
Definition: embedder.h:559
BoolCallback make_resource_current
Definition: embedder.h:537
BoolCallback clear_current
Definition: embedder.h:517
size_t struct_size
The size of this struct. Must be sizeof(FlutterPlatformMessage).
Definition: embedder.h:1164
const FlutterPlatformMessageResponseHandle * response_handle
Definition: embedder.h:1174
const char * channel
Definition: embedder.h:1165
const uint8_t * message
Definition: embedder.h:1166
double scroll_delta_y
The y offset of the scroll in physical pixels.
Definition: embedder.h:1053
int64_t buttons
The buttons currently pressed, if any.
Definition: embedder.h:1061
size_t struct_size
The size of this struct. Must be sizeof(FlutterPointerEvent).
Definition: embedder.h:1036
double scale
The scale of the pan/zoom, where 1.0 is the initial scale.
Definition: embedder.h:1067
FlutterViewId view_id
The identifier of the view that received the pointer event.
Definition: embedder.h:1071
FlutterPointerSignalKind signal_kind
Definition: embedder.h:1049
double rotation
The rotation of the pan/zoom in radians, where 0.0 is the initial angle.
Definition: embedder.h:1069
double scroll_delta_x
The x offset of the scroll in physical pixels.
Definition: embedder.h:1051
double y
The y coordinate of the pointer event in physical pixels.
Definition: embedder.h:1045
double x
The x coordinate of the pointer event in physical pixels.
Definition: embedder.h:1043
FlutterPointerDeviceKind device_kind
Definition: embedder.h:1059
double pan_x
The x offset of the pan/zoom in physical pixels.
Definition: embedder.h:1063
FlutterPointerPhase phase
Definition: embedder.h:1037
double pan_y
The y offset of the pan/zoom in physical pixels.
Definition: embedder.h:1065
FlutterOpenGLRendererConfig open_gl
Definition: embedder.h:829
FlutterRendererType type
Definition: embedder.h:827
A batch of updates to semantics nodes and custom actions.
Definition: embedder.h:1504
size_t struct_size
The size of this struct. Must be sizeof(FlutterTaskRunnerDescription).
Definition: embedder.h:1566
BoolCallback runs_task_on_current_thread_callback
Definition: embedder.h:1572
FlutterTaskRunnerPostTaskCallback post_task_callback
Definition: embedder.h:1583
size_t struct_size
The size of this struct. Must be sizeof(FlutterWindowMetricsEvent).
Definition: embedder.h:843
FlTaskRunner * task_runner
Definition: fl_engine.cc:51
gpointer update_semantics_handler_data
Definition: fl_engine.cc:63
FlEnginePlatformMessageHandler platform_message_handler
Definition: fl_engine.cc:57
GDestroyNotify platform_message_handler_destroy_notify
Definition: fl_engine.cc:59
gpointer platform_message_handler_data
Definition: fl_engine.cc:58
GThread * thread
Definition: fl_engine.cc:44
FlEngineUpdateSemanticsHandler update_semantics_handler
Definition: fl_engine.cc:62
FLUTTER_API_SYMBOL(FlutterEngine) engine
FlBinaryMessenger * binary_messenger
Definition: fl_engine.cc:48
FlRenderer * renderer
Definition: fl_engine.cc:47
FlSettingsPlugin * settings_plugin
Definition: fl_engine.cc:49
FlDartProject * project
Definition: fl_engine.cc:46
FlEngineOnPreEngineRestartHandler on_pre_engine_restart_handler
Definition: fl_engine.cc:67
GDestroyNotify on_pre_engine_restart_handler_destroy_notify
Definition: fl_engine.cc:69
GDestroyNotify update_semantics_handler_destroy_notify
Definition: fl_engine.cc:64
GObject parent_instance
Definition: fl_engine.cc:41
FlTextureRegistrar * texture_registrar
Definition: fl_engine.cc:50
gpointer on_pre_engine_restart_handler_data
Definition: fl_engine.cc:68
FlutterEngineAOTData aot_data
Definition: fl_engine.cc:52
FlutterEngineProcTable embedder_api
Definition: fl_engine.cc:54
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63
void * user_data
int64_t texture_id