Skip to content

Commit fb855f6

Browse files
move YGMarkerMeasure and YGMarkerBaselineFn to event based system
Summary: Using yoga event listener for adding systrace sections for measure and baseline events Reviewed By: davidaurelio Differential Revision: D16048795 fbshipit-source-id: 3c2161328250184929ed1a3357b8c42ec8ca2e29
1 parent e4186e9 commit fb855f6

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

ReactCommon/yoga/yoga/YGMarker.h

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ YG_EXTERN_C_BEGIN
1313
typedef struct YGNode* YGNodeRef;
1414
typedef struct YGConfig* YGConfigRef;
1515

16-
typedef YG_ENUM_BEGIN(YGMarker){
17-
YGMarkerMeasure,
18-
YGMarkerBaselineFn,
19-
} YG_ENUM_END(YGMarker);
16+
typedef YG_ENUM_BEGIN(YGMarker) {}
17+
YG_ENUM_END(YGMarker);
2018

2119
typedef struct {
2220
int layouts;
@@ -62,13 +60,6 @@ struct NoMarkerData {
6260
using type = YGMarkerNoData;
6361
static type*& get(YGMarkerData& d) { return d.noData; }
6462
};
65-
66-
template <>
67-
struct MarkerData<YGMarkerMeasure> : NoMarkerData {};
68-
69-
template <>
70-
struct MarkerData<YGMarkerBaselineFn> : NoMarkerData {};
71-
7263
} // namespace detail
7364

7465
template <YGMarker M>

ReactCommon/yoga/yoga/Yoga.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,9 +1000,7 @@ static float YGBaseline(const YGNodeRef node, void* layoutContext) {
10001000

10011001
Event::publish<Event::NodeBaselineStart>(node);
10021002

1003-
const float baseline = marker::MarkerSection<YGMarkerBaselineFn>::wrap(
1004-
node,
1005-
&YGNode::baseline,
1003+
const float baseline = node->baseline(
10061004
node->getLayout().measuredDimensions[YGDimensionWidth],
10071005
node->getLayout().measuredDimensions[YGDimensionHeight],
10081006
layoutContext);
@@ -1638,9 +1636,7 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(
16381636
Event::publish<Event::MeasureCallbackStart>(node);
16391637

16401638
// Measure the text under the current constraints.
1641-
const YGSize measuredSize = marker::MarkerSection<YGMarkerMeasure>::wrap(
1642-
node,
1643-
&YGNode::measure,
1639+
const YGSize measuredSize = node->measure(
16441640
innerWidth,
16451641
widthMeasureMode,
16461642
innerHeight,

0 commit comments

Comments
 (0)