Skip to content

Fix animation smoothness when using requestAnimationFrame. - #9858

Merged
bors-servo merged 1 commit into
servo:masterfrom
glennw:anim-smoothness
Mar 4, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
glennw:anim-smoothness

Conversation

@glennw

@glennw glennw commented Mar 3, 2016

Copy link
Copy Markdown
Member

Previously, the flow for ticking animations was:

Compositor -> Constellation -> Layout -> Script

However, this means that the compositor <-> layout messages can thrash, meaning layout thread is very rarely idle.

This means that the script thread (which joins on the layout thread during reflow) was unable to execute and run rAF callbacks.

With this change, the flow is now:

Compositor -> Constellation -> Script (when rAF is active).
Compositor -> Constellation -> Layout (when transitions / animations are active and no rAF is present).

This makes rAF based animation much smoother.

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Mar 3, 2016
@glennw

glennw commented Mar 3, 2016

Copy link
Copy Markdown
Member Author

r? @pcwalton

@highfive highfive assigned pcwalton and unassigned frewsxcv Mar 3, 2016
@pcwalton

pcwalton commented Mar 3, 2016

Copy link
Copy Markdown
Contributor

@bors-servo: r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit f0fdb04 has been approved by pcwalton

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Mar 3, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit f0fdb04 with merge 4ae71c5...

bors-servo pushed a commit that referenced this pull request Mar 3, 2016
Fix animation smoothness when using requestAnimationFrame.

Previously, the flow for ticking animations was:

Compositor -> Constellation -> Layout -> Script

However, this means that the compositor <-> layout messages can thrash, meaning layout thread is very rarely idle.

This means that the script thread (which joins on the layout thread during reflow) was unable to execute and run rAF callbacks.

With this change, the flow is now:

Compositor -> Constellation -> Script (when rAF is active).
Compositor -> Constellation -> Layout (when transitions / animations are active and no rAF is present).

This makes rAF based animation *much* smoother.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9858)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - linux-dev

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Mar 3, 2016
Previously, the flow for ticking animations was:

Compositor -> Constellation -> Layout -> Script

However, this means that the compositor <-> layout messages can thrash, meaning layout thread is very rarely idle.

This means that the script thread (which joins on the layout thread during reflow) was unable to execute and run rAF callbacks.

With this change, the flow is now:

Compositor -> Constellation -> Script (when rAF is active).
Compositor -> Constellation -> Layout (when transitions / animations are active and no rAF is present).

This makes rAF based animation *much* smoother.
@glennw
glennw force-pushed the anim-smoothness branch from f0fdb04 to 9206113 Compare March 3, 2016 21:26
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Mar 3, 2016
@pcwalton

pcwalton commented Mar 3, 2016

Copy link
Copy Markdown
Contributor

@bors-servo: r=pcwalton

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 9206113 has been approved by pcwalton

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Mar 3, 2016
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 9206113 with merge aba500a...

bors-servo pushed a commit that referenced this pull request Mar 4, 2016
Fix animation smoothness when using requestAnimationFrame.

Previously, the flow for ticking animations was:

Compositor -> Constellation -> Layout -> Script

However, this means that the compositor <-> layout messages can thrash, meaning layout thread is very rarely idle.

This means that the script thread (which joins on the layout thread during reflow) was unable to execute and run rAF callbacks.

With this change, the flow is now:

Compositor -> Constellation -> Script (when rAF is active).
Compositor -> Constellation -> Layout (when transitions / animations are active and no rAF is present).

This makes rAF based animation *much* smoother.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9858)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt

@bors-servo
bors-servo merged commit 9206113 into servo:master Mar 4, 2016
@glennw
glennw deleted the anim-smoothness branch December 12, 2016 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants