Donner SVG 0.8.0-pre
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...
class  donner::svg::Renderer
 Backend-agnostic renderer that resolves to the active build backend (Skia or tiny-skia). 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 components on that document's own registry and consumes them when the frame is submitted (see donner/svg/renderer/geode/GeodeResidentPathComponent.h), 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.