Flutter Engine
The Flutter Engine
Classes | Public Member Functions | List of all members
flutter_runner::PlatformView Class Reference

#include <platform_view.h>

Inheritance diagram for flutter_runner::PlatformView:
flutter::PlatformView

Public Member Functions

 PlatformView (flutter::PlatformView::Delegate &delegate, flutter::TaskRunners task_runners, fuchsia::ui::views::ViewRef view_ref, std::shared_ptr< flutter::ExternalViewEmbedder > external_view_embedder, fuchsia::ui::input::ImeServiceHandle ime_service, fuchsia::ui::input3::KeyboardHandle keyboard, fuchsia::ui::pointer::TouchSourceHandle touch_source, fuchsia::ui::pointer::MouseSourceHandle mouse_source, fuchsia::ui::views::FocuserHandle focuser, fuchsia::ui::views::ViewRefFocusedHandle view_ref_focused, fuchsia::ui::composition::ParentViewportWatcherHandle parent_viewport_watcher, fuchsia::ui::pointerinjector::RegistryHandle pointerinjector_registry, OnEnableWireframeCallback wireframe_enabled_callback, OnCreateViewCallback on_create_view_callback, OnUpdateViewCallback on_update_view_callback, OnDestroyViewCallback on_destroy_view_callback, OnCreateSurfaceCallback on_create_surface_callback, OnSemanticsNodeUpdateCallback on_semantics_node_update_callback, OnRequestAnnounceCallback on_request_announce_callback, OnShaderWarmupCallback on_shader_warmup_callback, AwaitVsyncCallback await_vsync_callback, AwaitVsyncForSecondaryCallbackCallback await_vsync_for_secondary_callback_callback, std::shared_ptr< sys::ServiceDirectory > dart_application_svc)
 
 ~PlatformView () override
 Destroys the platform view. The platform view is owned by the shell and will be destroyed by the same on the platform tasks runner. More...
 
void OnGetLayout (fuchsia::ui::composition::LayoutInfo info)
 
void OnParentViewportStatus (fuchsia::ui::composition::ParentViewportStatus status)
 
void OnChildViewStatus (uint64_t content_id, fuchsia::ui::composition::ChildViewStatus status)
 
void OnChildViewViewRef (uint64_t content_id, uint64_t view_id, fuchsia::ui::views::ViewRef view_ref)
 
void SetSemanticsEnabled (bool enabled) override
 Used by embedder to notify the running isolate hosted by the engine on the UI thread that the accessibility tree needs to be generated. More...
 
std::shared_ptr< flutter::ExternalViewEmbedderCreateExternalViewEmbedder () override
 
- Public Member Functions inherited from flutter::PlatformView
 PlatformView (Delegate &delegate, const TaskRunners &task_runners)
 Creates a platform view with the specified delegate and task runner. The base class by itself does not do much but is suitable for use in test environments where full platform integration may not be necessary. The platform view may only be created, accessed and destroyed on the platform task runner. More...
 
virtual ~PlatformView ()
 Destroys the platform view. The platform view is owned by the shell and will be destroyed by the same on the platform tasks runner. More...
 
virtual std::unique_ptr< VsyncWaiterCreateVSyncWaiter ()
 Invoked by the shell to obtain a platform specific vsync waiter. It is optional for platforms to override this method and provide a custom vsync waiter because a timer based fall-back waiter is used by default. However, it is highly recommended that platform provide their own Vsync waiter as the timer based fall-back will not render frames aligned with vsync boundaries. More...
 
void DispatchPlatformMessage (std::unique_ptr< PlatformMessage > message)
 Used by embedders to dispatch a platform message to a running root isolate hosted by the engine. If an isolate is not running, the message is dropped. If there is no one on the other side listening on the channel, the message is dropped. When a platform message is dropped, any response handles associated with that message will be dropped as well. All users of platform messages must assume that message may not be delivered and/or their response handles may not be invoked. Platform messages are not buffered. More...
 
virtual void HandlePlatformMessage (std::unique_ptr< PlatformMessage > message)
 Overridden by embedders to perform actions in response to platform messages sent from the framework to the embedder. Default implementation of this method simply returns an empty response. More...
 
void DispatchSemanticsAction (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. More...
 
virtual void SetSemanticsEnabled (bool enabled)
 Used by embedder to notify the running isolate hosted by the engine on the UI thread that the accessibility tree needs to be generated. More...
 
virtual void SetAccessibilityFeatures (int32_t flags)
 Used by the embedder to specify the features to enable in the accessibility tree generated by the isolate. This information is forwarded to the root isolate hosted by the engine on the UI thread. More...
 
virtual void UpdateSemantics (SemanticsNodeUpdates updates, CustomAccessibilityActionUpdates actions)
 Used by the framework to tell the embedder to apply the specified semantics node updates. The default implementation of this method does nothing. More...
 
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. More...
 
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, on the raster thread, the rasterizer may need to be reconfigured to the updated viewport dimensions. On the UI thread, the framework may need to start generating a new frame for the updated viewport metrics as well. More...
 
void NotifyCreated ()
 Used by embedders to notify the shell that a platform view has been created. This notification is used to create a rendering surface and pick the client rendering API to use to render into this surface. No frames will be scheduled or rendered before this call. The surface must remain valid till the corresponding call to NotifyDestroyed. More...
 
virtual void NotifyDestroyed ()
 Used by embedders to notify the shell that the platform view has been destroyed. This notification used to collect the rendering surface and all associated resources. Frame scheduling is also suspended. More...
 
void ScheduleFrame ()
 Used by embedders to schedule a frame. In response to this call, the framework may need to start generating a new frame. More...
 
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. More...
 
void RemoveView (int64_t view_id, RemoveViewCallback callback)
 Used by embedders to notify the shell of a removed non-implicit view. More...
 
virtual sk_sp< GrDirectContextCreateResourceContext () const
 Used by the shell to obtain a Skia GPU context that is capable of operating on the IO thread. The context must be in the same share-group as the Skia GPU context used on the render thread. This context will always be used on the IO thread. Because it is in the same share-group as the separate render thread context, any GPU resources uploaded in this context will be visible to the render thread context (synchronization of GPU resources is managed by Skia). More...
 
virtual std::shared_ptr< impeller::ContextGetImpellerContext () const
 
virtual void ReleaseResourceContext () const
 Used by the shell to notify the embedder that the resource context previously obtained via a call to CreateResourceContext() is being collected. The embedder is free to collect an platform specific resources associated with this context. More...
 
virtual PointerDataDispatcherMaker GetDispatcherMaker ()
 Returns a platform-specific PointerDataDispatcherMaker so the Engine can construct the PointerDataPacketDispatcher based on platforms. More...
 
fml::WeakPtr< PlatformViewGetWeakPtr () const
 Returns a weak pointer to the platform view. Since the platform view may only be created, accessed and destroyed on the platform thread, any access to the platform view from a non-platform task runner needs a weak pointer to the platform view along with a reference to the platform task runner. A task must be posted to the platform task runner with the weak pointer captured in the same. The platform view method may only be called in the posted task once the weak pointer validity has been checked. This method is used by callers to obtain that weak pointer. More...
 
virtual void OnPreEngineRestart () const
 Gives embedders a chance to react to a "cold restart" of the running isolate. The default implementation of this method does nothing. More...
 
void SetNextFrameCallback (const fml::closure &closure)
 Sets a callback that gets executed when the rasterizer renders the next frame. Due to the asynchronous nature of rendering in Flutter, embedders usually add a placeholder over the contents in which Flutter is going to render when Flutter is first initialized. This callback may be used as a signal to remove that placeholder. The callback is executed on the render task runner and not the platform task runner. It is the embedder's responsibility to re-thread as necessary. More...
 
void DispatchPointerDataPacket (std::unique_ptr< PointerDataPacket > packet)
 Dispatches pointer events from the embedder to the framework. Each pointer data packet may contain multiple pointer input events. Each call to this method wakes up the UI thread. More...
 
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 Flutter layer tree. All textures must have a unique identifier. When the rasterizer encounters an external texture within its hierarchy, it gives the embedder a chance to update that texture on the raster thread before it composites the same on-screen. More...
 
void UnregisterTexture (int64_t texture_id)
 Used by the embedder to notify the rasterizer that it will no longer attempt to composite the specified texture within the layer tree. This allows the rasterizer to collect associated resources. More...
 
void MarkTextureFrameAvailable (int64_t texture_id)
 Used by the embedder to notify the rasterizer that the context of the previously registered texture have been updated. Typically, Flutter will only render a frame if there is an updated layer tree. However, in cases where the layer tree is static but one of the externally composited textures has been updated by the embedder, the embedder needs to notify the rasterizer to render a new frame. In such cases, the existing layer tree may be reused with the frame re-composited with all updated external textures. Unlike the calls to register and unregister the texture, this call must be made each time a new texture frame is available. More...
 
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 resolved to. More...
 
virtual std::shared_ptr< ExternalViewEmbedderCreateExternalViewEmbedder ()
 
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 deferred library identified by the specified loading unit id should be downloaded and loaded into the Dart VM via LoadDartDeferredLibrary More...
 
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, the Dart future returned by the originating loadLibrary() call completes. More...
 
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 id has failed. More...
 
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_asset_resolver. The matching AssetResolver is removed and replaced with updated_asset_resolvers. More...
 
virtual std::unique_ptr< SnapshotSurfaceProducerCreateSnapshotSurfaceProducer ()
 Creates an object that produces surfaces suitable for raster snapshotting. The rasterizer will request this surface if no on screen surface is currently available when an application requests a snapshot, e.g. if Scene.toImage or Picture.toImage are called while the application is in the background. More...
 
virtual std::shared_ptr< PlatformMessageHandlerGetPlatformMessageHandler () const
 Specifies a delegate that will receive PlatformMessages from Flutter to the host platform. More...
 
const SettingsGetSettings () const
 Get the settings for this platform view instance. More...
 
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 font size. More...
 

Additional Inherited Members

- Public Types inherited from flutter::PlatformView
using AddViewCallback = std::function< void(bool added)>
 
using RemoveViewCallback = std::function< void(bool removed)>
 
virtual std::unique_ptr< SurfaceCreateRenderingSurface ()
 
- Protected Attributes inherited from flutter::PlatformView
PlatformView::Delegatedelegate_
 
const TaskRunners task_runners_
 
fml::WeakPtrFactory< PlatformViewweak_factory_
 

Detailed Description

Definition at line 71 of file platform_view.h.

Constructor & Destructor Documentation

◆ PlatformView()

flutter_runner::PlatformView::PlatformView ( flutter::PlatformView::Delegate delegate,
flutter::TaskRunners  task_runners,
fuchsia::ui::views::ViewRef  view_ref,
std::shared_ptr< flutter::ExternalViewEmbedder external_view_embedder,
fuchsia::ui::input::ImeServiceHandle  ime_service,
fuchsia::ui::input3::KeyboardHandle  keyboard,
fuchsia::ui::pointer::TouchSourceHandle  touch_source,
fuchsia::ui::pointer::MouseSourceHandle  mouse_source,
fuchsia::ui::views::FocuserHandle  focuser,
fuchsia::ui::views::ViewRefFocusedHandle  view_ref_focused,
fuchsia::ui::composition::ParentViewportWatcherHandle  parent_viewport_watcher,
fuchsia::ui::pointerinjector::RegistryHandle  pointerinjector_registry,
OnEnableWireframeCallback  wireframe_enabled_callback,
OnCreateViewCallback  on_create_view_callback,
OnUpdateViewCallback  on_update_view_callback,
OnDestroyViewCallback  on_destroy_view_callback,
OnCreateSurfaceCallback  on_create_surface_callback,
OnSemanticsNodeUpdateCallback  on_semantics_node_update_callback,
OnRequestAnnounceCallback  on_request_announce_callback,
OnShaderWarmupCallback  on_shader_warmup_callback,
AwaitVsyncCallback  await_vsync_callback,
AwaitVsyncForSecondaryCallbackCallback  await_vsync_for_secondary_callback_callback,
std::shared_ptr< sys::ServiceDirectory >  dart_application_svc 
)

Definition at line 59 of file platform_view.cc.

85 : flutter::PlatformView(delegate, std::move(task_runners)),
86 external_view_embedder_(external_view_embedder),
87 focus_delegate_(
88 std::make_shared<FocusDelegate>(std::move(view_ref_focused),
89 std::move(focuser))),
90 pointer_delegate_(
91 std::make_shared<PointerDelegate>(std::move(touch_source),
92 std::move(mouse_source))),
93 wireframe_enabled_callback_(std::move(wireframe_enabled_callback)),
94 on_update_view_callback_(std::move(on_update_view_callback)),
95 on_create_surface_callback_(std::move(on_create_surface_callback)),
96 on_semantics_node_update_callback_(
97 std::move(on_semantics_node_update_callback)),
98 on_request_announce_callback_(std::move(on_request_announce_callback)),
99 on_create_view_callback_(std::move(on_create_view_callback)),
100 on_destroy_view_callback_(std::move(on_destroy_view_callback)),
101 on_shader_warmup_callback_(std::move(on_shader_warmup_callback)),
102 await_vsync_callback_(await_vsync_callback),
103 await_vsync_for_secondary_callback_callback_(
104 await_vsync_for_secondary_callback_callback),
105 dart_application_svc_(dart_application_svc),
106 parent_viewport_watcher_(parent_viewport_watcher.Bind()),
107 weak_factory_(this) {
108 fuchsia::ui::views::ViewRef view_ref_clone;
109 fidl::Clone(view_ref, &view_ref_clone);
110
111 text_delegate_ =
112 std::make_unique<TextDelegate>(
113 std::move(view_ref), std::move(ime_service), std::move(keyboard),
114 [weak = weak_factory_.GetWeakPtr()](
115 std::unique_ptr<flutter::PlatformMessage> message) {
116 if (!weak) {
117 FML_LOG(WARNING)
118 << "PlatformView use-after-free attempted. Ignoring.";
119 }
120 weak->delegate_.OnPlatformViewDispatchPlatformMessage(
121 std::move(message));
122 });
123
124 // Begin watching for focus changes.
125 focus_delegate_->WatchLoop([weak = weak_factory_.GetWeakPtr()](bool focused) {
126 if (!weak) {
127 FML_LOG(WARNING) << "PlatformView use-after-free attempted. Ignoring.";
128 return;
129 }
130
131 // Ensure last_text_state_ is set to make sure Flutter actually wants
132 // an IME.
133 if (focused && weak->text_delegate_->HasTextState()) {
134 weak->text_delegate_->ActivateIme();
135 } else if (!focused) {
136 weak->text_delegate_->DeactivateIme();
137 }
138 });
139
140 // Begin watching for pointer events.
141 pointer_delegate_->WatchLoop([weak = weak_factory_.GetWeakPtr()](
142 std::vector<flutter::PointerData> events) {
143 if (!weak) {
144 FML_LOG(WARNING) << "PlatformView use-after-free attempted. Ignoring.";
145 return;
146 }
147
148 if (events.empty()) {
149 return; // No work, bounce out.
150 }
151
152 // If pixel ratio hasn't been set, use a default value of 1.
153 const float pixel_ratio = weak->view_pixel_ratio_.value_or(1.f);
154 auto packet = std::make_unique<flutter::PointerDataPacket>(events.size());
155 for (size_t i = 0; i < events.size(); ++i) {
156 auto& event = events[i];
157 // Translate logical to physical coordinates, as per
158 // flutter::PointerData contract. Done here because pixel ratio comes
159 // from the graphics API.
160 event.physical_x = event.physical_x * pixel_ratio;
161 event.physical_y = event.physical_y * pixel_ratio;
162 packet->SetPointerData(i, event);
163 }
164 weak->DispatchPointerDataPacket(std::move(packet));
165 });
166
167 // Configure the pointer injector delegate.
168 pointer_injector_delegate_ = std::make_unique<PointerInjectorDelegate>(
169 std::move(pointerinjector_registry), std::move(view_ref_clone));
170
171 // This is only used by the integration tests.
172 if (dart_application_svc) {
173 // Connect to TouchInputListener
174 fuchsia::ui::test::input::TouchInputListenerHandle touch_input_listener;
175 zx_status_t touch_input_listener_status =
176 dart_application_svc
177 ->Connect<fuchsia::ui::test::input::TouchInputListener>(
178 touch_input_listener.NewRequest());
179 if (touch_input_listener_status != ZX_OK) {
180 FML_LOG(WARNING)
181 << "fuchsia::ui::test::input::TouchInputListener connection failed: "
182 << zx_status_get_string(touch_input_listener_status);
183 } else {
184 touch_input_listener_.Bind(std::move(touch_input_listener));
185 }
186
187 // Connect to KeyboardInputListener
188 fuchsia::ui::test::input::KeyboardInputListenerHandle
189 keyboard_input_listener;
190 zx_status_t keyboard_input_listener_status =
191 dart_application_svc
192 ->Connect<fuchsia::ui::test::input::KeyboardInputListener>(
193 keyboard_input_listener.NewRequest());
194 if (keyboard_input_listener_status != ZX_OK) {
195 FML_LOG(WARNING) << "fuchsia::ui::test::input::KeyboardInputListener "
196 "connection failed: "
197 << zx_status_get_string(keyboard_input_listener_status);
198 } else {
199 keyboard_input_listener_.Bind(std::move(keyboard_input_listener));
200 }
201 // Connect to MouseInputListener
202 fuchsia::ui::test::input::MouseInputListenerHandle mouse_input_listener;
203 zx_status_t mouse_input_listener_status =
204 dart_application_svc
205 ->Connect<fuchsia::ui::test::input::MouseInputListener>(
206 mouse_input_listener.NewRequest());
207 if (mouse_input_listener_status != ZX_OK) {
208 FML_LOG(WARNING)
209 << "fuchsia::ui::test::input::MouseInputListener connection failed: "
210 << zx_status_get_string(mouse_input_listener_status);
211 } else {
212 mouse_input_listener_.Bind(std::move(mouse_input_listener));
213 }
214 }
215
216 // Finally! Register the native platform message handlers.
217 RegisterPlatformMessageHandlers();
218
219 parent_viewport_watcher_.set_error_handler([](zx_status_t status) {
220 FML_LOG(ERROR) << "Interface error on: ParentViewportWatcher status: "
221 << status;
222 });
223
224 parent_viewport_watcher_->GetLayout(
225 fit::bind_member(this, &PlatformView::OnGetLayout));
226 parent_viewport_watcher_->GetStatus(
227 fit::bind_member(this, &PlatformView::OnParentViewportStatus));
228}
for(const auto glyph :glyphs)
Definition: FontMgrTest.cpp:52
Platform views are created by the shell on the platform task runner. Unless explicitly specified,...
Definition: platform_view.h:51
void OnParentViewportStatus(fuchsia::ui::composition::ParentViewportStatus status)
void OnGetLayout(fuchsia::ui::composition::LayoutInfo info)
if(end==-1)
FlKeyEvent * event
#define FML_LOG(severity)
Definition: logging.h:82
Win32Message message
#define ERROR(message)
Definition: elf_loader.cc:260

◆ ~PlatformView()

flutter_runner::PlatformView::~PlatformView ( )
overridevirtualdefault

Destroys the platform view. The platform view is owned by the shell and will be destroyed by the same on the platform tasks runner.

Reimplemented from flutter::PlatformView.

Member Function Documentation

◆ CreateExternalViewEmbedder()

std::shared_ptr< flutter::ExternalViewEmbedder > flutter_runner::PlatformView::CreateExternalViewEmbedder ( )
overridevirtual

Reimplemented from flutter::PlatformView.

Definition at line 630 of file platform_view.cc.

630 {
631 return external_view_embedder_;
632}

◆ OnChildViewStatus()

void flutter_runner::PlatformView::OnChildViewStatus ( uint64_t  content_id,
fuchsia::ui::composition::ChildViewStatus  status 
)

Definition at line 378 of file platform_view.cc.

380 {
381 FML_DCHECK(child_view_info_.count(content_id) == 1);
382
383 std::ostringstream out;
384 out << "{" << "\"method\":\"View.viewStateChanged\"," << "\"args\":{"
385 << " \"viewId\":" << child_view_info_.at(content_id).view_id
386 << "," // ViewId
387 << " \"is_rendering\":true," // IsViewRendering
388 << " \"state\":true" // IsViewRendering
389 << " }" << "}";
390 auto call = out.str();
391
392 std::unique_ptr<flutter::PlatformMessage> message =
393 std::make_unique<flutter::PlatformMessage>(
394 "flutter/platform_views",
395 fml::MallocMapping::Copy(call.c_str(), call.size()), nullptr);
397
398 child_view_info_.at(content_id)
399 .child_view_watcher->GetStatus(
400 [this, content_id](fuchsia::ui::composition::ChildViewStatus status) {
401 OnChildViewStatus(content_id, status);
402 });
403}
void DispatchPlatformMessage(std::unique_ptr< PlatformMessage > message)
Used by embedders to dispatch a platform message to a running root isolate hosted by the engine....
void OnChildViewStatus(uint64_t content_id, fuchsia::ui::composition::ChildViewStatus status)
static MallocMapping Copy(const T *begin, const T *end)
Definition: mapping.h:162
#define FML_DCHECK(condition)
Definition: logging.h:103
def call(args)
Definition: dom.py:159

◆ OnChildViewViewRef()

void flutter_runner::PlatformView::OnChildViewViewRef ( uint64_t  content_id,
uint64_t  view_id,
fuchsia::ui::views::ViewRef  view_ref 
)

Definition at line 405 of file platform_view.cc.

407 {
408 FML_CHECK(child_view_info_.count(content_id) == 1);
409
410 fuchsia::ui::views::ViewRef view_ref_clone;
411 fidl::Clone(view_ref, &view_ref_clone);
412
413 focus_delegate_->OnChildViewViewRef(view_id, std::move(view_ref));
414
415 pointer_injector_delegate_->OnCreateView(view_id, std::move(view_ref_clone));
416 OnChildViewConnected(content_id);
417}
#define FML_CHECK(condition)
Definition: logging.h:85

◆ OnGetLayout()

void flutter_runner::PlatformView::OnGetLayout ( fuchsia::ui::composition::LayoutInfo  info)

Definition at line 328 of file platform_view.cc.

328 {
329 view_logical_size_ = {static_cast<float>(info.logical_size().width),
330 static_cast<float>(info.logical_size().height)};
331
332 if (info.has_device_pixel_ratio()) {
333 // Both values should be identical for the Vec2 for DPR.
334 FML_DCHECK(info.device_pixel_ratio().x == info.device_pixel_ratio().y);
335 view_pixel_ratio_ = info.device_pixel_ratio().x;
336 }
337
338 float pixel_ratio = view_pixel_ratio_ ? *view_pixel_ratio_ : 1.0f;
340 pixel_ratio, // device_pixel_ratio
341 std::round(view_logical_size_.value()[0] *
342 pixel_ratio), // physical_width
343 std::round(view_logical_size_.value()[1] *
344 pixel_ratio), // physical_height
345 0.0f, // physical_padding_top
346 0.0f, // physical_padding_right
347 0.0f, // physical_padding_bottom
348 0.0f, // physical_padding_left
349 0.0f, // physical_view_inset_top
350 0.0f, // physical_view_inset_right
351 0.0f, // physical_view_inset_bottom
352 0.0f, // physical_view_inset_left
353 0.0f, // p_physical_system_gesture_inset_top
354 0.0f, // p_physical_system_gesture_inset_right
355 0.0f, // p_physical_system_gesture_inset_bottom
356 0.0f, // p_physical_system_gesture_inset_left,
357 -1.0, // p_physical_touch_slop,
358 {}, // p_physical_display_features_bounds
359 {}, // p_physical_display_features_type
360 {}, // p_physical_display_features_state
361 0, // p_display_id
362 };
364
365 parent_viewport_watcher_->GetLayout(
366 fit::bind_member(this, &PlatformView::OnGetLayout));
367}
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
Definition: DM.cpp:213
static void round(SkPoint *p)
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,...
static constexpr int64_t kFlutterImplicitViewId

◆ OnParentViewportStatus()

void flutter_runner::PlatformView::OnParentViewportStatus ( fuchsia::ui::composition::ParentViewportStatus  status)

Definition at line 369 of file platform_view.cc.

370 {
371 // TODO(fxbug.dev/116001): Investigate if it is useful to send hidden/shown
372 // signals.
373 parent_viewport_status_ = status;
374 parent_viewport_watcher_->GetStatus(
375 fit::bind_member(this, &PlatformView::OnParentViewportStatus));
376}

◆ SetSemanticsEnabled()

void flutter_runner::PlatformView::SetSemanticsEnabled ( bool  enabled)
overridevirtual

Used by embedder to notify the running isolate hosted by the engine on the UI thread that the accessibility tree needs to be generated.

Attention
Subclasses may choose to override this method to perform platform specific functions. However, they must call the base class method at some point in their implementation.
Parameters
[in]enabledWhether the accessibility tree needs to be generated.

Reimplemented from flutter::PlatformView.

Definition at line 667 of file platform_view.cc.

667 {
669 if (enabled) {
670 SetAccessibilityFeatures(static_cast<int32_t>(
672 } else {
674 }
675}
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 void SetAccessibilityFeatures(int32_t flags)
Used by the embedder to specify the features to enable in the accessibility tree generated by the iso...

The documentation for this class was generated from the following files: