#include <cstddef>#include <cstdint>#include <entt/entity/helper.hpp>#include <optional>#include <vector>#include "donner/base/Box.h"#include "donner/base/EcsRegistry.h"#include "donner/base/Transform.h"#include "donner/svg/components/filter/FilterEffect.h"#include "donner/svg/core/ClipPathUnits.h"#include "donner/svg/core/MarkerUnits.h"#include "donner/svg/core/MaskUnits.h"#include "donner/svg/properties/PaintServer.h"Classes | |
| struct | donner::svg::components::SubtreeInfo |
| Created on the start of a subtree, to inform the renderer about which element ends the current subtree, plus how many isolated layers need to be popped when the subtree is complete. More... | |
| struct | donner::svg::components::PaintContextRemap |
| Remap information for a paint inherited through the SVG2 context-fill / context-stroke keywords (https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint). More... | |
| struct | donner::svg::components::PaintResolvedReference |
| Contains rendering information for a paint server, such as the subtree needed if it establishes an isolated layer, and where the paint server is located. More... | |
| struct | donner::svg::components::ResolvedClipPath |
| Contains resolved information about the clip-path property, such as which element it is pointing to. More... | |
| struct | donner::svg::components::ResolvedMask |
| Contains resolved information about the mask property, such as which element it is pointing to. More... | |
| struct | donner::svg::components::ResolvedMarkerLengths |
| Animated marker lengths resolved once against the referencing rendering instance. More... | |
| struct | donner::svg::components::ResolvedMarker |
| Resolved <marker> reference applied to a rendering instance. More... | |
| struct | donner::svg::components::SpanPatternPaint |
| A pattern that a text span's own fill or stroke references, other than the pattern of the instance's own fill or stroke. More... | |
| struct | donner::svg::components::RenderingInstanceComponent |
| An instance of the entity in the rendering tree. 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. | |
| namespace | donner::svg::components |
| Contains the implementation of the Donner ECS,. | |
Typedefs | |
| using | donner::svg::components::ResolvedPaintServer |
| The resolved paint server for a fill or stroke. | |
| using | donner::svg::components::ResolvedFilterEffect = std::variant<std::vector<FilterEffect>, ResolvedReference> |
| The resolved filter effect for a filter. | |
Functions | |
| bool | donner::svg::components::HasPaint (const ResolvedPaintServer &paint) |
| Returns true if the paint server is not a PaintServer::None. | |
| bool | donner::svg::components::IsProvablySamePaint (const ResolvedPaintServer &lhs, const ResolvedPaintServer &rhs) |
| Returns true only when both paints are provably identical: both none, or the same solid color. | |
| std::uint64_t | donner::svg::components::SpanPatternSlotId (std::uint32_t document, int drawOrder, std::size_t index) |
The span pattern slot of entry index of RenderingInstanceComponent::spanPatternPaints for the instance at drawOrder in the document the renderer driver numbers document. | |
| struct donner::svg::components::SubtreeInfo |
Created on the start of a subtree, to inform the renderer about which element ends the current subtree, plus how many isolated layers need to be popped when the subtree is complete.
| Class Members | ||
|---|---|---|
| Entity | firstRenderedEntity | Indicates the first entity within the current subtree. The renderer will continue rendering entities until it reaches this one, then it will pop restorePopDepth isolated layers from the render state. |
| Entity | lastRenderedEntity | Indicates the last entity within the current subtree. The renderer will continue rendering entities until it reaches this one, then it will pop restorePopDepth isolated layers from the render state. |
| int | restorePopDepth = 0 | How many isolated layers to pop after rendering this entity. |
| struct donner::svg::components::PaintContextRemap |
Remap information for a paint inherited through the SVG2 context-fill / context-stroke keywords (https://www.w3.org/TR/SVG2/painting.html#SpecifyingPaint).
The inherited paint server is evaluated in the context element's user space - the <use> element for <use> shadow trees, or the shape referencing a <marker> for marker content: objectBoundingBox paint units resolve against the context element's bounding box, and the resulting paint is transformed into the consuming entity's local space.
| Class Members | ||
|---|---|---|
| Box2d | contextBounds | Bounding box of the context element in its own user space, used to resolve objectBoundingBox paint units. May be empty (e.g. for a zero-size shape), in which case objectBoundingBox context paints fail to instantiate and render nothing. |
| Transform2d | entityFromContextTransform | Maps the context element's user space into the consuming entity's local space. When resolveAtDrawTime is set this value is not yet meaningful - the renderer driver substitutes the concrete per-placement transform before handing the paint to the backend. |
| bool | resolveAtDrawTime = false | True when entityFromContextTransform cannot be precomputed at render-tree instantiation time: the consuming entity lives in a marker's offscreen coordinate space, which is placed at multiple positions (one per path vertex) at draw time. The renderer driver resolves the concrete transform per placement. |
| bool | seededFromStroke = false | For resolveAtDrawTime remaps: identifies which of the referencing shape's paints seeded the context (false = the shape's fill, true = the shape's stroke), so the driver can chain through the shape's own context remap if its paint was itself inherited. |
| struct donner::svg::components::PaintResolvedReference |
Contains rendering information for a paint server, such as the subtree needed if it establishes an isolated layer, and where the paint server is located.
| Class Members | ||
|---|---|---|
| optional< PaintContextRemap > | contextRemap | Set when this paint was inherited through context-fill / context-stroke; carries how to evaluate the paint in the context element's space. See PaintContextRemap. |
| optional< Color > | fallback | Fallback color to use if this paint fails to instantiate. This can happen for various reasons, such as if a gradient has no stops (making it invalid). |
| ResolvedReference | reference | Reference to the paint server element. |
| optional< SubtreeInfo > | subtreeInfo | If this paint server creates a subtree, such as for patterns, contains subtree info to inform the renderer how to render it. |
| struct donner::svg::components::ResolvedMarkerLengths |
Animated marker lengths resolved once against the referencing rendering instance.
| Class Members | ||
|---|---|---|
| double | height = 0 | Marker viewport height in user units. |
| double | refX = 0 | Reference X coordinate in the marker's chosen percentage space. |
| double | refY = 0 | Reference Y coordinate in the marker's chosen percentage space. |
| double | width = 0 | Marker viewport width in user units. |
| struct donner::svg::components::SpanPatternPaint |
A pattern that a text span's own fill or stroke references, other than the pattern of the instance's own fill or stroke.
Before the instance draws its text, the driver renders the pattern's tile into the span pattern slot named by its index in RenderingInstanceComponent::spanPatternPaints.
| Class Members | ||
|---|---|---|
| bool | forStroke = false | True for a span's stroke, false for its fill. |
| PaintResolvedReference | reference | The pattern, with the tile content it renders. |