At the moment animation worklet run on compositor thread. Ideally we should be able to run it on a dedicated thread which can fall behind the compositor thread.
We need the following changes to be able to do that:
- Don't directly mutate the layer tree. Instead generate mutation records that later can get reconciled with an abstract layer tree.
- Add plumbing to send mutation signal should from compositor thread to dedicated worklet thread and send back the mutation records.
- Details of how/when the rAF is scheduled and how long would we wait for mutation records before allowing the worklet to fall behind.