Flutter Engine
 
Loading...
Searching...
No Matches
platform_view.h
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#ifndef FLUTTER_SHELL_COMMON_PLATFORM_VIEW_H_
6#define FLUTTER_SHELL_COMMON_PLATFORM_VIEW_H_
7
8#include <functional>
9#include <memory>
10
15#include "flutter/fml/macros.h"
16#include "flutter/fml/mapping.h"
27#include "third_party/skia/include/gpu/ganesh/GrDirectContext.h"
28
29namespace impeller {
30
31class Context;
32
33} // namespace impeller
34
35namespace flutter {
36
37//------------------------------------------------------------------------------
38/// @brief Platform views are created by the shell on the platform task
39/// runner. Unless explicitly specified, all platform view methods
40/// are called on the platform task runner as well. Platform views
41/// are usually sub-classed on a per platform basis and the bulk of
42/// the window system integration happens using that subclass. Since
43/// most platform window toolkits are usually only safe to access on
44/// a single "main" thread, any interaction that requires access to
45/// the underlying platform's window toolkit is routed through the
46/// platform view associated with that shell. This involves
47/// operations like settings up and tearing down the render surface,
48/// platform messages, interacting with accessibility features on
49/// the platform, input events, etc.
50///
52 public:
53 using AddViewCallback = std::function<void(bool added)>;
54 using RemoveViewCallback = std::function<void(bool removed)>;
55 //----------------------------------------------------------------------------
56 /// @brief Used to forward events from the platform view to interested
57 /// subsystems. This forwarding is done by the shell which sets
58 /// itself up as the delegate of the platform view.
59 ///
60 class Delegate {
61 public:
64 using KeyDataResponse = std::function<void(bool)>;
65 //--------------------------------------------------------------------------
66 /// @brief Notifies the delegate that the platform view was created
67 /// with the given render surface. This surface is platform
68 /// (iOS, Android) and client-rendering API (OpenGL, Software,
69 /// Metal, Vulkan) specific. This is usually a sign to the
70 /// rasterizer to set up and begin rendering to that surface.
71 ///
72 /// @param[in] surface The surface
73 ///
74 virtual void OnPlatformViewCreated(std::unique_ptr<Surface> surface) = 0;
75
76 //--------------------------------------------------------------------------
77 /// @brief Notifies the delegate that the platform view was destroyed.
78 /// This is usually a sign to the rasterizer to suspend
79 /// rendering a previously configured surface and collect any
80 /// intermediate resources.
81 ///
82 virtual void OnPlatformViewDestroyed() = 0;
83
84 //--------------------------------------------------------------------------
85 /// @brief Notifies the delegate that the platform needs to schedule a
86 /// frame to regenerate the layer tree and redraw the surface.
87 ///
88 virtual void OnPlatformViewScheduleFrame() = 0;
89
90 /// @brief Allocate resources for a new non-implicit view and inform
91 /// Dart about the view, and on success, schedules a new frame.
92 ///
93 /// After the operation, |callback| should be invoked with whether
94 /// the operation is successful.
95 ///
96 /// Adding |kFlutterImplicitViewId| or an existing view ID should
97 /// result in failure.
98 ///
99 /// @param[in] view_id The view ID of the new view.
100 /// @param[in] viewport_metrics The initial viewport metrics for the view.
101 /// @param[in] callback The callback that's invoked once the shell
102 /// has attempted to add the view.
103 ///
104 virtual void OnPlatformViewAddView(int64_t view_id,
105 const ViewportMetrics& viewport_metrics,
107
108 /// @brief Deallocate resources for a removed view and inform
109 /// Dart about the removal.
110 ///
111 /// After the operation, |callback| should be invoked with whether
112 /// the operation is successful.
113 ///
114 /// Removing |kFlutterImplicitViewId| or an non-existent view ID
115 /// should result in failure.
116 ///
117 /// @param[in] view_id The view ID of the view to be removed.
118 /// @param[in] callback The callback that's invoked once the shell has
119 /// attempted to remove the view.
120 ///
121 virtual void OnPlatformViewRemoveView(int64_t view_id,
123
124 /// @brief Notify the delegate that platform view focus state has changed.
125 ///
126 /// @param[in] event The focus event describing the change.
128 const ViewFocusEvent& event) = 0;
129
130 //--------------------------------------------------------------------------
131 /// @brief Notifies the delegate that the specified callback needs to
132 /// be invoked after the rasterizer is done rendering the next
133 /// frame. This callback will be called on the render thread and
134 /// it is caller responsibility to perform any re-threading as
135 /// necessary. Due to the asynchronous nature of rendering in
136 /// Flutter, embedders usually add a placeholder over the
137 /// contents in which Flutter is going to render when Flutter is
138 /// first initialized. This callback may be used as a signal to
139 /// remove that placeholder.
140 ///
141 /// @attention The callback will be invoked on the render thread and not
142 /// the calling thread.
143 ///
144 /// @param[in] closure The callback to execute on the next frame.
145 ///
147 const fml::closure& closure) = 0;
148
149 //--------------------------------------------------------------------------
150 /// @brief Notifies the delegate the viewport metrics of a view have
151 /// been updated. The rasterizer will need to be reconfigured to
152 /// render the frame in the updated viewport metrics.
153 ///
154 /// @param[in] view_id The ID for the view that `metrics` describes.
155 /// @param[in] metrics The updated viewport metrics.
156 ///
158 int64_t view_id,
159 const ViewportMetrics& metrics) = 0;
160
161 //--------------------------------------------------------------------------
162 /// @brief Notifies the delegate that the platform has dispatched a
163 /// platform message from the embedder to the Flutter
164 /// application. This message must be forwarded to the running
165 /// isolate hosted by the engine on the UI thread.
166 ///
167 /// @param[in] message The platform message to dispatch to the running
168 /// root isolate.
169 ///
171 std::unique_ptr<PlatformMessage> message) = 0;
172
173 //--------------------------------------------------------------------------
174 /// @brief Notifies the delegate that the platform view has encountered
175 /// a pointer event. This pointer event needs to be forwarded to
176 /// the running root isolate hosted by the engine on the UI
177 /// thread.
178 ///
179 /// @param[in] packet The pointer data packet containing multiple pointer
180 /// events.
181 ///
183 std::unique_ptr<PointerDataPacket> packet) = 0;
184
185 //--------------------------------------------------------------------------
186 /// @brief Notifies the delegate that the platform view has encountered
187 /// an accessibility related action on the specified node. This
188 /// event must be forwarded to the running root isolate hosted
189 /// by the engine on the UI thread.
190 ///
191 /// @param[in] view_id The identifier of the view that contains this node.
192 /// @param[in] node_id The identifier of the accessibility node.
193 /// @param[in] action The accessibility related action performed on the
194 /// node of the specified ID.
195 /// @param[in] args An optional list of argument that apply to the
196 /// specified action.
197 ///
199 int64_t view_id,
200 int32_t node_id,
203
204 //--------------------------------------------------------------------------
205 /// @brief Notifies the delegate that the embedder has expressed an
206 /// opinion about whether the accessibility tree needs to be
207 /// enabled or disabled. This information needs to be forwarded
208 /// to the root isolate running on the UI thread.
209 ///
210 /// @param[in] enabled Whether the accessibility tree is enabled or
211 /// disabled.
212 ///
213 virtual void OnPlatformViewSetSemanticsEnabled(bool enabled) = 0;
214
215 //--------------------------------------------------------------------------
216 /// @brief Notifies the delegate that the embedder has expressed an
217 /// opinion about the features to enable in the accessibility
218 /// tree.
219 ///
220 /// The engine does not care about the accessibility feature
221 /// flags as all it does is forward this information from the
222 /// embedder to the framework. However, curious readers may
223 /// refer to `AccessibilityFeatures` in `window.dart` for
224 /// currently supported accessibility feature flags.
225 ///
226 /// @param[in] flags The features to enable in the accessibility tree.
227 ///
228 virtual void OnPlatformViewSetAccessibilityFeatures(int32_t flags) = 0;
229
230 //--------------------------------------------------------------------------
231 /// @brief Notifies the delegate that the embedder has specified a
232 /// texture that it want the rasterizer to composite within the
233 /// Flutter layer tree. All textures must have a unique
234 /// identifier. When the rasterizer encounters an external
235 /// texture within its hierarchy, it gives the embedder a chance
236 /// to update that texture on the raster thread before it
237 /// composites the same on-screen.
238 ///
239 /// @param[in] texture The texture that is being updated by the embedder
240 /// but composited by Flutter in its own hierarchy.
241 ///
243 std::shared_ptr<Texture> texture) = 0;
244
245 //--------------------------------------------------------------------------
246 /// @brief Notifies the delegate that the embedder will no longer
247 /// attempt to composite the specified texture within the layer
248 /// tree. This allows the rasterizer to collect associated
249 /// resources.
250 ///
251 /// @param[in] texture_id The identifier of the texture to unregister. If
252 /// the texture has not been previously registered,
253 /// this call does nothing.
254 ///
256
257 //--------------------------------------------------------------------------
258 /// @brief Notifies the delegate that the embedder has updated the
259 /// contents of the texture with the specified identifier.
260 /// Typically, Flutter will only render a frame if there is an
261 /// updated layer tree. However, in cases where the layer tree
262 /// is static but one of the externally composited textures has
263 /// been updated by the embedder, the embedder needs to notify
264 /// the rasterizer to render a new frame. In such cases, the
265 /// existing layer tree may be reused with the frame composited
266 /// with all updated external textures.
267 ///
268 /// @param[in] texture_id The identifier of the texture that has been
269 /// updated.
270 ///
272 int64_t texture_id) = 0;
273
274 //--------------------------------------------------------------------------
275 /// @brief Loads the dart shared library into the dart VM. When the
276 /// dart library is loaded successfully, the dart future
277 /// returned by the originating loadLibrary() call completes.
278 ///
279 /// The Dart compiler may generate separate shared libraries
280 /// files called 'loading units' when libraries are imported
281 /// as deferred. Each of these shared libraries are identified
282 /// by a unique loading unit id. Callers should open and resolve
283 /// a SymbolMapping from the shared library. The Mappings should
284 /// be moved into this method, as ownership will be assumed by
285 /// the dart root isolate after successful loading and released
286 /// after shutdown of the root isolate. The loading unit may not
287 /// be used after isolate shutdown. If loading fails, the
288 /// mappings will be released.
289 ///
290 /// This method is paired with a RequestDartDeferredLibrary
291 /// invocation that provides the embedder with the loading unit
292 /// id of the deferred library to load.
293 ///
294 ///
295 /// @param[in] loading_unit_id The unique id of the deferred library's
296 /// loading unit.
297 ///
298 /// @param[in] snapshot_data Dart snapshot data of the loading unit's
299 /// shared library.
300 ///
301 /// @param[in] snapshot_data Dart snapshot instructions of the loading
302 /// unit's shared library.
303 ///
305 intptr_t loading_unit_id,
306 std::unique_ptr<const fml::Mapping> snapshot_data,
307 std::unique_ptr<const fml::Mapping> snapshot_instructions) = 0;
308
309 //--------------------------------------------------------------------------
310 /// @brief Indicates to the dart VM that the request to load a deferred
311 /// library with the specified loading unit id has failed.
312 ///
313 /// The dart future returned by the initiating loadLibrary()
314 /// call will complete with an error.
315 ///
316 /// @param[in] loading_unit_id The unique id of the deferred library's
317 /// loading unit, as passed in by
318 /// RequestDartDeferredLibrary.
319 ///
320 /// @param[in] error_message The error message that will appear in the
321 /// dart Future.
322 ///
323 /// @param[in] transient A transient error is a failure due to
324 /// temporary conditions such as no network.
325 /// Transient errors allow the dart VM to
326 /// re-request the same deferred library and
327 /// loading_unit_id again. Non-transient
328 /// errors are permanent and attempts to
329 /// re-request the library will instantly
330 /// complete with an error.
331 virtual void LoadDartDeferredLibraryError(intptr_t loading_unit_id,
332 const std::string error_message,
333 bool transient) = 0;
334
335 //--------------------------------------------------------------------------
336 /// @brief Replaces the asset resolver handled by the engine's
337 /// AssetManager of the specified `type` with
338 /// `updated_asset_resolver`. The matching AssetResolver is
339 /// removed and replaced with `updated_asset_resolvers`.
340 ///
341 /// AssetResolvers should be updated when the existing resolver
342 /// becomes obsolete and a newer one becomes available that
343 /// provides updated access to the same type of assets as the
344 /// existing one. This update process is meant to be performed
345 /// at runtime.
346 ///
347 /// If a null resolver is provided, nothing will be done. If no
348 /// matching resolver is found, the provided resolver will be
349 /// added to the end of the AssetManager resolvers queue. The
350 /// replacement only occurs with the first matching resolver.
351 /// Any additional matching resolvers are untouched.
352 ///
353 /// @param[in] updated_asset_resolver The asset resolver to replace the
354 /// resolver of matching type with.
355 ///
356 /// @param[in] type The type of AssetResolver to update. Only resolvers of
357 /// the specified type will be replaced by the updated
358 /// resolver.
359 ///
361 std::unique_ptr<AssetResolver> updated_asset_resolver,
363
364 //--------------------------------------------------------------------------
365 /// @brief Called by the platform view on the platform thread to get
366 /// the settings object associated with the platform view
367 /// instance.
368 ///
369 /// @return The settings.
370 ///
371 virtual const Settings& OnPlatformViewGetSettings() const = 0;
372 };
373
374 //----------------------------------------------------------------------------
375 /// @brief Creates a platform view with the specified delegate and task
376 /// runner. The base class by itself does not do much but is
377 /// suitable for use in test environments where full platform
378 /// integration may not be necessary. The platform view may only
379 /// be created, accessed and destroyed on the platform task
380 /// runner.
381 ///
382 /// @param delegate The delegate. This is typically the shell.
383 /// @param[in] task_runners The task runners used by this platform view.
384 ///
385 explicit PlatformView(Delegate& delegate, const TaskRunners& task_runners);
386
387 //----------------------------------------------------------------------------
388 /// @brief Destroys the platform view. The platform view is owned by the
389 /// shell and will be destroyed by the same on the platform tasks
390 /// runner.
391 ///
392 virtual ~PlatformView();
393
394 //----------------------------------------------------------------------------
395 /// @brief Invoked by the shell to obtain a platform specific vsync
396 /// waiter. It is optional for platforms to override this method
397 /// and provide a custom vsync waiter because a timer based
398 /// fall-back waiter is used by default. However, it is highly
399 /// recommended that platform provide their own Vsync waiter as
400 /// the timer based fall-back will not render frames aligned with
401 /// vsync boundaries.
402 ///
403 /// @attention If a timer based fall-back is used, a warning is logged to the
404 /// console. In case this method is overridden in a subclass, it
405 /// must return a valid vsync waiter. Returning null will lead to
406 /// internal errors. If a valid vsync waiter cannot be returned,
407 /// subclasses should just call the based class method instead.
408 ///
409 /// @return A vsync waiter. If is an internal error to return a null
410 /// waiter.
411 ///
412 virtual std::unique_ptr<VsyncWaiter> CreateVSyncWaiter();
413
414 //----------------------------------------------------------------------------
415 /// @brief Used by embedders to dispatch a platform message to a
416 /// running root isolate hosted by the engine. If an isolate is
417 /// not running, the message is dropped. If there is no one on the
418 /// other side listening on the channel, the message is dropped.
419 /// When a platform message is dropped, any response handles
420 /// associated with that message will be dropped as well. All
421 /// users of platform messages must assume that message may not be
422 /// delivered and/or their response handles may not be invoked.
423 /// Platform messages are not buffered.
424 ///
425 /// For embedders that wish to respond to platform message
426 /// directed from the framework to the embedder, the
427 /// `HandlePlatformMessage` method may be overridden.
428 ///
429 /// @see HandlePlatformMessage()
430 ///
431 /// @param[in] message The platform message to deliver to the root isolate.
432 ///
433 void DispatchPlatformMessage(std::unique_ptr<PlatformMessage> message);
434
435 //----------------------------------------------------------------------------
436 /// @brief Overridden by embedders to perform actions in response to
437 /// platform messages sent from the framework to the embedder.
438 /// Default implementation of this method simply returns an empty
439 /// response.
440 ///
441 /// Embedders that wish to send platform messages to the framework
442 /// may use the `DispatchPlatformMessage` method. This method is
443 /// for messages that go the other way.
444 ///
445 /// @see DispatchPlatformMessage()
446 ///
447 /// @param[in] message The message
448 ///
449 virtual void HandlePlatformMessage(std::unique_ptr<PlatformMessage> message);
450
451 //----------------------------------------------------------------------------
452 /// @brief Used by embedders to dispatch an accessibility action to a
453 /// running isolate hosted by the engine.
454 ///
455 /// @param[in] view_id The identifier of the view.
456 /// @param[in] node_id The identifier of the accessibility node on which to
457 /// perform the action.
458 /// @param[in] action The action
459 /// @param[in] args The arguments
460 ///
461 void DispatchSemanticsAction(int64_t view_id,
462 int32_t node_id,
465
466 //----------------------------------------------------------------------------
467 /// @brief Used by embedder to notify the running isolate hosted by the
468 /// engine on the UI thread that the accessibility tree needs to
469 /// be generated.
470 ///
471 /// @attention Subclasses may choose to override this method to perform
472 /// platform specific functions. However, they must call the base
473 /// class method at some point in their implementation.
474 ///
475 /// @param[in] enabled Whether the accessibility tree needs to be generated.
476 ///
477 virtual void SetSemanticsEnabled(bool enabled);
478
479 //----------------------------------------------------------------------------
480 /// @brief Used by the embedder to specify the features to enable in the
481 /// accessibility tree generated by the isolate. This information
482 /// is forwarded to the root isolate hosted by the engine on the
483 /// UI thread.
484 ///
485 /// The engine does not care about the accessibility feature flags
486 /// as all it does is forward this information from the embedder
487 /// to the framework. However, curious readers may refer to
488 /// `AccessibilityFeatures` in `window.dart` for currently
489 /// supported accessibility feature flags.
490 ///
491 /// @attention Subclasses may choose to override this method to perform
492 /// platform specific functions. However, they must call the base
493 /// class method at some point in their implementation.
494 ///
495 /// @param[in] flags The features to enable in the accessibility tree.
496 ///
497 virtual void SetAccessibilityFeatures(int32_t flags);
498
499 //----------------------------------------------------------------------------
500 /// @brief Used by the framework to tell the embedder to apply the
501 /// specified semantics node updates. The default implementation
502 /// of this method does nothing.
503 ///
504 /// @see SemanticsNode, SemticsNodeUpdates,
505 /// CustomAccessibilityActionUpdates
506 ///
507 /// @param[in] view_id The ID of the view that this update is for
508 /// @param[in] updates A map with the stable semantics node identifier as
509 /// key and the node properties as the value.
510 /// @param[in] actions A map with the stable semantics node identifier as
511 /// key and the custom node action as the value.
512 ///
513 virtual void UpdateSemantics(int64_t view_id,
514 SemanticsNodeUpdates updates,
516
517 //----------------------------------------------------------------------------
518 /// @brief Used by the framework to set application locale in the
519 /// embedding
520 ///
521 /// @param[in] locale The application locale in BCP 47 format.
522 ///
523 virtual void SetApplicationLocale(std::string locale);
524
525 //----------------------------------------------------------------------------
526 /// @brief Used by the framework to tell the embedder to prepare or clear
527 /// resoruce for accepting semantics tree.
528 ///
529 /// @param[in] enabled whether framework starts or stops sending semantics
530 /// updates
531 ///
532 virtual void SetSemanticsTreeEnabled(bool enabled);
533
534 //----------------------------------------------------------------------------
535 /// @brief Used by the framework to tell the embedder that it has
536 /// registered a listener on a given channel.
537 ///
538 /// @param[in] name The name of the channel on which the listener has
539 /// set or cleared a listener.
540 /// @param[in] listening True if a listener has been set, false if it has
541 /// been cleared.
542 ///
543 virtual void SendChannelUpdate(const std::string& name, bool listening);
544
545 //----------------------------------------------------------------------------
546 /// @brief Used by embedders to specify the updated viewport metrics for
547 /// a view. In response to this call, on the raster thread, the
548 /// rasterizer may need to be reconfigured to the updated viewport
549 /// dimensions. On the UI thread, the framework may need to start
550 /// generating a new frame for the updated viewport metrics as
551 /// well.
552 ///
553 /// @param[in] view_id The ID for the view that `metrics` describes.
554 /// @param[in] metrics The updated viewport metrics.
555 ///
556 void SetViewportMetrics(int64_t view_id, const ViewportMetrics& metrics);
557
558 //----------------------------------------------------------------------------
559 /// @brief Used by embedders to notify the shell that a platform view
560 /// has been created. This notification is used to create a
561 /// rendering surface and pick the client rendering API to use to
562 /// render into this surface. No frames will be scheduled or
563 /// rendered before this call. The surface must remain valid till
564 /// the corresponding call to NotifyDestroyed.
565 ///
566 void NotifyCreated();
567
568 //----------------------------------------------------------------------------
569 /// @brief Used by embedders to notify the shell that the platform view
570 /// has been destroyed. This notification used to collect the
571 /// rendering surface and all associated resources. Frame
572 /// scheduling is also suspended.
573 ///
574 /// @attention Subclasses may choose to override this method to perform
575 /// platform specific functions. However, they must call the base
576 /// class method at some point in their implementation.
577 ///
578 virtual void NotifyDestroyed();
579
580 //----------------------------------------------------------------------------
581 /// @brief Used by embedders to schedule a frame. In response to this
582 /// call, the framework may need to start generating a new frame.
583 ///
584 void ScheduleFrame();
585
586 /// @brief Used by embedders to notify the shell of a new non-implicit view.
587 ///
588 /// This method notifies the shell to allocate resources and inform
589 /// Dart about the view, and on success, schedules a new frame.
590 /// Finally, it invokes |callback| with whether the operation is
591 /// successful.
592 ///
593 /// This operation is asynchronous; avoid using the view until
594 /// |callback| returns true. Callers should prepare resources for the
595 /// view (if any) in advance but be ready to clean up on failure.
596 ///
597 /// The callback is called on a different thread.
598 ///
599 /// Do not use for implicit views, which are added internally during
600 /// shell initialization. Adding |kFlutterImplicitViewId| or an
601 /// existing view ID will fail, indicated by |callback| returning
602 /// false.
603 ///
604 /// @param[in] view_id The view ID of the new view.
605 /// @param[in] viewport_metrics The initial viewport metrics for the view.
606 /// @param[in] callback The callback that's invoked once the shell
607 /// has attempted to add the view.
608 ///
609 void AddView(int64_t view_id,
610 const ViewportMetrics& viewport_metrics,
612
613 /// @brief Used by embedders to notify the shell of a removed non-implicit
614 /// view.
615 ///
616 /// This method notifies the shell to deallocate resources and inform
617 /// Dart about the removal. Finally, it invokes |callback| with
618 /// whether the operation is successful.
619 ///
620 /// This operation is asynchronous. The embedder should not deallocate
621 /// resources until the |callback| is invoked.
622 ///
623 /// The callback is called on a different thread.
624 ///
625 /// Do not use for implicit views, which are never removed throughout
626 /// the lifetime of the app.
627 /// Removing |kFlutterImplicitViewId| or an
628 /// non-existent view ID will fail, indicated by |callback| returning
629 /// false.
630 ///
631 /// @param[in] view_id The view ID of the view to be removed.
632 /// @param[in] callback The callback that's invoked once the shell has
633 /// attempted to remove the view.
634 ///
636
637 void SendViewFocusEvent(const ViewFocusEvent& event);
638
639 //----------------------------------------------------------------------------
640 /// @brief Used by the shell to obtain a Skia GPU context that is capable
641 /// of operating on the IO thread. The context must be in the same
642 /// share-group as the Skia GPU context used on the render thread.
643 /// This context will always be used on the IO thread. Because it
644 /// is in the same share-group as the separate render thread
645 /// context, any GPU resources uploaded in this context will be
646 /// visible to the render thread context (synchronization of GPU
647 /// resources is managed by Skia).
648 ///
649 /// If such context cannot be created on the IO thread, callers
650 /// may return `nullptr`. This will mean that all texture uploads
651 /// will be queued onto the render thread which will cause
652 /// performance issues. When this context is `nullptr`, an error
653 /// is logged to the console. It is highly recommended that all
654 /// platforms provide a resource context.
655 ///
656 /// @attention Unlike all other methods on the platform view, this will be
657 /// called on IO task runner.
658 ///
659 /// @return The Skia GPU context that is in the same share-group as the
660 /// main render thread GPU context. May be `nullptr` in case such
661 /// a context cannot be created.
662 ///
663 virtual sk_sp<GrDirectContext> CreateResourceContext() const;
664
665 virtual std::shared_ptr<impeller::Context> GetImpellerContext() const;
666
667 //----------------------------------------------------------------------------
668 /// @brief Used by the shell to notify the embedder that the resource
669 /// context previously obtained via a call to
670 /// `CreateResourceContext()` is being collected. The embedder
671 /// is free to collect an platform specific resources
672 /// associated with this context.
673 ///
674 /// @attention Unlike all other methods on the platform view, this will be
675 /// called on IO task runner.
676 ///
677 virtual void ReleaseResourceContext() const;
678
679 //--------------------------------------------------------------------------
680 /// @brief Returns a platform-specific PointerDataDispatcherMaker so the
681 /// `Engine` can construct the PointerDataPacketDispatcher based
682 /// on platforms.
684
685 //----------------------------------------------------------------------------
686 /// @brief Returns a weak pointer to the platform view. Since the
687 /// platform view may only be created, accessed and destroyed
688 /// on the platform thread, any access to the platform view
689 /// from a non-platform task runner needs a weak pointer to
690 /// the platform view along with a reference to the platform
691 /// task runner. A task must be posted to the platform task
692 /// runner with the weak pointer captured in the same. The
693 /// platform view method may only be called in the posted task
694 /// once the weak pointer validity has been checked. This
695 /// method is used by callers to obtain that weak pointer.
696 ///
697 /// @return The weak pointer to the platform view.
698 ///
700
701 //----------------------------------------------------------------------------
702 /// @brief Gives embedders a chance to react to a "cold restart" of the
703 /// running isolate. The default implementation of this method
704 /// does nothing.
705 ///
706 /// While a "hot restart" patches a running isolate, a "cold
707 /// restart" restarts the root isolate in a running shell.
708 ///
709 virtual void OnPreEngineRestart() const;
710
711 //----------------------------------------------------------------------------
712 /// @brief Sets a callback that gets executed when the rasterizer renders
713 /// the next frame. Due to the asynchronous nature of
714 /// rendering in Flutter, embedders usually add a placeholder
715 /// over the contents in which Flutter is going to render when
716 /// Flutter is first initialized. This callback may be used as
717 /// a signal to remove that placeholder. The callback is
718 /// executed on the render task runner and not the platform
719 /// task runner. It is the embedder's responsibility to
720 /// re-thread as necessary.
721 ///
722 /// @attention The callback is executed on the render task runner and not the
723 /// platform task runner. Embedders must re-thread as necessary.
724 ///
725 /// @param[in] closure The callback to execute on the render thread when the
726 /// next frame gets rendered.
727 ///
728 void SetNextFrameCallback(const fml::closure& closure);
729
730 //----------------------------------------------------------------------------
731 /// @brief Dispatches pointer events from the embedder to the
732 /// framework. Each pointer data packet may contain multiple
733 /// pointer input events. Each call to this method wakes up
734 /// the UI thread.
735 ///
736 /// @param[in] packet The pointer data packet to dispatch to the framework.
737 ///
738 void DispatchPointerDataPacket(std::unique_ptr<PointerDataPacket> packet);
739
740 //--------------------------------------------------------------------------
741 /// @brief Used by the embedder to specify a texture that it wants the
742 /// rasterizer to composite within the Flutter layer tree. All
743 /// textures must have a unique identifier. When the
744 /// rasterizer encounters an external texture within its
745 /// hierarchy, it gives the embedder a chance to update that
746 /// texture on the raster thread before it composites the same
747 /// on-screen.
748 ///
749 /// @attention This method must only be called once per texture. When the
750 /// texture is updated, calling `MarkTextureFrameAvailable`
751 /// with the specified texture identifier is sufficient to
752 /// make Flutter re-render the frame with the updated texture
753 /// composited in-line.
754 ///
755 /// @see UnregisterTexture, MarkTextureFrameAvailable
756 ///
757 /// @param[in] texture The texture that is being updated by the embedder
758 /// but composited by Flutter in its own hierarchy.
759 ///
760 void RegisterTexture(std::shared_ptr<flutter::Texture> texture);
761
762 //--------------------------------------------------------------------------
763 /// @brief Used by the embedder to notify the rasterizer that it will
764 /// no longer attempt to composite the specified texture within
765 /// the layer tree. This allows the rasterizer to collect
766 /// associated resources.
767 ///
768 /// @attention This call must only be called once per texture identifier.
769 ///
770 /// @see RegisterTexture, MarkTextureFrameAvailable
771 ///
772 /// @param[in] texture_id The identifier of the texture to unregister. If
773 /// the texture has not been previously registered,
774 /// this call does nothing.
775 ///
776 void UnregisterTexture(int64_t texture_id);
777
778 //--------------------------------------------------------------------------
779 /// @brief Used by the embedder to notify the rasterizer that the context
780 /// of the previously registered texture have been updated.
781 /// Typically, Flutter will only render a frame if there is an
782 /// updated layer tree. However, in cases where the layer tree
783 /// is static but one of the externally composited textures
784 /// has been updated by the embedder, the embedder needs to
785 /// notify the rasterizer to render a new frame. In such
786 /// cases, the existing layer tree may be reused with the
787 /// frame re-composited with all updated external textures.
788 /// Unlike the calls to register and unregister the texture,
789 /// this call must be made each time a new texture frame is
790 /// available.
791 ///
792 /// @see RegisterTexture, UnregisterTexture
793 ///
794 /// @param[in] texture_id The identifier of the texture that has been
795 /// updated.
796 ///
798
799 //--------------------------------------------------------------------------
800 /// @brief Directly invokes platform-specific APIs to compute the
801 /// locale the platform would have natively resolved to.
802 ///
803 /// @param[in] supported_locale_data The vector of strings that represents
804 /// the locales supported by the app.
805 /// Each locale consists of three
806 /// strings: languageCode, countryCode,
807 /// and scriptCode in that order.
808 ///
809 /// @return A vector of 3 strings languageCode, countryCode, and
810 /// scriptCode that represents the locale selected by the
811 /// platform. Empty strings mean the value was unassigned. Empty
812 /// vector represents a null locale.
813 ///
814 virtual std::unique_ptr<std::vector<std::string>>
816 const std::vector<std::string>& supported_locale_data);
817
818 virtual std::shared_ptr<ExternalViewEmbedder> CreateExternalViewEmbedder();
819
820 //--------------------------------------------------------------------------
821 /// @brief Invoked when the dart VM requests that a deferred library
822 /// be loaded. Notifies the engine that the deferred library
823 /// identified by the specified loading unit id should be
824 /// downloaded and loaded into the Dart VM via
825 /// `LoadDartDeferredLibrary`
826 ///
827 /// Upon encountering errors or otherwise failing to load a
828 /// loading unit with the specified id, the failure should be
829 /// directly reported to dart by calling
830 /// `LoadDartDeferredLibraryFailure` to ensure the waiting dart
831 /// future completes with an error.
832 ///
833 /// @param[in] loading_unit_id The unique id of the deferred library's
834 /// loading unit. This id is to be passed
835 /// back into LoadDartDeferredLibrary
836 /// in order to identify which deferred
837 /// library to load.
838 ///
839 virtual void RequestDartDeferredLibrary(intptr_t loading_unit_id);
840
841 //--------------------------------------------------------------------------
842 /// @brief Loads the Dart shared library into the Dart VM. When the
843 /// Dart library is loaded successfully, the Dart future
844 /// returned by the originating loadLibrary() call completes.
845 ///
846 /// The Dart compiler may generate separate shared libraries
847 /// files called 'loading units' when libraries are imported
848 /// as deferred. Each of these shared libraries are identified
849 /// by a unique loading unit id. Callers should open and resolve
850 /// a SymbolMapping from the shared library. The Mappings should
851 /// be moved into this method, as ownership will be assumed by the
852 /// dart isolate after successful loading and released after
853 /// shutdown of the dart isolate. If loading fails, the mappings
854 /// will naturally go out of scope.
855 ///
856 /// This method is paired with a RequestDartDeferredLibrary
857 /// invocation that provides the embedder with the loading unit id
858 /// of the deferred library to load.
859 ///
860 ///
861 /// @param[in] loading_unit_id The unique id of the deferred library's
862 /// loading unit, as passed in by
863 /// RequestDartDeferredLibrary.
864 ///
865 /// @param[in] snapshot_data Dart snapshot data of the loading unit's
866 /// shared library.
867 ///
868 /// @param[in] snapshot_data Dart snapshot instructions of the loading
869 /// unit's shared library.
870 ///
871 virtual void LoadDartDeferredLibrary(
872 intptr_t loading_unit_id,
873 std::unique_ptr<const fml::Mapping> snapshot_data,
874 std::unique_ptr<const fml::Mapping> snapshot_instructions);
875
876 //--------------------------------------------------------------------------
877 /// @brief Indicates to the dart VM that the request to load a deferred
878 /// library with the specified loading unit id has failed.
879 ///
880 /// The dart future returned by the initiating loadLibrary() call
881 /// will complete with an error.
882 ///
883 /// @param[in] loading_unit_id The unique id of the deferred library's
884 /// loading unit, as passed in by
885 /// RequestDartDeferredLibrary.
886 ///
887 /// @param[in] error_message The error message that will appear in the
888 /// dart Future.
889 ///
890 /// @param[in] transient A transient error is a failure due to
891 /// temporary conditions such as no network.
892 /// Transient errors allow the dart VM to
893 /// re-request the same deferred library and
894 /// loading_unit_id again. Non-transient
895 /// errors are permanent and attempts to
896 /// re-request the library will instantly
897 /// complete with an error.
898 ///
899 virtual void LoadDartDeferredLibraryError(intptr_t loading_unit_id,
900 const std::string error_message,
901 bool transient);
902
903 //--------------------------------------------------------------------------
904 /// @brief Replaces the asset resolver handled by the engine's
905 /// AssetManager of the specified `type` with
906 /// `updated_asset_resolver`. The matching AssetResolver is
907 /// removed and replaced with `updated_asset_resolvers`.
908 ///
909 /// AssetResolvers should be updated when the existing resolver
910 /// becomes obsolete and a newer one becomes available that
911 /// provides updated access to the same type of assets as the
912 /// existing one. This update process is meant to be performed
913 /// at runtime.
914 ///
915 /// If a null resolver is provided, nothing will be done. If no
916 /// matching resolver is found, the provided resolver will be
917 /// added to the end of the AssetManager resolvers queue. The
918 /// replacement only occurs with the first matching resolver.
919 /// Any additional matching resolvers are untouched.
920 ///
921 /// @param[in] updated_asset_resolver The asset resolver to replace the
922 /// resolver of matching type with.
923 ///
924 /// @param[in] type The type of AssetResolver to update. Only resolvers of
925 /// the specified type will be replaced by the updated
926 /// resolver.
927 ///
928 virtual void UpdateAssetResolverByType(
929 std::unique_ptr<AssetResolver> updated_asset_resolver,
931
932 //--------------------------------------------------------------------------
933 /// @brief Creates an object that produces surfaces suitable for raster
934 /// snapshotting. The rasterizer will request this surface if no
935 /// on screen surface is currently available when an application
936 /// requests a snapshot, e.g. if `Scene.toImage` or
937 /// `Picture.toImage` are called while the application is in the
938 /// background.
939 ///
940 /// Not all backends support this kind of surface usage, and the
941 /// default implementation returns nullptr. Platforms should
942 /// override this if they can support GPU operations in the
943 /// background and support GPU resource context usage.
944 ///
945 virtual std::unique_ptr<SnapshotSurfaceProducer>
947
948 //--------------------------------------------------------------------------
949 /// @brief Specifies a delegate that will receive PlatformMessages from
950 /// Flutter to the host platform.
951 ///
952 /// @details If this returns `null` that means PlatformMessages should be sent
953 /// to the PlatformView. That is to protect legacy behavior, any embedder
954 /// that wants to support executing Platform Channel handlers on background
955 /// threads should be returning a thread-safe PlatformMessageHandler instead.
956 virtual std::shared_ptr<PlatformMessageHandler> GetPlatformMessageHandler()
957 const;
958
959 //----------------------------------------------------------------------------
960 /// @brief Get the settings for this platform view instance.
961 ///
962 /// @return The settings.
963 ///
964 const Settings& GetSettings() const;
965
966 //--------------------------------------------------------------------------
967 /// @brief Synchronously invokes platform-specific APIs to apply the
968 /// system text scaling on the given unscaled font size.
969 ///
970 /// Platforms that support this feature (currently it's only
971 /// implemented for Android SDK level 34+) will send a valid
972 /// configuration_id to potential callers, before this method can
973 /// be called.
974 ///
975 /// @param[in] unscaled_font_size The unscaled font size specified by the
976 /// app developer. The value is in logical
977 /// pixels, and is guaranteed to be finite and
978 /// non-negative.
979 /// @param[in] configuration_id The unique id of the configuration to use
980 /// for computing the scaled font size.
981 ///
982 /// @return The scaled font size in logical pixels, or -1 if the given
983 /// configuration_id did not match a valid configuration.
984 ///
985 virtual double GetScaledFontSize(double unscaled_font_size,
986 int configuration_id) const;
987
988 //--------------------------------------------------------------------------
989 /// @brief Notifies the client that the Flutter view focus state has
990 /// changed and the platform view should be updated.
991 ///
992 /// Called on platform thread.
993 ///
994 /// @param[in] request The request to change the focus state of the view.
995 virtual void RequestViewFocusChange(const ViewFocusChangeRequest& request);
996
997 //--------------------------------------------------------------------------
998 /// @brief Performs any deferred setup of the Impeller context
999 ///
1000 /// This is intended to be called from the raster thread so that
1001 /// Impeller context creation can be moved off the startup path.
1002 virtual void SetupImpellerContext() {}
1003
1004 protected:
1005 // This is the only method called on the raster task runner.
1006 virtual std::unique_ptr<Surface> CreateRenderingSurface();
1007
1011
1012 private:
1014};
1015
1016} // namespace flutter
1017
1018#endif // FLUTTER_SHELL_COMMON_PLATFORM_VIEW_H_
GLenum type
AssetResolverType
Identifies the type of AssetResolver an instance is.
Used to forward events from the platform view to interested subsystems. This forwarding is done by th...
virtual void OnPlatformViewAddView(int64_t view_id, const ViewportMetrics &viewport_metrics, AddViewCallback callback)=0
Allocate resources for a new non-implicit view and inform Dart about the view, and on success,...
virtual void OnPlatformViewSetNextFrameCallback(const fml::closure &closure)=0
Notifies the delegate that the specified callback needs to be invoked after the rasterizer is done re...
virtual void OnPlatformViewDispatchSemanticsAction(int64_t view_id, int32_t node_id, SemanticsAction action, fml::MallocMapping args)=0
Notifies the delegate that the platform view has encountered an accessibility related action on the s...
virtual void UpdateAssetResolverByType(std::unique_ptr< AssetResolver > updated_asset_resolver, AssetResolver::AssetResolverType type)=0
Replaces the asset resolver handled by the engine's AssetManager of the specified type with updated_a...
virtual void OnPlatformViewUnregisterTexture(int64_t texture_id)=0
Notifies the delegate that the embedder will no longer attempt to composite the specified texture wit...
virtual void OnPlatformViewRegisterTexture(std::shared_ptr< Texture > texture)=0
Notifies the delegate that the embedder has specified a texture that it want the rasterizer to compos...
virtual void OnPlatformViewDispatchPointerDataPacket(std::unique_ptr< PointerDataPacket > packet)=0
Notifies the delegate that the platform view has encountered a pointer event. This pointer event need...
virtual void OnPlatformViewRemoveView(int64_t view_id, RemoveViewCallback callback)=0
Deallocate resources for a removed view and inform Dart about the removal.
virtual void OnPlatformViewSetViewportMetrics(int64_t view_id, const ViewportMetrics &metrics)=0
Notifies the delegate the viewport metrics of a view have been updated. The rasterizer will need to b...
virtual void OnPlatformViewSetAccessibilityFeatures(int32_t flags)=0
Notifies the delegate that the embedder has expressed an opinion about the features to enable in the ...
virtual void OnPlatformViewSendViewFocusEvent(const ViewFocusEvent &event)=0
Notify the delegate that platform view focus state has changed.
virtual void OnPlatformViewSetSemanticsEnabled(bool enabled)=0
Notifies the delegate that the embedder has expressed an opinion about whether the accessibility tree...
virtual void OnPlatformViewCreated(std::unique_ptr< Surface > surface)=0
Notifies the delegate that the platform view was created with the given render surface....
virtual const Settings & OnPlatformViewGetSettings() const =0
Called by the platform view on the platform thread to get the settings object associated with the pla...
std::function< void(bool)> KeyDataResponse
virtual void OnPlatformViewScheduleFrame()=0
Notifies the delegate that the platform needs to schedule a frame to regenerate the layer tree and re...
PlatformView::AddViewCallback AddViewCallback
virtual void LoadDartDeferredLibrary(intptr_t loading_unit_id, std::unique_ptr< const fml::Mapping > snapshot_data, std::unique_ptr< const fml::Mapping > snapshot_instructions)=0
Loads the dart shared library into the dart VM. When the dart library is loaded successfully,...
virtual void OnPlatformViewDestroyed()=0
Notifies the delegate that the platform view was destroyed. This is usually a sign to the rasterizer ...
virtual void LoadDartDeferredLibraryError(intptr_t loading_unit_id, const std::string error_message, bool transient)=0
Indicates to the dart VM that the request to load a deferred library with the specified loading unit ...
virtual void OnPlatformViewDispatchPlatformMessage(std::unique_ptr< PlatformMessage > message)=0
Notifies the delegate that the platform has dispatched a platform message from the embedder to the Fl...
virtual void OnPlatformViewMarkTextureFrameAvailable(int64_t texture_id)=0
Notifies the delegate that the embedder has updated the contents of the texture with the specified id...
PlatformView::RemoveViewCallback RemoveViewCallback
Platform views are created by the shell on the platform task runner. Unless explicitly specified,...
virtual void NotifyDestroyed()
Used by embedders to notify the shell that the platform view has been destroyed. This notification us...
virtual void RequestViewFocusChange(const ViewFocusChangeRequest &request)
Notifies the client that the Flutter view focus state has changed and the platform view should be upd...
std::function< void(bool removed)> RemoveViewCallback
void SetNextFrameCallback(const fml::closure &closure)
Sets a callback that gets executed when the rasterizer renders the next frame. Due to the asynchronou...
virtual void SetSemanticsEnabled(bool enabled)
Used by embedder to notify the running isolate hosted by the engine on the UI thread that the accessi...
virtual std::shared_ptr< PlatformMessageHandler > GetPlatformMessageHandler() const
Specifies a delegate that will receive PlatformMessages from Flutter to the host platform.
void RegisterTexture(std::shared_ptr< flutter::Texture > texture)
Used by the embedder to specify a texture that it wants the rasterizer to composite within the Flutte...
virtual void HandlePlatformMessage(std::unique_ptr< PlatformMessage > message)
Overridden by embedders to perform actions in response to platform messages sent from the framework t...
virtual sk_sp< GrDirectContext > CreateResourceContext() const
Used by the shell to obtain a Skia GPU context that is capable of operating on the IO thread....
virtual double GetScaledFontSize(double unscaled_font_size, int configuration_id) const
Synchronously invokes platform-specific APIs to apply the system text scaling on the given unscaled f...
void DispatchSemanticsAction(int64_t view_id, int32_t node_id, SemanticsAction action, fml::MallocMapping args)
Used by embedders to dispatch an accessibility action to a running isolate hosted by the engine.
virtual ~PlatformView()
Destroys the platform view. The platform view is owned by the shell and will be destroyed by the same...
virtual PointerDataDispatcherMaker GetDispatcherMaker()
Returns a platform-specific PointerDataDispatcherMaker so the Engine can construct the PointerDataPac...
virtual void SendChannelUpdate(const std::string &name, bool listening)
Used by the framework to tell the embedder that it has registered a listener on a given channel.
void SetViewportMetrics(int64_t view_id, const ViewportMetrics &metrics)
Used by embedders to specify the updated viewport metrics for a view. In response to this call,...
virtual void SetSemanticsTreeEnabled(bool enabled)
Used by the framework to tell the embedder to prepare or clear resoruce for accepting semantics tree.
virtual void LoadDartDeferredLibrary(intptr_t loading_unit_id, std::unique_ptr< const fml::Mapping > snapshot_data, std::unique_ptr< const fml::Mapping > snapshot_instructions)
Loads the Dart shared library into the Dart VM. When the Dart library is loaded successfully,...
virtual void UpdateAssetResolverByType(std::unique_ptr< AssetResolver > updated_asset_resolver, AssetResolver::AssetResolverType type)
Replaces the asset resolver handled by the engine's AssetManager of the specified type with updated_a...
const Settings & GetSettings() const
Get the settings for this platform view instance.
std::function< void(bool added)> AddViewCallback
virtual void SetApplicationLocale(std::string locale)
Used by the framework to set application locale in the embedding.
void DispatchPlatformMessage(std::unique_ptr< PlatformMessage > message)
Used by embedders to dispatch a platform message to a running root isolate hosted by the engine....
PlatformView::Delegate & delegate_
virtual std::unique_ptr< std::vector< std::string > > ComputePlatformResolvedLocales(const std::vector< std::string > &supported_locale_data)
Directly invokes platform-specific APIs to compute the locale the platform would have natively resolv...
void NotifyCreated()
Used by embedders to notify the shell that a platform view has been created. This notification is use...
fml::WeakPtr< PlatformView > GetWeakPtr() const
Returns a weak pointer to the platform view. Since the platform view may only be created,...
virtual std::unique_ptr< SnapshotSurfaceProducer > CreateSnapshotSurfaceProducer()
Creates an object that produces surfaces suitable for raster snapshotting. The rasterizer will reques...
virtual void SetupImpellerContext()
Performs any deferred setup of the Impeller context.
void UnregisterTexture(int64_t texture_id)
Used by the embedder to notify the rasterizer that it will no longer attempt to composite the specifi...
virtual std::shared_ptr< ExternalViewEmbedder > CreateExternalViewEmbedder()
virtual void LoadDartDeferredLibraryError(intptr_t loading_unit_id, const std::string error_message, bool transient)
Indicates to the dart VM that the request to load a deferred library with the specified loading unit ...
virtual void OnPreEngineRestart() const
Gives embedders a chance to react to a "cold restart" of the running isolate. The default implementat...
virtual void ReleaseResourceContext() const
Used by the shell to notify the embedder that the resource context previously obtained via a call to ...
virtual void RequestDartDeferredLibrary(intptr_t loading_unit_id)
Invoked when the dart VM requests that a deferred library be loaded. Notifies the engine that the def...
virtual std::unique_ptr< VsyncWaiter > CreateVSyncWaiter()
Invoked by the shell to obtain a platform specific vsync waiter. It is optional for platforms to over...
virtual void SetAccessibilityFeatures(int32_t flags)
Used by the embedder to specify the features to enable in the accessibility tree generated by the iso...
virtual std::unique_ptr< Surface > CreateRenderingSurface()
virtual std::shared_ptr< impeller::Context > GetImpellerContext() const
void AddView(int64_t view_id, const ViewportMetrics &viewport_metrics, AddViewCallback callback)
Used by embedders to notify the shell of a new non-implicit view.
virtual void UpdateSemantics(int64_t view_id, SemanticsNodeUpdates updates, CustomAccessibilityActionUpdates actions)
Used by the framework to tell the embedder to apply the specified semantics node updates....
void SendViewFocusEvent(const ViewFocusEvent &event)
fml::WeakPtrFactory< PlatformView > weak_factory_
void DispatchPointerDataPacket(std::unique_ptr< PointerDataPacket > packet)
Dispatches pointer events from the embedder to the framework. Each pointer data packet may contain mu...
void RemoveView(int64_t view_id, RemoveViewCallback callback)
Used by embedders to notify the shell of a removed non-implicit view.
void ScheduleFrame()
Used by embedders to schedule a frame. In response to this call, the framework may need to start gene...
void MarkTextureFrameAvailable(int64_t texture_id)
Used by the embedder to notify the rasterizer that the context of the previously registered texture h...
const TaskRunners task_runners_
A Mapping like NonOwnedMapping, but uses Free as its release proc.
Definition mapping.h:144
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
G_BEGIN_DECLS GBytes * message
G_BEGIN_DECLS FlutterViewId view_id
FlutterDesktopBinaryReply callback
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
FlTexture * texture
std::unordered_map< int32_t, SemanticsNode > SemanticsNodeUpdates
std::unordered_map< int32_t, CustomAccessibilityAction > CustomAccessibilityActionUpdates
std::function< std::unique_ptr< PointerDataDispatcher >(PointerDataDispatcher::Delegate &)> PointerDataDispatcherMaker
Signature for constructing PointerDataDispatcher.
DEF_SWITCHES_START aot vmservice shared library name
Definition switch_defs.h:27
std::function< void()> closure
Definition closure.h:14
int64_t texture_id