Donner SVG main
0.8.0 ยท 766e862a0.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
Renderer.h File Reference
#include <memory>
#include <span>
#include "donner/svg/SVGDocument.h"
#include "donner/svg/SVGElement.h"
#include "donner/svg/renderer/RendererInterface.h"
Include dependency graph for Renderer.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::svg::AtlasDocumentPlacement
 Placement of one document inside a shared atlas render target. More...
struct  donner::svg::RendererOptions
 Options for frame preparation and rendering. More...
class  donner::svg::Renderer
 Backend-agnostic renderer that resolves to the active build backend (tiny-skia by default, or Geode). More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.
namespace  donner::svg
 Donner SVG library, which can load, manipulate and render SVG files.

Functions

RendererBitmap donner::svg::RenderDocumentsToAtlasBitmap (RendererInterface &renderer, std::span< const AtlasDocumentPlacement > placements, Vector2i atlasSizePx)
 Rasterize several documents into one render target and read it back once.

Class Documentation

◆ donner::svg::AtlasDocumentPlacement

struct donner::svg::AtlasDocumentPlacement

Placement of one document inside a shared atlas render target.

See also
RenderDocumentsToAtlasBitmap
Class Members
SVGDocument * document = nullptr Document to rasterize. Must outlive the atlas call; null entries are skipped.

Outliving the call is a hard requirement, not a lifetime convenience. A GPU backend keeps each document's resident geometry and bind groups in state owned by that document and consumes them when the frame is submitted, so a document released before this call returns frees buffers the recorded draws still reference and its tile comes back blank. Callers bounding peak memory must therefore shrink the batch, not shorten a document's lifetime inside one.

Vector2i originPx = Vector2i::Zero() Top-left corner of this document's tile, in atlas device pixels.

◆ donner::svg::RendererOptions

struct donner::svg::RendererOptions

Options for frame preparation and rendering.

Class Members
StylePassScheduler scheduler = {}
bool verbose = false Enable verbose rendering diagnostics. Optional scheduler for frame preparation. It must outlive the renderer. Its other tasks must leave capacity for frame preparation without waiting on the drawing thread or acquiring its document guard. Drawing on this scheduler's worker uses serial style.