Remove legacy layout diffing

Summary:
This removes some unused flags which will cause Yoga to layout every tree twice, then diffing the tree, reporting whether the whole tree is different. This is too expensive to run outside of local experimentation, but we have more nuanced ways to implement the `YGNodeLayoutAffectedByQuirk` I am wanting to add.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D42406917

fbshipit-source-id: b415ed02768f6b59de3a6fa90c60c750d56fd4b0
This commit is contained in:
Nick Gerleman
2023-01-19 06:38:45 -08:00
committed by Facebook GitHub Bot
parent cac197f5a6
commit 9e1bcd8557
13 changed files with 1 additions and 364 deletions

View File

@@ -233,29 +233,6 @@ public class YogaNodeTest {
}
}
@Test
public void testFlagShouldDiffLayoutWithoutLegacyStretchBehaviour() throws Exception {
YogaConfig config = YogaConfigFactory.create();
config.setShouldDiffLayoutWithoutLegacyStretchBehaviour(true);
config.setUseLegacyStretchBehaviour(true);
YogaNode root = createNode(config);
root.setWidth(500);
root.setHeight(500);
YogaNode root_child0 = createNode(config);
root_child0.setAlignItems(YogaAlign.FLEX_START);
root.addChildAt(root_child0, 0);
YogaNode root_child0_child0 = createNode(config);
root_child0_child0.setFlexGrow(1);
root_child0_child0.setFlexShrink(1);
root_child0.addChildAt(root_child0_child0, 0);
YogaNode root_child0_child0_child0 = createNode(config);
root_child0_child0_child0.setFlexGrow(1);
root_child0_child0_child0.setFlexShrink(1);
root_child0_child0.addChildAt(root_child0_child0_child0, 0);
root.calculateLayout(YogaConstants.UNDEFINED, YogaConstants.UNDEFINED);
assertTrue(((YogaNodeJNIBase) root).getDoesLegacyStretchFlagAffectsLayout());
}
@Test
public void initiallyHasNewLayout() {
YogaNode root = createNode();
@@ -315,7 +292,6 @@ public class YogaNodeTest {
@Test
public void testResetApiShouldResetAllLayoutOutputs() {
YogaConfig config = YogaConfigFactory.create();
config.setShouldDiffLayoutWithoutLegacyStretchBehaviour(true);
config.setUseLegacyStretchBehaviour(true);
YogaNode node = createNode(config);
node.setWidth(100);
@@ -371,7 +347,6 @@ public class YogaNodeTest {
assertTrue(node.hasNewLayout());
assertFalse(node.isMeasureDefined());
assertFalse(node.isBaselineDefined());
assertFalse(((YogaNodeJNIBase) node).getDoesLegacyStretchFlagAffectsLayout());
assertEquals(null, node.getData());
}