Remove YGNodeMarkDirtyAndPropagateToDescendants
(#1448)
Summary: X-link: https://github.com/facebook/react-native/pull/41305 Pull Request resolved: https://github.com/facebook/yoga/pull/1448 This should not be part of Yoga's API. If benchmarks want to do this, they still can (though I don't know the ones we have for it are super valuable). Reviewed By: javache Differential Revision: D50963933 fbshipit-source-id: 6482bd269928188b6469a358ffde5c4f9f5f9527
This commit is contained in:
committed by
Facebook GitHub Bot
parent
283e3203f6
commit
9eb8a62739
@@ -41,7 +41,6 @@ public class YogaNative {
|
|||||||
static native void jni_YGNodeRemoveChildJNI(long nativePointer, long childPointer);
|
static native void jni_YGNodeRemoveChildJNI(long nativePointer, long childPointer);
|
||||||
static native void jni_YGNodeCalculateLayoutJNI(long nativePointer, float width, float height, long[] nativePointers, YogaNodeJNIBase[] nodes);
|
static native void jni_YGNodeCalculateLayoutJNI(long nativePointer, float width, float height, long[] nativePointers, YogaNodeJNIBase[] nodes);
|
||||||
static native void jni_YGNodeMarkDirtyJNI(long nativePointer);
|
static native void jni_YGNodeMarkDirtyJNI(long nativePointer);
|
||||||
static native void jni_YGNodeMarkDirtyAndPropagateToDescendantsJNI(long nativePointer);
|
|
||||||
static native boolean jni_YGNodeIsDirtyJNI(long nativePointer);
|
static native boolean jni_YGNodeIsDirtyJNI(long nativePointer);
|
||||||
static native void jni_YGNodeCopyStyleJNI(long dstNativePointer, long srcNativePointer);
|
static native void jni_YGNodeCopyStyleJNI(long dstNativePointer, long srcNativePointer);
|
||||||
static native int jni_YGNodeStyleGetDirectionJNI(long nativePointer);
|
static native int jni_YGNodeStyleGetDirectionJNI(long nativePointer);
|
||||||
|
@@ -231,10 +231,6 @@ public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable {
|
|||||||
YogaNative.jni_YGNodeMarkDirtyJNI(mNativePointer);
|
YogaNative.jni_YGNodeMarkDirtyJNI(mNativePointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void dirtyAllDescendants() {
|
|
||||||
YogaNative.jni_YGNodeMarkDirtyAndPropagateToDescendantsJNI(mNativePointer);
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isDirty() {
|
public boolean isDirty() {
|
||||||
return YogaNative.jni_YGNodeIsDirtyJNI(mNativePointer);
|
return YogaNative.jni_YGNodeIsDirtyJNI(mNativePointer);
|
||||||
}
|
}
|
||||||
|
@@ -385,13 +385,6 @@ jni_YGNodeMarkDirtyJNI(JNIEnv* /*env*/, jobject /*obj*/, jlong nativePointer) {
|
|||||||
YGNodeMarkDirty(_jlong2YGNodeRef(nativePointer));
|
YGNodeMarkDirty(_jlong2YGNodeRef(nativePointer));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void jni_YGNodeMarkDirtyAndPropagateToDescendantsJNI(
|
|
||||||
JNIEnv* /*env*/,
|
|
||||||
jobject /*obj*/,
|
|
||||||
jlong nativePointer) {
|
|
||||||
YGNodeMarkDirtyAndPropagateToDescendants(_jlong2YGNodeRef(nativePointer));
|
|
||||||
}
|
|
||||||
|
|
||||||
static jboolean
|
static jboolean
|
||||||
jni_YGNodeIsDirtyJNI(JNIEnv* /*env*/, jobject /*obj*/, jlong nativePointer) {
|
jni_YGNodeIsDirtyJNI(JNIEnv* /*env*/, jobject /*obj*/, jlong nativePointer) {
|
||||||
return (jboolean)YGNodeIsDirty(_jlong2YGNodeRef(nativePointer));
|
return (jboolean)YGNodeIsDirty(_jlong2YGNodeRef(nativePointer));
|
||||||
@@ -776,9 +769,6 @@ static JNINativeMethod methods[] = {
|
|||||||
"(JFF[J[Lcom/facebook/yoga/YogaNodeJNIBase;)V",
|
"(JFF[J[Lcom/facebook/yoga/YogaNodeJNIBase;)V",
|
||||||
(void*)jni_YGNodeCalculateLayoutJNI},
|
(void*)jni_YGNodeCalculateLayoutJNI},
|
||||||
{"jni_YGNodeMarkDirtyJNI", "(J)V", (void*)jni_YGNodeMarkDirtyJNI},
|
{"jni_YGNodeMarkDirtyJNI", "(J)V", (void*)jni_YGNodeMarkDirtyJNI},
|
||||||
{"jni_YGNodeMarkDirtyAndPropagateToDescendantsJNI",
|
|
||||||
"(J)V",
|
|
||||||
(void*)jni_YGNodeMarkDirtyAndPropagateToDescendantsJNI},
|
|
||||||
{"jni_YGNodeIsDirtyJNI", "(J)Z", (void*)jni_YGNodeIsDirtyJNI},
|
{"jni_YGNodeIsDirtyJNI", "(J)Z", (void*)jni_YGNodeIsDirtyJNI},
|
||||||
{"jni_YGNodeCopyStyleJNI", "(JJ)V", (void*)jni_YGNodeCopyStyleJNI},
|
{"jni_YGNodeCopyStyleJNI", "(JJ)V", (void*)jni_YGNodeCopyStyleJNI},
|
||||||
{"jni_YGNodeStyleGetDirectionJNI",
|
{"jni_YGNodeStyleGetDirectionJNI",
|
||||||
|
@@ -92,10 +92,6 @@ bool YGNodeIsDirty(YGNodeConstRef node) {
|
|||||||
return resolveRef(node)->isDirty();
|
return resolveRef(node)->isDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
void YGNodeMarkDirtyAndPropagateToDescendants(const YGNodeRef node) {
|
|
||||||
return resolveRef(node)->markDirtyAndPropagateDownwards();
|
|
||||||
}
|
|
||||||
|
|
||||||
YGNodeRef YGNodeNewWithConfig(const YGConfigConstRef config) {
|
YGNodeRef YGNodeNewWithConfig(const YGConfigConstRef config) {
|
||||||
auto* node = new yoga::Node{resolveRef(config)};
|
auto* node = new yoga::Node{resolveRef(config)};
|
||||||
yoga::assertFatal(
|
yoga::assertFatal(
|
||||||
|
@@ -94,12 +94,6 @@ YG_EXPORT void YGNodeCalculateLayout(
|
|||||||
// this dirty marking manually.
|
// this dirty marking manually.
|
||||||
YG_EXPORT void YGNodeMarkDirty(YGNodeRef node);
|
YG_EXPORT void YGNodeMarkDirty(YGNodeRef node);
|
||||||
|
|
||||||
// Marks the current node and all its descendants as dirty.
|
|
||||||
//
|
|
||||||
// Intended to be used for Yoga benchmarks. Don't use in production, as calling
|
|
||||||
// `YGCalculateLayout` will cause the recalculation of each and every node.
|
|
||||||
YG_EXPORT void YGNodeMarkDirtyAndPropagateToDescendants(YGNodeRef node);
|
|
||||||
|
|
||||||
YG_EXPORT void YGNodePrint(YGNodeConstRef node, YGPrintOptions options);
|
YG_EXPORT void YGNodePrint(YGNodeConstRef node, YGPrintOptions options);
|
||||||
|
|
||||||
YG_EXPORT bool YGFloatIsUndefined(float value);
|
YG_EXPORT bool YGFloatIsUndefined(float value);
|
||||||
|
@@ -640,13 +640,6 @@ void Node::markDirtyAndPropagate() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Node::markDirtyAndPropagateDownwards() {
|
|
||||||
isDirty_ = true;
|
|
||||||
for_each(children_.begin(), children_.end(), [](Node* childNode) {
|
|
||||||
childNode->markDirtyAndPropagateDownwards();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
float Node::resolveFlexGrow() const {
|
float Node::resolveFlexGrow() const {
|
||||||
// Root nodes flexGrow should always be 0
|
// Root nodes flexGrow should always be 0
|
||||||
if (owner_ == nullptr) {
|
if (owner_ == nullptr) {
|
||||||
|
@@ -341,7 +341,6 @@ class YG_EXPORT Node : public ::YGNode {
|
|||||||
const float mainSize,
|
const float mainSize,
|
||||||
const float crossSize,
|
const float crossSize,
|
||||||
const float ownerWidth);
|
const float ownerWidth);
|
||||||
void markDirtyAndPropagateDownwards();
|
|
||||||
|
|
||||||
// Other methods
|
// Other methods
|
||||||
YGValue getFlexStartMarginValue(FlexDirection axis) const;
|
YGValue getFlexStartMarginValue(FlexDirection axis) const;
|
||||||
|
Reference in New Issue
Block a user