You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is often called in a tight loop (the callback to requestAnimation typically
calls requestAnimation).
Instead, we can treat it like a setTimeout with a short delay (5ms ?). This has
the added benefit of making it cancelable, FWIW.
Copy file name to clipboardExpand all lines: src/browser/html/window.zig
+28-30Lines changed: 28 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -163,50 +163,33 @@ pub const Window = struct {
163
163
return&self.performance;
164
164
}
165
165
166
-
// Tells the browser you wish to perform an animation. It requests the browser to call a user-supplied callback function before the next repaint.
167
-
// fn callback(timestamp: f64)
168
-
// Returns the request ID, that uniquely identifies the entry in the callback list.
169
-
pubfn_requestAnimationFrame(
170
-
self: *Window,
171
-
callback: Function,
172
-
) !u32 {
173
-
// We immediately execute the callback, but this may not be correct TBD.
174
-
// Since: When multiple callbacks queued by requestAnimationFrame() begin to fire in a single frame, each receives the same timestamp even though time has passed during the computation of every previous callback's workload.
0 commit comments