mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fabric: Removing get/setHasNewLayout from LayoutableShadowNode interface
Summary: It's a Yoga specific feature that does not need to exposed as LayoutableShadowNode. Removing this we save many virtual calls and add simplicity. Changelog: [Internal] Fabric-specific internal change. Reviewed By: sammy-SC Differential Revision: D22304717 fbshipit-source-id: f2dda8309dd86b78cd2775971721d29e5317ffd5
This commit is contained in:
committed by
Facebook GitHub Bot
parent
72a85040cd
commit
753fdebcd4
@@ -104,14 +104,6 @@ bool YogaLayoutableShadowNode::getIsLayoutClean() const {
|
||||
return !yogaNode_.isDirty();
|
||||
}
|
||||
|
||||
bool YogaLayoutableShadowNode::getHasNewLayout() const {
|
||||
return yogaNode_.getHasNewLayout();
|
||||
}
|
||||
|
||||
void YogaLayoutableShadowNode::setHasNewLayout(bool hasNewLayout) {
|
||||
yogaNode_.setHasNewLayout(hasNewLayout);
|
||||
}
|
||||
|
||||
#pragma mark - Mutating Methods
|
||||
|
||||
void YogaLayoutableShadowNode::enableMeasurement() {
|
||||
@@ -342,11 +334,11 @@ void YogaLayoutableShadowNode::layoutTree(
|
||||
&yogaNode_, YGUndefined, YGUndefined, YGDirectionInherit);
|
||||
}
|
||||
|
||||
if (getHasNewLayout()) {
|
||||
if (yogaNode_.getHasNewLayout()) {
|
||||
auto layoutMetrics = layoutMetricsFromYogaNode(yogaNode_);
|
||||
layoutMetrics.pointScaleFactor = layoutContext.pointScaleFactor;
|
||||
setLayoutMetrics(layoutMetrics);
|
||||
setHasNewLayout(false);
|
||||
yogaNode_.setHasNewLayout(false);
|
||||
}
|
||||
|
||||
layout(layoutContext);
|
||||
|
||||
@@ -73,9 +73,6 @@ class YogaLayoutableShadowNode : public LayoutableShadowNode {
|
||||
void dirtyLayout() override;
|
||||
bool getIsLayoutClean() const override;
|
||||
|
||||
void setHasNewLayout(bool hasNewLayout) override;
|
||||
bool getHasNewLayout() const override;
|
||||
|
||||
/*
|
||||
* Computes layout using Yoga layout engine.
|
||||
* See `LayoutableShadowNode` for more details.
|
||||
|
||||
@@ -238,11 +238,6 @@ ShadowNode::Shared LayoutableShadowNode::findNodeAtPoint(
|
||||
SharedDebugStringConvertibleList LayoutableShadowNode::getDebugProps() const {
|
||||
auto list = SharedDebugStringConvertibleList{};
|
||||
|
||||
if (getHasNewLayout()) {
|
||||
list.push_back(
|
||||
std::make_shared<DebugStringConvertibleItem>("hasNewLayout"));
|
||||
}
|
||||
|
||||
if (!getIsLayoutClean()) {
|
||||
list.push_back(std::make_shared<DebugStringConvertibleItem>("dirty"));
|
||||
}
|
||||
|
||||
@@ -153,13 +153,6 @@ class LayoutableShadowNode : public ShadowNode {
|
||||
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) = 0;
|
||||
virtual bool getHasNewLayout() const = 0;
|
||||
|
||||
/*
|
||||
* Unifed methods to access text layout metrics.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user