run Updates
Animation loop performs two BFSes over the graph of animated nodes. We use incremented
mAnimatedGraphBFSColor
to mark nodes as visited in each of the BFSes which saves additional loops for clearing "visited" states.
First BFS starts with nodes that are in mUpdatedNodes
(that is, their value have been modified from JS in the last batch of JS operations) or directly attached to an active animation (hence linked to objects from mActiveAnimations
). In that step we calculate an attribute activeIncomingNodes
. The second BFS runs in topological order over the sub-graph of *active* nodes. This is done by adding node to the BFS queue only if all its "predecessors" have already been visited.