Flutter Engine
The Flutter Engine
|
A client interface that the RuntimeController
uses to define handlers for PlatformConfiguration
requests.
More...
#include <platform_configuration.h>
Public Member Functions | |
virtual std::string | DefaultRouteName ()=0 |
The route or path that the embedder requested when the application was launched. More... | |
virtual void | ScheduleFrame ()=0 |
Requests that, at the next appropriate opportunity, a new frame be scheduled for rendering. More... | |
virtual void | EndWarmUpFrame ()=0 |
Called when a warm up frame has ended. More... | |
virtual void | Render (int64_t view_id, Scene *scene, double width, double height)=0 |
Updates the client's rendering on the GPU with the newly provided Scene. More... | |
virtual void | UpdateSemantics (SemanticsUpdate *update)=0 |
Receives an updated semantics tree from the Framework. More... | |
virtual void | HandlePlatformMessage (std::unique_ptr< PlatformMessage > message)=0 |
When the Flutter application has a message to send to the underlying platform, the message needs to be forwarded to the platform on the appropriate thread (via the platform task runner). The PlatformConfiguration delegates this task to the engine via this method. More... | |
virtual FontCollection & | GetFontCollection ()=0 |
Returns the current collection of fonts available on the platform. More... | |
virtual std::shared_ptr< AssetManager > | GetAssetManager ()=0 |
Returns the current collection of assets available on the platform. More... | |
virtual void | UpdateIsolateDescription (const std::string isolate_name, int64_t isolate_port)=0 |
Notifies this client of the name of the root isolate and its port when that isolate is launched, restarted (in the cold-restart scenario) or the application itself updates the name of the root isolate (via Window.setIsolateDebugName in window.dart ). The name of the isolate is meaningless to the engine but is used in instrumentation and tooling. Currently, this information is to update the service protocol list of available root isolates running in the VM and their names so that the appropriate isolate can be selected in the tools for debugging and instrumentation. More... | |
virtual void | SetNeedsReportTimings (bool value)=0 |
Notifies this client that the application has an opinion about whether its frame timings need to be reported backed to it. Due to the asynchronous nature of rendering in Flutter, it is not possible for the application to determine the total time it took to render a specific frame. While the layer-tree is constructed on the UI thread, it needs to be rendering on the raster thread. Dart code cannot execute on this thread. So any instrumentation about the frame times gathered on this thread needs to be aggregated and sent back to the UI thread for processing in Dart. More... | |
virtual std::shared_ptr< const fml::Mapping > | GetPersistentIsolateData ()=0 |
The embedder can specify data that the isolate can request synchronously on launch. This accessor fetches that data. More... | |
virtual std::unique_ptr< std::vector< std::string > > | ComputePlatformResolvedLocale (const std::vector< std::string > &supported_locale_data)=0 |
Directly invokes platform-specific APIs to compute the locale the platform would have natively resolved to. More... | |
virtual void | RequestDartDeferredLibrary (intptr_t loading_unit_id)=0 |
Invoked when the Dart VM requests that a deferred library be loaded. Notifies the engine that the deferred library identified by the specified loading unit id should be downloaded and loaded into the Dart VM via LoadDartDeferredLibrary More... | |
virtual void | SendChannelUpdate (std::string name, bool listening)=0 |
Invoked when a listener is registered on a platform channel. More... | |
virtual double | GetScaledFontSize (double unscaled_font_size, int configuration_id) const =0 |
Synchronously invokes platform-specific APIs to apply the system text scaling on the given unscaled font size. More... | |
virtual std::shared_ptr< PlatformIsolateManager > | GetPlatformIsolateManager ()=0 |
Protected Member Functions | |
virtual | ~PlatformConfigurationClient () |
A client interface that the RuntimeController
uses to define handlers for PlatformConfiguration
requests.
PlatformConfiguration
Definition at line 52 of file platform_configuration.h.
|
protectedvirtual |
Definition at line 32 of file platform_configuration.cc.
|
pure virtual |
Directly invokes platform-specific APIs to compute the locale the platform would have natively resolved to.
[in] | supported_locale_data | The vector of strings that represents the locales supported by the app. Each locale consists of three strings: languageCode, countryCode, and scriptCode in that order. |
Implemented in flutter::testing::FakePlatformConfigurationClient.
|
pure virtual |
The route or path that the embedder requested when the application was launched.
This will be the string "`/`" if no particular route was requested.
Implemented in flutter::testing::FakePlatformConfigurationClient.
|
pure virtual |
Called when a warm up frame has ended.
For more introduction, see `Animator::EndWarmUpFrame`.
Implemented in flutter::testing::FakePlatformConfigurationClient.
|
pure virtual |
Returns the current collection of assets available on the platform.
Implemented in flutter::testing::FakePlatformConfigurationClient.
|
pure virtual |
Returns the current collection of fonts available on the platform.
This function reads an XML file and makes font families and collections of them. MinikinFontForTest is used for FontFamily creation.
Implemented in flutter::testing::FakePlatformConfigurationClient.
|
pure virtual |
The embedder can specify data that the isolate can request synchronously on launch. This accessor fetches that data.
This data is persistent for the duration of the Flutter application and is available even after isolate restarts. Because of this lifecycle, the size of this data must be kept to a minimum.
For asynchronous communication between the embedder and isolate, a platform channel may be used.
Implemented in flutter::testing::FakePlatformConfigurationClient, and flutter::RuntimeController.
|
pure virtual |
Implemented in flutter::testing::FakePlatformConfigurationClient, and flutter::RuntimeController.
|
pure virtual |
Synchronously invokes platform-specific APIs to apply the system text scaling on the given unscaled font size.
Platforms that support this feature (currently it's only implemented for Android SDK level 34+) will send a valid configuration_id to potential callers, before this method can be called.
[in] | unscaled_font_size | The unscaled font size specified by the app developer. The value is in logical pixels, and is guaranteed to be finite and non-negative. |
[in] | configuration_id | The unique id of the configuration to use for computing the scaled font size. |
Implemented in flutter::testing::FakePlatformConfigurationClient.
|
pure virtual |
When the Flutter application has a message to send to the underlying platform, the message needs to be forwarded to the platform on the appropriate thread (via the platform task runner). The PlatformConfiguration delegates this task to the engine via this method.
[in] | message | The message from the Flutter application to send to the underlying platform. |
Implemented in flutter::testing::FakePlatformConfigurationClient.
|
pure virtual |
Updates the client's rendering on the GPU with the newly provided Scene.
Implemented in flutter::testing::FakePlatformConfigurationClient.
|
pure virtual |
Invoked when the Dart VM requests that a deferred library be loaded. Notifies the engine that the deferred library identified by the specified loading unit id should be downloaded and loaded into the Dart VM via LoadDartDeferredLibrary
Upon encountering errors or otherwise failing to load a loading unit with the specified id, the failure should be directly reported to dart by calling LoadDartDeferredLibraryFailure
to ensure the waiting dart future completes with an error.
[in] | loading_unit_id | The unique id of the deferred library's loading unit. This id is to be passed back into LoadDartDeferredLibrary in order to identify which deferred library to load. |
Implemented in flutter::testing::FakePlatformConfigurationClient, and flutter::RuntimeController.
|
pure virtual |
Requests that, at the next appropriate opportunity, a new frame be scheduled for rendering.
Implemented in flutter::testing::FakePlatformConfigurationClient.
|
pure virtual |
Invoked when a listener is registered on a platform channel.
[in] | name | The name of the platform channel to which a listener has been registered or cleared. |
[in] | listening | Whether the listener has been set (true) or cleared (false). |
Implemented in flutter::testing::FakePlatformConfigurationClient.
|
pure virtual |
Notifies this client that the application has an opinion about whether its frame timings need to be reported backed to it. Due to the asynchronous nature of rendering in Flutter, it is not possible for the application to determine the total time it took to render a specific frame. While the layer-tree is constructed on the UI thread, it needs to be rendering on the raster thread. Dart code cannot execute on this thread. So any instrumentation about the frame times gathered on this thread needs to be aggregated and sent back to the UI thread for processing in Dart.
When the application indicates that frame times need to be reported, it collects this information till a specified number of data points are gathered. Then this information is sent back to Dart code via Engine::ReportTimings
.
This option is engine counterpart of the Window._setNeedsReportTimings
in window.dart
.
[in] | needs_reporting | If reporting information should be collected and send back to Dart. |
Implemented in flutter::testing::FakePlatformConfigurationClient.
|
pure virtual |
Notifies this client of the name of the root isolate and its port when that isolate is launched, restarted (in the cold-restart scenario) or the application itself updates the name of the root isolate (via Window.setIsolateDebugName
in window.dart
). The name of the isolate is meaningless to the engine but is used in instrumentation and tooling. Currently, this information is to update the service protocol list of available root isolates running in the VM and their names so that the appropriate isolate can be selected in the tools for debugging and instrumentation.
[in] | isolate_name | The isolate name |
[in] | isolate_port | The isolate port |
Implemented in flutter::testing::FakePlatformConfigurationClient.
|
pure virtual |
Receives an updated semantics tree from the Framework.
[in] | update | The updated semantic tree to apply. |
Implemented in flutter::testing::FakePlatformConfigurationClient.