-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes additional calls to rAF. #9401
Conversation
Often, a rAF callback will request another rAF from the callback itself. Previously, the constellation would quickly receive two messages saying that there were no animations, and then there are animations again in the situation above. This would make the compositor tick the new animation straight away, causing strange fluctuations and timings in rAF callbacks. Instead, only send the NoAnimationCallbacks message if the animation callback queue is still empty after invoking the callbacks. This fixes rAF timing, which now runs at the correct (vsync) framerate.
r? @jdm I don't think there's any way to add a reliable test for this - can you think of a way? |
Maybe add a comment about the interactions here? It's not quite obvious on first sight that the message needs to be sent after the callbacks. |
Added comment to the code explaining the ordering. r? @jdm |
@bors-servo: r+ |
📌 Commit de81d88 has been approved by |
Fixes additional calls to rAF. Often, a rAF callback will request another rAF from the callback itself. Previously, the constellation would quickly receive two messages saying that there were no animations, and then there are animations again in the situation above. This would make the compositor tick the new animation straight away, causing strange fluctuations and timings in rAF callbacks. Instead, only send the NoAnimationCallbacks message if the animation callback queue is still empty after invoking the callbacks. This fixes rAF timing, which now runs at the correct (vsync) framerate. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9401) <!-- Reviewable:end -->
💔 Test failed - linux-rel |
The test uses rAF, so I'm suspicious. |
…uired. Fixes timeout in transition_calc.html.
@jdm The last commit fixes that test failure. It ensures that when compositing for a screenshot, animation ticks still occur once each frame is correctly painted. |
@bors-servo: r+ |
📌 Commit 6a85102 has been approved by |
Fixes additional calls to rAF. Often, a rAF callback will request another rAF from the callback itself. Previously, the constellation would quickly receive two messages saying that there were no animations, and then there are animations again in the situation above. This would make the compositor tick the new animation straight away, causing strange fluctuations and timings in rAF callbacks. Instead, only send the NoAnimationCallbacks message if the animation callback queue is still empty after invoking the callbacks. This fixes rAF timing, which now runs at the correct (vsync) framerate. <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9401) <!-- Reviewable:end -->
☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt |
Often, a rAF callback will request another rAF from the callback itself.
Previously, the constellation would quickly receive two messages saying
that there were no animations, and then there are animations again in the
situation above. This would make the compositor tick the new animation straight
away, causing strange fluctuations and timings in rAF callbacks.
Instead, only send the NoAnimationCallbacks message if the animation
callback queue is still empty after invoking the callbacks.
This fixes rAF timing, which now runs at the correct (vsync) framerate.