Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
ReplayingRenderer.h File Reference

Decodes a SerializingRenderer wire stream and dispatches its messages onto a wrapped, real RendererInterface. The replay is host-side: the target can be RendererTinySkia, RendererGeode, or a test mock. More...

#include <cstdint>
#include <memory>
#include <span>
#include "donner/base/EcsRegistry.h"
#include "donner/editor/sandbox/Wire.h"
#include "donner/svg/renderer/RendererInterface.h"
Include dependency graph for ReplayingRenderer.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::editor::sandbox::ReplayReport
 Statistics and diagnostic info from a replay. Always valid regardless of status. More...
class  donner::editor::sandbox::ReplayingRenderer

Namespaces

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

Enumerations

enum class  donner::editor::sandbox::ReplayStatus {
  kOk ,
  kEndOfStream ,
  kMalformed ,
  kUnknownOpcode ,
  kHeaderMismatch ,
  kEncounteredUnsupported
}
 Outcome of replaying a single frame onto the wrapped backend. More...

Detailed Description

Decodes a SerializingRenderer wire stream and dispatches its messages onto a wrapped, real RendererInterface. The replay is host-side: the target can be RendererTinySkia, RendererGeode, or a test mock.

ReplayingRenderer::pumpFrame() is the single entry point. It reads messages from the wire until it encounters kEndFrame, an unknown opcode, a malformed payload, or end-of-stream. It never crashes on adversarial input; every failure is reported via a ReplayStatus return code.

Enumeration Type Documentation

◆ ReplayStatus

Outcome of replaying a single frame onto the wrapped backend.

Enumerator
kOk 

Frame ended cleanly with kEndFrame.

kEndOfStream 

Reader ran out of bytes without seeing kEndFrame.

kMalformed 

A payload failed to decode (length, tag, range).

kUnknownOpcode 

Reader saw an opcode it doesn't know.

kHeaderMismatch 

Magic or version mismatch on the stream header.

kEncounteredUnsupported 

Replay succeeded but hit a kUnsupported message.