move YGMarkerLayout to event based system
Summary: Using layoutPassStart and LayoutPassEnd events instead of YGMarkerLayout for instrumentation Reviewed By: davidaurelio Differential Revision: D16048789 fbshipit-source-id: 041a35bc2cb1b7281ca83cf9d35041b4011cfeb9
This commit is contained in:
committed by
Facebook Github Bot
parent
ce517689ff
commit
eeae39d707
@@ -14,7 +14,6 @@ typedef struct YGNode* YGNodeRef;
|
||||
typedef struct YGConfig* YGConfigRef;
|
||||
|
||||
typedef YG_ENUM_BEGIN(YGMarker){
|
||||
YGMarkerLayout,
|
||||
YGMarkerMeasure,
|
||||
YGMarkerBaselineFn,
|
||||
} YG_ENUM_END(YGMarker);
|
||||
@@ -33,7 +32,6 @@ typedef struct {
|
||||
} YGMarkerNoData;
|
||||
|
||||
typedef union {
|
||||
YGMarkerLayoutData* layout;
|
||||
YGMarkerNoData* noData;
|
||||
} YGMarkerData;
|
||||
|
||||
@@ -60,12 +58,6 @@ namespace detail {
|
||||
template <YGMarker M>
|
||||
struct MarkerData;
|
||||
|
||||
template <>
|
||||
struct MarkerData<YGMarkerLayout> {
|
||||
using type = YGMarkerLayoutData;
|
||||
static type*& get(YGMarkerData& d) { return d.layout; }
|
||||
};
|
||||
|
||||
struct NoMarkerData {
|
||||
using type = YGMarkerNoData;
|
||||
static type*& get(YGMarkerData& d) { return d.noData; }
|
||||
|
@@ -4063,7 +4063,7 @@ void YGNodeCalculateLayoutWithContext(
|
||||
void* layoutContext) {
|
||||
|
||||
Event::publish<Event::LayoutPassStart>(node, {layoutContext});
|
||||
marker::MarkerSection<YGMarkerLayout> marker{node};
|
||||
YGMarkerLayoutData markerData = {};
|
||||
|
||||
// Increment the generation count. This will force the recursive routine to
|
||||
// visit all dirty nodes at least once. Subsequent visits will be skipped if
|
||||
@@ -4122,7 +4122,7 @@ void YGNodeCalculateLayoutWithContext(
|
||||
true,
|
||||
"initial",
|
||||
node->getConfig(),
|
||||
marker.data,
|
||||
markerData,
|
||||
layoutContext,
|
||||
0, // tree root
|
||||
gCurrentGenerationCount)) {
|
||||
@@ -4141,8 +4141,7 @@ void YGNodeCalculateLayoutWithContext(
|
||||
#endif
|
||||
}
|
||||
|
||||
marker.end();
|
||||
Event::publish<Event::LayoutPassEnd>(node, {layoutContext, &marker.data});
|
||||
Event::publish<Event::LayoutPassEnd>(node, {layoutContext, &markerData});
|
||||
|
||||
// We want to get rid off `useLegacyStretchBehaviour` from YGConfig. But we
|
||||
// aren't sure whether client's of yoga have gotten rid off this flag or not.
|
||||
@@ -4160,7 +4159,7 @@ void YGNodeCalculateLayoutWithContext(
|
||||
gCurrentGenerationCount++;
|
||||
// Rerun the layout, and calculate the diff
|
||||
unsetUseLegacyFlagRecursively(nodeWithoutLegacyFlag);
|
||||
YGMarkerLayoutData layoutMarkerData;
|
||||
YGMarkerLayoutData layoutMarkerData = {};
|
||||
if (YGLayoutNodeInternal(
|
||||
nodeWithoutLegacyFlag,
|
||||
width,
|
||||
|
Reference in New Issue
Block a user