Reverting the dirty child optimization

Reviewed By: emilsjolander

Differential Revision: D6203290

fbshipit-source-id: 8e42abb70e55f0fac90faaa21ecdbe0fbb76ce6b
This commit is contained in:
Pritesh Nandgaonkar
2017-10-31 23:08:19 -07:00
committed by Facebook Github Bot
parent 1dca01b532
commit 0230672275
6 changed files with 8 additions and 70 deletions

View File

@@ -82,8 +82,6 @@ public interface ReactShadowNode<T extends ReactShadowNode> {
boolean isDirty();
boolean hasDirtyDescendants();
void addChildAt(T child, int i);
T removeChildAt(int i);

View File

@@ -134,7 +134,7 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
@Override
public final boolean hasUpdates() {
return mNodeUpdated || hasNewLayout() || isDirty() || hasDirtyDescendants();
return mNodeUpdated || hasNewLayout() || isDirty();
}
@Override
@@ -174,11 +174,6 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
return mYogaNode != null && mYogaNode.isDirty();
}
@Override
public boolean hasDirtyDescendants() {
return mYogaNode != null && mYogaNode.hasDirtyDescendants();
}
@Override
public void addChildAt(ReactShadowNodeImpl child, int i) {
if (child.getParent() != null) {

View File

@@ -9,11 +9,13 @@
package com.facebook.yoga;
import javax.annotation.Nullable;
import java.util.List;
import java.util.ArrayList;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.soloader.SoLoader;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;
@DoNotStrip
public class YogaNode {
@@ -196,12 +198,6 @@ public class YogaNode {
return jni_YGNodeIsDirty(mNativePointer);
}
private native boolean jni_YGNodeHasDirtyDescendants(long nativePointer);
public boolean hasDirtyDescendants() {
return jni_YGNodeHasDirtyDescendants(mNativePointer);
}
private native void jni_YGNodeCopyStyle(long dstNativePointer, long srcNativePointer);
public void copyStyle(YogaNode srcNode) {
jni_YGNodeCopyStyle(mNativePointer, srcNode.mNativePointer);