Improve performance for node reordering in FabricReconciler

Summary: This diff improves performance of re-layout and delivery of OnLayout events for Fabric surfaces.

Reviewed By: fkgozali

Differential Revision: D8622718

fbshipit-source-id: 703b6c3ca70b570e8fb79ae1c1e8d9e8fcd38658
This commit is contained in:
David Vacca 2018-06-25 21:41:04 -07:00 committed by Facebook Github Bot
parent 6bbc1b7b96
commit a07b66026d
2 changed files with 2 additions and 2 deletions

View File

@ -88,7 +88,7 @@ public class FabricReconciler {
for (int k = firstRemovedOrAddedViewIndex; k < newList.size(); k++) {
ReactShadowNode newNode = newList.get(k);
if (newNode.isVirtual()) continue;
enqueueUpdateProperties(newNode, null);
enqueueUpdateProperties(newNode, newNode.getOriginalReactShadowNode());
viewsToAdd.add(new ViewAtIndex(newNode.getReactTag(), k));
List previousChildrenList = newNode.getOriginalReactShadowNode() == null ? null : newNode.getOriginalReactShadowNode().getChildrenList();
manageChildren(newNode, previousChildrenList, newNode.getChildrenList());

View File

@ -1221,8 +1221,8 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
}
}
@Override
public void updateScreenLayout(ReactShadowNode prevNode) {
assertNotSealed();
mScreenHeight = prevNode.getScreenHeight();
mScreenWidth = prevNode.getScreenWidth();
mScreenX = prevNode.getScreenX();