Donner SVG 0.8.0
0.8.0 ยท ebf353960.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
FrameCallbackAdmission.h File Reference

Coalesces browser frame notifications and invalidates callbacks across shutdown/restart. More...

#include <algorithm>
#include <array>
#include <atomic>
#include <cstdint>
#include <cstdlib>
#include <optional>
Include dependency graph for FrameCallbackAdmission.h:

Classes

struct  donner::editor::FrameAttemptStats
 Owner-thread counters; index zero is scheduled work and index one is an event frame. More...
class  donner::editor::FrameCallbackAdmission
 Start/stop and callback execution belong to the app thread; admission may run on another thread. More...
class  donner::editor::EventFrameWake
 Coalesces event-frame requests into at most one queued frame without losing a request. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Functions

std::optional< double > donner::editor::NextScheduledFrameDeadline (std::optional< double > previousDeadlineMs, std::optional< double > nextDeadlineMs, bool eventFrame)
 Preserve scheduled work across asynchronous event frames that cannot service an animation tick.

Detailed Description

Coalesces browser frame notifications and invalidates callbacks across shutdown/restart.

Function Documentation

◆ NextScheduledFrameDeadline()

std::optional< double > donner::editor::NextScheduledFrameDeadline ( std::optional< double > previousDeadlineMs,
std::optional< double > nextDeadlineMs,
bool eventFrame )
inline

Preserve scheduled work across asynchronous event frames that cannot service an animation tick.

Parameters
previousDeadlineMsDeadline owed before this frame, on the host's monotonic clock.
nextDeadlineMsRecomputed deadline after this frame, or no remaining idle work.
eventFrameWhether this frame services an event rather than a scheduled tick.