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

OverlayRenderer draws editor chrome (currently selection path outlines) directly into the renderer's existing frame buffer using the canvas primitives RendererInterface already exposes. It is not a separate compositing layer and not a fabricated SVG subtree — chrome and document share one render target so there is no subpixel drift between them. More...

#include <optional>
#include <span>
#include "donner/base/Box.h"
#include "donner/base/Transform.h"
#include "donner/svg/SVGElement.h"
Include dependency graph for OverlayRenderer.h:
This graph shows which files directly or indirectly include this file:

Classes

class  donner::editor::OverlayRenderer

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.

Detailed Description

OverlayRenderer draws editor chrome (currently selection path outlines) directly into the renderer's existing frame buffer using the canvas primitives RendererInterface already exposes. It is not a separate compositing layer and not a fabricated SVG subtree — chrome and document share one render target so there is no subpixel drift between them.

See docs/design_docs/editor.md "OverlayRenderer uses direct canvas- style Renderer calls" for the architectural rationale and the primitive policy.

Usage:

renderer.draw(editor.document().document());
const auto bitmap = renderer.takeSnapshot(); // contains chrome
static void drawChrome(svg::Renderer &renderer, const EditorApp &editor)
Draw all editor chrome layers for the current state of editor into renderer's active frame....

Must be called after Renderer::draw(document) (which has its own internal beginFrame / endFrame cycle) and before Renderer::takeSnapshot(). The renderer's frame pixmap survives across endFrame so additional canvas commands compose onto it directly.