Back out "Assign batch number to only batched animated instructions"

Summary:
This change broke some animations on non-Fabric surfaces due to inconsistent batching of animation operations.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D28013968

fbshipit-source-id: 2f65c799dbe00168f1e756ef0af60206df5a8fcc
This commit is contained in:
Andrei Shikov
2021-04-27 03:58:38 -07:00
committed by Facebook GitHub Bot
parent ef0db95300
commit 0aa7e5b5d4
@@ -118,7 +118,6 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
private boolean mBatchingControlledByJS = false; // TODO T71377544: delete
private volatile long mCurrentFrameNumber; // TODO T71377544: delete
private volatile long mCurrentBatchNumber;
private volatile boolean mIsInBatch = false;
private boolean mInitializedForFabric = false;
private boolean mInitializedForNonFabric = false;
@@ -174,7 +173,7 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
}
private void addOperation(UIThreadOperation operation) {
operation.setBatchNumber(mIsInBatch ? mCurrentBatchNumber : -1);
operation.setBatchNumber(mCurrentBatchNumber);
mOperations.add(operation);
}
@@ -184,7 +183,7 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
}
private void addPreOperation(UIThreadOperation operation) {
operation.setBatchNumber(mIsInBatch ? mCurrentBatchNumber : -1);
operation.setBatchNumber(mCurrentBatchNumber);
mPreOperations.add(operation);
}
@@ -427,14 +426,12 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
@Override
public void startOperationBatch() {
mBatchingControlledByJS = true;
mIsInBatch = true;
mCurrentBatchNumber++;
}
@Override
public void finishOperationBatch() {
mBatchingControlledByJS = true;
mIsInBatch = false;
mCurrentBatchNumber++;
}