diff --git a/tests/InstrumentationTest.cpp b/tests/InstrumentationTest.cpp index a6bbcc40..62902e31 100644 --- a/tests/InstrumentationTest.cpp +++ b/tests/InstrumentationTest.cpp @@ -67,35 +67,6 @@ struct MarkerTest : public ::testing::Test { uniquePtr config; }; -TEST_F(MarkerTest, measure_functions_get_wrapped) { - auto root = makeNode(); - YGNodeSetMeasureFunc( - root.get(), [](YGNodeRef, float, YGMeasureMode, float, YGMeasureMode) { - return YGSize{}; - }); - - calculateLayout(root); - auto& markerCookie = findLastMarker(YGMarkerMeasure); - - ASSERT_EQ(markerCookie.start.marker, YGMarkerMeasure) - << "have " << markerCookies.size() << " recorded markers"; -} - -TEST_F(MarkerTest, baseline_functions_get_wrapped) { - auto root = makeNode(); - auto child = addChild(root); - YGNodeSetBaselineFunc( - child.get(), [](YGNodeRef, float, float) { return 0.0f; }); - YGNodeStyleSetFlexDirection(root.get(), YGFlexDirectionRow); - YGNodeStyleSetAlignItems(root.get(), YGAlignBaseline); - - calculateLayout(root); - auto& markerCookie = findLastMarker(YGMarkerBaselineFn); - - ASSERT_EQ(markerCookie.start.marker, YGMarkerBaselineFn) - << "have " << markerCookies.size() << " recorded markers"; -} - void* MarkerTest::startMarker( YGMarker marker, YGNodeRef node, @@ -113,11 +84,6 @@ void MarkerTest::endMarker( void* id) { auto cookie = static_cast(id); cookie->end = {{marker, node, data}, id, {}}; - switch (marker) { - case YGMarkerMeasure: - case YGMarkerBaselineFn: - break; - }; } uniquePtr MarkerTest::makeNode() { @@ -141,12 +107,6 @@ void MarkerTest::calculateLayout( namespace { const char* markerTypeName(YGMarker type) { - switch (type) { - case YGMarkerMeasure: - return "YGMarkerMeasure"; - case YGMarkerBaselineFn: - return "YGMarkerBaselineFn"; - } return ""; } diff --git a/yoga/YGMarker.h b/yoga/YGMarker.h index 785f5629..025e246a 100644 --- a/yoga/YGMarker.h +++ b/yoga/YGMarker.h @@ -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 : NoMarkerData {}; - -template <> -struct MarkerData : NoMarkerData {}; - } // namespace detail template diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index d8175295..e3cc78bc 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -1000,9 +1000,7 @@ static float YGBaseline(const YGNodeRef node, void* layoutContext) { Event::publish(node); - const float baseline = marker::MarkerSection::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(node); // Measure the text under the current constraints. - const YGSize measuredSize = marker::MarkerSection::wrap( - node, - &YGNode::measure, + const YGSize measuredSize = node->measure( innerWidth, widthMeasureMode, innerHeight,