class LinkSystem
Defined at line 268 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 30 of file ../../src/ui/scenic/lib/flatland/link_system.cc
LinkToChild CreateLinkToChild (std::shared_ptr<utils::DispatcherHolder>dispatcher_holder,fuchsia_ui_views::ViewportCreationTokentoken,fuchsia_ui_composition::ViewportPropertiesinitial_properties,fidl::ServerEnd<fuchsia_ui_composition::ChildViewWatcher>child_view_watcher,TransformHandleparent_transform_handle,LinkProtocolErrorCallbackerror_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 41 of file ../../src/ui/scenic/lib/flatland/link_system.cc
LinkToParent CreateLinkToParent (std::shared_ptr<utils::DispatcherHolder>dispatcher_holder,fuchsia_ui_views::ViewCreationTokentoken,std::optional<fuchsia_ui_views::ViewIdentityOnCreation>view_identity,fidl::ServerEnd<fuchsia_ui_composition::ParentViewportWatcher>parent_viewport_watcher,TransformHandlechild_transform_handle,LinkProtocolErrorCallbackerror_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 123 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 274 of file ../../src/ui/scenic/lib/flatland/link_system.h
LinkSystem & operator= (const LinkSystem & )
Defined at line 275 of file ../../src/ui/scenic/lib/flatland/link_system.h
void LinkSystem (LinkSystem && )
Defined at line 276 of file ../../src/ui/scenic/lib/flatland/link_system.h
LinkSystem & operator= (LinkSystem && )
Defined at line 277 of file ../../src/ui/scenic/lib/flatland/link_system.h
uint64_t GetResolvedTopologyLinks (GlobalTopologyData::LinkTopologyMap & out_links)
Populates `out_links` with a snapshot of the current set of links, represented as a map from
LinkSystem-owned TransformHandles to TransformHandles in LinkToParents, and returns the
`link_topology_generation_` value the snapshot was taken at. 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 330 of file ../../src/ui/scenic/lib/flatland/link_system.cc
uint64_t GetResolvedTopologyLinksIfChanged (uint64_t known_generation, GlobalTopologyData::LinkTopologyMap & out_links)
Like `GetResolvedTopologyLinks()`, but leaves `out_links` untouched when the generation equals
`known_generation`, so a caller that still holds the links of that generation skips the copy.
Defined at line 336 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 355 of file ../../src/ui/scenic/lib/flatland/link_system.cc
void UpdateLinkWatchers (const GlobalTopologyData::TopologyVector &global_topology,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 212 of file ../../src/ui/scenic/lib/flatland/link_system.cc
void GetLinkChildToParentTransformMap (GlobalTopologyData::ChildToParentTransformMap & out_map)
Populates `out_map` with the mapping from the `child_transform_handle` of each LinkToParent to
the corresponding `parent_transform_handle` from each LinkToChild.
Defined at line 357 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 298 of file ../../src/ui/scenic/lib/flatland/link_system.cc
void UpdateDevicePixelRatio (const fuchsia_math::VecF & device_pixel_ratio)
Updates |device_pixel_ratio_| and, if the value changed, sends updates to all waiting clients.
Defined at line 277 of file ../../src/ui/scenic/lib/flatland/link_system.cc
void UpdateDevicePixelRatio (const glm::vec2 & initial_device_pixel_ratio)
Defined at line 401 of file ../../src/ui/scenic/lib/flatland/link_system.h