BREAKING - Make first parameter of measure and print functions CSSNodeRef instead of just context

Summary: To perform some JNI optimizations for java we need a reference to the node in the measure function. This updates the API to provide the whole node as input instead of just the context.

Reviewed By: javache

Differential Revision: D4081544

fbshipit-source-id: d49679025cea027cf7b8482898de0a01fe0f9d40
This commit is contained in:
Emil Sjolander
2016-10-27 10:52:11 -07:00
committed by Facebook Github Bot
parent b59ce09109
commit 46823878a5
10 changed files with 24 additions and 24 deletions

View File

@@ -456,7 +456,7 @@ static void _CSSNodePrint(const CSSNodeRef node,
gLogger("{");
if (node->print) {
node->print(node->context);
node->print(node);
}
if (options & CSSPrintOptionsLayout) {
@@ -1263,7 +1263,7 @@ static void layoutNodeImpl(const CSSNodeRef node,
} else {
// Measure the text under the current constraints.
const CSSSize measuredSize =
node->measure(node->context, innerWidth, widthMeasureMode, innerHeight, heightMeasureMode);
node->measure(node, innerWidth, widthMeasureMode, innerHeight, heightMeasureMode);
node->layout.measuredDimensions[CSSDimensionWidth] =
boundAxis(node,
@@ -2284,7 +2284,7 @@ bool layoutNodeInternal(const CSSNodeRef node,
if (gPrintChanges && gPrintSkips) {
printf("%s%d.{[skipped] ", getSpacer(gDepth), gDepth);
if (node->print) {
node->print(node->context);
node->print(node);
}
printf("wm: %s, hm: %s, aw: %f ah: %f => d: (%f, %f) %s\n",
getModeName(widthMeasureMode, performLayout),
@@ -2299,7 +2299,7 @@ bool layoutNodeInternal(const CSSNodeRef node,
if (gPrintChanges) {
printf("%s%d.{%s", getSpacer(gDepth), gDepth, needToVisitNode ? "*" : "");
if (node->print) {
node->print(node->context);
node->print(node);
}
printf("wm: %s, hm: %s, aw: %f ah: %f %s\n",
getModeName(widthMeasureMode, performLayout),
@@ -2320,7 +2320,7 @@ bool layoutNodeInternal(const CSSNodeRef node,
if (gPrintChanges) {
printf("%s%d.}%s", getSpacer(gDepth), gDepth, needToVisitNode ? "*" : "");
if (node->print) {
node->print(node->context);
node->print(node);
}
printf("wm: %s, hm: %s, d: (%f, %f) %s\n",
getModeName(widthMeasureMode, performLayout),