1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
//! Two clocks, two types.
//!
//! A `Tree` answers two questions about time and they are not the same
//! question: *when is this frame being drawn for* and *when did the event now
//! being dispatched happen*. An event's instant is the older of the two — it
//! was stamped when the compositor sent it and is read when the frame that
//! carries it runs — so differencing one against the other measures the loop's
//! input latency, which is almost never what the differencing code meant.
//!
//! Both were `std::time::Instant`, so a value from either fitted anywhere the
//! other was expected and the mistake compiled. `ScrollState::momentum_since`
//! is what that costs: written from the event clock when a finger lifts and
//! differenced against the frame clock to decide whether the motion had gone
//! stale — so the first frame after a lift measured the loop's input latency
//! against a 200ms threshold, and could cancel a flick that had only just
//! started (#265).
//!
//! That field still takes the lift's moment across, and is right to: the glide
//! *begins* there, and what reads it now is a friction applied for the elapsed
//! time rather than a threshold that cancels (#340). Which is the rule below —
//! a start may cross, a deadline may not — and the same field on both sides of
//! it is as good an illustration as the two types have.
//!
//! Neither type carries `elapsed()`. Nor is either a wall against a determined
//! caller — `From<Instant>` and `into_inner` are both public, because a job
//! deadline genuinely leaves the pass's sequence. What the types buy is that
//! crossing has to be *written*, and every crossing can be found by grepping
//! for the two names that do it.
//!
//! That there is no `elapsed()` is the other half of the same rule: an instant from a pass is a moment in that pass's own
//! sequence, and the wall clock is not in it. Ask the pass what time it is
//! instead.
use ;
pass_clock!;
pass_clock!;