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

Ensure that critical vsync tasks run when rAF is disabled. #7639

Merged
merged 2 commits into from
Mar 14, 2017

Conversation

cramforce
Copy link
Member

Add a backup timer for non-animation vsync tasks. This ensures that non-animation tasks still eventually (timer at 2.5X normal rAF time) execute when we somehow failed to detect that we aren't visible.

Fixes #7589

Add a backup timer for non-animation vsync tasks. This ensures that non-animation tasks still eventually (timer at 2.5X normal rAF time) execute when we somehow failed to detect that we aren't visible.

Fixes ampproject#7589
* we continue to get work done.
* @const {!Pass}
*/
this.backupPass_ = new Pass(this.win, this.boundRunScheduledTasks_,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should check in this pass when was the last rAF (or queue run) time and only proceed with "force" if this was more than X. Otherwise, we risk constantly interrupting the existing rAF queue. Or do you hope that give .5 we'd mostly find this pass empty?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We always schedule this and an rAF and cancel the pass when the rAF runs. Under normal rAF operation I do not see how this could ever not be cancelled.

@cramforce
Copy link
Member Author

Friendly ping.

@cramforce cramforce merged commit 2a585d0 into ampproject:master Mar 14, 2017
mrjoro pushed a commit to mrjoro/amphtml that referenced this pull request Apr 28, 2017
…t#7639)



Add a backup timer for non-animation vsync tasks. This ensures that non-animation tasks still eventually (timer at 2.5X normal rAF time) execute when we somehow failed to detect that we aren't visible.

Fixes ampproject#7589
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants