mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 03:50:11 +08:00
Fixed performance regression in ShadowViews 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:
committed by
Facebook Github Bot
parent
909861ff05
commit
c194c18126
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user