Fixed performance regression in `ShadowView`s layout process

Summary:
This fixes perf regression which was introduced by recent refactoring of the layout process.
That is how it used to be:
114c258045/React/Views/RCTShadowView.m (L160-L166)
Note: We have to resert this flag in indication that we already applied those changes and we don't need to traverse this subtree until it is changed again.

Reviewed By: fkgozali

Differential Revision: D7343564

fbshipit-source-id: ba7e00bc5fe4992d777eed20ba0d959fd8f6c037
This commit is contained in:
Valentin Shergin 2018-03-21 10:19:01 -07:00 committed by Facebook Github Bot
parent 909861ff05
commit c194c18126
1 changed files with 4 additions and 0 deletions

View File

@ -284,6 +284,8 @@ static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT],
return;
}
YGNodeSetHasNewLayout(yogaNode, false);
RCTLayoutMetrics layoutMetrics = RCTLayoutMetricsFromYogaNode(yogaNode);
layoutContext.absolutePosition.x += layoutMetrics.frame.origin.x;
@ -321,6 +323,8 @@ static void RCTProcessMetaPropsBorder(const YGValue metaProps[META_PROP_COUNT],
continue;
}
YGNodeSetHasNewLayout(childYogaNode, false);
RCTLayoutMetrics childLayoutMetrics = RCTLayoutMetricsFromYogaNode(childYogaNode);
layoutContext.absolutePosition.x += childLayoutMetrics.frame.origin.x;