Donner 0.8.0-pre
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::svg::compositor::CancellationToken Class Reference

Design doc 0033 §M4 — cancellation handle for CompositorController:: renderFrame. The token wraps a single std::atomic<bool>; the compositor's per-layer / per-segment rasterize loops poll isCancelled() at coarse safe points (between rasterizeLayer / rasterizeStaticSegment calls, not mid-rasterize, per design doc 0033 §R3 / §D4) and bail early when set. More...

#include "donner/svg/compositor/CompositorController.h"

Public Member Functions

void cancel ()
 Mark the token as cancelled. Safe to call from any thread.
void reset ()
 Clear the cancellation. The renderFrame caller calls this at the top of each new render request so the token doesn't carry over.
bool isCancelled () const
 Polled by the compositor at coarse safe points.

Detailed Description

Design doc 0033 §M4 — cancellation handle for CompositorController:: renderFrame. The token wraps a single std::atomic<bool>; the compositor's per-layer / per-segment rasterize loops poll isCancelled() at coarse safe points (between rasterizeLayer / rasterizeStaticSegment calls, not mid-rasterize, per design doc 0033 §R3 / §D4) and bail early when set.

Cancellation is best-effort: a partially-rasterized frame leaves the compositor's segment / layer dirty flags in their pre-rasterize state, so the next renderFrame finishes the work without duplicating it. The caller (worker) discards the (incomplete) takeSnapshot result on cancel and restarts with the latest pendingRequest_.


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