Fabric: Layout/Yoga related systrace sections

Summary: Trivial.

Reviewed By: mdvacca

Differential Revision: D13643275

fbshipit-source-id: 67a562b899f077d7ca53b64456807a8d7c8fe6b7
This commit is contained in:
Valentin Shergin 2019-01-11 18:03:25 -08:00 коммит произвёл Facebook Github Bot
Родитель 7d79411008
Коммит 7bf6f2c238
1 изменённых файлов: 13 добавлений и 2 удалений

Просмотреть файл

@ -14,6 +14,7 @@
#include <react/core/LayoutConstraints.h>
#include <react/core/LayoutContext.h>
#include <react/debug/DebugStringConvertibleItem.h>
#include <react/debug/SystraceSection.h>
#include <yoga/Yoga.h>
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<YogaLayoutableShadowNode *>(yogaNode->getContext());