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:
committed by
Facebook Github Bot
parent
b59ce09109
commit
46823878a5
@@ -10,13 +10,13 @@
|
||||
#include <CSSLayout/CSSLayout.h>
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
static CSSSize _measureMax(void *context,
|
||||
static CSSSize _measureMax(CSSNodeRef node,
|
||||
float width,
|
||||
CSSMeasureMode widthMode,
|
||||
float height,
|
||||
CSSMeasureMode heightMode) {
|
||||
|
||||
int *measureCount = (int *)context;
|
||||
int *measureCount = (int *)CSSNodeGetContext(node);
|
||||
*measureCount = *measureCount + 1;
|
||||
return CSSSize {
|
||||
.width = widthMode == CSSMeasureModeUndefined ? 10 : width,
|
||||
@@ -24,13 +24,13 @@ static CSSSize _measureMax(void *context,
|
||||
};
|
||||
}
|
||||
|
||||
static CSSSize _measureMin(void *context,
|
||||
static CSSSize _measureMin(CSSNodeRef node,
|
||||
float width,
|
||||
CSSMeasureMode widthMode,
|
||||
float height,
|
||||
CSSMeasureMode heightMode) {
|
||||
|
||||
int *measureCount = (int *)context;
|
||||
int *measureCount = (int *)CSSNodeGetContext(node);
|
||||
*measureCount = *measureCount + 1;
|
||||
return CSSSize {
|
||||
.width = widthMode == CSSMeasureModeUndefined || (widthMode == CSSMeasureModeAtMost && width > 10) ? 10 : width,
|
||||
|
Reference in New Issue
Block a user