#include <cstring>#include <iostream>#include <memory>#include <set>#include <string>#include <vector>#include "flutter/fml/build_config.h"#include "flutter/fml/closure.h"#include "flutter/fml/make_copyable.h"#include "flutter/fml/native_library.h"#include "flutter/fml/status_or.h"#include "flutter/fml/thread.h"#include "third_party/dart/runtime/bin/elf_loader.h"#include "third_party/dart/runtime/include/dart_native_api.h"#include "third_party/skia/include/core/SkSurface.h"#include "third_party/skia/include/gpu/GpuTypes.h"#include "third_party/skia/include/gpu/ganesh/GrBackendSurface.h"#include "third_party/skia/include/gpu/ganesh/SkSurfaceGanesh.h"#include "flutter/assets/directory_asset_bundle.h"#include "flutter/common/graphics/persistent_cache.h"#include "flutter/common/task_runners.h"#include "flutter/fml/command_line.h"#include "flutter/fml/file.h"#include "flutter/fml/message_loop.h"#include "flutter/fml/paths.h"#include "flutter/fml/trace_event.h"#include "flutter/shell/common/rasterizer.h"#include "flutter/shell/common/switches.h"#include "flutter/shell/platform/embedder/embedder.h"#include "flutter/shell/platform/embedder/embedder_engine.h"#include "flutter/shell/platform/embedder/embedder_external_texture_resolver.h"#include "flutter/shell/platform/embedder/embedder_platform_message_response.h"#include "flutter/shell/platform/embedder/embedder_render_target.h"#include "flutter/shell/platform/embedder/embedder_render_target_skia.h"#include "flutter/shell/platform/embedder/embedder_semantics_update.h"#include "flutter/shell/platform/embedder/embedder_struct_macros.h"#include "flutter/shell/platform/embedder/embedder_task_runner.h"#include "flutter/shell/platform/embedder/embedder_thread_host.h"#include "flutter/shell/platform/embedder/pixel_formats.h"#include "flutter/shell/platform/embedder/platform_view_embedder.h"#include "rapidjson/rapidjson.h"#include "rapidjson/writer.h"Go to the source code of this file.
Classes | |
| struct | _FlutterPlatformMessageResponseHandle |
| struct | LoadedElfDeleter |
| struct | _FlutterEngineAOTData |
Macros | |
| #define | FML_USED_ON_EMBEDDER |
| #define | RAPIDJSON_HAS_STDSTRING 1 |
| #define | FLUTTER_EXPORT __attribute__((visibility("default"))) |
| #define | LOG_EMBEDDER_ERROR(code, reason) LogEmbedderError(code, reason, #code, __FUNCTION__, __FILE__, __LINE__) |
| #define | SET_PROC(member, function) |
Typedefs | |
| using | UniqueLoadedElf = std::unique_ptr< Dart_LoadedElf, LoadedElfDeleter > |
Functions | |
| static FlutterEngineResult | LogEmbedderError (FlutterEngineResult code, const char *reason, const char *code_name, const char *function, const char *file, int line) |
| static bool | IsOpenGLRendererConfigValid (const FlutterRendererConfig *config) |
| static bool | IsSoftwareRendererConfigValid (const FlutterRendererConfig *config) |
| static bool | IsMetalRendererConfigValid (const FlutterRendererConfig *config) |
| static bool | IsVulkanRendererConfigValid (const FlutterRendererConfig *config) |
| static bool | IsRendererValid (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) |
| 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 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, bool enable_impeller) |
| 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) |
| 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) |
| static sk_sp< SkSurface > | MakeSkSurfaceFromBackingStore (GrDirectContext *context, const FlutterBackingStoreConfig &config, const FlutterOpenGLTexture *texture) |
| static sk_sp< SkSurface > | MakeSkSurfaceFromBackingStore (GrDirectContext *context, const FlutterBackingStoreConfig &config, const FlutterOpenGLFramebuffer *framebuffer) |
| static sk_sp< SkSurface > | MakeSkSurfaceFromBackingStore (GrDirectContext *context, const FlutterBackingStoreConfig &config, const FlutterOpenGLSurface *surface) |
| static sk_sp< SkSurface > | MakeSkSurfaceFromBackingStore (GrDirectContext *context, const FlutterBackingStoreConfig &config, const FlutterSoftwareBackingStore *software) |
| static sk_sp< SkSurface > | MakeSkSurfaceFromBackingStore (GrDirectContext *context, const FlutterBackingStoreConfig &config, const FlutterSoftwareBackingStore2 *software) |
| static sk_sp< SkSurface > | MakeSkSurfaceFromBackingStore (GrDirectContext *context, const FlutterBackingStoreConfig &config, const FlutterMetalBackingStore *metal) |
| 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) |
| 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 FlutterMetalBackingStore *metal) |
| static sk_sp< SkSurface > | MakeSkSurfaceFromBackingStore (GrDirectContext *context, const FlutterBackingStoreConfig &config, const FlutterVulkanBackingStore *vulkan) |
| static std::unique_ptr< flutter::EmbedderRenderTarget > | MakeRenderTargetFromSkSurface (FlutterBackingStore backing_store, sk_sp< SkSurface > skia_surface, fml::closure on_release, flutter::EmbedderRenderTarget::MakeOrClearCurrentCallback on_make_current, flutter::EmbedderRenderTarget::MakeOrClearCurrentCallback on_clear_current) |
| static std::unique_ptr< flutter::EmbedderRenderTarget > | MakeRenderTargetFromSkSurface (FlutterBackingStore backing_store, sk_sp< SkSurface > skia_surface, fml::closure on_release) |
| 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) |
| static fml::StatusOr< std::unique_ptr< flutter::EmbedderExternalViewEmbedder > > | InferExternalViewEmbedderFromArgs (const FlutterCompositor *compositor, bool enable_impeller) |
| 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. The data may only be collected after all FlutterEngine instances launched using this data have been terminated. | |
| FlutterEngineResult | FlutterEngineCollectAOTData (FlutterEngineAOTData data) |
| Collects the AOT data. | |
| void | PopulateJITSnapshotMappingCallbacks (const FlutterProjectArgs *args, flutter::Settings &settings) |
| void | PopulateAOTSnapshotMappingCallbacks (const FlutterProjectArgs *args, flutter::Settings &settings) |
| flutter::PlatformViewEmbedder::UpdateSemanticsCallback | CreateEmbedderSemanticsUpdateCallbackV1 (FlutterUpdateSemanticsNodeCallback update_semantics_node_callback, FlutterUpdateSemanticsCustomActionCallback update_semantics_custom_action_callback, void *user_data) |
| flutter::PlatformViewEmbedder::UpdateSemanticsCallback | CreateEmbedderSemanticsUpdateCallbackV2 (FlutterUpdateSemanticsCallback update_semantics_callback, void *user_data) |
| flutter::PlatformViewEmbedder::UpdateSemanticsCallback | CreateEmbedderSemanticsUpdateCallbackV3 (FlutterUpdateSemanticsCallback2 update_semantics_callback, void *user_data) |
| flutter::PlatformViewEmbedder::UpdateSemanticsCallback | CreateEmbedderSemanticsUpdateCallback (const FlutterProjectArgs *args, void *user_data) |
| 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 for the pair of calls to FlutterEngineInitialize and FlutterEngineRunInitialized. | |
| 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 FlutterEngineRunInitialized call is made. Besides Flutter application code, no tasks are scheduled on embedder managed task runners either. This allows embedders providing custom task runners to the Flutter engine to obtain a handle to the Flutter engine before the engine can post tasks on these task runners. | |
| FlutterEngineResult | FlutterEngineRunInitialized (FLUTTER_API_SYMBOL(FlutterEngine) engine) |
Runs an initialized engine instance. An engine can be initialized via FlutterEngineInitialize. An initialized instance can only be run once. During and after this call, custom task runners supplied by the embedder are expected to start servicing tasks. | |
| FLUTTER_EXPORT FlutterEngineResult | FlutterEngineAddView (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterAddViewInfo *info) |
| Adds a view. | |
| FLUTTER_EXPORT FlutterEngineResult | FlutterEngineRemoveView (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterRemoveViewInfo *info) |
| Removes a view. | |
| FlutterEngineResult | FlutterEngineSendViewFocusEvent (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterViewFocusEvent *event) |
| Notifies the engine that platform view focus state has changed. | |
| 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 more calls to post tasks onto custom task runners specified by the embedder are made. The Flutter engine handle still needs to be collected via a call to FlutterEngineShutdown. | |
| 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 embedder API after this point. Making additional calls with this handle is undefined behavior. | |
| FlutterEngineResult | FlutterEngineSendWindowMetricsEvent (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterWindowMetricsEvent *flutter_metrics) |
| flutter::PointerData::Change | ToPointerDataChange (FlutterPointerPhase phase) |
| flutter::PointerData::DeviceKind | ToPointerDataKind (FlutterPointerDeviceKind device_kind) |
| flutter::PointerData::SignalKind | ToPointerDataSignalKind (FlutterPointerSignalKind kind) |
| int64_t | PointerDataButtonsForLegacyEvent (flutter::PointerData::Change change) |
| FlutterEngineResult | FlutterEngineSendPointerEvent (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPointerEvent *pointers, size_t events_count) |
| static flutter::KeyEventType | MapKeyEventType (FlutterKeyEventType event_kind) |
| static flutter::KeyEventDeviceType | MapKeyEventDeviceType (FlutterKeyEventDeviceType event_kind) |
| 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 | 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 synchronous fashion, although due to technical limitation, the result is always reported asynchronously. The callback is guaranteed to be called exactly once. | |
| FlutterEngineResult | FlutterEngineSendPlatformMessage (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterPlatformMessage *flutter_message) |
| 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 response to a message. This handle may be set on the response_handle field of any FlutterPlatformMessage sent to the engine. | |
| FlutterEngineResult | FlutterPlatformMessageReleaseResponseHandle (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterPlatformMessageResponseHandle *response) |
Collects the handle created using FlutterPlatformMessageCreateResponseHandle. | |
| 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. | |
| FlutterEngineResult | __FlutterEngineFlushPendingTasksNow () |
| This API is only meant to be used by platforms that need to flush tasks on a message loop not controlled by the Flutter engine. | |
| 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 support external textures accept external texture registrations. After the external texture is registered, the application can mark that a frame is available by calling FlutterEngineMarkExternalTextureFrameAvailable. | |
| FlutterEngineResult | FlutterEngineUnregisterExternalTexture (FLUTTER_API_SYMBOL(FlutterEngine) engine, int64_t texture_identifier) |
| Unregister a previous texture registration. | |
| 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 | FlutterEngineUpdateSemanticsEnabled (FLUTTER_API_SYMBOL(FlutterEngine) engine, bool enabled) |
| Enable or disable accessibility semantics. | |
| FlutterEngineResult | FlutterEngineUpdateAccessibilityFeatures (FLUTTER_API_SYMBOL(FlutterEngine) engine, FlutterAccessibilityFeature flags) |
| Sets additional accessibility features. | |
| 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 in the implicit view. | |
| FlutterEngineResult | FlutterEngineSendSemanticsAction (FLUTTER_API_SYMBOL(FlutterEngine) engine, const FlutterSendSemanticsActionInfo *info) |
| Dispatch a semantics action to the specified semantics node within a specific view. | |
| 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 must be returned. This call must be made on the thread on which the call to FlutterEngineRun was made. | |
| FlutterEngineResult | FlutterEngineReloadSystemFonts (FLUTTER_API_SYMBOL(FlutterEngine) engine) |
| Reloads the system fonts in engine. | |
| void | FlutterEngineTraceEventDurationBegin (const char *name) |
A profiling utility. Logs a trace duration begin event to the timeline. If the timeline is unavailable or disabled, this has no effect. Must be balanced with an duration end event (via FlutterEngineTraceEventDurationEnd) with the same name on the same thread. Can be called on any thread. Strings passed into the function will NOT be copied when added to the timeline. Only string literals may be passed in. | |
| void | FlutterEngineTraceEventDurationEnd (const char *name) |
A profiling utility. Logs a trace duration end event to the timeline. If the timeline is unavailable or disabled, this has no effect. This call must be preceded by a trace duration begin call (via FlutterEngineTraceEventDurationBegin) with the same name on the same thread. Can be called on any thread. Strings passed into the function will NOT be copied when added to the timeline. Only string literals may be passed in. | |
| void | FlutterEngineTraceEventInstant (const char *name) |
| A profiling utility. Logs a trace duration instant event to the timeline. If the timeline is unavailable or disabled, this has no effect. Can be called on any thread. Strings passed into the function will NOT be copied when added to the timeline. Only string literals may be passed in. | |
| 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 a FlutterEngineShutdown on the specific engine has not already been initiated. | |
| uint64_t | FlutterEngineGetCurrentTime () |
| Get the current time in nanoseconds from the clock used by the flutter engine. This is the system monotonic clock. | |
| 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 embedder via the FlutterTaskRunnerDescription.post_task_callback. This call must only be made at the target time specified in that callback. Running the task before that time is undefined behavior. | |
| static bool | DispatchJSONPlatformMessage (FLUTTER_API_SYMBOL(FlutterEngine) engine, const rapidjson::Document &document, const std::string &channel_name) |
| 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 first item in the list of locales supplied. The other entries will be used as a fallback. | |
| bool | FlutterEngineRunsAOTCompiledDartCode (void) |
| Returns if the Flutter engine instance will run AOT compiled Dart code. This call has no threading restrictions. | |
| 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 any isolate running in the VM. This isolate can also be the root isolate for an unrelated engine. The engine parameter is necessary only to ensure the call is not made when no engine (and hence no VM) is running. | |
| 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 non-critical resources in response. It is not guaranteed that the resource would have been collected by the time this call returns however. The notification is posted to engine subsystems that may be operating on other threads. | |
| 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 callback the next time the message loop for each managed thread is idle. Since the engine manages the entire lifecycle of multiple threads, there is no opportunity for the embedders to finely tune the priorities of threads directly, or, perform other thread specific configuration (for example, setting thread names for tracing). This callback gives embedders a chance to affect such tuning. | |
| 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 | FlutterEngineScheduleFrame (FLUTTER_API_SYMBOL(FlutterEngine) engine) |
| Schedule a new frame to redraw the content. | |
| 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 thread. The callback is executed only once from the raster thread; embedders must re-thread if necessary. Performing blocking calls in this callback may introduce application jank. | |
| FlutterEngineResult | FlutterEngineGetProcAddresses (FlutterEngineProcTable *table) |
| Gets the table of engine function pointers. | |
Variables | |
| const uint8_t | kPlatformStrongDill [] |
| const intptr_t | kPlatformStrongDillSize |
| const int32_t | kFlutterSemanticsNodeIdBatchEnd = -1 |
| const int32_t | kFlutterSemanticsCustomActionIdBatchEnd = -1 |
| static constexpr FlutterViewId | kFlutterImplicitViewId = 0 |
| const char * | kFlutterKeyDataChannel = "flutter/keydata" |
| #define FLUTTER_EXPORT __attribute__((visibility("default"))) |
Definition at line 32 of file embedder.cc.
| #define FML_USED_ON_EMBEDDER |
Definition at line 5 of file embedder.cc.
| #define LOG_EMBEDDER_ERROR | ( | code, | |
| reason | |||
| ) | LogEmbedderError(code, reason, #code, __FUNCTION__, __FILE__, __LINE__) |
Definition at line 155 of file embedder.cc.
| #define RAPIDJSON_HAS_STDSTRING 1 |
Definition at line 6 of file embedder.cc.
| #define SET_PROC | ( | member, | |
| function | |||
| ) |
| using UniqueLoadedElf = std::unique_ptr<Dart_LoadedElf, LoadedElfDeleter> |
Definition at line 1672 of file embedder.cc.
| FlutterEngineResult __FlutterEngineFlushPendingTasksNow | ( | ) |
This API is only meant to be used by platforms that need to flush tasks on a message loop not controlled by the Flutter engine.
Definition at line 3105 of file embedder.cc.
References fml::MessageLoop::GetCurrent(), kSuccess, and fml::MessageLoop::RunExpiredTasksNow().
|
static |
Definition at line 1376 of file embedder.cc.
References callback, FlutterOpenGLSurface::clear_current_callback, FlutterCompositor::collect_backing_store_callback, FlutterCompositor::create_backing_store_callback, FML_LOG, FlutterOpenGLBackingStore::framebuffer, kFlutterBackingStoreTypeMetal, kFlutterBackingStoreTypeOpenGL, kFlutterBackingStoreTypeSoftware, kFlutterBackingStoreTypeSoftware2, kFlutterBackingStoreTypeVulkan, kFlutterOpenGLTargetTypeFramebuffer, kFlutterOpenGLTargetTypeSurface, kFlutterOpenGLTargetTypeTexture, FlutterOpenGLSurface::make_current_callback, MakeRenderTargetFromBackingStoreImpeller(), MakeRenderTargetFromSkSurface(), MakeSkSurfaceFromBackingStore(), FlutterBackingStore::metal, FlutterBackingStore::open_gl, fml::ScopedCleanupClosure::Release(), FlutterBackingStore::software, FlutterBackingStore::software2, FlutterBackingStore::struct_size, FlutterOpenGLBackingStore::surface, FlutterOpenGLBackingStore::texture, TRACE_EVENT0, FlutterOpenGLBackingStore::type, FlutterBackingStore::type, user_data, FlutterOpenGLSurface::user_data, FlutterCompositor::user_data, and FlutterBackingStore::vulkan.
Referenced by InferExternalViewEmbedderFromArgs().
| flutter::PlatformViewEmbedder::UpdateSemanticsCallback CreateEmbedderSemanticsUpdateCallback | ( | const FlutterProjectArgs * | args, |
| void * | user_data | ||
| ) |
Definition at line 1925 of file embedder.cc.
References args, CreateEmbedderSemanticsUpdateCallbackV1(), CreateEmbedderSemanticsUpdateCallbackV2(), CreateEmbedderSemanticsUpdateCallbackV3(), SAFE_ACCESS, and user_data.
Referenced by FlutterEngineInitialize().
| flutter::PlatformViewEmbedder::UpdateSemanticsCallback CreateEmbedderSemanticsUpdateCallbackV1 | ( | FlutterUpdateSemanticsNodeCallback | update_semantics_node_callback, |
| FlutterUpdateSemanticsCustomActionCallback | update_semantics_custom_action_callback, | ||
| void * | user_data | ||
| ) |
Definition at line 1845 of file embedder.cc.
References FlutterSemanticsUpdate::custom_actions, FlutterSemanticsUpdate::custom_actions_count, i, kFlutterSemanticsCustomActionIdBatchEnd, kFlutterSemanticsNodeIdBatchEnd, FlutterSemanticsUpdate::nodes, FlutterSemanticsUpdate::nodes_count, user_data, and view_id.
Referenced by CreateEmbedderSemanticsUpdateCallback().
| flutter::PlatformViewEmbedder::UpdateSemanticsCallback CreateEmbedderSemanticsUpdateCallbackV2 | ( | FlutterUpdateSemanticsCallback | update_semantics_callback, |
| void * | user_data | ||
| ) |
Definition at line 1894 of file embedder.cc.
References user_data, and view_id.
Referenced by CreateEmbedderSemanticsUpdateCallback().
| flutter::PlatformViewEmbedder::UpdateSemanticsCallback CreateEmbedderSemanticsUpdateCallbackV3 | ( | FlutterUpdateSemanticsCallback2 | update_semantics_callback, |
| void * | user_data | ||
| ) |
Definition at line 1909 of file embedder.cc.
References user_data, and view_id.
Referenced by CreateEmbedderSemanticsUpdateCallback().
|
static |
Definition at line 3333 of file embedder.cc.
References fml::MallocMapping::Copy(), engine, and message.
Referenced by FlutterEngineNotifyLowMemoryWarning(), and FlutterEngineUpdateLocales().
| FLUTTER_EXPORT FlutterEngineResult FlutterEngineAddView | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
| const FlutterAddViewInfo * | info | ||
| ) |
Adds a view.
This is an asynchronous operation. The view should not be used
until the |info.add_view_callback| is invoked with an |added|
value of true. The embedder should prepare resources in advance
but be ready to clean up on failure.
A frame is scheduled if the operation succeeds.
The callback is invoked on a thread managed by the engine. The
embedder should re-thread if needed.
Attempting to add the implicit view will fail and will return
kInvalidArguments. Attempting to add a view with an already
existing view ID will fail, and |info.add_view_callback| will be
invoked with an |added| value of false.
| [in] | engine | A running engine instance. |
| [in] | info | The add view arguments. This can be deallocated once |FlutterEngineAddView| returns, before |add_view_callback| is invoked. |
kSuccess, the |add_view_callback| will be invoked. Definition at line 2500 of file embedder.cc.
References FlutterAddViewInfo::add_view_callback, FlutterAddViewResult::added, callback, engine, error, kFlutterImplicitViewId, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, MakeViewportMetricsFromWindowMetrics(), SAFE_ACCESS, FlutterAddViewResult::struct_size, user_data, FlutterAddViewResult::user_data, FlutterAddViewInfo::user_data, FlutterAddViewInfo::view_id, view_id, and FlutterAddViewInfo::view_metrics.
Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| FlutterEngineResult FlutterEngineCollectAOTData | ( | FlutterEngineAOTData | data | ) |
Collects the AOT data.
| [in] | data | The data to collect. |
Definition at line 1736 of file embedder.cc.
References data, and kSuccess.
Referenced by FlutterEngineGetProcAddresses(), flutter::testing::AOTDataDeleter::operator()(), AOTDataDeleter::operator()(), and flutter::testing::TEST_F().
| FlutterEngineResult FlutterEngineCreateAOTData | ( | const FlutterEngineAOTDataSource * | source, |
| FlutterEngineAOTData * | data_out | ||
| ) |
Creates the necessary data structures to launch a Flutter Dart application in AOT mode. The data may only be collected after all FlutterEngine instances launched using this data have been terminated.
| [in] | source | The source of the AOT data. |
| [out] | data_out | The AOT data on success. Unchanged on failure. |
Definition at line 1682 of file embedder.cc.
References FlutterEngineAOTDataSource::elf_path, error, fml::IsFile(), flutter::DartVM::IsRunningPrecompiledCode(), kFlutterEngineAOTDataSourceTypeElfPath, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, and FlutterEngineAOTDataSource::type.
Referenced by FlutterEngineGetProcAddresses(), LoadAotData(), flutter::testing::EmbedderTestContext::SetupAOTDataIfNecessary(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| 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 more calls to post tasks onto custom task runners specified by the embedder are made. The Flutter engine handle still needs to be collected via a call to FlutterEngineShutdown.
| [in] | engine | The running engine instance to de-initialize. |
Definition at line 2636 of file embedder.cc.
References engine, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, and flutter::EmbedderEngine::NotifyDestroyed().
Referenced by FlutterEngineGetProcAddresses(), FlutterEngineShutdown(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_P().
| 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 in the implicit view.
| [in] | engine | A running engine instance. |
| [in] | node_id | The semantics node identifier. |
| [in] | action | The semantics action. |
| [in] | data | Data associated with the action. |
| [in] | data_length | The data length. |
Definition at line 3196 of file embedder.cc.
References action, data, engine, FlutterEngineSendSemanticsAction(), kFlutterImplicitViewId, FlutterSendSemanticsActionInfo::struct_size, and view_id.
Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| uint64_t FlutterEngineGetCurrentTime | ( | ) |
Get the current time in nanoseconds from the clock used by the flutter engine. This is the system monotonic clock.
Definition at line 3309 of file embedder.cc.
References fml::TimePoint::Now(), fml::TimePoint::ToEpochDelta(), and fml::TimeDelta::ToNanoseconds().
Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST(), and flutter::EventLoop::TimePointFromFlutterTime().
| FlutterEngineResult FlutterEngineGetProcAddresses | ( | FlutterEngineProcTable * | table | ) |
Gets the table of engine function pointers.
| [out] | table | The table to fill with pointers. This should be zero-initialized, except for struct_size. |
Definition at line 3696 of file embedder.cc.
References FlutterEngineAddView(), FlutterEngineCollectAOTData(), FlutterEngineCreateAOTData(), FlutterEngineDeinitialize(), FlutterEngineDispatchSemanticsAction(), FlutterEngineGetCurrentTime(), FlutterEngineInitialize(), FlutterEngineMarkExternalTextureFrameAvailable(), FlutterEngineNotifyDisplayUpdate(), FlutterEngineNotifyLowMemoryWarning(), FlutterEngineOnVsync(), FlutterEnginePostCallbackOnAllNativeThreads(), FlutterEnginePostDartObject(), FlutterEnginePostRenderThreadTask(), FlutterEngineRegisterExternalTexture(), FlutterEngineReloadSystemFonts(), FlutterEngineRemoveView(), FlutterEngineRun(), FlutterEngineRunInitialized(), FlutterEngineRunsAOTCompiledDartCode(), FlutterEngineRunTask(), FlutterEngineScheduleFrame(), FlutterEngineSendKeyEvent(), FlutterEngineSendPlatformMessage(), FlutterEngineSendPlatformMessageResponse(), FlutterEngineSendPointerEvent(), FlutterEngineSendSemanticsAction(), FlutterEngineSendViewFocusEvent(), FlutterEngineSendWindowMetricsEvent(), FlutterEngineSetNextFrameCallback(), FlutterEngineShutdown(), FlutterEngineTraceEventDurationBegin(), FlutterEngineTraceEventDurationEnd(), FlutterEngineTraceEventInstant(), FlutterEngineUnregisterExternalTexture(), FlutterEngineUpdateAccessibilityFeatures(), FlutterEngineUpdateLocales(), FlutterEngineUpdateSemanticsEnabled(), FlutterPlatformMessageCreateResponseHandle(), FlutterPlatformMessageReleaseResponseHandle(), GetCurrentTime, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, and SET_PROC.
Referenced by fl_engine_init(), flutter::FlutterWindowsEngine::FlutterWindowsEngine(), flutter::testing::TEST(), flutter::testing::TEST(), and flutter::testing::TEST().
| 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 FlutterEngineRunInitialized call is made. Besides Flutter application code, no tasks are scheduled on embedder managed task runners either. This allows embedders providing custom task runners to the Flutter engine to obtain a handle to the Flutter engine before the engine can post tasks on these task runners.
| [in] | version | The Flutter embedder API version. Must be FLUTTER_ENGINE_VERSION. |
| [in] | config | The renderer configuration. |
| [in] | args | The Flutter project arguments. |
| user_data | A user data baton passed back to embedders in callbacks. | |
| [out] | engine_out | The engine handle on successful engine creation. |
Definition at line 1987 of file embedder.cc.
References fml::MessageLoop::AddTaskObserver(), flutter::Settings::application_kernel_asset, args, flutter::Settings::assets_path, callback, FlutterPlatformMessage::channel, fml::CommandLineFromArgcArgv(), flutter::EmbedderThreadHost::CreateEmbedderOrEngineManagedThreadHost(), CreateEmbedderSemanticsUpdateCallback(), flutter::Settings::enable_impeller, FlutterMetalRendererConfig::external_texture_frame_callback, FLUTTER_API_SYMBOL, FLUTTER_ENGINE_VERSION, FML_LOG, fml::MessageLoop::GetCurrent(), flutter::PersistentCache::gIsReadOnly, FlutterOpenGLRendererConfig::gl_external_texture_frame_callback, height, i, flutter::Settings::icu_data_path, InferExternalViewEmbedderFromArgs(), flutter::RunConfiguration::InferFromSettings(), InferPlatformViewCreationCallback(), fml::TaskQueueId::Invalid(), fml::IsFile(), IsRendererValid(), flutter::DartVM::IsRunningPrecompiledCode(), fml::paths::JoinPaths(), kApplicationKernelSnapshotFileName, fml::Thread::kBackground, kBackground, fml::Thread::kDisplay, kDisplay, key, kInternalInconsistency, kInvalidArguments, kInvalidLibraryVersion, kMetal, fml::Thread::kNormal, kNormal, kOpenGL, fml::Thread::kRaster, kRaster, kSuccess, flutter::Settings::leak_vm, LOG_EMBEDDER_ERROR, flutter::Settings::log_message_callback, flutter::Settings::log_tag, message, FlutterRendererConfig::metal, name, flutter::Settings::old_gen_heap_size, FlutterRendererConfig::open_gl, PopulateAOTSnapshotMappingCallbacks(), PopulateJITSnapshotMappingCallbacks(), fml::MessageLoop::RemoveTaskObserver(), flutter::Settings::root_isolate_create_callback, SAFE_ACCESS, flutter::PersistentCache::SetCacheDirectoryPath(), fml::Thread::SetCurrentThreadName(), flutter::SettingsFromCommandLine(), FlutterViewFocusChangeRequest::struct_size, flutter::Settings::task_observer_add, flutter::Settings::task_observer_remove, texture, FlutterRendererConfig::type, user_data, view_id, and width.
Referenced by FlutterEngineGetProcAddresses(), and FlutterEngineRun().
| FlutterEngineResult FlutterEngineMarkExternalTextureFrameAvailable | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
| int64_t | texture_identifier | ||
| ) |
Mark that a new texture frame is available for a given texture identifier.
| [in] | engine | A running engine instance. |
| [in] | texture_identifier | The identifier of the texture whose frame has been updated. |
Definition at line 3150 of file embedder.cc.
References engine, kInternalInconsistency, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.
Referenced by FlutterEngineGetProcAddresses().
| FlutterEngineResult FlutterEngineNotifyDisplayUpdate | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
| FlutterEngineDisplaysUpdateType | update_type, | ||
| const FlutterEngineDisplay * | displays, | ||
| size_t | display_count | ||
| ) |
Posts updates corresponding to display changes to a running engine instance.
| [in] | update_type | The type of update pushed to the engine. |
| [in] | displays | The displays affected by this update. |
| [in] | display_count | Size of the displays array, must be at least 1. |
Definition at line 3613 of file embedder.cc.
References displays, engine, height, i, kFlutterEngineDisplaysUpdateTypeStartup, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, SAFE_ACCESS, and width.
Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| FlutterEngineResult FlutterEngineNotifyLowMemoryWarning | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine | ) |
Posts a low memory notification to a running engine instance. The engine will do its best to release non-critical resources in response. It is not guaranteed that the resource would have been collected by the time this call returns however. The notification is posted to engine subsystems that may be operating on other threads.
Flutter applications can respond to these notifications by setting WidgetsBindingObserver.didHaveMemoryPressure observers.
| [in] | engine | A running engine instance. |
Definition at line 3552 of file embedder.cc.
References allocator, DispatchJSONPlatformMessage(), engine, kInternalInconsistency, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.
Referenced by FlutterEngineGetProcAddresses(), and flutter::testing::TEST_F().
| 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 must be returned. This call must be made on the thread on which the call to FlutterEngineRun was made.
| [in] | engine. | A running engine instance. |
| [in] | baton | The baton supplied by the engine. |
| [in] | frame_start_time_nanos | The point at which the vsync event occurred or will occur. If the time point is in the future, the engine will wait till that point to begin its frame workload. |
| [in] | frame_target_time_nanos | The point at which the embedder anticipates the next vsync to occur. This is a hint the engine uses to schedule Dart VM garbage collection in periods in which the various threads are most likely to be idle. For example, for a 60Hz display, embedders should add 16.6 * 1e6 to the frame time field. |
Definition at line 3229 of file embedder.cc.
References engine, fml::TimePoint::FromEpochDelta(), fml::TimeDelta::FromNanoseconds(), kInternalInconsistency, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, and TRACE_EVENT0.
Referenced by FlutterEngineGetProcAddresses(), and flutter::testing::TEST_F().
| 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 callback the next time the message loop for each managed thread is idle. Since the engine manages the entire lifecycle of multiple threads, there is no opportunity for the embedders to finely tune the priorities of threads directly, or, perform other thread specific configuration (for example, setting thread names for tracing). This callback gives embedders a chance to affect such tuning.
| [in] | engine | A running engine instance. |
| [in] | callback | The callback that will get called multiple times on each engine managed thread. |
| [in] | user_data | A baton passed by the engine to the callback. This baton is not interpreted by the engine in any way. |
Definition at line 3574 of file embedder.cc.
References callback, engine, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, type, and user_data.
Referenced by FlutterEngineGetProcAddresses(), and flutter::testing::TEST_F().
| 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 any isolate running in the VM. This isolate can also be the root isolate for an unrelated engine. The engine parameter is necessary only to ensure the call is not made when no engine (and hence no VM) is running.
Unlike the platform messages mechanism, there are no threading restrictions when using this API. Message can be posted on any thread and they will be made available to isolate on which the corresponding send port is listening.
However, it is the embedders responsibility to ensure that the call is not made during an ongoing call the FlutterEngineDeinitialize or FlutterEngineShutdown on another thread.
| [in] | engine | A running engine instance. |
| [in] | port | The send port to send the object to. |
| [in] | object | The object to send to the isolate with the corresponding receive port. |
Definition at line 3428 of file embedder.cc.
References FlutterEngineDartObject::buffer_value, callback, engine, kFlutterEngineDartObjectTypeBool, kFlutterEngineDartObjectTypeBuffer, kFlutterEngineDartObjectTypeDouble, kFlutterEngineDartObjectTypeInt32, kFlutterEngineDartObjectTypeInt64, kFlutterEngineDartObjectTypeNull, kFlutterEngineDartObjectTypeString, kInternalInconsistency, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, fml::ScopedCleanupClosure::Release(), SAFE_ACCESS, fml::ScopedCleanupClosure::SetClosure(), FlutterEngineDartObject::string_value, FlutterEngineDartObject::type, and user_data.
Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| FlutterEngineResult FlutterEnginePostRenderThreadTask | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
| VoidCallback | callback, | ||
| void * | callback_data | ||
| ) |
Posts a task onto the Flutter render thread. Typically, this may be called from any thread as long as a FlutterEngineShutdown on the specific engine has not already been initiated.
| [in] | engine | A running engine instance. |
| [in] | callback | The callback to execute on the render thread. |
| callback_data | The callback context. |
Definition at line 3287 of file embedder.cc.
References callback, engine, kInternalInconsistency, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.
Referenced by FlutterEngineGetProcAddresses().
| 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 support external textures accept external texture registrations. After the external texture is registered, the application can mark that a frame is available by calling FlutterEngineMarkExternalTextureFrameAvailable.
| [in] | engine | A running engine instance. |
| [in] | texture_identifier | The identifier of the texture to register with the engine. The embedder may supply new frames to this texture using the same identifier. |
Definition at line 3110 of file embedder.cc.
References engine, kInternalInconsistency, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.
Referenced by FlutterEngineGetProcAddresses(), and flutter::testing::TEST_F().
| FlutterEngineResult FlutterEngineReloadSystemFonts | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine | ) |
Reloads the system fonts in engine.
| [in] | engine. | A running engine instance. |
Definition at line 3256 of file embedder.cc.
References engine, kInternalInconsistency, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, and TRACE_EVENT0.
Referenced by FlutterEngineGetProcAddresses(), and flutter::testing::TEST_F().
| FLUTTER_EXPORT FlutterEngineResult FlutterEngineRemoveView | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
| const FlutterRemoveViewInfo * | info | ||
| ) |
Removes a view.
This is an asynchronous operation. The view's resources must not
be cleaned up until |info.remove_view_callback| is invoked with
a |removed| value of true.
The callback is invoked on a thread managed by the engine. The
embedder should re-thread if needed.
Attempting to remove the implicit view will fail and will return
kInvalidArguments. Attempting to remove a view with a
non-existent view ID will fail, and |info.remove_view_callback|
will be invoked with a |removed| value of false.
| [in] | engine | A running engine instance. |
| [in] | info | The remove view arguments. This can be deallocated once |FlutterEngineRemoveView| returns, before |remove_view_callback| is invoked. |
kSuccess, the |remove_view_callback| will be invoked. Definition at line 2561 of file embedder.cc.
References callback, engine, kFlutterImplicitViewId, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, FlutterRemoveViewInfo::remove_view_callback, FlutterRemoveViewResult::removed, FlutterRemoveViewResult::struct_size, user_data, FlutterRemoveViewResult::user_data, FlutterRemoveViewInfo::user_data, and FlutterRemoveViewInfo::view_id.
Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| 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 for the pair of calls to FlutterEngineInitialize and FlutterEngineRunInitialized.
FlutterProjectArgs::custom_task_runners. In such cases, the engine may need the embedder to post tasks back to it before FlutterEngineRun has returned. Embedders can only post tasks to the engine if they have a handle to the engine. In such cases, embedders are advised to get the engine handle by calling FlutterEngineInitialize. Then they can call FlutterEngineRunInitialized knowing that they will be able to service custom tasks on other threads with the engine handle.| [in] | version | The Flutter embedder API version. Must be FLUTTER_ENGINE_VERSION. |
| [in] | config | The renderer configuration. |
| [in] | args | The Flutter project arguments. |
| user_data | A user data baton passed back to embedders in callbacks. | |
| [out] | engine_out | The engine handle on successful engine creation. |
Definition at line 1971 of file embedder.cc.
References args, FlutterEngineInitialize(), FlutterEngineRunInitialized(), kSuccess, and user_data.
Referenced by FlutterEngineGetProcAddresses(), main(), RunFlutter(), and RunFlutterEngine().
| FlutterEngineResult FlutterEngineRunInitialized | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine | ) |
Runs an initialized engine instance. An engine can be initialized via FlutterEngineInitialize. An initialized instance can only be run once. During and after this call, custom task runners supplied by the embedder are expected to start servicing tasks.
| [in] | engine | An initialized engine instance that has not previously been run. |
Definition at line 2461 of file embedder.cc.
References engine, kInternalInconsistency, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.
Referenced by FlutterEngineGetProcAddresses(), FlutterEngineRun(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_P().
| bool FlutterEngineRunsAOTCompiledDartCode | ( | void | ) |
Returns if the Flutter engine instance will run AOT compiled Dart code. This call has no threading restrictions.
For embedder code that is configured for both AOT and JIT mode Dart execution based on the Flutter engine being linked to, this runtime check may be used to appropriately configure the FlutterProjectArgs. In JIT mode execution, the kernel snapshots must be present in the Flutter assets directory specified in the FlutterProjectArgs. For AOT execution, the fields vm_snapshot_data, vm_snapshot_instructions, isolate_snapshot_data and isolate_snapshot_instructions (along with their size fields) must be specified in FlutterProjectArgs.
Definition at line 3424 of file embedder.cc.
References flutter::DartVM::IsRunningPrecompiledCode().
Referenced by FlutterEngineGetProcAddresses(), RunFlutterEngine(), and flutter::testing::TEST_F().
| 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 embedder via the FlutterTaskRunnerDescription.post_task_callback. This call must only be made at the target time specified in that callback. Running the task before that time is undefined behavior.
| [in] | engine | A running engine instance. |
| [in] | task | the task handle. |
Definition at line 3313 of file embedder.cc.
References engine, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, FlutterTask::runner, and flutter::EmbedderThreadHost::RunnerIsValid().
Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_P().
| FlutterEngineResult FlutterEngineScheduleFrame | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine | ) |
Schedule a new frame to redraw the content.
| [in] | engine | A running engine instance. |
Definition at line 3654 of file embedder.cc.
References engine, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.
Referenced by FlutterEngineGetProcAddresses(), and flutter::testing::TEST_F().
| 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 synchronous fashion, although due to technical limitation, the result is always reported asynchronously. The callback is guaranteed to be called exactly once.
| [in] | engine | A running engine instance. |
| [in] | event | The event data to be sent. This function will no longer access event after returning. |
| [in] | callback | The callback invoked by the engine when the Flutter application has decided whether it handles this event. Accepts nullptr. |
| [in] | user_data | The context associated with the callback. The exact same value will used to invoke callback. Accepts nullptr. |
Definition at line 2921 of file embedder.cc.
References callback, character, flutter::KeyData::Clear(), data, flutter::KeyData::device_type, engine, InternalSendPlatformMessage(), kFlutterKeyDataChannel, kFlutterKeyEventDeviceTypeKeyboard, kFlutterKeyEventTypeUp, kInvalidArguments, LOG_EMBEDDER_ERROR, flutter::KeyData::logical, MapKeyEventDeviceType(), MapKeyEventType(), flutter::KeyData::physical, SAFE_ACCESS, flutter::KeyData::synthesized, flutter::KeyData::timestamp, type, flutter::KeyData::type, and user_data.
Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| FlutterEngineResult FlutterEngineSendPlatformMessage | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
| const FlutterPlatformMessage * | flutter_message | ||
| ) |
Definition at line 2977 of file embedder.cc.
References FlutterPlatformMessage::channel, channel, fml::MallocMapping::Copy(), engine, kInternalInconsistency, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, _FlutterPlatformMessageResponseHandle::message, message, and SAFE_ACCESS.
Referenced by FlutterDesktopMessengerSendWithReply(), FlutterEngineGetProcAddresses(), InternalSendPlatformMessage(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| 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.
| [in] | engine | The running engine instance. |
| [in] | handle | The platform message response handle. |
| [in] | data | The data to associate with the platform message response. |
| [in] | data_length | The length of the platform message response data. |
Definition at line 3078 of file embedder.cc.
References data, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, and _FlutterPlatformMessageResponseHandle::message.
Referenced by FlutterDesktopMessengerSendResponse(), FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| FlutterEngineResult FlutterEngineSendPointerEvent | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
| const FlutterPointerEvent * | pointers, | ||
| size_t | events_count | ||
| ) |
Definition at line 2769 of file embedder.cc.
References flutter::PointerData::buttons, flutter::PointerData::change, flutter::PointerData::Clear(), device, flutter::PointerData::device, flutter::PointerData::embedder_id, engine, i, kCancel, flutter::PointerData::kDown, kFlutterImplicitViewId, kFlutterPointerDeviceKindMouse, kFlutterPointerSignalKindNone, flutter::PointerData::kind, kInternalInconsistency, kInvalidArguments, flutter::PointerData::kMouse, flutter::PointerData::kMove, flutter::kPointerButtonTouchContact, kSuccess, flutter::PointerData::kTouch, LOG_EMBEDDER_ERROR, flutter::PointerData::pan_delta_x, flutter::PointerData::pan_delta_y, flutter::PointerData::pan_x, flutter::PointerData::pan_y, flutter::PointerData::physical_delta_x, flutter::PointerData::physical_delta_y, flutter::PointerData::physical_x, flutter::PointerData::physical_y, flutter::PointerData::pointer_identifier, PointerDataButtonsForLegacyEvent(), flutter::PointerData::rotation, SAFE_ACCESS, flutter::PointerData::scale, flutter::PointerData::scroll_delta_x, flutter::PointerData::scroll_delta_y, flutter::PointerData::signal_kind, FlutterPointerEvent::struct_size, flutter::PointerData::time_stamp, ToPointerDataChange(), ToPointerDataKind(), ToPointerDataSignalKind(), flutter::PointerData::view_id, view_id, x, and y.
Referenced by FlutterEngineGetProcAddresses(), GLFWcursorPositionCallbackAtPhase(), SendPointerEventWithData(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| FlutterEngineResult FlutterEngineSendSemanticsAction | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
| const FlutterSendSemanticsActionInfo * | info | ||
| ) |
Dispatch a semantics action to the specified semantics node within a specific view.
| [in] | engine | A running engine instance. |
| [in] | info | The dispatch semantics on view arguments. This can be deallocated once |FlutterEngineSendSemanticsAction| returns. |
Definition at line 3212 of file embedder.cc.
References FlutterSendSemanticsActionInfo::action, fml::MallocMapping::Copy(), FlutterSendSemanticsActionInfo::data, FlutterSendSemanticsActionInfo::data_length, flutter::EmbedderEngine::DispatchSemanticsAction(), engine, kInternalInconsistency, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, FlutterSendSemanticsActionInfo::node_id, and FlutterSendSemanticsActionInfo::view_id.
Referenced by FlutterEngineDispatchSemanticsAction(), and FlutterEngineGetProcAddresses().
| FlutterEngineResult FlutterEngineSendViewFocusEvent | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
| const FlutterViewFocusEvent * | event | ||
| ) |
Notifies the engine that platform view focus state has changed.
| [in] | engine | A running engine instance |
| [in] | event | The focus event data describing the change. |
Definition at line 2603 of file embedder.cc.
References FlutterViewFocusEvent::direction, engine, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, FlutterViewFocusEvent::state, STRUCT_HAS_MEMBER, and FlutterViewFocusEvent::view_id.
Referenced by FlutterEngineGetProcAddresses(), and flutter::testing::TEST_F().
| FlutterEngineResult FlutterEngineSendWindowMetricsEvent | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
| const FlutterWindowMetricsEvent * | flutter_metrics | ||
| ) |
Definition at line 2660 of file embedder.cc.
References engine, error, kFlutterImplicitViewId, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, MakeViewportMetricsFromWindowMetrics(), SAFE_ACCESS, and view_id.
Referenced by flutter::testing::expectSoftwareRenderingOutputMatches(), FlutterEngineGetProcAddresses(), GLFWframebufferSizeCallback(), GLFWwindowSizeCallback(), SendWindowMetrics(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), flutter::testing::TEST_P(), and flutter::testing::TEST_P().
| 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 thread. The callback is executed only once from the raster thread; embedders must re-thread if necessary. Performing blocking calls in this callback may introduce application jank.
| [in] | engine | A running engine instance. |
| [in] | callback | The callback to execute. |
| [in] | user_data | A baton passed by the engine to the callback. This baton is not interpreted by the engine in any way. |
Definition at line 3666 of file embedder.cc.
References callback, engine, flutter::Shell::GetPlatformView(), flutter::EmbedderEngine::GetShell(), kInternalInconsistency, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, and user_data.
Referenced by FlutterEngineGetProcAddresses(), and flutter::testing::TEST_F().
| 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 embedder API after this point. Making additional calls with this handle is undefined behavior.
FlutterEngineDeinitialize) if necessary.| [in] | engine | The Flutter engine instance to collect. |
Definition at line 2649 of file embedder.cc.
References engine, FlutterEngineDeinitialize(), and kSuccess.
Referenced by FlutterDesktopDestroyWindow(), FlutterDesktopShutDownEngine(), FlutterEngineGetProcAddresses(), flutter::testing::UniqueEngineTraits::Free(), main(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| void FlutterEngineTraceEventDurationBegin | ( | const char * | name | ) |
A profiling utility. Logs a trace duration begin event to the timeline. If the timeline is unavailable or disabled, this has no effect. Must be balanced with an duration end event (via FlutterEngineTraceEventDurationEnd) with the same name on the same thread. Can be called on any thread. Strings passed into the function will NOT be copied when added to the timeline. Only string literals may be passed in.
| [in] | name | The name of the trace event. |
Definition at line 3273 of file embedder.cc.
References name, and fml::tracing::TraceEvent0().
Referenced by FlutterEngineGetProcAddresses().
| void FlutterEngineTraceEventDurationEnd | ( | const char * | name | ) |
A profiling utility. Logs a trace duration end event to the timeline. If the timeline is unavailable or disabled, this has no effect. This call must be preceded by a trace duration begin call (via FlutterEngineTraceEventDurationBegin) with the same name on the same thread. Can be called on any thread. Strings passed into the function will NOT be copied when added to the timeline. Only string literals may be passed in.
| [in] | name | The name of the trace event. |
Definition at line 3278 of file embedder.cc.
References name, and fml::tracing::TraceEventEnd().
Referenced by FlutterEngineGetProcAddresses().
| void FlutterEngineTraceEventInstant | ( | const char * | name | ) |
A profiling utility. Logs a trace duration instant event to the timeline. If the timeline is unavailable or disabled, this has no effect. Can be called on any thread. Strings passed into the function will NOT be copied when added to the timeline. Only string literals may be passed in.
| [in] | name | The name of the trace event. |
Definition at line 3282 of file embedder.cc.
References name, and fml::tracing::TraceEventInstant0().
Referenced by FlutterEngineGetProcAddresses().
| FlutterEngineResult FlutterEngineUnregisterExternalTexture | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
| int64_t | texture_identifier | ||
| ) |
Unregister a previous texture registration.
| [in] | engine | A running engine instance. |
| [in] | texture_identifier | The identifier of the texture for which new frame will not be available. |
Definition at line 3129 of file embedder.cc.
References engine, kInternalInconsistency, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.
Referenced by FlutterEngineGetProcAddresses().
| FlutterEngineResult FlutterEngineUpdateAccessibilityFeatures | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
| FlutterAccessibilityFeature | features | ||
| ) |
Sets additional accessibility features.
| [in] | engine | A running engine instance |
| [in] | features | The accessibility features to set. |
Definition at line 3182 of file embedder.cc.
References engine, kInternalInconsistency, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.
Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| 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 first item in the list of locales supplied. The other entries will be used as a fallback.
| [in] | engine | A running engine instance. |
| [in] | locales | The updated locales in the order of preference. |
| [in] | locales_count | The count of locales supplied. |
Definition at line 3365 of file embedder.cc.
References allocator, args, DispatchJSONPlatformMessage(), engine, i, kInternalInconsistency, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, and SAFE_ACCESS.
Referenced by FlutterEngineGetProcAddresses(), SetUpLocales(), and flutter::testing::TEST_F().
| FlutterEngineResult FlutterEngineUpdateSemanticsEnabled | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
| bool | enabled | ||
| ) |
Enable or disable accessibility semantics.
| [in] | engine | A running engine instance. |
| [in] | enabled | When enabled, changes to the semantic contents of the window are sent via the FlutterUpdateSemanticsCallback2 registered to update_semantics_callback2 in FlutterProjectArgs. |
Definition at line 3168 of file embedder.cc.
References engine, kInternalInconsistency, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.
Referenced by FlutterEngineGetProcAddresses(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| 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 response to a message. This handle may be set on the response_handle field of any FlutterPlatformMessage sent to the engine.
The handle must be collected via a call to FlutterPlatformMessageReleaseResponseHandle. This may be done immediately after a call to FlutterEngineSendPlatformMessage with a platform message whose response handle contains the handle created using this call. In case a handle is created but never sent in a message, the release call must still be made. Not calling release on the handle results in a small memory leak.
The user data baton passed to the data callback is the one specified in this call as the third argument.
| [in] | engine | A running engine instance. |
| [in] | data_callback | The callback invoked by the engine when the Flutter application send a response on the handle. |
| [in] | user_data | The user data associated with the data callback. |
| [out] | response_out | The response handle created when this call is successful. |
Definition at line 3028 of file embedder.cc.
References data, engine, kInvalidArguments, kSuccess, LOG_EMBEDDER_ERROR, and user_data.
Referenced by FlutterDesktopMessengerSendWithReply(), FlutterEngineGetProcAddresses(), InternalSendPlatformMessage(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
| FlutterEngineResult FlutterPlatformMessageReleaseResponseHandle | ( | FLUTTER_API_SYMBOL(FlutterEngine) | engine, |
| FlutterPlatformMessageResponseHandle * | response | ||
| ) |
Collects the handle created using FlutterPlatformMessageCreateResponseHandle.
| [in] | engine | A running engine instance. |
| [in] | response | The platform message response handle to collect. These handles are created using FlutterPlatformMessageCreateResponseHandle(). |
Definition at line 3063 of file embedder.cc.
References engine, kInvalidArguments, kSuccess, and LOG_EMBEDDER_ERROR.
Referenced by FlutterDesktopMessengerSendWithReply(), FlutterEngineGetProcAddresses(), InternalSendPlatformMessage(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
|
static |
Creates an EmbedderExternalViewEmbedder.
When a non-OK status is returned, engine startup should be halted.
Definition at line 1535 of file embedder.cc.
References CreateEmbedderRenderTarget(), FML_DCHECK, fml::kInvalidArgument, layers, layers_count, SAFE_ACCESS, FlutterLayer::size, FlutterPresentViewInfo::struct_size, TRACE_EVENT0, user_data, FlutterCompositor::user_data, and view_id.
Referenced by FlutterEngineInitialize().
|
static |
Definition at line 517 of file embedder.cc.
References flutter::GPUMTLTextureInfo::destruction_callback, FlutterMetalTexture::destruction_callback, flutter::GPUMTLTextureInfo::destruction_context, FlutterMetalRendererConfig::device, FML_LOG, FlutterMetalRendererConfig::get_next_drawable_callback, flutter::Shell::GetTaskRunners(), kMetal, fml::MakeCopyable(), FlutterRendererConfig::metal, flutter::EmbedderSurfaceMetalImpeller::MetalDispatchTable::present, flutter::EmbedderSurfaceMetalSkia::MetalDispatchTable::present, FlutterMetalRendererConfig::present_command_queue, FlutterMetalRendererConfig::present_drawable_callback, FlutterFrameInfo::size, FlutterFrameInfo::struct_size, FlutterMetalTexture::struct_size, flutter::GPUMTLTextureInfo::texture, FlutterMetalTexture::texture, texture, flutter::GPUMTLTextureInfo::texture_id, FlutterMetalTexture::texture_id, FlutterRendererConfig::type, user_data, and FlutterMetalTexture::user_data.
Referenced by InferPlatformViewCreationCallback().
|
inlinestatic |
Definition at line 305 of file embedder.cc.
References FlutterOpenGLRendererConfig::clear_current, FlutterDamage::damage, FlutterOpenGLRendererConfig::fbo_callback, flutter::GLFBOInfo::fbo_id, FlutterOpenGLRendererConfig::fbo_with_frame_info_callback, FML_LOG, flutter::Shell::GetTaskRunners(), FlutterOpenGLRendererConfig::gl_proc_resolver, i, id, kOpenGL, FlutterOpenGLRendererConfig::make_current, FlutterOpenGLRendererConfig::make_resource_current, fml::MakeCopyable(), FlutterDamage::num_rects, FlutterRendererConfig::open_gl, FlutterTransformation::pers0, FlutterTransformation::pers1, FlutterTransformation::pers2, FlutterOpenGLRendererConfig::populate_existing_damage, FlutterOpenGLRendererConfig::present, FlutterOpenGLRendererConfig::present_with_info, SAFE_ACCESS, FlutterTransformation::scaleX, FlutterTransformation::scaleY, FlutterFrameInfo::size, FlutterTransformation::skewX, FlutterTransformation::skewY, FlutterDamage::struct_size, FlutterFrameInfo::struct_size, FlutterPresentInfo::struct_size, FlutterOpenGLRendererConfig::surface_transformation, FlutterTransformation::transX, FlutterTransformation::transY, FlutterRendererConfig::type, user_data, and FlutterUIntSize::width.
Referenced by InferPlatformViewCreationCallback().
|
static |
Definition at line 811 of file embedder.cc.
References InferMetalPlatformViewCreationCallback(), InferOpenGLPlatformViewCreationCallback(), InferSoftwarePlatformViewCreationCallback(), InferVulkanPlatformViewCreationCallback(), kMetal, kOpenGL, kSoftware, kVulkan, FlutterRendererConfig::type, and user_data.
Referenced by FlutterEngineInitialize().
|
static |
Definition at line 774 of file embedder.cc.
References flutter::Shell::GetTaskRunners(), height, kSoftware, fml::MakeCopyable(), FlutterRendererConfig::software, FlutterSoftwareRendererConfig::surface_present_callback, FlutterRendererConfig::type, and user_data.
Referenced by InferPlatformViewCreationCallback().
|
static |
Definition at line 611 of file embedder.cc.
References FlutterVulkanRendererConfig::device, FlutterVulkanRendererConfig::enabled_device_extension_count, FlutterVulkanRendererConfig::enabled_device_extensions, FlutterVulkanRendererConfig::enabled_instance_extension_count, FlutterVulkanRendererConfig::enabled_instance_extensions, FML_LOG, FlutterVulkanImage::format, format, flutter::EmbedderSurfaceVulkan::VulkanDispatchTable::get_instance_proc_address, flutter::EmbedderSurfaceVulkanImpeller::VulkanDispatchTable::get_instance_proc_address, FlutterVulkanRendererConfig::get_instance_proc_address_callback, FlutterVulkanRendererConfig::get_next_image_callback, flutter::Shell::GetTaskRunners(), image, instance, FlutterVulkanRendererConfig::instance, kVulkan, fml::MakeCopyable(), FlutterVulkanRendererConfig::physical_device, FlutterVulkanRendererConfig::present_image_callback, FlutterVulkanRendererConfig::queue, FlutterVulkanRendererConfig::queue_family_index, FlutterFrameInfo::struct_size, FlutterVulkanImage::struct_size, FlutterRendererConfig::type, user_data, FlutterVulkanRendererConfig::version, and FlutterRendererConfig::vulkan.
Referenced by InferPlatformViewCreationCallback().
|
static |
Definition at line 2885 of file embedder.cc.
References channel, data, engine, FlutterEngineSendPlatformMessage(), FlutterPlatformMessageCreateResponseHandle(), FlutterPlatformMessageReleaseResponseHandle(), kSuccess, message, and user_data.
Referenced by FlutterEngineSendKeyEvent().
|
static |
Definition at line 191 of file embedder.cc.
References device, kMetal, FlutterRendererConfig::metal, SAFE_ACCESS, and FlutterRendererConfig::type.
Referenced by IsRendererValid().
|
static |
Definition at line 158 of file embedder.cc.
References kOpenGL, FlutterRendererConfig::open_gl, SAFE_EXISTS, SAFE_EXISTS_ONE_OF, and FlutterRendererConfig::type.
Referenced by IsRendererValid().
|
static |
Definition at line 229 of file embedder.cc.
References IsMetalRendererConfigValid(), IsOpenGLRendererConfigValid(), IsSoftwareRendererConfigValid(), IsVulkanRendererConfigValid(), kMetal, kOpenGL, kSoftware, kVulkan, and FlutterRendererConfig::type.
Referenced by FlutterEngineInitialize().
|
static |
Definition at line 176 of file embedder.cc.
References kSoftware, SAFE_ACCESS, FlutterRendererConfig::software, and FlutterRendererConfig::type.
Referenced by IsRendererValid().
|
static |
Definition at line 209 of file embedder.cc.
References device, instance, kVulkan, physical_device, queue, SAFE_EXISTS, FlutterRendererConfig::type, and FlutterRendererConfig::vulkan.
Referenced by IsRendererValid().
|
static |
Definition at line 134 of file embedder.cc.
|
static |
Definition at line 1233 of file embedder.cc.
References callback, impeller::ColorAttachment::clear_color, impeller::Color::DarkSlateGray(), FlutterMetalTexture::destruction_callback, FML_LOG, impeller::TextureDescriptor::format, FlutterSize::height, impeller::kClear, impeller::kCount1, impeller::kCount4, impeller::kDevicePrivate, impeller::kDeviceTransient, impeller::kMultisampleResolve, impeller::kRenderTarget, impeller::kShaderRead, impeller::kTexture2DMultisample, impeller::Attachment::load_action, impeller::Attachment::resolve_texture, impeller::TextureDescriptor::sample_count, impeller::RenderTarget::SetColorAttachment(), impeller::TextureDescriptor::size, FlutterBackingStoreConfig::size, impeller::TextureDescriptor::storage_mode, impeller::Attachment::store_action, impeller::Attachment::texture, FlutterMetalTexture::texture, FlutterMetalBackingStore::texture, impeller::TextureDescriptor::type, impeller::TextureDescriptor::usage, user_data, FlutterMetalTexture::user_data, FlutterSize::width, and impeller::WrapTextureMTL().
|
static |
Definition at line 1139 of file embedder.cc.
References callback, impeller::BackendCast< ContextGLES, Context >::Cast(), impeller::ColorAttachment::clear_color, impeller::DepthAttachment::clear_depth, impeller::StencilAttachment::clear_stencil, impeller::TextureGLES::CreatePlaceholder(), impeller::Color::DarkSlateGray(), FlutterOpenGLFramebuffer::destruction_callback, impeller::TextureDescriptor::format, format, FlutterSize::height, impeller::kClear, impeller::kCount1, impeller::kCount4, impeller::kD24UnormS8Uint, impeller::kDevicePrivate, impeller::kDontCare, impeller::kMultisampleResolve, impeller::kRenderTarget, impeller::kStore, impeller::kTexture2D, impeller::kTexture2DMultisample, impeller::Attachment::load_action, FlutterOpenGLFramebuffer::name, impeller::Attachment::resolve_texture, impeller::TextureDescriptor::sample_count, impeller::RenderTarget::SetColorAttachment(), impeller::RenderTarget::SetDepthAttachment(), impeller::RenderTarget::SetStencilAttachment(), impeller::TextureDescriptor::size, FlutterBackingStoreConfig::size, impeller::TextureDescriptor::storage_mode, impeller::Attachment::store_action, FlutterOpenGLFramebuffer::target, impeller::Attachment::texture, impeller::TextureDescriptor::type, impeller::TextureDescriptor::usage, user_data, FlutterOpenGLFramebuffer::user_data, FlutterSize::width, and impeller::TextureGLES::WrapFBO().
Referenced by CreateEmbedderRenderTarget().
|
static |
Definition at line 1368 of file embedder.cc.
References MakeRenderTargetFromSkSurface().
|
static |
Definition at line 1352 of file embedder.cc.
Referenced by CreateEmbedderRenderTarget(), and MakeRenderTargetFromSkSurface().
|
static |
Definition at line 1075 of file embedder.cc.
References FlutterMetalTexture::destruction_callback, FML_LOG, FlutterSize::height, FlutterBackingStoreConfig::size, surface, FlutterMetalTexture::texture, FlutterMetalBackingStore::texture, FlutterMetalTexture::user_data, and FlutterSize::width.
|
static |
Definition at line 892 of file embedder.cc.
References color_type, FlutterOpenGLFramebuffer::destruction_callback, FML_LOG, FlutterSize::height, FlutterOpenGLFramebuffer::name, FlutterBackingStoreConfig::size, surface, FlutterOpenGLFramebuffer::target, FlutterOpenGLFramebuffer::user_data, and FlutterSize::width.
|
static |
Definition at line 939 of file embedder.cc.
References color_type, FML_LOG, format, FlutterSize::height, SAFE_ACCESS, FlutterBackingStoreConfig::size, surface, and FlutterSize::width.
|
static |
Definition at line 846 of file embedder.cc.
References color_type, FML_LOG, FlutterSize::height, FlutterBackingStoreConfig::size, surface, texture, and FlutterSize::width.
Referenced by CreateEmbedderRenderTarget().
|
static |
Definition at line 986 of file embedder.cc.
References FlutterSoftwareBackingStore::allocation, FlutterSoftwareBackingStore::destruction_callback, FML_LOG, FlutterSize::height, FlutterSoftwareBackingStore::row_bytes, FlutterBackingStoreConfig::size, surface, user_data, FlutterSoftwareBackingStore::user_data, and FlutterSize::width.
|
static |
Definition at line 1030 of file embedder.cc.
References FlutterSoftwareBackingStore2::allocation, FlutterSoftwareBackingStore2::destruction_callback, FML_LOG, getSkColorInfo(), FlutterSize::height, FlutterSoftwareBackingStore2::pixel_format, FlutterSoftwareBackingStore2::row_bytes, FlutterBackingStoreConfig::size, surface, user_data, FlutterSoftwareBackingStore2::user_data, and FlutterSize::width.
|
static |
Definition at line 1300 of file embedder.cc.
References flutter::GPUSurfaceVulkan::ColorTypeFromFormat(), FML_LOG, FlutterSize::height, FlutterBackingStoreConfig::size, surface, and FlutterSize::width.
|
static |
Definition at line 1612 of file embedder.cc.
References flutter::ViewportMetrics::device_pixel_ratio, flutter::ViewportMetrics::display_id, height, flutter::ViewportMetrics::physical_height, flutter::ViewportMetrics::physical_max_height_constraint, flutter::ViewportMetrics::physical_max_width_constraint, flutter::ViewportMetrics::physical_min_height_constraint, flutter::ViewportMetrics::physical_min_width_constraint, flutter::ViewportMetrics::physical_view_inset_bottom, flutter::ViewportMetrics::physical_view_inset_left, flutter::ViewportMetrics::physical_view_inset_right, flutter::ViewportMetrics::physical_view_inset_top, flutter::ViewportMetrics::physical_width, SAFE_ACCESS, and width.
Referenced by FlutterEngineAddView(), and FlutterEngineSendWindowMetricsEvent().
|
inlinestatic |
Definition at line 2865 of file embedder.cc.
References flutter::kDirectionalPad, kFlutterKeyEventDeviceTypeDirectionalPad, kFlutterKeyEventDeviceTypeGamepad, kFlutterKeyEventDeviceTypeHdmi, kFlutterKeyEventDeviceTypeJoystick, kFlutterKeyEventDeviceTypeKeyboard, flutter::kGamepad, flutter::kHdmi, flutter::kJoystick, and flutter::kKeyboard.
Referenced by FlutterEngineSendKeyEvent().
|
inlinestatic |
Definition at line 2852 of file embedder.cc.
References flutter::kDown, kFlutterKeyEventTypeDown, kFlutterKeyEventTypeRepeat, kFlutterKeyEventTypeUp, flutter::kRepeat, and flutter::kUp.
Referenced by FlutterEngineSendKeyEvent().
|
inline |
Definition at line 2748 of file embedder.cc.
References flutter::PointerData::kAdd, flutter::PointerData::kCancel, flutter::PointerData::kDown, flutter::PointerData::kHover, flutter::PointerData::kMove, flutter::PointerData::kPanZoomEnd, flutter::PointerData::kPanZoomStart, flutter::PointerData::kPanZoomUpdate, flutter::kPointerButtonMousePrimary, flutter::PointerData::kRemove, and flutter::PointerData::kUp.
Referenced by FlutterEngineSendPointerEvent().
| void PopulateAOTSnapshotMappingCallbacks | ( | const FlutterProjectArgs * | args, |
| flutter::Settings & | settings | ||
| ) |
Definition at line 1792 of file embedder.cc.
References args, flutter::Settings::isolate_snapshot_data, flutter::Settings::isolate_snapshot_instr, SAFE_ACCESS, flutter::Settings::vm_snapshot_data, and flutter::Settings::vm_snapshot_instr.
Referenced by FlutterEngineInitialize().
| void PopulateJITSnapshotMappingCallbacks | ( | const FlutterProjectArgs * | args, |
| flutter::Settings & | settings | ||
| ) |
Definition at line 1749 of file embedder.cc.
References args, fml::FileMapping::CreateReadExecute(), fml::FileMapping::CreateReadOnly(), flutter::Settings::dart_library_sources_kernel, flutter::Settings::isolate_snapshot_data, flutter::Settings::isolate_snapshot_instr, kPlatformStrongDill, kPlatformStrongDillSize, SAFE_ACCESS, flutter::Settings::vm_snapshot_data, and flutter::Settings::vm_snapshot_instr.
Referenced by FlutterEngineInitialize().
|
inline |
Definition at line 2685 of file embedder.cc.
References flutter::PointerData::kAdd, kAdd, flutter::PointerData::kCancel, kCancel, flutter::PointerData::kDown, kDown, flutter::PointerData::kHover, kHover, flutter::PointerData::kMove, kMove, flutter::PointerData::kPanZoomEnd, kPanZoomEnd, flutter::PointerData::kPanZoomStart, kPanZoomStart, flutter::PointerData::kPanZoomUpdate, kPanZoomUpdate, flutter::PointerData::kRemove, kRemove, flutter::PointerData::kUp, and kUp.
Referenced by FlutterEngineSendPointerEvent().
|
inline |
Definition at line 2714 of file embedder.cc.
References kFlutterPointerDeviceKindMouse, kFlutterPointerDeviceKindStylus, kFlutterPointerDeviceKindTouch, kFlutterPointerDeviceKindTrackpad, flutter::PointerData::kMouse, flutter::PointerData::kStylus, flutter::PointerData::kTouch, and flutter::PointerData::kTrackpad.
Referenced by FlutterEngineSendPointerEvent().
|
inline |
Definition at line 2731 of file embedder.cc.
References kFlutterPointerSignalKindNone, kFlutterPointerSignalKindScale, kFlutterPointerSignalKindScroll, kFlutterPointerSignalKindScrollInertiaCancel, flutter::PointerData::kNone, flutter::PointerData::kScale, flutter::PointerData::kScroll, and flutter::PointerData::kScrollInertiaCancel.
Referenced by FlutterEngineSendPointerEvent().
|
staticconstexpr |
Definition at line 110 of file embedder.cc.
Referenced by FlutterEngineAddView(), FlutterEngineDispatchSemanticsAction(), FlutterEngineRemoveView(), FlutterEngineSendPointerEvent(), and FlutterEngineSendWindowMetricsEvent().
| const char* kFlutterKeyDataChannel = "flutter/keydata" |
Definition at line 132 of file embedder.cc.
Referenced by FlutterEngineSendKeyEvent().
| const int32_t kFlutterSemanticsCustomActionIdBatchEnd = -1 |
FlutterSemanticsCustomAction ID used as a sentinel to signal the end of a batch of semantics custom action updates. This is unused if using FlutterUpdateSemanticsCallback2.
Definition at line 108 of file embedder.cc.
Referenced by CreateEmbedderSemanticsUpdateCallbackV1(), and flutter::testing::TEST_F().
| const int32_t kFlutterSemanticsNodeIdBatchEnd = -1 |
FlutterSemanticsNode ID used as a sentinel to signal the end of a batch of semantics node updates. This is unused if using FlutterUpdateSemanticsCallback2.
Definition at line 107 of file embedder.cc.
Referenced by CreateEmbedderSemanticsUpdateCallbackV1(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), and flutter::testing::TEST_F().
|
extern |
Referenced by PopulateJITSnapshotMappingCallbacks().
|
extern |
Referenced by PopulateJITSnapshotMappingCallbacks().