Skip to content

Commit

Permalink
Fabric: LayoutContext::affectedShadowNodes was removed
Browse files Browse the repository at this point in the history
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
  • Loading branch information
shergin authored and facebook-github-bot committed May 9, 2018
1 parent e028631 commit cb48fa4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
6 changes: 0 additions & 6 deletions ReactCommon/fabric/core/layout/LayoutContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion ReactCommon/fabric/uimanager/Scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
5 changes: 1 addition & 4 deletions ReactCommon/fabric/view/yoga/YogaLayoutableShadowNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit cb48fa4

Please sign in to comment.