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

Refactored vsync for animations and non-animations uses #1001

Merged
merged 1 commit into from
Nov 25, 2015

Conversation

dvoytenko
Copy link
Contributor

Vsync now has two sets of APIs: one for animation cases and one for all others. The animation cases are protected from running when document is not visible. Non-animation cases are forced to run even when document is not visible.

Closes #839.

/cc @sriramkrish85

@@ -160,13 +160,11 @@ export class FontLoader {
} else if (this.compareMeasurements_()) {
resolve();
} else {
vsync.run(vsyncTask);
Copy link
Member

Choose a reason for hiding this comment

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

do we still want to expose run as public if createTask is the preferred interface?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now, yes. run - one time call. createTask - repeated calls. This way they are easy to tell apart.

@erwinmombay
Copy link
Member

LGTM, minor nits.

dvoytenko added a commit that referenced this pull request Nov 25, 2015
Refactored vsync for animations and non-animations uses
@dvoytenko dvoytenko merged commit da1de88 into ampproject:master Nov 25, 2015
@dvoytenko dvoytenko deleted the vsync2 branch November 25, 2015 01:31
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