MCPcopy Create free account
hub / github.com/Snapchat/Valdi / setViewToRootViewNode

Method setViewToRootViewNode

valdi/src/valdi/runtime/Context/ViewNodeTree.cpp:529–542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

527}
528
529void ViewNodeTree::setViewToRootViewNode(const Ref<ViewNode>& rootViewNode, const Ref<View>& view) {
530 auto& viewTransactionScope = getCurrentViewTransactionScope();
531 if (rootViewNode != nullptr) {
532 rootViewNode->setView(viewTransactionScope, view, nullptr);
533 }
534
535 if (view != nullptr) {
536 viewTransactionScope.transaction().moveViewToTree(view, this, rootViewNode.get());
537 }
538
539 if (rootViewNode != nullptr) {
540 rootViewNode->setViewTreeNeedsUpdate();
541 }
542}
543
544void ViewNodeTree::setRootViewNode(Ref<ViewNode> rootViewNode, bool useDefaultViewFactory) {
545 auto oldRootViewNode = std::move(_rootViewNode);

Callers

nothing calls this directly

Calls 4

setViewMethod · 0.80
getMethod · 0.65
moveViewToTreeMethod · 0.45

Tested by

no test coverage detected