OLD | NEW |
1 Sky's Run Loop | 1 Sky's Run Loop |
2 ============== | 2 ============== |
3 | 3 |
4 Sky's run loop consists of running the following, at 120Hz (each loop | 4 Sky's run loop consists of running the following, at 120Hz (each loop |
5 takes 8.333ms): | 5 takes 8.333ms): |
6 | 6 |
7 1. Send scroll and resize events if necessary, limiting each handler | 7 1. Send scroll and resize events if necessary, limiting each handler |
8 to 1ms, and limiting the total time spent on these handlers to 1ms. | 8 to 1ms, and limiting the total time spent on these handlers to 1ms. |
9 | 9 |
10 2. Fire animation frame callbacks for up to 1ms. Each callback can run | 10 2. Fire animation frame callbacks for up to 1ms. Each callback can run |
11 for up to 1ms. Once 1ms has expired, throw a (catchable) | 11 for up to 1ms. Once 1ms has expired, throw a (catchable) |
12 EDeadlineExceeded exception. If it's not caught, drop subsequent | 12 EDeadlineExceeded exception. If it's not caught, drop subsequent |
13 callbacks. | 13 callbacks. |
14 | 14 |
15 3. Spend up to 1ms to update the render tree, including calling | 15 4. Spend up to 1ms to update the render tree, including calling |
16 childAdded(), childRemoved(), and getLayoutManager() as needed. | 16 childAdded(), childRemoved(), and getLayoutManager() as needed. |
17 Once 1ms has expired, throw a (catchable) EDeadlineExceeded | 17 Once 1ms has expired, throw a (catchable) EDeadlineExceeded |
18 exception, leaving the render tree in whatever state it has | 18 exception, leaving the render tree in whatever state it has |
19 reached. | 19 reached. |
20 | 20 |
21 4. Update as much of layout as possible; after 1ms, throw a | 21 3. Update the ElementStyleDeclarationList objects for all elements on |
| 22 the RenderTree. |
| 23 |
| 24 5. Update as much of layout as possible; after 1ms, throw a |
22 (catchable) EDeadlineExceeded exception, leaving the remaining | 25 (catchable) EDeadlineExceeded exception, leaving the remaining |
23 nodes unprepared. | 26 nodes unprepared. |
24 | 27 |
25 5. Update as much of paint as possible; after 1ms, throw a (catchable) | 28 6. Update as much of paint as possible; after 1ms, throw a (catchable) |
26 EDeadlineExceeded exception, leaving any remaining nodes | 29 EDeadlineExceeded exception, leaving any remaining nodes |
27 unprepared. | 30 unprepared. |
28 | 31 |
29 6. Send frame to GPU. | 32 7. Send frame to GPU. |
30 | 33 |
31 7. Run pending tasks until the 8.333ms expires. Each task may only run | 34 8. Run pending tasks until the 8.333ms expires. Each task may only run |
32 for at most 1ms, after 1ms they get a (catchable) EDeadlineExceeded | 35 for at most 1ms, after 1ms they get a (catchable) EDeadlineExceeded |
33 exception. While there are no pending tasks, sleep. | 36 exception. While there are no pending tasks, sleep. |
34 Tasks are things like: | 37 Tasks are things like: |
35 - timers | 38 - timers |
36 - updating the DOM in response to parsing | 39 - updating the DOM in response to parsing |
37 - input events | 40 - input events |
38 - mojo callbacks | 41 - mojo callbacks |
39 | 42 |
40 TODO(ianh): Update the timings above to have some relationship to | 43 TODO(ianh): Update the timings above to have some relationship to |
41 reality. | 44 reality. |
42 | 45 |
43 TODO(ianh): Define an API so that the application can adjust the | 46 TODO(ianh): Define an API so that the application can adjust the |
44 budgets. | 47 budgets. |
45 | 48 |
46 TODO(ianh): Define how scroll notifications get sent, or decide to | 49 TODO(ianh): Define how scroll notifications get sent, or decide to |
47 drop them entirely from this model. | 50 drop them entirely from this model. |
OLD | NEW |