Donner SVG 0.8.0
0.8.0 ยท ebf353960.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::editor::NothingToPresentRetry Class Reference

Paces re-posting a render request whose worker result had nothing to present. More...

#include "donner/editor/RenderCoordinator.h"

Public Types

using Clock = std::chrono::steady_clock
 Steady clock used to pace identical retry attempts.

Public Member Functions

bool noteFailure (const RenderAttemptIdentity &attempt, Clock::time_point now)
 Record that the result of attempt had nothing to present.
bool mayPost (const RenderAttemptIdentity &attempt, Clock::time_point now) const
 Whether attempt may be posted at now.
bool retryScheduled () const
 True while a retry of the failed request is still scheduled.
std::optional< float > secondsUntilRetry (Clock::time_point now) const
 Seconds until the scheduled retry is due, or nullopt when none is scheduled or it is already due: the wake for it has fired, and the next frame that asks for a render posts it.
void reset ()
 Forget the failed request, once a result presents or the document is replaced.

Static Public Attributes

static constexpr std::array< std::chrono::milliseconds, 3 > kRetryDelays
 Delay before each successive retry of the same failed request.

Detailed Description

Paces re-posting a render request whose worker result had nothing to present.

Such a result (no compositor tile: a failed readback, a lost device, refused surfaces) marks nothing rendered, and every idle frame asks for a render, so without pacing the identical request would be posted again on every frame. The failed request may be posted again after each delay in kRetryDelays; once the last retry fails too, an identical request is held until something about it changes. A different request is never held.

Member Function Documentation

◆ mayPost()

bool donner::editor::NothingToPresentRetry::mayPost ( const RenderAttemptIdentity & attempt,
Clock::time_point now ) const
nodiscard

Whether attempt may be posted at now.

Parameters
attemptThe request about to be posted.
nowCurrent time.

◆ noteFailure()

bool donner::editor::NothingToPresentRetry::noteFailure ( const RenderAttemptIdentity & attempt,
Clock::time_point now )

Record that the result of attempt had nothing to present.

Parameters
attemptThe request that produced the result.
nowCurrent time.
Returns
True when this failure used up the last retry.

◆ secondsUntilRetry()

std::optional< float > donner::editor::NothingToPresentRetry::secondsUntilRetry ( Clock::time_point now) const
nodiscard

Seconds until the scheduled retry is due, or nullopt when none is scheduled or it is already due: the wake for it has fired, and the next frame that asks for a render posts it.

Parameters
nowCurrent time.

Member Data Documentation

◆ kRetryDelays

std::array<std::chrono::milliseconds, 3> donner::editor::NothingToPresentRetry::kRetryDelays
staticconstexpr
Initial value:
= {
std::chrono::milliseconds(100), std::chrono::milliseconds(500),
std::chrono::milliseconds(2000)}

Delay before each successive retry of the same failed request.


The documentation for this class was generated from the following file: