Dont create a spacing object for returning margin, padding, border, and position

Summary: The current implementation was made out of simplicity and to keep the same API as before. Now that the java version of csslayout is deprecated it is time to change the API to make the calls more efficient for the JNI version. This diff with reduce allocations as well as reduce the number of JNI calls done.

Differential Revision: D4050773

fbshipit-source-id: 3fd04c27f887a36875e455b5404a17154ac18f91
This commit is contained in:
Emil Sjolander
2016-10-24 10:35:43 -07:00
committed by Facebook Github Bot
parent 69c374e74e
commit e9b9973cae
4 changed files with 28 additions and 92 deletions

View File

@@ -59,13 +59,13 @@ public interface CSSNodeAPI<CSSNodeType extends CSSNodeAPI> {
void setFlexShrink(float flexShrink);
float getFlexBasis();
void setFlexBasis(float flexBasis);
Spacing getMargin();
float getMargin(int spacingType);
void setMargin(int spacingType, float margin);
Spacing getPadding();
float getPadding(int spacingType);
void setPadding(int spacingType, float padding);
Spacing getBorder();
float getBorder(int spacingType);
void setBorder(int spacingType, float border);
Spacing getPosition();
float getPosition(int spacingType);
void setPosition(int spacingType, float position);
float getStyleWidth();
void setStyleWidth(float width);