|
|
Donner SVG 0.8.0-pre
SVG editor and embeddable C++20 engine.
|
#include <algorithm>#include <cstddef>#include <cstdint>#include <functional>#include <memory>#include <optional>#include <span>#include <vector>#include "donner/base/Box.h"#include "donner/base/EcsRegistry_fwd.h"#include "donner/base/FillRule.h"#include "donner/base/Path.h"#include "donner/base/RcString.h"#include "donner/base/RelativeLengthMetrics.h"#include "donner/base/SmallVector.h"#include "donner/base/Transform.h"#include "donner/base/Utils.h"#include "donner/base/Vector2.h"#include "donner/css/Color.h"#include "donner/css/FontFace.h"#include "donner/svg/components/RenderingInstanceComponent.h"#include "donner/svg/components/filter/FilterEffect.h"#include "donner/svg/components/filter/FilterGraph.h"#include "donner/svg/components/text/ComputedTextComponent.h"#include "donner/svg/core/ImageRendering.h"#include "donner/svg/core/LengthAdjust.h"#include "donner/svg/core/MaskType.h"#include "donner/svg/core/MixBlendMode.h"#include "donner/svg/core/TextAnchor.h"#include "donner/svg/core/TextDecoration.h"#include "donner/svg/core/WritingMode.h"#include "donner/svg/renderer/PixelFormatUtils.h"#include "donner/svg/renderer/StrokeParams.h"#include "donner/svg/resources/ImageResource.h"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. | |
| 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. |
| 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 | |
| struct donner::svg::RendererSurfaceBudget::Limits |
| struct donner::svg::RendererFilterPreparationBudget::Limits |
| struct donner::svg::RendererDrawBudget::Cost |
| struct donner::svg::RendererTextMaterializationBudget::Cost |
| struct donner::svg::RendererResourceStats |
Bounded-resource diagnostics for the most recently started render frame.
| 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 | |
| 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 |
|
| 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. |
| 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. |
| 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. |
| 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. |