Commit d150e48
bors-servo
Auto merge of #17398 - glennw:opt-composite, r=pcwalton
Improve decisions in compositor over when to draw a frame.
This patch fixes a couple of issues in the compositor:
1) Remove the delayed composition code. Previously, this would schedule
a composite for 12ms in the future. This doesn't really make any sense
with WR. There's no point in doing a composite unless WR has provided
a new frame to be drawn. This fixes issues in several benchmarks where
we were doing multiple composite / renders per rAF, which is a waste
of CPU time. This *does* make the framerate slower in some cases (such
as a slow rAF callback) but it's more correct - otherwise we were just
compositing the same frame multiple times for no real benefit.
2) Inform the window of the current animation state of the compositor.
Specifically, if an animation (or rAF) is currently active, the
window system switches to use event polling, and does not block on
the OS-level event loop. In the case of active animation, we just
assume that we want to be running as the vsync interval and not
blocking. This means the compositor thread only sleeps on vsync
during animation, which reduces OS scheduling and results in much
smoother animation.
<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17398)
<!-- Reviewable:end -->File tree
6 files changed
+32
-154
lines changed- components/compositing
- ports/glutin
6 files changed
+32
-154
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
131 | 130 | | |
132 | 131 | | |
133 | 132 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | 133 | | |
138 | 134 | | |
139 | 135 | | |
| |||
207 | 203 | | |
208 | 204 | | |
209 | 205 | | |
210 | | - | |
211 | 206 | | |
212 | 207 | | |
213 | 208 | | |
| |||
363 | 358 | | |
364 | 359 | | |
365 | 360 | | |
366 | | - | |
367 | 361 | | |
368 | 362 | | |
369 | 363 | | |
| |||
437 | 431 | | |
438 | 432 | | |
439 | 433 | | |
440 | | - | |
441 | | - | |
442 | 434 | | |
443 | 435 | | |
444 | 436 | | |
| |||
524 | 516 | | |
525 | 517 | | |
526 | 518 | | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | 519 | | |
538 | 520 | | |
539 | 521 | | |
| |||
753 | 735 | | |
754 | 736 | | |
755 | 737 | | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | | - | |
764 | | - | |
765 | | - | |
766 | | - | |
767 | | - | |
768 | 738 | | |
769 | 739 | | |
770 | 740 | | |
| |||
1235 | 1205 | | |
1236 | 1206 | | |
1237 | 1207 | | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
1238 | 1214 | | |
1239 | 1215 | | |
1240 | 1216 | | |
1241 | 1217 | | |
1242 | 1218 | | |
1243 | 1219 | | |
1244 | | - | |
1245 | 1220 | | |
1246 | 1221 | | |
1247 | 1222 | | |
| |||
1635 | 1610 | | |
1636 | 1611 | | |
1637 | 1612 | | |
1638 | | - | |
1639 | | - | |
1640 | | - | |
1641 | | - | |
1642 | | - | |
1643 | | - | |
1644 | | - | |
1645 | | - | |
1646 | 1613 | | |
1647 | 1614 | | |
1648 | 1615 | | |
| |||
1664 | 1631 | | |
1665 | 1632 | | |
1666 | 1633 | | |
1667 | | - | |
1668 | | - | |
| 1634 | + | |
1669 | 1635 | | |
1670 | 1636 | | |
1671 | 1637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
104 | | - | |
105 | 103 | | |
106 | 104 | | |
107 | 105 | | |
| |||
160 | 158 | | |
161 | 159 | | |
162 | 160 | | |
163 | | - | |
164 | 161 | | |
165 | 162 | | |
166 | 163 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
39 | 38 | | |
40 | 39 | | |
41 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
105 | 111 | | |
106 | 112 | | |
107 | 113 | | |
| |||
163 | 169 | | |
164 | 170 | | |
165 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
166 | 178 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| 199 | + | |
| 200 | + | |
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
| |||
316 | 318 | | |
317 | 319 | | |
318 | 320 | | |
| 321 | + | |
319 | 322 | | |
320 | 323 | | |
321 | 324 | | |
| |||
655 | 658 | | |
656 | 659 | | |
657 | 660 | | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
658 | 665 | | |
659 | 666 | | |
660 | 667 | | |
661 | | - | |
| 668 | + | |
662 | 669 | | |
663 | 670 | | |
664 | 671 | | |
| |||
1005 | 1012 | | |
1006 | 1013 | | |
1007 | 1014 | | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
1008 | 1019 | | |
1009 | 1020 | | |
1010 | 1021 | | |
| |||
0 commit comments