servo/components
bors-servo 9d47b344d9 Auto merge of #9663 - pcwalton:browser-html-jank-fix, r=glennw
compositing: Stop compositing unnecessarily after each animation frame.

Instead, schedule a delayed composite after each frame of an animation.

The previous code would cause jank, because the following sequence
frequently occurred:

1. The page uses `requestAnimationFrame()` to request a frame.

2. The compositor receives the message, schedules a composite,
dispatches the rAF message to the script thread, composites, and goes to
sleep waiting for vblank (frame 1).

3. The script makes a change and sends it through the pipeline.
Eventually it gets painted and is sent to the compositor, but the
compositor is sleeping.

4. The compositor wakes up, sees the new painted content, page flips,
and goes to sleep (frame 2). Repeat from step 1.

The problem is that we have two composition frames, not just one. This
halves Web apps' framerate!

This commit fixes the problem by scheduling the composite in step 2 to
12 ms in the future. We already have this delayed-composition
functionality in the form of the scrolling timer, which I repurposed and
renamed to the "delayed composition timer" for this task. This change
gives the page 12 ms to prepare the frame, which seems to usually be
enough, especially with WebRender.

Note that simply removing the scheduled composite after rAF is not the
correct solution. If this is done, then pages that call rAF and don't
modify the page won't receive future rAFs, since the compositor will be
sleeping and won't be notified of vblank.

Fixes a bunch of jank in browser.html. The remaining jank seems to be a
problem with browser.html itself.

r? @glennw

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9663)
<!-- Reviewable:end -->
2016-02-25 03:56:02 +05:30
..
canvas Update webrender crate refs to reflect ownership change. 2016-02-23 19:49:50 -05:00
canvas_traits Update webrender crate refs to reflect ownership change. 2016-02-23 19:49:50 -05:00
compositing compositing: Stop compositing unnecessarily after each animation frame. 2016-02-24 14:06:46 -08:00
devtools Completed implementation of devtools' getLayout. 2016-02-24 13:51:47 -05:00
devtools_traits Completed implementation of devtools' getLayout. 2016-02-24 13:51:47 -05:00
gfx Update webrender crate refs to reflect ownership change. 2016-02-23 19:49:50 -05:00
gfx_traits Bump heapsize to 0.3 2016-02-13 11:13:19 +01:00
layout Auto merge of #9663 - pcwalton:browser-html-jank-fix, r=glennw 2016-02-25 03:56:02 +05:30
layout_traits Update webrender crate refs to reflect ownership change. 2016-02-23 19:49:50 -05:00
msg Update webrender crate refs to reflect ownership change. 2016-02-23 19:49:50 -05:00
net Update webrender crate refs to reflect ownership change. 2016-02-23 19:49:50 -05:00
net_traits Update websocket 2016-02-19 15:34:41 +01:00
plugins Bump to Rust 2016-02-22 2016-02-23 02:43:57 +01:00
profile Bump to Rust 2016-02-22 2016-02-23 02:43:57 +01:00
profile_traits Implement planned navigation 2016-02-18 06:37:32 -05:00
script Auto merge of #9661 - jdm:devtools-inspector-get-layout, r=pcwalton 2016-02-25 00:22:43 +05:30
script_traits Move util::cursor to style_traits 2016-02-16 00:50:01 +01:00
servo Completed implementation of devtools' getLayout. 2016-02-24 13:51:47 -05:00
style Move util::logical_geometry to style 2016-02-18 10:17:13 +01:00
style_traits Move util::cursor to style_traits 2016-02-16 00:50:01 +01:00
util Auto merge of #9706 - mrobinson:remove-parallel-display-list-building, r=pcwalton 2016-02-25 02:52:45 +05:30
webdriver_server Bump url to 0.5.5 2016-02-13 00:08:12 +01:00