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
This commit is contained in:
Sidharth Guglani
2019-07-17 08:08:01 -07:00
committed by Facebook Github Bot
parent 6d916ab063
commit 7c891db9af
3 changed files with 4 additions and 57 deletions

View File

@@ -13,10 +13,8 @@ YG_EXTERN_C_BEGIN
typedef struct YGNode* YGNodeRef;
typedef struct YGConfig* YGConfigRef;
typedef YG_ENUM_BEGIN(YGMarker){
YGMarkerMeasure,
YGMarkerBaselineFn,
} YG_ENUM_END(YGMarker);
typedef YG_ENUM_BEGIN(YGMarker) {}
YG_ENUM_END(YGMarker);
typedef struct {
int layouts;
@@ -62,13 +60,6 @@ struct NoMarkerData {
using type = YGMarkerNoData;
static type*& get(YGMarkerData& d) { return d.noData; }
};
template <>
struct MarkerData<YGMarkerMeasure> : NoMarkerData {};
template <>
struct MarkerData<YGMarkerBaselineFn> : NoMarkerData {};
} // namespace detail
template <YGMarker M>

View File

@@ -1000,9 +1000,7 @@ static float YGBaseline(const YGNodeRef node, void* layoutContext) {
Event::publish<Event::NodeBaselineStart>(node);
const float baseline = marker::MarkerSection<YGMarkerBaselineFn>::wrap(
node,
&YGNode::baseline,
const float baseline = node->baseline(
node->getLayout().measuredDimensions[YGDimensionWidth],
node->getLayout().measuredDimensions[YGDimensionHeight],
layoutContext);
@@ -1638,9 +1636,7 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(
Event::publish<Event::MeasureCallbackStart>(node);
// Measure the text under the current constraints.
const YGSize measuredSize = marker::MarkerSection<YGMarkerMeasure>::wrap(
node,
&YGNode::measure,
const YGSize measuredSize = node->measure(
innerWidth,
widthMeasureMode,
innerHeight,