Add support for context-aware measure and baseline functions

Summary:
@public

Context-aware measure and baseline functions are an internal Yoga feature that will be used for Yoga’s JNI code.

It will be possible to specify a context when calculating layout, which will be passed on to baseline and measure functions. This will be a private feature.

Reviewed By: SidharthGuglani

Differential Revision: D14100509

fbshipit-source-id: acf4a030549b2e38d5ce0cd5dbe837864e5ffd81
This commit is contained in:
David Aurelio
2019-02-19 09:54:48 -08:00
committed by Facebook Github Bot
parent f86c74ce7e
commit e7fcf1ee65
4 changed files with 148 additions and 27 deletions

View File

@@ -1080,7 +1080,8 @@ static float YGBaseline(const YGNodeRef node) {
node,
&YGNode::baseline,
node->getLayout().measuredDimensions[YGDimensionWidth],
node->getLayout().measuredDimensions[YGDimensionHeight]);
node->getLayout().measuredDimensions[YGDimensionHeight],
(void*) nullptr);
YGAssertWithNode(
node,
!YGFloatIsUndefined(baseline),
@@ -1697,7 +1698,8 @@ static void YGNodeWithMeasureFuncSetMeasuredDimensions(
innerWidth,
widthMeasureMode,
innerHeight,
heightMeasureMode);
heightMeasureMode,
(void*) nullptr);
node->setLayoutMeasuredDimension(
YGNodeBoundAxis(