mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-01-12 22:50:10 +08:00
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
This commit is contained in:
committed by
Facebook Github Bot
parent
32d5c7e1f3
commit
be6fa25d16
@@ -26,7 +26,6 @@ YogaLayoutableShadowNode::YogaLayoutableShadowNode()
|
||||
|
||||
yogaNode_.setConfig(&yogaConfig_);
|
||||
yogaNode_.setContext(this);
|
||||
yogaNode_.setDirty(true);
|
||||
}
|
||||
|
||||
YogaLayoutableShadowNode::YogaLayoutableShadowNode(
|
||||
@@ -48,7 +47,7 @@ void YogaLayoutableShadowNode::cleanLayout() {
|
||||
}
|
||||
|
||||
void YogaLayoutableShadowNode::dirtyLayout() {
|
||||
yogaNode_.markDirtyAndPropogate();
|
||||
yogaNode_.setDirty(true);
|
||||
}
|
||||
|
||||
bool YogaLayoutableShadowNode::getIsLayoutClean() const {
|
||||
|
||||
@@ -65,26 +65,6 @@ LayoutMetrics LayoutableShadowNode::getRelativeLayoutMetrics(
|
||||
return layoutMetrics;
|
||||
}
|
||||
|
||||
void LayoutableShadowNode::cleanLayout() {
|
||||
isLayoutClean_ = true;
|
||||
}
|
||||
|
||||
void LayoutableShadowNode::dirtyLayout() {
|
||||
isLayoutClean_ = false;
|
||||
}
|
||||
|
||||
bool LayoutableShadowNode::getIsLayoutClean() const {
|
||||
return isLayoutClean_;
|
||||
}
|
||||
|
||||
bool LayoutableShadowNode::getHasNewLayout() const {
|
||||
return hasNewLayout_;
|
||||
};
|
||||
|
||||
void LayoutableShadowNode::setHasNewLayout(bool hasNewLayout) {
|
||||
hasNewLayout_ = hasNewLayout;
|
||||
}
|
||||
|
||||
Size LayoutableShadowNode::measure(LayoutConstraints layoutConstraints) const {
|
||||
return Size();
|
||||
}
|
||||
|
||||
@@ -76,16 +76,16 @@ class LayoutableShadowNode : public virtual Sealable {
|
||||
* Indicates whether all nodes (and possibly their subtrees) along the path
|
||||
* to the root node should be re-layouted.
|
||||
*/
|
||||
virtual void cleanLayout();
|
||||
virtual void dirtyLayout();
|
||||
virtual bool getIsLayoutClean() const;
|
||||
virtual void cleanLayout() = 0;
|
||||
virtual void dirtyLayout() = 0;
|
||||
virtual bool getIsLayoutClean() const = 0;
|
||||
|
||||
/*
|
||||
* Indicates does the shadow node (or any descendand node of the node)
|
||||
* get a new layout metrics during a previous layout pass.
|
||||
*/
|
||||
virtual void setHasNewLayout(bool hasNewLayout);
|
||||
virtual bool getHasNewLayout() const;
|
||||
virtual void setHasNewLayout(bool hasNewLayout) = 0;
|
||||
virtual bool getHasNewLayout() const = 0;
|
||||
|
||||
/*
|
||||
* Applies layout for all children;
|
||||
@@ -127,8 +127,6 @@ class LayoutableShadowNode : public virtual Sealable {
|
||||
|
||||
private:
|
||||
LayoutMetrics layoutMetrics_{};
|
||||
bool hasNewLayout_{false};
|
||||
bool isLayoutClean_{false};
|
||||
};
|
||||
|
||||
} // namespace react
|
||||
|
||||
Reference in New Issue
Block a user