Skip to content

Commit be6fa25

Browse files
sherginfacebook-github-bot
authored andcommitted
Fabric: Removing default implementation of some methods of LayoutableShadowNode
Summary: These default implementations are never being used. Removing them allowing to ensure that flags inside YGNode have same values as flags in YogaLayoutableShadowNode. That also saves a couple of bytes in size of ShadowNode. Reviewed By: JoshuaGross Differential Revision: D14496938 fbshipit-source-id: c43f9c8a2eec054f728ff54a6573668eccda55fb
1 parent 32d5c7e commit be6fa25

File tree

3 files changed

+6
-29
lines changed

3 files changed

+6
-29
lines changed

ReactCommon/fabric/components/view/yoga/YogaLayoutableShadowNode.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ YogaLayoutableShadowNode::YogaLayoutableShadowNode()
2626

2727
yogaNode_.setConfig(&yogaConfig_);
2828
yogaNode_.setContext(this);
29-
yogaNode_.setDirty(true);
3029
}
3130

3231
YogaLayoutableShadowNode::YogaLayoutableShadowNode(
@@ -48,7 +47,7 @@ void YogaLayoutableShadowNode::cleanLayout() {
4847
}
4948

5049
void YogaLayoutableShadowNode::dirtyLayout() {
51-
yogaNode_.markDirtyAndPropogate();
50+
yogaNode_.setDirty(true);
5251
}
5352

5453
bool YogaLayoutableShadowNode::getIsLayoutClean() const {

ReactCommon/fabric/core/layout/LayoutableShadowNode.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -65,26 +65,6 @@ LayoutMetrics LayoutableShadowNode::getRelativeLayoutMetrics(
6565
return layoutMetrics;
6666
}
6767

68-
void LayoutableShadowNode::cleanLayout() {
69-
isLayoutClean_ = true;
70-
}
71-
72-
void LayoutableShadowNode::dirtyLayout() {
73-
isLayoutClean_ = false;
74-
}
75-
76-
bool LayoutableShadowNode::getIsLayoutClean() const {
77-
return isLayoutClean_;
78-
}
79-
80-
bool LayoutableShadowNode::getHasNewLayout() const {
81-
return hasNewLayout_;
82-
};
83-
84-
void LayoutableShadowNode::setHasNewLayout(bool hasNewLayout) {
85-
hasNewLayout_ = hasNewLayout;
86-
}
87-
8868
Size LayoutableShadowNode::measure(LayoutConstraints layoutConstraints) const {
8969
return Size();
9070
}

ReactCommon/fabric/core/layout/LayoutableShadowNode.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,16 @@ class LayoutableShadowNode : public virtual Sealable {
7676
* Indicates whether all nodes (and possibly their subtrees) along the path
7777
* to the root node should be re-layouted.
7878
*/
79-
virtual void cleanLayout();
80-
virtual void dirtyLayout();
81-
virtual bool getIsLayoutClean() const;
79+
virtual void cleanLayout() = 0;
80+
virtual void dirtyLayout() = 0;
81+
virtual bool getIsLayoutClean() const = 0;
8282

8383
/*
8484
* Indicates does the shadow node (or any descendand node of the node)
8585
* get a new layout metrics during a previous layout pass.
8686
*/
87-
virtual void setHasNewLayout(bool hasNewLayout);
88-
virtual bool getHasNewLayout() const;
87+
virtual void setHasNewLayout(bool hasNewLayout) = 0;
88+
virtual bool getHasNewLayout() const = 0;
8989

9090
/*
9191
* Applies layout for all children;
@@ -127,8 +127,6 @@ class LayoutableShadowNode : public virtual Sealable {
127127

128128
private:
129129
LayoutMetrics layoutMetrics_{};
130-
bool hasNewLayout_{false};
131-
bool isLayoutClean_{false};
132130
};
133131

134132
} // namespace react

0 commit comments

Comments
 (0)