DisplayListReplay Class

Definition

A replay of a DisplayList into one backend that runs in time slices: Continue(TimeSpan) hands operations over until its budget is used, and the next call resumes at the operation where it stopped. Start one with BeginReplay(IRenderingBackend, CancellationToken, IProgress<Double>?).

public sealed class DisplayListReplay

Remarks

Viewer capability 2 (issue #97), PDFium's progressive rendering. Between slices the backend keeps the state the operations so far gave it (graphics state stack, transform, clip) and whatever it drew, so its output after any slice is a valid partial image, and the whole replay hands the backend exactly the calls of Replay(IRenderingBackend). The budget is checked after each operation, so a slice runs at least one operation and ends at most one operation after its budget; one operation (a large image, a long glyph run) is never split.

Nothing here blocks or waits, and no thread is used: a single-threaded host (Blazor WebAssembly) replays a slice, yields to its event loop, and continues, for example while (!replay.Continue(TimeSpan.FromMilliseconds(8))) await Task.Yield();. Cancelling the token stops the replay before its next operation; Continue(TimeSpan) then throws , now and on every later call until the replay is complete. Not thread-safe: one thread at a time continues a replay.

Tip: use kind:method, kind:property, kind:ctor. Press Esc to clear.

Properties (5)

Methods (1)