mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Back out "Adjust animation batch numbers to be consistent when controlled by native"
Summary: This change caused crashes in animations on some surfaces. Changelog: [Internal] Reviewed By: JoshuaGross Differential Revision: D28013969 fbshipit-source-id: 95845c69d6e67d59582ea14ad08cbf42fd3e2f8f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
841756b150
commit
ef0db95300
@@ -174,7 +174,7 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
|
||||
}
|
||||
|
||||
private void addOperation(UIThreadOperation operation) {
|
||||
operation.setBatchNumber(getCurrentBatchNumber());
|
||||
operation.setBatchNumber(mIsInBatch ? mCurrentBatchNumber : -1);
|
||||
mOperations.add(operation);
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
|
||||
}
|
||||
|
||||
private void addPreOperation(UIThreadOperation operation) {
|
||||
operation.setBatchNumber(getCurrentBatchNumber());
|
||||
operation.setBatchNumber(mIsInBatch ? mCurrentBatchNumber : -1);
|
||||
mPreOperations.add(operation);
|
||||
}
|
||||
|
||||
@@ -342,13 +342,6 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
|
||||
ReactChoreographer.CallbackType.NATIVE_ANIMATED_MODULE, mAnimatedFrameCallback);
|
||||
}
|
||||
|
||||
private long getCurrentBatchNumber() {
|
||||
if (mBatchingControlledByJS && !mIsInBatch) {
|
||||
return -1;
|
||||
}
|
||||
return mCurrentBatchNumber;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public void setNodesManager(NativeAnimatedNodesManager nodesManager) {
|
||||
mNodesManager.set(nodesManager);
|
||||
@@ -433,9 +426,6 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
|
||||
|
||||
@Override
|
||||
public void startOperationBatch() {
|
||||
if (ANIMATED_MODULE_DEBUG) {
|
||||
FLog.d(NAME, "Start JS operation batch " + mCurrentBatchNumber);
|
||||
}
|
||||
mBatchingControlledByJS = true;
|
||||
mIsInBatch = true;
|
||||
mCurrentBatchNumber++;
|
||||
@@ -443,9 +433,6 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
|
||||
|
||||
@Override
|
||||
public void finishOperationBatch() {
|
||||
if (ANIMATED_MODULE_DEBUG) {
|
||||
FLog.d(NAME, "Finish JS operation batch " + mCurrentBatchNumber);
|
||||
}
|
||||
mBatchingControlledByJS = true;
|
||||
mIsInBatch = false;
|
||||
mCurrentBatchNumber++;
|
||||
|
||||
Reference in New Issue
Block a user