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

Method makePlaceholderViewNode

valdi/src/valdi/runtime/Context/ViewNode.cpp:1597–1612  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1595 *this, width, widthMode, height, heightMode);
1596 } else if (_lazyLayoutData != nullptr) {
1597 return Size(_lazyLayoutData->estimatedWidth, _lazyLayoutData->estimatedHeight);
1598 } else {
1599 return Size();
1600 }
1601}
1602
1603Ref<ViewNode> ViewNode::makePlaceholderViewNode(ViewTransactionScope& viewTransactionScope,
1604 const Ref<View>& placeholderView) {
1605 auto viewNode = Valdi::makeShared<ViewNode>(nullptr, _attributeIds, _logger);
1606 viewNode->setViewNodeTree(_viewNodeTree);
1607 viewNode->setViewFactory(viewTransactionScope, _viewFactory);
1608 viewNode->_emittingViewNode = strongSmallRef(this);
1609 viewNode->_cssAttributesManager.copyCSSDocument(_cssAttributesManager);
1610 placeholderView->setCanBeReused(false);
1611
1612 _attributesApplier.copyViewLayoutAttributes(viewNode->_attributesApplier);
1613
1614 viewNode->setView(viewTransactionScope, placeholderView, nullptr);
1615 viewTransactionScope.transaction().moveViewToTree(placeholderView, _viewNodeTree, viewNode.get());

Callers 1

measureMethod · 0.80

Calls 9

strongSmallRefFunction · 0.85
setViewNodeTreeMethod · 0.80
setViewFactoryMethod · 0.80
copyCSSDocumentMethod · 0.80
setCanBeReusedMethod · 0.80
setViewMethod · 0.80
getMethod · 0.65
moveViewToTreeMethod · 0.45

Tested by

no test coverage detected