class LinkSystem

Defined at line 269 of file ../../src/ui/scenic/lib/flatland/link_system.h

A system for managing links between Flatland instances. Each Flatland instance creates Links

using tokens provided by Flatland clients. Each end of a Link consists of:

- An implementation of the FIDL protocol for communicating with the other end of the link.

- A TransformHandle which serves as the "attachment point" for that end of the link.

- The ObjectLinker link which serves as the actual implementation of the link.

The LinkSystem is only responsible for connecting the "attachment point" TransformHandles

returned in the Link structs. Flatland instances must attach these handles to their own

transform hierarchy and notify the TopologySystem in order for the link to actually be

established.

Public Methods

void LinkSystem (TransformHandle::InstanceId instance_id)

Defined at line 26 of file ../../src/ui/scenic/lib/flatland/link_system.cc

LinkToChild CreateLinkToChild (std::shared_ptr<utils::DispatcherHolder> dispatcher_holder, fuchsia::ui::views::ViewportCreationToken token, fuchsia::ui::composition::ViewportProperties initial_properties, fidl::InterfaceRequest<fuchsia::ui::composition::ChildViewWatcher> child_view_watcher, TransformHandle parent_transform_handle, LinkProtocolErrorCallback error_callback)

Creates the parent end of a link. The LinkToChild's |internal_link_handle| serves as the

attachment point for the caller's transform hierarchy. |initial_properties| is immediately

dispatched to the LinkToParent when the Link is resolved, regardless of whether the parent or

the child has called |Flatland::Present()|.

Link handles are excluded from global topologies, so the |parent_transform_handle| is

provided by the parent as the attachment point for the ChildViewWatcherImpl.

|dispatcher_holder| allows hanging-get response-callbacks to be invoked from the appropriate

Flatland session thread.

Defined at line 29 of file ../../src/ui/scenic/lib/flatland/link_system.cc

LinkToParent CreateLinkToParent (std::shared_ptr<utils::DispatcherHolder> dispatcher_holder, fuchsia::ui::views::ViewCreationToken token, std::optional<fuchsia::ui::views::ViewIdentityOnCreation> view_identity, fidl::InterfaceRequest<fuchsia::ui::composition::ParentViewportWatcher> parent_viewport_watcher, TransformHandle child_transform_handle, LinkProtocolErrorCallback error_callback)

Creates the child end of a link. Once both ends of a Link have been created, the LinkSystem

will create a local topology that connects the internal Link to the LinkToParent's

|child_transform_handle|.

|dispatcher_holder| allows hanging-get response-callbacks to be invoked from the appropriate

Flatland session thread.

Defined at line 109 of file ../../src/ui/scenic/lib/flatland/link_system.cc

void LinkSystem (const LinkSystem & )

Because this object captures its "this" pointer in internal closures, it is unsafe to copy or

move it. Disable all copy and move operations.

Defined at line 275 of file ../../src/ui/scenic/lib/flatland/link_system.h

LinkSystem & operator= (const LinkSystem & )

Defined at line 276 of file ../../src/ui/scenic/lib/flatland/link_system.h

void LinkSystem (LinkSystem && )

Defined at line 277 of file ../../src/ui/scenic/lib/flatland/link_system.h

LinkSystem & operator= (LinkSystem && )

Defined at line 278 of file ../../src/ui/scenic/lib/flatland/link_system.h

GlobalTopologyData::LinkTopologyMap GetResolvedTopologyLinks ()

Returns a snapshot of the current set of links, represented as a map from LinkSystem-owned

TransformHandles to TransformHandles in LinkToParents. The LinkSystem generates Keys for this

map in CreateLinkToChild() and returns them to callers in a LinkToChild's

|internal_link_handle|. The values in this map are arguments to CreateLinkToParent() and become

the LinkToParent's |child_transform_handle|. The LinkSystem places entries in the map when a

link resolves and removes them when a link is invalidated.

Defined at line 307 of file ../../src/ui/scenic/lib/flatland/link_system.cc

TransformHandle::InstanceId GetInstanceId ()

Returns the instance ID used for LinkSystem-authored handles.

Defined at line 319 of file ../../src/ui/scenic/lib/flatland/link_system.cc

void UpdateLinkWatchers (const GlobalTopologyData::TopologyVector & global_topology, const std::unordered_set<TransformHandle> & live_handles, const GlobalMatrixVector & global_matrices, const UberStruct::InstanceMap & uber_structs)

For use by the core processing loop, this function consumes global information, processes it,

and sends all necessary updates to active ParentViewportWatcher and ChildViewWatcher channels.

This data passed into this function is generated by merging information from multiple Flatland

instances. |global_topology| is the TopologyVector of all nodes visible from the (currently

single) display. |live_handles| is the set of nodes in that vector. |global_matrices| is the

list of global matrices, one per handle in |global_topology|. |uber_structs| is the set of

UberStructs used to generate the global topology.

Defined at line 199 of file ../../src/ui/scenic/lib/flatland/link_system.cc

const std::pair<std::unordered_map<TransformHandle, TransformHandle>, bool> GetLinkChildToParentTransformMap ()

Returns the mapping from the child_transform_handle of each LinkToParent to the corresponding

parent_transform_handle from each LinkToChild.

Defined at line 321 of file ../../src/ui/scenic/lib/flatland/link_system.cc

void UpdateViewportPropertiesFor (TransformHandle handle, const fuchsia::ui::composition::ViewportProperties & properties)

Updates |device_pixel_ratio_| for the View with parent |handle|. If the value changed it sends

updates to all waiting clients, otherwise it does nothing.

|handle| should have been previously used as |parent_transform_handle| in CreateLinkToChild().

Defined at line 276 of file ../../src/ui/scenic/lib/flatland/link_system.cc

void UpdateDevicePixelRatio (const fuchsia::math::VecF & device_pixel_raito)

Updates |device_pixel_ratio_| and, if the value changed, sends updates to all waiting clients.

Defined at line 256 of file ../../src/ui/scenic/lib/flatland/link_system.cc

void UpdateDevicePixelRatio (const glm::vec2 & initial_device_pixel_ratio)

Defined at line 398 of file ../../src/ui/scenic/lib/flatland/link_system.h

Records