Move event NodeLayout to end of NodeLayout step
Summary: Added event NodeLayoutEnd and this is being used now instead of NodeLayout It will be used later to add more information about caches Reviewed By: davidaurelio Differential Revision: D15920935 fbshipit-source-id: c9f5e193bc8cc70d26ff5d84882d483c9b09f67d
This commit is contained in:
committed by
Facebook Github Bot
parent
d667ebd66e
commit
2dc5a16d1f
@@ -96,12 +96,18 @@ TEST_F(EventTest, layout_events) {
|
|||||||
|
|
||||||
YGNodeCalculateLayout(root, 123, 456, YGDirectionLTR);
|
YGNodeCalculateLayout(root, 123, 456, YGDirectionLTR);
|
||||||
|
|
||||||
ASSERT_EQ(events[2].node, root);
|
ASSERT_EQ(events[2].node, child);
|
||||||
ASSERT_EQ(events[2].type, Event::NodeLayout);
|
ASSERT_EQ(events[2].type, Event::NodeLayout);
|
||||||
|
|
||||||
ASSERT_EQ(events[3].node, child);
|
ASSERT_EQ(events[3].node, child);
|
||||||
ASSERT_EQ(events[3].type, Event::NodeLayout);
|
ASSERT_EQ(events[3].type, Event::NodeLayout);
|
||||||
|
|
||||||
|
ASSERT_EQ(events[4].node, child);
|
||||||
|
ASSERT_EQ(events[4].type, Event::NodeLayout);
|
||||||
|
|
||||||
|
ASSERT_EQ(events[5].node, root);
|
||||||
|
ASSERT_EQ(events[5].type, Event::NodeLayout);
|
||||||
|
|
||||||
YGNodeFreeRecursive(root);
|
YGNodeFreeRecursive(root);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3693,9 +3693,6 @@ bool YGLayoutNodeInternal(
|
|||||||
const YGConfigRef config,
|
const YGConfigRef config,
|
||||||
YGMarkerLayoutData& layoutMarkerData,
|
YGMarkerLayoutData& layoutMarkerData,
|
||||||
void* const layoutContext) {
|
void* const layoutContext) {
|
||||||
#ifdef YG_ENABLE_EVENTS
|
|
||||||
Event::publish<Event::NodeLayout>(node, {performLayout, layoutContext});
|
|
||||||
#endif
|
|
||||||
YGLayout* layout = &node->getLayout();
|
YGLayout* layout = &node->getLayout();
|
||||||
|
|
||||||
gDepth++;
|
gDepth++;
|
||||||
@@ -3929,6 +3926,11 @@ bool YGLayoutNodeInternal(
|
|||||||
|
|
||||||
gDepth--;
|
gDepth--;
|
||||||
layout->generationCount = gCurrentGenerationCount;
|
layout->generationCount = gCurrentGenerationCount;
|
||||||
|
|
||||||
|
#ifdef YG_ENABLE_EVENTS
|
||||||
|
Event::publish<Event::NodeLayout>(node, {performLayout, layoutContext});
|
||||||
|
#endif
|
||||||
|
|
||||||
return (needToVisitNode || cachedResults == nullptr);
|
return (needToVisitNode || cachedResults == nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user