Skip to content
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

What is set_animation_state for? #21855

Open
paulrouget opened this issue Oct 2, 2018 · 4 comments
Open

What is set_animation_state for? #21855

paulrouget opened this issue Oct 2, 2018 · 4 comments

Comments

@paulrouget
Copy link
Contributor

@paulrouget paulrouget commented Oct 2, 2018

As far as I understand, there are 2 ways we want to run the embedder event loop.

Either Servo is not animating, then we block on window events, either Servo is animating, and then we block on swap_buffer.

If I'm not mistaken, this behavior was introduced a while back: c825592

But when animating, a Recomposite message i sent to the compositor. And sending any message to the compositor end up waking up the event loop (a Idle window event is generated). So blocking on window events works even during animations.

So, if my understand is right, it means that either:

  • the embedder doesn't need to know about the animation state of Servo, and we should remove the set_animation_state callback
  • servo should not bother waking up the compositor thread during animation and let embedder schedule that based on the animation state

@gw3583 you worked on that. Can you help me understand what we are supposed to do while animations are running?

@gw3583
Copy link
Contributor

@gw3583 gw3583 commented Oct 3, 2018

I can't recall the specifics, sorry. I think the main issue is probably that if the compositor thread is going to sleep / being woken up during animation, it's quite likely that it will miss vsync due to OS scheduler timing differences. This would result in animation sometimes looking janky if that occurs?

@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Oct 3, 2018

@gw3583 is it also possible that waking up the compositor thread too often might increase CPU consumption too?

@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Oct 3, 2018

I can measure that.

@asajeffrey
Copy link
Member

@asajeffrey asajeffrey commented Feb 22, 2019

Related: #22926.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.