Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::svg::compositor::DualPathVerifier Class Reference

Dual-path assertion harness for composited rendering. More...

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

Classes

struct  VerifyResult
 Result of a dual-path verification pass. More...

Public Member Functions

 DualPathVerifier (CompositorController &compositor, RendererInterface &renderer)
 Construct a dual-path verifier.
VerifyResult renderAndVerify (const RenderViewport &viewport)
 Render a frame through both paths and compare the results.
const VerifyResult & lastResult () const
 Returns the result of the last renderAndVerify() call.
const RendererBitmap & compositorSnapshot () const
 Returns the compositor snapshot from the last verification.
const RendererBitmap & referenceSnapshot () const
 Returns the reference snapshot from the last verification.

Detailed Description

Dual-path assertion harness for composited rendering.

Runs both the compositor path and a full re-render reference path, then pixel-diffs the results. Use this to verify that composited output matches the ground truth during development and testing.

The harness wraps a CompositorController and a RendererInterface, intercepting renderFrame to additionally perform a reference render and diff.

Usage in tests:

DualPathVerifier verifier(compositor, renderer);
verifier.renderAndVerify(viewport);
EXPECT_EQ(verifier.mismatchCount(), 0u);
DualPathVerifier(CompositorController &compositor, RendererInterface &renderer)
Construct a dual-path verifier.

Constructor & Destructor Documentation

◆ DualPathVerifier()

donner::svg::compositor::DualPathVerifier::DualPathVerifier ( CompositorController & compositor,
RendererInterface & renderer )

Construct a dual-path verifier.

Parameters
compositorThe compositor controller to verify.
rendererThe renderer backend used for both the compositor and reference paths.

Member Function Documentation

◆ renderAndVerify()

VerifyResult donner::svg::compositor::DualPathVerifier::renderAndVerify ( const RenderViewport & viewport)

Render a frame through both paths and compare the results.

  1. Renders via compositor.renderFrame(viewport) and captures a snapshot.
  2. Renders via RendererDriver::draw(document) and captures a snapshot.
  3. Pixel-diffs the two snapshots.
Parameters
viewportThe viewport for both render passes.
Returns
The verification result.

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