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

Immutable command stream captured from a prepared SVG document. More...

#include "donner/svg/renderer/RenderSnapshot.h"

Public Member Functions

 RenderSnapshot ()
 Create an empty render snapshot.
 ~RenderSnapshot ()
 Destructor.
 RenderSnapshot (RenderSnapshot &&other) noexcept
 Move constructor.
RenderSnapshotoperator= (RenderSnapshot &&other) noexcept
 Move assignment.
 RenderSnapshot (const RenderSnapshot &other)=delete
RenderSnapshotoperator= (const RenderSnapshot &other)=delete
std::uint64_t sourceRevision () const
 Source document revision observed when this snapshot was captured.
std::size_t commandCount () const
 Number of renderer commands stored in this snapshot.
std::size_t estimatedCommandStorageBytes () const
 Estimated bytes used by the snapshot command stream.
std::size_t liveRegistryReferenceCountForTesting (const Registry &registry) const
 Count snapshot-owned command references that still point at registry.
void replay (RendererInterface &renderer) const
 Replay the captured command stream into renderer.

Friends

class RenderSnapshotRecorder
class RendererDriver

Detailed Description

Immutable command stream captured from a prepared SVG document.

Snapshot capture may inspect the live ECS registry, but replay emits only the recorded renderer commands. Resource references embedded in those commands point at snapshot-owned storage so backend replay does not dereference the live document registry.

Member Function Documentation

◆ estimatedCommandStorageBytes()

std::size_t donner::svg::RenderSnapshot::estimatedCommandStorageBytes ( ) const
nodiscard

Estimated bytes used by the snapshot command stream.

This counts the command vector allocation and snapshot implementation object. It intentionally does not include nested allocations owned by command payloads, such as paths, text spans, filter graphs, or paint-server resource components.

◆ liveRegistryReferenceCountForTesting()

std::size_t donner::svg::RenderSnapshot::liveRegistryReferenceCountForTesting ( const Registry & registry) const
nodiscard

Count snapshot-owned command references that still point at registry.

This is a test-only invariant helper: a captured snapshot should not retain any EntityHandle into the live document registry.

Parameters
registryRegistry that must not be referenced by replay payloads.

◆ replay()

void donner::svg::RenderSnapshot::replay ( RendererInterface & renderer) const

Replay the captured command stream into renderer.

Parameters
rendererBackend receiving the recorded commands.

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