Donner SVG 0.8.0-pre
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
RendererInterface.h File Reference
Include dependency graph for RendererInterface.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::svg::RenderViewport
 Describes the viewport for a render pass. More...
struct  donner::svg::RendererBitmap
 CPU-readable bitmap produced by a renderer snapshot. More...
struct  donner::svg::RendererReadbackStats
 Aggregate diagnostics for CPU readbacks completed by a renderer and any offscreen instances that share its backend device, plus the device-health outcome those readbacks observed. More...
class  donner::svg::RendererSurfaceBudget
 Aggregate budget for render targets, layers, masks, clips, and pattern tiles. More...
struct  donner::svg::RendererSurfaceBudget::Limits
class  donner::svg::RendererFilterPreparationBudget
 Aggregate filter-graph preparation and source-image materialization budget for one frame. More...
struct  donner::svg::RendererFilterPreparationBudget::Limits
class  donner::svg::RendererDrawBudget
 Aggregate conversion, rasterization, and upload work shared by a render frame. More...
struct  donner::svg::RendererDrawBudget::Cost
class  donner::svg::RendererDrawBudget::PathMeasurementReservation
 Exclusive reservation for one bounded path-measurement query. More...
class  donner::svg::RendererTextMaterializationBudget
 Aggregate decoded-outline and path-copy budget shared by one renderer frame. More...
struct  donner::svg::RendererTextMaterializationBudget::Cost
struct  donner::svg::RendererResourceStats
 Bounded-resource diagnostics for the most recently started render frame. More...
class  donner::svg::RendererTextureSnapshot
 Backend-owned GPU texture snapshot produced by a renderer. More...
class  donner::svg::RendererImage
 A rendered image that lives either in a backend GPU texture or in CPU pixels. More...
struct  donner::svg::PathShape
 A path to draw, along with its fill rule and the entity it came from. More...
struct  donner::svg::ClipPathShape
 One resolved clip-path shape, owned by the ResolvedClip that holds it. More...
struct  donner::svg::PaintParams
 Paint state derived from resolved style for the current node. More...
struct  donner::svg::ResolvedClip
 Clip stack entry combining rectangles, paths, and optional masks. More...
struct  donner::svg::ImageParams
 Parameters describing how an image should be drawn. More...
struct  donner::svg::TextParams
 Parameters describing how text is drawn and outlined. More...
class  donner::svg::RendererInterface
 Backend-agnostic rendering interface consumed by RendererDriver during document traversal. 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.

Enumerations

enum class  donner::svg::AlphaType : uint8_t {
  donner::svg::Premultiplied ,
  donner::svg::Unpremultiplied
}
 Alpha channel interpretation for pixel data. More...
enum class  donner::svg::GpuWaitTimeoutSite : uint8_t {
  donner::svg::None ,
  donner::svg::ReadbackMap ,
  donner::svg::QueueIdle ,
  donner::svg::Unknown
}
 Bounded CPU-blocks-on-GPU wait that exceeded its deadline and caused a renderer backend to declare its device lost. More...
enum class  donner::svg::RendererTextureSnapshotBackend : uint8_t {
  Unknown ,
  Geode
}
 Backend type for RendererTextureSnapshot payloads.

Class Documentation

◆ donner::svg::RenderViewport

struct donner::svg::RenderViewport

Describes the viewport for a render pass.

Class Members
double devicePixelRatio = 1.0 Device pixel ratio used to map logical coordinates to device pixels.
Vector2d size = Vector2d::Zero() Logical size in CSS/SVG units after layout.

◆ donner::svg::RendererReadbackStats

struct donner::svg::RendererReadbackStats

Aggregate diagnostics for CPU readbacks completed by a renderer and any offscreen instances that share its backend device, plus the device-health outcome those readbacks observed.

Class Members
int count = 0
bool deviceLost = false True once the backend device has been declared lost. Sticky: a device that hangs never recovers, and a caller whose frame produced nothing has no other evidence to report.
int pollIterations = 0
int timedOutWaitMs = 0 Wall time that wait spent before giving up, in milliseconds. Zero while timedOutWaitSite is GpuWaitTimeoutSite::None.
GpuWaitTimeoutSite timedOutWaitSite = GpuWaitTimeoutSite::None Which bounded wait declared that loss, when a deadline did.
bool usedTimedWaitAny = false

◆ donner::svg::RendererSurfaceBudget::Limits

struct donner::svg::RendererSurfaceBudget::Limits
Class Members
uint64_t bytes = kMaximumBytes
size_t surfaces = kMaximumSurfaces

◆ donner::svg::RendererFilterPreparationBudget::Limits

struct donner::svg::RendererFilterPreparationBudget::Limits
Class Members
size_t graphs = kMaximumGraphs
uint64_t imageBytes = kMaximumImageBytes
uint64_t materializationBytes = kMaximumMaterializationBytes
size_t nodes = kMaximumNodes
uint64_t payloadBytes = kMaximumPayloadBytes
size_t shadowEntities = kMaximumShadowEntities

◆ donner::svg::RendererDrawBudget::Cost

struct donner::svg::RendererDrawBudget::Cost
Class Members
size_t drawCalls = 0
size_t gradientStops = 0
uint64_t imageBytes = 0
size_t imageDraws = 0
size_t pathCommands = 0
size_t pathMeasurementWorkUnits = 0

◆ donner::svg::RendererTextMaterializationBudget::Cost

struct donner::svg::RendererTextMaterializationBudget::Cost
Class Members
uint64_t bytes = 0
size_t commands = 0
size_t decodeWork = 0
size_t points = 0
size_t uniqueOutlines = 0

◆ donner::svg::RendererResourceStats

struct donner::svg::RendererResourceStats

Bounded-resource diagnostics for the most recently started render frame.

Class Members
bool drawBudgetRejected = false
bool drawBudgetSupported = false
size_t drawCalls = 0
bool filterBudgetRejected = false
bool filterBudgetSupported = false
uint64_t filterCaptureBytesReserved = 0
uint64_t filterExecutions = 0
uint64_t filterRetainedBytes = 0
uint64_t filterWorkUnits = 0
bool geometryBudgetRejected = false
bool geometryBudgetSupported = false
size_t geometryDraws = 0
size_t geometryItems = 0
size_t geometryRetainedBytes = 0
size_t gradientStops = 0
uint64_t imageBytes = 0
size_t imageDraws = 0
size_t pathCommands = 0
bool pathMeasurementWorkSupported = false
size_t pathMeasurementWorkUnits = 0
bool surfaceBudgetRejected = false
bool surfaceBudgetSupported = false
uint64_t surfaceBytes = 0
size_t surfaceCount = 0
size_t textGlyphDecodeWork = 0
size_t textGlyphOccurrences = 0
bool textMaterializationBudgetRejected = false
bool textMaterializationBudgetSupported = false
uint64_t textMaterializationBytes = 0
size_t textMaterializationCommands = 0
size_t textMaterializationPoints = 0
size_t textUniqueOutlines = 0

◆ donner::svg::ClipPathShape

struct donner::svg::ClipPathShape

One resolved clip-path shape, owned by the ResolvedClip that holds it.

Unlike PathShape this owns its geometry: a ResolvedClip is copied into render snapshots that outlive the document registry, so it cannot borrow from the source ComputedClipPathsComponent.

Class Members
FillRule fillRule = FillRule::NonZero
int layer = 0 Layer index for boolean combination: paths on the same layer are unioned, layers are intersected.
Transform2d parentFromEntity Transform from clip path child to the clip path's coordinate system.
Path path

◆ donner::svg::PaintParams

struct donner::svg::PaintParams

Paint state derived from resolved style for the current node.

Class Members
Color currentColor = css::Color(css::RGBA()) CurrentColor value for paint server resolution.
bool drawFillComponent = true When paint-order reorders fill and stroke around markers, the driver issues a shape draw per paint component, restricting which of fill/stroke a single drawPath/drawRect/drawEllipse call emits. Defaults to drawing both in the usual fill-then-stroke order.
bool drawStrokeComponent = true
See also
drawFillComponent
ResolvedPaintServer fill = PaintServer::None{}
double fillOpacity = 1.0
double opacity = 1.0 Multiplicative opacity applied to all drawing.
ResolvedPaintServer stroke = PaintServer::None{}
double strokeOpacity = 1.0
StrokeParams strokeParams
Box2d viewBox View box used for unit resolution and gradient coordinate conversion.

◆ donner::svg::ImageParams

struct donner::svg::ImageParams

Parameters describing how an image should be drawn.

Class Members
ImageRendering imageRendering = ImageRendering::Auto Resolved CSS image sampling policy.
bool imageRenderingPixelated = false Legacy source-compatibility switch. New callers set imageRendering.
double opacity = 1.0
EntityHandle sourceEntity Source entity the drawn image was loaded onto. Set by the driver at the drawImage call site. Backends that cache a converted form of the pixels key off this, the same way PathShape::sourceEntity keys converted geometry. A null EntityHandle (the default) means "no associated entity" - non-driver callers leave it null and backends fall back to converting per draw.
Box2d targetRect Destination rectangle in device-independent units.

◆ donner::svg::TextParams

struct donner::svg::TextParams

Parameters describing how text is drawn and outlined.

Class Members
Color fillColor = css::Color(css::RGBA())
span< const FontFace > fontFaces @font-face declarations for custom font resolution.
SmallVector< RcString, 1 > fontFamilies
FontMetrics fontMetrics
Lengthd fontSize
double inlineSizePx = 0.0 SVG2 inline-size measure in pixels. > 0 wraps text to this measure (horizontal only); 0 = no wrapping area.
See also
https://www.w3.org/TR/SVG2/text.html#InlineSizeProperty
LengthAdjust lengthAdjust = LengthAdjust::Default
double letterSpacingPx = 0.0 Extra spacing added after each character (CSS letter-spacing). 0 = normal.
double opacity = 1.0
Color strokeColor = css::Color(css::RGBA())
StrokeParams strokeParams
TextAnchor textAnchor = TextAnchor::Start
TextDecoration textDecoration = TextDecoration::None
optional< Lengthd > textLength If set, stretches or compresses text to fill the given length.
entity textRootEntity = entt::null Entity of the text root element, for cached layout lookup. entt::null if unknown.
Box2d viewBox
double wordSpacingPx = 0.0 Extra spacing added after each word/space character (CSS word-spacing). 0 = normal.
WritingMode writingMode = WritingMode::HorizontalTb CSS writing-mode for this text element. Controls horizontal vs vertical text flow.