From 7bf6f2c23895a91968d66193da7f44e43942d90a Mon Sep 17 00:00:00 2001 From: Valentin Shergin Date: Fri, 11 Jan 2019 18:03:25 -0800 Subject: [PATCH] Fabric: Layout/Yoga related systrace sections Summary: Trivial. Reviewed By: mdvacca Differential Revision: D13643275 fbshipit-source-id: 67a562b899f077d7ca53b64456807a8d7c8fe6b7 --- .../view/yoga/YogaLayoutableShadowNode.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp index 298295f2146..30d49d862c1 100644 --- a/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp +++ b/ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include namespace facebook { @@ -114,8 +115,13 @@ void YogaLayoutableShadowNode::layout(LayoutContext layoutContext) { * (and this is by design). */ yogaConfig_.pointScaleFactor = layoutContext.pointScaleFactor; - YGNodeCalculateLayout( - &yogaNode_, YGUndefined, YGUndefined, YGDirectionInherit); + + { + SystraceSection s("YogaLayoutableShadowNode::YGNodeCalculateLayout"); + + YGNodeCalculateLayout( + &yogaNode_, YGUndefined, YGUndefined, YGDirectionInherit); + } } LayoutableShadowNode::layout(layoutContext); @@ -153,6 +159,8 @@ YGNode *YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector( YGNode *oldYogaNode, YGNode *parentYogaNode, int childIndex) { + SystraceSection s("YogaLayoutableShadowNode::yogaNodeCloneCallbackConnector"); + // At this point it is garanteed that all shadow nodes associated with yoga // nodes are `YogaLayoutableShadowNode` subclasses. auto parentNode = @@ -170,6 +178,9 @@ YGSize YogaLayoutableShadowNode::yogaNodeMeasureCallbackConnector( YGMeasureMode widthMode, float height, YGMeasureMode heightMode) { + SystraceSection s( + "YogaLayoutableShadowNode::yogaNodeMeasureCallbackConnector"); + auto shadowNodeRawPtr = static_cast(yogaNode->getContext());