This reverts rB1693a5efe919: Fix T66378: Missing animation update when switching view layer and implements an alternative solution.
Benefits of this solution:
Does not require tagging all depsgraph when the frame changed.- Less code.
- Fixes a problem when trying to evaluate a depsgraph on a different frame than is stored in the original scene.
Since a depsgraph already stores the time it was last evaluated at, there is no need to tag the depsgraph after time changes. Before evaluation, one just has to compare the last evaluated frame with the frame that is about to be evaluated.
I also removed the DEG_needs_eval function, because it was never used and is incorrect now. Whether a depsgraph needs evaluation depends on the frame that you want to evaluate it on. An alternative fix would be to pass a frame into DEG_needs_eval`, but it was easier to just remove it for now.
I don't expect any user visible changes from this patch.