Flutter Engine
The Flutter Engine
platform_configuration.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "flutter/lib/ui/window/platform_configuration.h"
6
7#include <cstring>
8
9#include "flutter/common/constants.h"
10#include "flutter/lib/ui/compositing/scene.h"
11#include "flutter/lib/ui/ui_dart_state.h"
12#include "flutter/lib/ui/window/platform_message.h"
13#include "flutter/lib/ui/window/platform_message_response_dart.h"
14#include "flutter/lib/ui/window/platform_message_response_dart_port.h"
15#include "flutter/lib/ui/window/viewport_metrics.h"
22
23namespace flutter {
24namespace {
25
26Dart_Handle ToByteData(const fml::Mapping& buffer) {
27 return tonic::DartByteData::Create(buffer.GetMapping(), buffer.GetSize());
28}
29
30} // namespace
31
33
36 : client_(client) {}
37
39
41 Dart_Handle library = Dart_LookupLibrary(tonic::ToDart("dart:ui"));
42
44 Dart_GetField(library, tonic::ToDart("_onError")));
46 Dart_GetField(library, tonic::ToDart("_addView")));
47 remove_view_.Set(tonic::DartState::Current(),
48 Dart_GetField(library, tonic::ToDart("_removeView")));
49 update_window_metrics_.Set(
51 Dart_GetField(library, tonic::ToDart("_updateWindowMetrics")));
52 update_displays_.Set(
54 Dart_GetField(library, tonic::ToDart("_updateDisplays")));
55 update_locales_.Set(tonic::DartState::Current(),
56 Dart_GetField(library, tonic::ToDart("_updateLocales")));
57 update_user_settings_data_.Set(
59 Dart_GetField(library, tonic::ToDart("_updateUserSettingsData")));
60 update_initial_lifecycle_state_.Set(
62 Dart_GetField(library, tonic::ToDart("_updateInitialLifecycleState")));
63 update_semantics_enabled_.Set(
65 Dart_GetField(library, tonic::ToDart("_updateSemanticsEnabled")));
66 update_accessibility_features_.Set(
68 Dart_GetField(library, tonic::ToDart("_updateAccessibilityFeatures")));
69 dispatch_platform_message_.Set(
71 Dart_GetField(library, tonic::ToDart("_dispatchPlatformMessage")));
72 dispatch_pointer_data_packet_.Set(
74 Dart_GetField(library, tonic::ToDart("_dispatchPointerDataPacket")));
75 dispatch_semantics_action_.Set(
77 Dart_GetField(library, tonic::ToDart("_dispatchSemanticsAction")));
78 begin_frame_.Set(tonic::DartState::Current(),
79 Dart_GetField(library, tonic::ToDart("_beginFrame")));
80 draw_frame_.Set(tonic::DartState::Current(),
81 Dart_GetField(library, tonic::ToDart("_drawFrame")));
82 report_timings_.Set(tonic::DartState::Current(),
83 Dart_GetField(library, tonic::ToDart("_reportTimings")));
84}
85
86bool PlatformConfiguration::AddView(int64_t view_id,
87 const ViewportMetrics& view_metrics) {
88 auto [view_iterator, insertion_happened] =
89 metrics_.emplace(view_id, view_metrics);
90 if (!insertion_happened) {
91 FML_LOG(ERROR) << "View #" << view_id << " already exists.";
92 return false;
93 }
94
95 std::shared_ptr<tonic::DartState> dart_state = add_view_.dart_state().lock();
96 if (!dart_state) {
97 return false;
98 }
99 tonic::DartState::Scope scope(dart_state);
101 add_view_.Get(),
102 {
103 tonic::ToDart(view_id),
104 tonic::ToDart(view_metrics.device_pixel_ratio),
105 tonic::ToDart(view_metrics.physical_width),
106 tonic::ToDart(view_metrics.physical_height),
107 tonic::ToDart(view_metrics.physical_padding_top),
108 tonic::ToDart(view_metrics.physical_padding_right),
109 tonic::ToDart(view_metrics.physical_padding_bottom),
110 tonic::ToDart(view_metrics.physical_padding_left),
111 tonic::ToDart(view_metrics.physical_view_inset_top),
112 tonic::ToDart(view_metrics.physical_view_inset_right),
113 tonic::ToDart(view_metrics.physical_view_inset_bottom),
114 tonic::ToDart(view_metrics.physical_view_inset_left),
115 tonic::ToDart(view_metrics.physical_system_gesture_inset_top),
116 tonic::ToDart(view_metrics.physical_system_gesture_inset_right),
117 tonic::ToDart(view_metrics.physical_system_gesture_inset_bottom),
118 tonic::ToDart(view_metrics.physical_system_gesture_inset_left),
119 tonic::ToDart(view_metrics.physical_touch_slop),
120 tonic::ToDart(view_metrics.physical_display_features_bounds),
121 tonic::ToDart(view_metrics.physical_display_features_type),
122 tonic::ToDart(view_metrics.physical_display_features_state),
123 tonic::ToDart(view_metrics.display_id),
124 }));
125 return true;
126}
127
129 if (view_id == kFlutterImplicitViewId) {
130 FML_LOG(FATAL) << "The implicit view #" << view_id << " cannot be removed.";
131 return false;
132 }
133 size_t erased_elements = metrics_.erase(view_id);
134 if (erased_elements == 0) {
135 FML_LOG(ERROR) << "View #" << view_id << " doesn't exist.";
136 return false;
137 }
138
139 std::shared_ptr<tonic::DartState> dart_state =
140 remove_view_.dart_state().lock();
141 if (!dart_state) {
142 return false;
143 }
144 tonic::DartState::Scope scope(dart_state);
146 tonic::DartInvoke(remove_view_.Get(), {
147 tonic::ToDart(view_id),
148 }));
149 return true;
150}
151
153 int64_t view_id,
154 const ViewportMetrics& view_metrics) {
155 auto found_iter = metrics_.find(view_id);
156 if (found_iter == metrics_.end()) {
157 return false;
158 }
159
160 found_iter->second = view_metrics;
161
162 std::shared_ptr<tonic::DartState> dart_state =
163 update_window_metrics_.dart_state().lock();
164 if (!dart_state) {
165 return false;
166 }
167 tonic::DartState::Scope scope(dart_state);
169 update_window_metrics_.Get(),
170 {
171 tonic::ToDart(view_id),
172 tonic::ToDart(view_metrics.device_pixel_ratio),
173 tonic::ToDart(view_metrics.physical_width),
174 tonic::ToDart(view_metrics.physical_height),
175 tonic::ToDart(view_metrics.physical_padding_top),
176 tonic::ToDart(view_metrics.physical_padding_right),
177 tonic::ToDart(view_metrics.physical_padding_bottom),
178 tonic::ToDart(view_metrics.physical_padding_left),
179 tonic::ToDart(view_metrics.physical_view_inset_top),
180 tonic::ToDart(view_metrics.physical_view_inset_right),
181 tonic::ToDart(view_metrics.physical_view_inset_bottom),
182 tonic::ToDart(view_metrics.physical_view_inset_left),
183 tonic::ToDart(view_metrics.physical_system_gesture_inset_top),
184 tonic::ToDart(view_metrics.physical_system_gesture_inset_right),
185 tonic::ToDart(view_metrics.physical_system_gesture_inset_bottom),
186 tonic::ToDart(view_metrics.physical_system_gesture_inset_left),
187 tonic::ToDart(view_metrics.physical_touch_slop),
188 tonic::ToDart(view_metrics.physical_display_features_bounds),
189 tonic::ToDart(view_metrics.physical_display_features_type),
190 tonic::ToDart(view_metrics.physical_display_features_state),
191 tonic::ToDart(view_metrics.display_id),
192 }));
193 return true;
194}
195
197 const std::vector<DisplayData>& displays) {
198 std::vector<DisplayId> ids;
199 std::vector<double> widths;
200 std::vector<double> heights;
201 std::vector<double> device_pixel_ratios;
202 std::vector<double> refresh_rates;
203 for (const auto& display : displays) {
204 ids.push_back(display.id);
205 widths.push_back(display.width);
206 heights.push_back(display.height);
207 device_pixel_ratios.push_back(display.pixel_ratio);
208 refresh_rates.push_back(display.refresh_rate);
209 }
210 std::shared_ptr<tonic::DartState> dart_state =
211 update_displays_.dart_state().lock();
212 if (!dart_state) {
213 return;
214 }
215 tonic::DartState::Scope scope(dart_state);
217 update_displays_.Get(),
218 {
219 tonic::ToDart<std::vector<DisplayId>>(ids),
220 tonic::ToDart<std::vector<double>>(widths),
221 tonic::ToDart<std::vector<double>>(heights),
222 tonic::ToDart<std::vector<double>>(device_pixel_ratios),
223 tonic::ToDart<std::vector<double>>(refresh_rates),
224 }));
225}
226
228 const std::vector<std::string>& locales) {
229 std::shared_ptr<tonic::DartState> dart_state =
230 update_locales_.dart_state().lock();
231 if (!dart_state) {
232 return;
233 }
234
235 tonic::DartState::Scope scope(dart_state);
237 tonic::DartInvoke(update_locales_.Get(),
238 {
239 tonic::ToDart<std::vector<std::string>>(locales),
240 }));
241}
242
244 std::shared_ptr<tonic::DartState> dart_state =
245 update_user_settings_data_.dart_state().lock();
246 if (!dart_state) {
247 return;
248 }
249 tonic::DartState::Scope scope(dart_state);
250
251 tonic::CheckAndHandleError(tonic::DartInvoke(update_user_settings_data_.Get(),
252 {
253 tonic::StdStringToDart(data),
254 }));
255}
256
258 const std::string& data) {
259 std::shared_ptr<tonic::DartState> dart_state =
260 update_initial_lifecycle_state_.dart_state().lock();
261 if (!dart_state) {
262 return;
263 }
264 tonic::DartState::Scope scope(dart_state);
266 update_initial_lifecycle_state_.Get(), {
267 tonic::StdStringToDart(data),
268 }));
269}
270
272 std::shared_ptr<tonic::DartState> dart_state =
273 update_semantics_enabled_.dart_state().lock();
274 if (!dart_state) {
275 return;
276 }
277 tonic::DartState::Scope scope(dart_state);
279
280 tonic::CheckAndHandleError(tonic::DartInvoke(update_semantics_enabled_.Get(),
281 {tonic::ToDart(enabled)}));
282}
283
285 std::shared_ptr<tonic::DartState> dart_state =
286 update_accessibility_features_.dart_state().lock();
287 if (!dart_state) {
288 return;
289 }
290 tonic::DartState::Scope scope(dart_state);
291
293 update_accessibility_features_.Get(), {tonic::ToDart(values)}));
294}
295
297 std::unique_ptr<PlatformMessage> message) {
298 std::shared_ptr<tonic::DartState> dart_state =
299 dispatch_platform_message_.dart_state().lock();
300 if (!dart_state) {
301 FML_DLOG(WARNING)
302 << "Dropping platform message for lack of DartState on channel: "
303 << message->channel();
304 return;
305 }
306 tonic::DartState::Scope scope(dart_state);
307 Dart_Handle data_handle =
308 (message->hasData()) ? ToByteData(message->data()) : Dart_Null();
309 if (Dart_IsError(data_handle)) {
310 FML_DLOG(WARNING)
311 << "Dropping platform message because of a Dart error on channel: "
312 << message->channel();
313 return;
314 }
315
316 int response_id = 0;
317 if (auto response = message->response()) {
318 response_id = next_response_id_++;
319 pending_responses_[response_id] = response;
320 }
321
323 tonic::DartInvoke(dispatch_platform_message_.Get(),
324 {tonic::ToDart(message->channel()), data_handle,
325 tonic::ToDart(response_id)}));
326}
327
329 const PointerDataPacket& packet) {
330 std::shared_ptr<tonic::DartState> dart_state =
331 dispatch_pointer_data_packet_.dart_state().lock();
332 if (!dart_state) {
333 return;
334 }
335 tonic::DartState::Scope scope(dart_state);
336
337 const std::vector<uint8_t>& buffer = packet.data();
338 Dart_Handle data_handle =
340 if (Dart_IsError(data_handle)) {
341 return;
342 }
343
345 tonic::DartInvoke(dispatch_pointer_data_packet_.Get(), {data_handle}));
346}
347
351 std::shared_ptr<tonic::DartState> dart_state =
352 dispatch_semantics_action_.dart_state().lock();
353 if (!dart_state) {
354 return;
355 }
356 tonic::DartState::Scope scope(dart_state);
357
358 Dart_Handle args_handle =
359 (args.GetSize() <= 0) ? Dart_Null() : ToByteData(args);
360
361 if (Dart_IsError(args_handle)) {
362 return;
363 }
364
366 dispatch_semantics_action_.Get(),
367 {tonic::ToDart(node_id), tonic::ToDart(static_cast<int32_t>(action)),
368 args_handle}));
369}
370
372 uint64_t frame_number) {
373 std::shared_ptr<tonic::DartState> dart_state =
374 begin_frame_.dart_state().lock();
375 if (!dart_state) {
376 return;
377 }
378 tonic::DartState::Scope scope(dart_state);
379
380 int64_t microseconds = (frameTime - fml::TimePoint()).ToMicroseconds();
381
383 tonic::DartInvoke(begin_frame_.Get(), {
384 Dart_NewInteger(microseconds),
385 Dart_NewInteger(frame_number),
386 }));
387
389
391}
392
393void PlatformConfiguration::ReportTimings(std::vector<int64_t> timings) {
394 std::shared_ptr<tonic::DartState> dart_state =
395 report_timings_.dart_state().lock();
396 if (!dart_state) {
397 return;
398 }
399 tonic::DartState::Scope scope(dart_state);
400
401 Dart_Handle data_handle =
403
405 void* data = nullptr;
406 intptr_t num_acquired = 0;
408 Dart_TypedDataAcquireData(data_handle, &type, &data, &num_acquired)));
409 FML_DCHECK(num_acquired == static_cast<int>(timings.size()));
410
411 memcpy(data, timings.data(), sizeof(int64_t) * timings.size());
413
415 tonic::DartInvoke(report_timings_.Get(), {
416 data_handle,
417 }));
418}
419
421 auto found = metrics_.find(view_id);
422 if (found != metrics_.end()) {
423 return &found->second;
424 } else {
425 return nullptr;
426 }
427}
428
430 int response_id) {
431 if (!response_id) {
432 return;
433 }
434 auto it = pending_responses_.find(response_id);
435 if (it == pending_responses_.end()) {
436 return;
437 }
438 auto response = std::move(it->second);
439 pending_responses_.erase(it);
440 response->CompleteEmpty();
441}
442
444 int response_id,
445 std::vector<uint8_t> data) {
446 if (!response_id) {
447 return;
448 }
449 auto it = pending_responses_.find(response_id);
450 if (it == pending_responses_.end()) {
451 return;
452 }
453 auto response = std::move(it->second);
454 pending_responses_.erase(it);
455 response->Complete(std::make_unique<fml::DataMapping>(std::move(data)));
456}
457
459 Scene* scene,
460 double width,
461 double height) {
464 view_id, scene, width, height);
465}
466
471 ->client()
473}
474
475namespace {
476Dart_Handle HandlePlatformMessage(
477 UIDartState* dart_state,
478 const std::string& name,
479 Dart_Handle data_handle,
480 const fml::RefPtr<PlatformMessageResponse>& response) {
481 if (Dart_IsNull(data_handle)) {
482 return dart_state->HandlePlatformMessage(
483 std::make_unique<PlatformMessage>(name, response));
484 } else {
485 tonic::DartByteData data(data_handle);
486 const uint8_t* buffer = static_cast<const uint8_t*>(data.data());
487 return dart_state->HandlePlatformMessage(std::make_unique<PlatformMessage>(
488 name, fml::MallocMapping::Copy(buffer, data.length_in_bytes()),
489 response));
490 }
491}
492} // namespace
493
495 const std::string& name,
497 Dart_Handle data_handle) {
498 UIDartState* dart_state = UIDartState::Current();
499
500 if (!dart_state->platform_configuration()) {
501 return tonic::ToDart(
502 "SendPlatformMessage only works on the root isolate, see "
503 "SendPortPlatformMessage.");
504 }
505
507 if (!Dart_IsNull(callback)) {
508 response = fml::MakeRefCounted<PlatformMessageResponseDart>(
510 dart_state->GetTaskRunners().GetUITaskRunner(), name);
511 }
512
513 return HandlePlatformMessage(dart_state, name, data_handle, response);
514}
515
517 const std::string& name,
519 Dart_Handle send_port,
520 Dart_Handle data_handle) {
521 // This can be executed on any isolate.
522 UIDartState* dart_state = UIDartState::Current();
523
524 int64_t c_send_port = tonic::DartConverter<int64_t>::FromDart(send_port);
525 if (c_send_port == ILLEGAL_PORT) {
526 return tonic::ToDart("Invalid port specified");
527 }
528
530 fml::MakeRefCounted<PlatformMessageResponseDartPort>(
532 name);
533
534 return HandlePlatformMessage(dart_state, name, data_handle, response);
535}
536
538 int response_id,
539 const tonic::DartByteData& data) {
540 if (Dart_IsNull(data.dart_handle())) {
544 } else {
545 // TODO(engine): Avoid this copy.
546 const uint8_t* buffer = static_cast<const uint8_t*>(data.data());
550 response_id,
551 std::vector<uint8_t>(buffer, buffer + data.length_in_bytes()));
552 }
553}
554
556 const std::string& name) {
559}
560
561Dart_PerformanceMode PlatformConfigurationNativeApi::current_performance_mode_ =
563
565 return current_performance_mode_;
566}
567
570 current_performance_mode_ = static_cast<Dart_PerformanceMode>(mode);
571 return Dart_SetPerformanceMode(current_performance_mode_);
572}
573
576
577 auto persistent_isolate_data = UIDartState::Current()
579 ->client()
581
582 if (!persistent_isolate_data) {
583 return Dart_Null();
584 }
585
586 return tonic::DartByteData::Create(persistent_isolate_data->GetMapping(),
587 persistent_isolate_data->GetSize());
588}
589
593}
594
598}
599
603 update);
604}
605
607 Dart_Handle supportedLocalesHandle) {
609 std::vector<std::string> supportedLocales =
611 supportedLocalesHandle);
612
613 std::vector<std::string> results =
616 ->client()
617 ->ComputePlatformResolvedLocale(supportedLocales);
618
620}
621
624 return UIDartState::Current()
626 ->client()
628}
629
631 UIDartState* dart_state = UIDartState::Current();
632 FML_DCHECK(dart_state);
633 return dart_state->GetRootIsolateToken();
634}
635
637 int64_t root_isolate_token) {
638 UIDartState* dart_state = UIDartState::Current();
639 FML_DCHECK(dart_state && !dart_state->IsRootIsolate());
640 auto platform_message_handler =
641 (*static_cast<std::shared_ptr<PlatformMessageHandlerStorage>*>(
643 FML_DCHECK(platform_message_handler);
644 auto weak_platform_message_handler =
645 platform_message_handler->GetPlatformMessageHandler(root_isolate_token);
646 dart_state->SetPlatformMessageHandler(weak_platform_message_handler);
647}
648
650 bool listening) {
652 name, listening);
653}
654
656 double unscaled_font_size,
657 int configuration_id) {
659 return UIDartState::Current()
661 ->client()
662 ->GetScaledFontSize(unscaled_font_size, configuration_id);
663}
664} // namespace flutter
const SkScalar widths[]
Definition: StrokerTest.cpp:39
GLenum type
A client interface that the RuntimeController uses to define handlers for PlatformConfiguration reque...
virtual std::shared_ptr< const fml::Mapping > GetPersistentIsolateData()=0
The embedder can specify data that the isolate can request synchronously on launch....
virtual void EndWarmUpFrame()=0
Called when a warm up frame has ended.
virtual void SetNeedsReportTimings(bool value)=0
Notifies this client that the application has an opinion about whether its frame timings need to be r...
virtual std::string DefaultRouteName()=0
The route or path that the embedder requested when the application was launched.
virtual void ScheduleFrame()=0
Requests that, at the next appropriate opportunity, a new frame be scheduled for rendering.
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 f...
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 resolv...
virtual void UpdateSemantics(SemanticsUpdate *update)=0
Receives an updated semantics tree from the Framework.
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.
virtual void SendChannelUpdate(std::string name, bool listening)=0
Invoked when a listener is registered on a platform channel.
static void SendChannelUpdate(const std::string &name, bool listening)
static void Render(int64_t view_id, Scene *scene, double width, double height)
static Dart_Handle SendPortPlatformMessage(const std::string &name, Dart_Handle identifier, Dart_Handle send_port, Dart_Handle data_handle)
static double GetScaledFontSize(double unscaled_font_size, int configuration_id)
static int RequestDartPerformanceMode(int mode)
Requests the Dart VM to adjusts the GC heuristics based on the requested performance_mode....
static void UpdateSemantics(SemanticsUpdate *update)
static Dart_PerformanceMode GetDartPerformanceMode()
Returns the current performance mode of the Dart VM. Defaults to Dart_PerformanceMode_Default if no p...
static Dart_Handle ComputePlatformResolvedLocale(Dart_Handle supportedLocalesHandle)
static void RegisterBackgroundIsolate(int64_t root_isolate_token)
static Dart_Handle SendPlatformMessage(const std::string &name, Dart_Handle callback, Dart_Handle data_handle)
static void RespondToPlatformMessage(int response_id, const tonic::DartByteData &data)
static void SetIsolateDebugName(const std::string &name)
void UpdateAccessibilityFeatures(int32_t flags)
Forward the preference of accessibility features that must be enabled in the semantics tree to the fr...
void DidCreateIsolate()
Called by the RuntimeController once it has created the root isolate, so that the PlatformController ...
void DispatchPointerDataPacket(const PointerDataPacket &packet)
Notifies the PlatformConfiguration that the client has sent it pointer events. This call originates i...
void CompletePlatformMessageResponse(int response_id, std::vector< uint8_t > data)
Responds to a previous platform message to the engine from the framework.
void DispatchPlatformMessage(std::unique_ptr< PlatformMessage > message)
Notifies the PlatformConfiguration that the client has sent it a message. This call originates in the...
PlatformConfiguration(PlatformConfigurationClient *client)
Creates a new PlatformConfiguration, typically created by the RuntimeController.
void UpdateSemanticsEnabled(bool enabled)
Notifies the PlatformConfiguration that the embedder has expressed an opinion about whether the acces...
void ReportTimings(std::vector< int64_t > timings)
Dart code cannot fully measure the time it takes for a specific frame to be rendered....
bool AddView(int64_t view_id, const ViewportMetrics &view_metrics)
Notify the framework that a new view is available.
void UpdateInitialLifecycleState(const std::string &data)
Updates the lifecycle state data in the framework.
void DispatchSemanticsAction(int32_t node_id, SemanticsAction action, fml::MallocMapping args)
Notifies the framework that the embedder encountered an accessibility related action on the specified...
void UpdateDisplays(const std::vector< DisplayData > &displays)
Update the specified display data in the framework.
void UpdateLocales(const std::vector< std::string > &locales)
Update the specified locale data in the framework.
bool RemoveView(int64_t view_id)
Notify the framework that a view is no longer available.
void BeginFrame(fml::TimePoint frame_time, uint64_t frame_number)
Notifies the framework that it is time to begin working on a new frame previously scheduled via a cal...
void CompletePlatformMessageEmptyResponse(int response_id)
Responds to a previous platform message to the engine from the framework with an empty response.
const ViewportMetrics * GetMetrics(int view_id)
Retrieves the viewport metrics with the given ID managed by the PlatformConfiguration.
bool UpdateViewMetrics(int64_t view_id, const ViewportMetrics &metrics)
Update the view metrics for the specified view.
PlatformConfigurationClient * client() const
Access to the platform configuration client (which typically is implemented by the RuntimeController)...
void UpdateUserSettingsData(const std::string &data)
Update the user settings data in the framework.
const std::vector< uint8_t > & data() const
fml::RefPtr< fml::TaskRunner > GetUITaskRunner() const
Definition: task_runners.cc:34
PlatformConfiguration * platform_configuration() const
bool IsRootIsolate() const
const TaskRunners & GetTaskRunners() const
void SetDebugName(const std::string &name)
int64_t GetRootIsolateToken() const
void SetPlatformMessageHandler(std::weak_ptr< PlatformMessageHandler > handler)
static UIDartState * Current()
static void ThrowIfUIOperationsProhibited()
Dart_Handle HandlePlatformMessage(std::unique_ptr< PlatformMessage > message)
A Mapping like NonOwnedMapping, but uses Free as its release proc.
Definition: mapping.h:144
static MallocMapping Copy(const T *begin, const T *end)
Definition: mapping.h:162
static Dart_Handle Create(const void *data, size_t length)
void Set(DartState *dart_state, Dart_Handle value)
const std::weak_ptr< DartState > & dart_state() const
static DartState * Current()
Definition: dart_state.cc:56
static SkString identifier(const FontFamilyDesc &family, const FontDesc &font)
#define ILLEGAL_PORT
Definition: dart_api.h:1535
Dart_PerformanceMode
Definition: dart_api.h:1369
@ Dart_PerformanceMode_Default
Definition: dart_api.h:1373
struct _Dart_Handle * Dart_Handle
Definition: dart_api.h:258
DART_EXPORT Dart_Handle Dart_TypedDataReleaseData(Dart_Handle object)
DART_EXPORT Dart_Handle Dart_LookupLibrary(Dart_Handle url)
DART_EXPORT Dart_Handle Dart_TypedDataAcquireData(Dart_Handle object, Dart_TypedData_Type *type, void **data, intptr_t *len)
Dart_TypedData_Type
Definition: dart_api.h:2612
@ Dart_TypedData_kInt64
Definition: dart_api.h:2621
DART_EXPORT Dart_Handle Dart_NewTypedData(Dart_TypedData_Type type, intptr_t length)
DART_EXPORT Dart_Handle Dart_Null(void)
DART_EXPORT bool Dart_IsNull(Dart_Handle object)
DART_EXPORT DART_WARN_UNUSED_RESULT Dart_Handle Dart_GetField(Dart_Handle container, Dart_Handle name)
DART_EXPORT Dart_PerformanceMode Dart_SetPerformanceMode(Dart_PerformanceMode mode)
DART_EXPORT bool Dart_IsError(Dart_Handle handle)
DART_EXPORT void * Dart_CurrentIsolateGroupData(void)
#define FATAL(error)
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
uint8_t value
#define FML_DLOG(severity)
Definition: logging.h:102
#define FML_LOG(severity)
Definition: logging.h:82
#define FML_CHECK(condition)
Definition: logging.h:85
#define FML_DCHECK(condition)
Definition: logging.h:103
Win32Message message
constexpr int64_t kFlutterImplicitViewId
Definition: constants.h:35
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition: switches.h:41
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive mode
Definition: switches.h:228
std::chrono::time_point< std::chrono::high_resolution_clock > TimePoint
Definition: timing.h:15
Dart_Handle ToDart(const T &object)
Dart_Handle DartInvoke(Dart_Handle closure, std::initializer_list< Dart_Handle > args)
Definition: dart_invoke.cc:20
Dart_Handle DartInvokeVoid(Dart_Handle closure)
Definition: dart_invoke.cc:29
bool CheckAndHandleError(Dart_Handle handle)
Definition: dart_error.cc:33
Definition: update.py:1
int32_t height
int32_t width
#define ERROR(message)
Definition: elf_loader.cc:260