Fabric: Stripping the word `fabric` from some function names

Summary:
@public
Trivial.
We should not use the name of the effort in the API interfaces where it's not neccecery.

Reviewed By: sahrens

Differential Revision: D9652991

fbshipit-source-id: 52b99e39f92926f9fc99626690eb4385195558f6
This commit is contained in:
Valentin Shergin 2018-09-07 23:38:55 -07:00 committed by Facebook Github Bot
parent ff1b950e29
commit 1e3e2387d3
2 changed files with 29 additions and 29 deletions

View File

@ -18,7 +18,7 @@
namespace facebook { namespace facebook {
namespace react { namespace react {
inline Float fabricFloatFromYogaFloat(float value) { inline Float floatFromYogaFloat(float value) {
if (value == YGUndefined) { if (value == YGUndefined) {
return kFloatUndefined; return kFloatUndefined;
} }
@ -26,7 +26,7 @@ inline Float fabricFloatFromYogaFloat(float value) {
return (Float)value; return (Float)value;
} }
inline float yogaFloatFromFabricFloat(Float value) { inline float yogaFloatFromFloat(Float value) {
if (value == kFloatUndefined) { if (value == kFloatUndefined) {
return YGUndefined; return YGUndefined;
} }
@ -34,20 +34,20 @@ inline float yogaFloatFromFabricFloat(Float value) {
return (float)value; return (float)value;
} }
inline Float fabricFloatFromYogaOptionalFloat(YGFloatOptional value) { inline Float floatFromYogaOptionalFloat(YGFloatOptional value) {
if (value.isUndefined()) { if (value.isUndefined()) {
return kFloatUndefined; return kFloatUndefined;
} }
return fabricFloatFromYogaFloat(value.getValue()); return floatFromYogaFloat(value.getValue());
} }
inline YGFloatOptional yogaOptionalFloatFromFabricFloat(Float value) { inline YGFloatOptional yogaOptionalFloatFromFloat(Float value) {
if (value == kFloatUndefined) { if (value == kFloatUndefined) {
return YGFloatOptional(); return YGFloatOptional();
} }
return YGFloatOptional(yogaFloatFromFabricFloat(value)); return YGFloatOptional(yogaFloatFromFloat(value));
} }
inline YGValue yogaStyleValueFromFloat(const Float &value) { inline YGValue yogaStyleValueFromFloat(const Float &value) {
@ -63,9 +63,9 @@ inline folly::Optional<Float> optionalFloatFromYogaValue(const YGValue &value, f
case YGUnitUndefined: case YGUnitUndefined:
return {}; return {};
case YGUnitPoint: case YGUnitPoint:
return fabricFloatFromYogaFloat(value.value); return floatFromYogaFloat(value.value);
case YGUnitPercent: case YGUnitPercent:
return base.has_value() ? folly::Optional<Float>(base.value() * fabricFloatFromYogaFloat(value.value)) : folly::Optional<Float>(); return base.has_value() ? folly::Optional<Float>(base.value() * floatFromYogaFloat(value.value)) : folly::Optional<Float>();
case YGUnitAuto: case YGUnitAuto:
return {}; return {};
} }
@ -78,27 +78,27 @@ inline LayoutMetrics layoutMetricsFromYogaNode(YGNode &yogaNode) {
layoutMetrics.frame = Rect { layoutMetrics.frame = Rect {
Point { Point {
fabricFloatFromYogaFloat(layout.position[YGEdgeLeft]), floatFromYogaFloat(layout.position[YGEdgeLeft]),
fabricFloatFromYogaFloat(layout.position[YGEdgeTop]) floatFromYogaFloat(layout.position[YGEdgeTop])
}, },
Size { Size {
fabricFloatFromYogaFloat(layout.dimensions[YGDimensionWidth]), floatFromYogaFloat(layout.dimensions[YGDimensionWidth]),
fabricFloatFromYogaFloat(layout.dimensions[YGDimensionHeight]) floatFromYogaFloat(layout.dimensions[YGDimensionHeight])
} }
}; };
layoutMetrics.borderWidth = EdgeInsets { layoutMetrics.borderWidth = EdgeInsets {
fabricFloatFromYogaFloat(layout.border[YGEdgeLeft]), floatFromYogaFloat(layout.border[YGEdgeLeft]),
fabricFloatFromYogaFloat(layout.border[YGEdgeTop]), floatFromYogaFloat(layout.border[YGEdgeTop]),
fabricFloatFromYogaFloat(layout.border[YGEdgeRight]), floatFromYogaFloat(layout.border[YGEdgeRight]),
fabricFloatFromYogaFloat(layout.border[YGEdgeBottom]) floatFromYogaFloat(layout.border[YGEdgeBottom])
}; };
layoutMetrics.contentInsets = EdgeInsets { layoutMetrics.contentInsets = EdgeInsets {
fabricFloatFromYogaFloat(layout.border[YGEdgeLeft] + layout.padding[YGEdgeLeft]), floatFromYogaFloat(layout.border[YGEdgeLeft] + layout.padding[YGEdgeLeft]),
fabricFloatFromYogaFloat(layout.border[YGEdgeTop] + layout.padding[YGEdgeTop]), floatFromYogaFloat(layout.border[YGEdgeTop] + layout.padding[YGEdgeTop]),
fabricFloatFromYogaFloat(layout.border[YGEdgeRight] + layout.padding[YGEdgeRight]), floatFromYogaFloat(layout.border[YGEdgeRight] + layout.padding[YGEdgeRight]),
fabricFloatFromYogaFloat(layout.border[YGEdgeBottom] + layout.padding[YGEdgeBottom]) floatFromYogaFloat(layout.border[YGEdgeBottom] + layout.padding[YGEdgeBottom])
}; };
layoutMetrics.displayType = layoutMetrics.displayType =
@ -393,7 +393,7 @@ inline std::string toString(const YGFloatOptional &value) {
return "undefined"; return "undefined";
} }
return folly::to<std::string>(fabricFloatFromYogaFloat(value.getValue())); return folly::to<std::string>(floatFromYogaFloat(value.getValue()));
} }
inline std::string toString(const std::array<YGValue, YGDimensionCount> &value) { inline std::string toString(const std::array<YGValue, YGDimensionCount> &value) {

View File

@ -168,11 +168,11 @@ YGSize YogaLayoutableShadowNode::yogaNodeMeasureCallbackConnector(YGNode *yogaNo
case YGMeasureModeUndefined: case YGMeasureModeUndefined:
break; break;
case YGMeasureModeExactly: case YGMeasureModeExactly:
minimumSize.width = fabricFloatFromYogaFloat(width); minimumSize.width = floatFromYogaFloat(width);
maximumSize.width = fabricFloatFromYogaFloat(width); maximumSize.width = floatFromYogaFloat(width);
break; break;
case YGMeasureModeAtMost: case YGMeasureModeAtMost:
maximumSize.width = fabricFloatFromYogaFloat(width); maximumSize.width = floatFromYogaFloat(width);
break; break;
} }
@ -180,19 +180,19 @@ YGSize YogaLayoutableShadowNode::yogaNodeMeasureCallbackConnector(YGNode *yogaNo
case YGMeasureModeUndefined: case YGMeasureModeUndefined:
break; break;
case YGMeasureModeExactly: case YGMeasureModeExactly:
minimumSize.height = fabricFloatFromYogaFloat(height); minimumSize.height = floatFromYogaFloat(height);
maximumSize.height = fabricFloatFromYogaFloat(height); maximumSize.height = floatFromYogaFloat(height);
break; break;
case YGMeasureModeAtMost: case YGMeasureModeAtMost:
maximumSize.height = fabricFloatFromYogaFloat(height); maximumSize.height = floatFromYogaFloat(height);
break; break;
} }
auto size = shadowNodeRawPtr->measure({minimumSize, maximumSize}); auto size = shadowNodeRawPtr->measure({minimumSize, maximumSize});
return YGSize { return YGSize {
yogaFloatFromFabricFloat(size.width), yogaFloatFromFloat(size.width),
yogaFloatFromFabricFloat(size.height) yogaFloatFromFloat(size.height)
}; };
} }