Fabric: `LayoutContext::affectedShadowNodes` was removed

Summary:
Apparently, we don't need this functionality in Fabric because we compute mutation instactions during diffing anyways.
But we still need (will need) `LayoutContext` for sure.

Reviewed By: mdvacca

Differential Revision: D7857045

fbshipit-source-id: 4be2744d9abea473ead847f35f698104f94af33d
This commit is contained in:
Valentin Shergin 2018-05-08 22:56:10 -07:00 committed by Facebook Github Bot
parent e028631513
commit cb48fa4d49
3 changed files with 1 additions and 11 deletions

View File

@ -24,12 +24,6 @@ struct LayoutContext {
* Compound absolute position of the node relative to the root node.
*/
Point absolutePosition {0, 0};
/*
* Collection of shadow nodes which were chanded during the layout pass,
* and which associated views might need to be updated.
*/
std::shared_ptr<std::unordered_set<SharedLayoutableShadowNode>> affectedShadowNodes {nullptr};
};
} // namespace react

View File

@ -65,7 +65,6 @@ void Scheduler::uiManagerDidFinishTransaction(Tag rootTag, const SharedShadowNod
auto nonConstNewRootShadowNode = std::const_pointer_cast<RootShadowNode>(newRootShadowNode);
LayoutContext layoutContext = LayoutContext();
layoutContext.affectedShadowNodes = std::make_shared<std::unordered_set<SharedLayoutableShadowNode>>();
LOG(INFO) << "Old Shadow Tree: \n" << oldRootShadowNode->getDebugDescription();
LOG(INFO) << "New Shadow Tree *before* layout: \n" << newRootShadowNode->getDebugDescription();

View File

@ -130,10 +130,7 @@ void YogaLayoutableShadowNode::layoutChildren(LayoutContext layoutContext) {
auto nonConstYogaLayoutableChild = std::const_pointer_cast<YogaLayoutableShadowNode>(yogaLayoutableChild);
LayoutMetrics childLayoutMetrics = layoutMetricsFromYogaNode(*nonConstYogaLayoutableChild->yogaNode_);
bool isAffected = nonConstYogaLayoutableChild->setLayoutMetrics(childLayoutMetrics);
if (isAffected) {
layoutContext.affectedShadowNodes->insert(child);
}
nonConstYogaLayoutableChild->setLayoutMetrics(childLayoutMetrics);
}
}