Back out "not using templates for updating styles which are used via bitfield"

Reviewed By: astreet

Differential Revision: D18628090

fbshipit-source-id: 9d006534111f10ec25a0d56214792aeb96fbdef9
This commit is contained in:
Sidharth Guglani
2019-11-22 04:28:49 -08:00
committed by Facebook Github Bot
parent cd0191c247
commit 198e99d30c

View File

@@ -582,10 +582,7 @@ void updateIndexedStyleProp(
YOGA_EXPORT void YGNodeStyleSetDirection( YOGA_EXPORT void YGNodeStyleSetDirection(
const YGNodeRef node, const YGNodeRef node,
const YGDirection value) { const YGDirection value) {
if (node->getStyle().direction() != value) { updateStyle<MSVC_HINT(direction)>(node, &YGStyle::direction, value);
node->getStyle().direction() = value;
node->markDirtyAndPropogate();
}
} }
YOGA_EXPORT YGDirection YGNodeStyleGetDirection(const YGNodeConstRef node) { YOGA_EXPORT YGDirection YGNodeStyleGetDirection(const YGNodeConstRef node) {
return node->getStyle().direction(); return node->getStyle().direction();
@@ -594,10 +591,8 @@ YOGA_EXPORT YGDirection YGNodeStyleGetDirection(const YGNodeConstRef node) {
YOGA_EXPORT void YGNodeStyleSetFlexDirection( YOGA_EXPORT void YGNodeStyleSetFlexDirection(
const YGNodeRef node, const YGNodeRef node,
const YGFlexDirection flexDirection) { const YGFlexDirection flexDirection) {
if (node->getStyle().flexDirection() != flexDirection) { updateStyle<MSVC_HINT(flexDirection)>(
node->getStyle().flexDirection() = flexDirection; node, &YGStyle::flexDirection, flexDirection);
node->markDirtyAndPropogate();
}
} }
YOGA_EXPORT YGFlexDirection YOGA_EXPORT YGFlexDirection
YGNodeStyleGetFlexDirection(const YGNodeConstRef node) { YGNodeStyleGetFlexDirection(const YGNodeConstRef node) {
@@ -607,10 +602,8 @@ YGNodeStyleGetFlexDirection(const YGNodeConstRef node) {
YOGA_EXPORT void YGNodeStyleSetJustifyContent( YOGA_EXPORT void YGNodeStyleSetJustifyContent(
const YGNodeRef node, const YGNodeRef node,
const YGJustify justifyContent) { const YGJustify justifyContent) {
if (node->getStyle().justifyContent() != justifyContent) { updateStyle<MSVC_HINT(justifyContent)>(
node->getStyle().justifyContent() = justifyContent; node, &YGStyle::justifyContent, justifyContent);
node->markDirtyAndPropogate();
}
} }
YOGA_EXPORT YGJustify YGNodeStyleGetJustifyContent(const YGNodeConstRef node) { YOGA_EXPORT YGJustify YGNodeStyleGetJustifyContent(const YGNodeConstRef node) {
return node->getStyle().justifyContent(); return node->getStyle().justifyContent();
@@ -619,10 +612,8 @@ YOGA_EXPORT YGJustify YGNodeStyleGetJustifyContent(const YGNodeConstRef node) {
YOGA_EXPORT void YGNodeStyleSetAlignContent( YOGA_EXPORT void YGNodeStyleSetAlignContent(
const YGNodeRef node, const YGNodeRef node,
const YGAlign alignContent) { const YGAlign alignContent) {
if (node->getStyle().alignContent() != alignContent) { updateStyle<MSVC_HINT(alignContent)>(
node->getStyle().alignContent() = alignContent; node, &YGStyle::alignContent, alignContent);
node->markDirtyAndPropogate();
}
} }
YOGA_EXPORT YGAlign YGNodeStyleGetAlignContent(const YGNodeConstRef node) { YOGA_EXPORT YGAlign YGNodeStyleGetAlignContent(const YGNodeConstRef node) {
return node->getStyle().alignContent(); return node->getStyle().alignContent();
@@ -631,10 +622,7 @@ YOGA_EXPORT YGAlign YGNodeStyleGetAlignContent(const YGNodeConstRef node) {
YOGA_EXPORT void YGNodeStyleSetAlignItems( YOGA_EXPORT void YGNodeStyleSetAlignItems(
const YGNodeRef node, const YGNodeRef node,
const YGAlign alignItems) { const YGAlign alignItems) {
if (node->getStyle().alignItems() != alignItems) { updateStyle<MSVC_HINT(alignItems)>(node, &YGStyle::alignItems, alignItems);
node->getStyle().alignItems() = alignItems;
node->markDirtyAndPropogate();
}
} }
YOGA_EXPORT YGAlign YGNodeStyleGetAlignItems(const YGNodeConstRef node) { YOGA_EXPORT YGAlign YGNodeStyleGetAlignItems(const YGNodeConstRef node) {
return node->getStyle().alignItems(); return node->getStyle().alignItems();
@@ -643,10 +631,7 @@ YOGA_EXPORT YGAlign YGNodeStyleGetAlignItems(const YGNodeConstRef node) {
YOGA_EXPORT void YGNodeStyleSetAlignSelf( YOGA_EXPORT void YGNodeStyleSetAlignSelf(
const YGNodeRef node, const YGNodeRef node,
const YGAlign alignSelf) { const YGAlign alignSelf) {
if (node->getStyle().alignSelf() != alignSelf) { updateStyle<MSVC_HINT(alignSelf)>(node, &YGStyle::alignSelf, alignSelf);
node->getStyle().alignSelf() = alignSelf;
node->markDirtyAndPropogate();
}
} }
YOGA_EXPORT YGAlign YGNodeStyleGetAlignSelf(const YGNodeConstRef node) { YOGA_EXPORT YGAlign YGNodeStyleGetAlignSelf(const YGNodeConstRef node) {
return node->getStyle().alignSelf(); return node->getStyle().alignSelf();
@@ -655,10 +640,8 @@ YOGA_EXPORT YGAlign YGNodeStyleGetAlignSelf(const YGNodeConstRef node) {
YOGA_EXPORT void YGNodeStyleSetPositionType( YOGA_EXPORT void YGNodeStyleSetPositionType(
const YGNodeRef node, const YGNodeRef node,
const YGPositionType positionType) { const YGPositionType positionType) {
if (node->getStyle().positionType() != positionType) { updateStyle<MSVC_HINT(positionType)>(
node->getStyle().positionType() = positionType; node, &YGStyle::positionType, positionType);
node->markDirtyAndPropogate();
}
} }
YOGA_EXPORT YGPositionType YOGA_EXPORT YGPositionType
YGNodeStyleGetPositionType(const YGNodeConstRef node) { YGNodeStyleGetPositionType(const YGNodeConstRef node) {
@@ -668,10 +651,7 @@ YGNodeStyleGetPositionType(const YGNodeConstRef node) {
YOGA_EXPORT void YGNodeStyleSetFlexWrap( YOGA_EXPORT void YGNodeStyleSetFlexWrap(
const YGNodeRef node, const YGNodeRef node,
const YGWrap flexWrap) { const YGWrap flexWrap) {
if (node->getStyle().flexWrap() != flexWrap) { updateStyle<MSVC_HINT(flexWrap)>(node, &YGStyle::flexWrap, flexWrap);
node->getStyle().flexWrap() = flexWrap;
node->markDirtyAndPropogate();
}
} }
YOGA_EXPORT YGWrap YGNodeStyleGetFlexWrap(const YGNodeConstRef node) { YOGA_EXPORT YGWrap YGNodeStyleGetFlexWrap(const YGNodeConstRef node) {
return node->getStyle().flexWrap(); return node->getStyle().flexWrap();
@@ -680,10 +660,7 @@ YOGA_EXPORT YGWrap YGNodeStyleGetFlexWrap(const YGNodeConstRef node) {
YOGA_EXPORT void YGNodeStyleSetOverflow( YOGA_EXPORT void YGNodeStyleSetOverflow(
const YGNodeRef node, const YGNodeRef node,
const YGOverflow overflow) { const YGOverflow overflow) {
if (node->getStyle().overflow() != overflow) { updateStyle<MSVC_HINT(overflow)>(node, &YGStyle::overflow, overflow);
node->getStyle().overflow() = overflow;
node->markDirtyAndPropogate();
}
} }
YOGA_EXPORT YGOverflow YGNodeStyleGetOverflow(const YGNodeConstRef node) { YOGA_EXPORT YGOverflow YGNodeStyleGetOverflow(const YGNodeConstRef node) {
return node->getStyle().overflow(); return node->getStyle().overflow();
@@ -692,10 +669,7 @@ YOGA_EXPORT YGOverflow YGNodeStyleGetOverflow(const YGNodeConstRef node) {
YOGA_EXPORT void YGNodeStyleSetDisplay( YOGA_EXPORT void YGNodeStyleSetDisplay(
const YGNodeRef node, const YGNodeRef node,
const YGDisplay display) { const YGDisplay display) {
if (node->getStyle().display() != display) { updateStyle<MSVC_HINT(display)>(node, &YGStyle::display, display);
node->getStyle().display() = display;
node->markDirtyAndPropogate();
}
} }
YOGA_EXPORT YGDisplay YGNodeStyleGetDisplay(const YGNodeConstRef node) { YOGA_EXPORT YGDisplay YGNodeStyleGetDisplay(const YGNodeConstRef node) {
return node->getStyle().display(); return node->getStyle().display();