|
|
Donner SVG 0.8.0-pre
SVG editor and embeddable C++20 engine.
|
Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css. More...
Namespaces | |
| namespace | parser |
| Parsers for shared data types such as NumberParser and LengthParser. | |
| namespace | css |
| Donner CSS library, a standalone composable CSS parser. | |
| namespace | svg |
| Donner SVG library, which can load, manipulate and render SVG files. | |
| namespace | xml |
| XML parsing and document model support, top-level objects are donner::xml::XMLParser and donner::xml::XMLDocument. | |
Classes | |
| struct | FrameSuspendTotals |
| Suspend totals accumulated between BeginSuspendFrame and EndSuspendFrame on the calling thread. More... | |
| class | ScopedSuspendPoint |
| Brackets one call that may suspend the wasm stack under ASYNCIFY. More... | |
| struct | Box2 |
| A 2D axis-aligned bounding box. More... | |
| class | ChunkedString |
| ChunkedString is a small helper to accumulate multiple RcStringOrRef pieces, either as small appended fragments or single codepoints. More... | |
| struct | CompileTimeMapTables |
| Perfect-hash metadata used to resolve keys into storage slots. More... | |
| struct | CompileTimeMapDiagnostics |
| Diagnostics describing how a CompileTimeMap was constructed. More... | |
| class | CompileTimeMap |
| Compile-time associative container backed by a perfect hash layout. More... | |
| class | DiagnosticRenderer |
| Renders diagnostic messages with source context and caret/tilde indicators, similar to clang/rustc output. More... | |
| class | ElementTraversalGenerator |
| Selectors may need to traverse the tree in different ways to match, and this is abstracted away using C++20 coroutines. More... | |
| class | Decompress |
| A utility class for decompressing data. More... | |
| struct | FileOffset |
| Error context for a failed parse, such as the error reason, line, and character offset. More... | |
| struct | SourceRange |
| Holds a selection range for a region in the source text, as a half-open interval [start, end). More... | |
| struct | AllocTagTotals |
| Live large-block bytes attributed to each AllocTag. More... | |
| class | ScopedAllocTag |
| Sets the calling thread's AllocTag for the lifetime of the scope, restoring the previous one on exit so guards nest. More... | |
| struct | HeapSizeHistogram |
| Live allocation totals split by block size. More... | |
| struct | Length |
| Parses a CSS <length-percentage> type as defined by https://www.w3.org/TR/css-values-3/#typedef-length-percentage. More... | |
| struct | MathConstants |
| Contains a set of math constants for the specified type (float or double). More... | |
| struct | MathConstants< float > |
| Math constants for float. More... | |
| struct | MathConstants< double > |
| Math constants for double. More... | |
| struct | QuadraticSolution |
| Holds the solution of a quadratic equation, as returned by SolveQuadratic. More... | |
| struct | MemoryAttributionSample |
| One frame's view of where the process's bytes are. More... | |
| struct | MemoryStageSample |
| Net allocator movement attributed to each stage. More... | |
| class | ScopedHeapDelta |
| Brackets one stage of the frame and attributes the allocator movement across it. More... | |
| class | OptionalRef |
| A class that simulates an optional reference to a constant object of type T. More... | |
| struct | ParseDiagnostic |
| A diagnostic message from a parser, with severity, source range, and human-readable reason. More... | |
| class | ParseResult |
| A parser result, which may contain a result of type T, or an error, or both. More... | |
| class | ParseWarningSink |
| Collects parse warnings during parsing. More... | |
| struct | StrokeStyle |
| Parameters for converting a stroked path to a filled outline. More... | |
| class | Path |
| Immutable 2D vector path. More... | |
| class | PathBuilder |
| Mutable builder for constructing immutable Path objects. More... | |
| struct | PathBooleanInput |
| One filled path participating in a boolean operation. More... | |
| struct | PathBooleanOptions |
| Limits and tolerances for bounded boolean operations. More... | |
| struct | PathBooleanResult |
| Result of ApplyPathBoolean. More... | |
| class | RcString |
| A reference counted string, that is copy-on-write and implements the small-string optimization. More... | |
| class | RcStringOrRef |
| An in-transit type that can hold either an RcString or std::string_view, to enable transferring the RcString reference or also accepting a non-owning std::string_view from API surfaces. More... | |
| struct | FontMetrics |
| A container for font information relevant for computing font-relative lengths, per https://www.w3.org/TR/css-values/#font-relative-lengths. More... | |
| struct | AbsoluteLengthMetrics |
| A container with ratios for converting absolute lengths, such as "cm" or "in", see https://www.w3.org/TR/css-values/#absolute-lengths. More... | |
| class | SmallVector |
| A vector with small-size optimization. More... | |
| struct | CaseInsensitiveCharTraits |
| Type traits for case-insensitive string comparison, usable with algorithms that accept an STL std::char_traits. More... | |
| class | StringUtils |
| A collection of string utils, such as case-insensitive comparison and StartsWith/EndsWith. More... | |
| struct | Transform2 |
| A 2D matrix representing an affine transformation. More... | |
| class | Utf8 |
| Utility class for working with UTF-8 encoded strings. More... | |
| struct | Vector2 |
| A 2D vector, (x, y). More... | |
Concepts | |
| concept | ElementLike |
| Concept for types that can be matched against a selector, such as a donner::svg::SVGElement. | |
| concept | StringLike |
| A concept for types that are string-like, i.e. | |
Typedefs | |
| using | Entity = entt::entity |
Entity type for the Registry, a std::uint32_t alias. | |
| using | Registry = entt::basic_registry<Entity> |
| Registry type for the SVG ECS, which is the entry point for storing all data. | |
| using | EntityHandle = entt::basic_handle<Registry> |
| Convenience handle for a Entity with an attached Registry. | |
| using | FileReadResult = std::variant<std::string, FileReadError> |
| Contents or failure from a bounded file read. | |
| using | Lengthd = Length<double> |
| Shorthand for Length<double>. | |
Typedefs | |
| using | Box2d = Box2<double> |
| Shorthand for Box2<double>. | |
| using | Transform2f = Transform2<float> |
Shorthand for Transform2<float>. | |
| using | Transform2d = Transform2<double> |
Shorthand for Transform2<double>. | |
| using | Vector2f = Vector2<float> |
Shorthand for Vector2<float>. | |
| using | Vector2d = Vector2<double> |
Shorthand for Vector2<double>. | |
| using | Vector2i = Vector2<int> |
Shorthand for Vector2<int>. | |
Enumerations | |
| enum class | SuspendKind : std::uint8_t { TileYield = 0 , GpuReadback = 1 , DeviceWait = 2 , Startup = 3 } |
| Why a call site can suspend. Kept small and stable: it is published to the stats surface as an array index. More... | |
| enum class | CompileTimeMapStatus { kOk , kUsingFallbackHash , kDuplicateKey , kSeedSearchFailed , kConstexprHashUnsupported } |
| Indicates the result of building a CompileTimeMap. More... | |
| enum class | FileReadError { OpenFailed , TooLarge , ReadFailed } |
| Failure returned by ReadFileBounded. | |
| enum class | FillRule : uint8_t { NonZero , EvenOdd } |
| The parsed result of the 'fill-rule' property, see: https://www.w3.org/TR/SVG2/painting.html#FillRuleProperty. More... | |
| enum class | AllocTag : std::uint8_t { Untagged = 0 , WorkerRenderFrame = 1 , WorkerBuildPreview = 2 , WorkerFinalSnapshot = 3 , WorkerOther = 4 , AppPollResult = 5 , AppUiFrame = 6 , AppHostFrame = 7 , AppInput = 8 , RenderTileRaster = 9 , GpuReadbackStaging = 10 , CompositorBitmap = 11 , PresentationUpload = 12 , ImGuiDrawLists = 13 } |
| Who was on the stack when a large block was allocated. More... | |
| enum class | LengthUnit : uint8_t { None , Percent , Cm , Mm , Q , In , Pc , Pt , Px , Em , Ex , Ch , Rem , Vw , Vh , Vmin , Vmax } |
| The unit identifier for a length, corresponding to CSS unit identifiers. More... | |
| enum class | MemoryCategory : std::uint8_t { CompositorSegmentBitmaps = 0 , CompositorSegmentTextures = 1 , CompositorLayerBitmaps = 2 , CompositorLayerTextures = 3 , RenderResultTiles = 4 , WorkerFrameSnapshot = 5 , PresentationTiles = 6 , PresentationOverviewTiles = 7 , PresentationRetired = 8 , LayerThumbnails = 9 } |
| A subsystem that retains or allocates pixel-scale memory. Kept small and stable: values are published to the stats surface as array indices. More... | |
| enum class | MemoryStage : std::uint8_t { WorkerRenderFrame = 0 , WorkerBuildPreview = 1 , WorkerFinalSnapshot = 2 , WorkerOther = 3 , AppPollResult = 4 , AppUiFrame = 5 , AppHostFrame = 6 , AppInput = 7 } |
| A bracketed stage of the frame, measured by what it does to the allocator rather than by what a subsystem says it holds. More... | |
| enum class | DiagnosticSeverity : uint8_t { Warning , Error } |
| Severity level for a parser diagnostic. More... | |
| enum class | LineCap : uint8_t { Butt , Round , Square } |
| Line cap style for stroke endpoints. More... | |
| enum class | LineJoin : uint8_t { Miter , Round , Bevel } |
| Line join style for stroke corners. More... | |
| enum class | PathBooleanOp : std::uint8_t { Union , Intersect , Difference , Xor } |
| Boolean operation to apply to filled path inputs. More... | |
| enum class | PathBooleanStatus : std::uint8_t { Ok , EmptyResult , InvalidInput , TooComplex } |
| Status for a path boolean result. More... | |
| enum class | StringComparison : uint8_t { Default , IgnoreCase } |
| String comparison options, e.g. case sensitivity. More... | |
Functions | |
| void | BeginSuspendFrame () |
| Start a new attribution window on the calling thread, discarding whatever was accumulated since the previous EndSuspendFrame. | |
| FrameSuspendTotals | EndSuspendFrame () |
| Close the attribution window opened by BeginSuspendFrame and return what it accumulated. Safe to call without a matching begin; the totals are then everything since the thread's last reset. | |
| FrameSuspendTotals | PeekSuspendFrame () |
| Read the current window's totals without closing it. | |
| FrameSuspendTotals | LifetimeSuspendTotals () |
| Lifetime totals for the calling thread, never reset by frame boundaries. Used by the boot report, where there is no frame to attribute against. | |
| Vector2d | EvalQuadratic (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2, double t) |
Evaluate a quadratic Bezier curve at parameter t using the standard basis expansion. | |
| Vector2d | EvalCubic (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2, const Vector2d &p3, double t) |
Evaluate a cubic Bezier curve at parameter t using the standard basis expansion. | |
| std::pair< std::array< Vector2d, 3 >, std::array< Vector2d, 3 > > | SplitQuadratic (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2, double t) |
Split a quadratic Bezier curve at parameter t using De Casteljau subdivision. | |
| std::pair< std::array< Vector2d, 4 >, std::array< Vector2d, 4 > > | SplitCubic (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2, const Vector2d &p3, double t) |
Split a cubic Bezier curve at parameter t using De Casteljau subdivision. | |
| void | ApproximateCubicWithQuadratics (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2, const Vector2d &p3, double tolerance, std::vector< Vector2d > &out) |
| Approximate a cubic Bezier curve as a sequence of quadratic Bezier curves within a given tolerance. | |
| bool | ApproximateCubicWithQuadratics (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2, const Vector2d &p3, double tolerance, std::size_t maximumOutputPoints, std::vector< Vector2d > &out) |
| Bounded variant of ApproximateCubicWithQuadratics. | |
| SmallVector< double, 1 > | QuadraticYExtrema (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2) |
| Find parameter values where the Y-derivative is zero for a quadratic Bezier curve. | |
| SmallVector< double, 1 > | QuadraticXExtrema (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2) |
| Find parameter values where the X-derivative is zero for a quadratic Bezier curve. | |
| SmallVector< double, 2 > | CubicYExtrema (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2, const Vector2d &p3) |
| Find parameter values where the Y-derivative is zero for a cubic Bezier curve. | |
| SmallVector< double, 2 > | CubicXExtrema (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2, const Vector2d &p3) |
| Find parameter values where the X-derivative is zero for a cubic Bezier curve. | |
| Box2d | QuadraticBounds (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2) |
| Compute the tight axis-aligned bounding box of a quadratic Bezier curve. | |
| Box2d | CubicBounds (const Vector2d &p0, const Vector2d &p1, const Vector2d &p2, const Vector2d &p3) |
| Compute the tight axis-aligned bounding box of a cubic Bezier curve. | |
| constexpr uint64_t | mixHash (uint64_t baseHash, std::uint32_t seed) |
| Mix a base hash value with a seed to produce a new hash. Used to construct perfect-hash bucket seeds during CompileTimeMap construction. | |
| template<typename Key> | |
| constexpr bool | supportsConstexprHash () |
| Returns true when the provided key type can be hashed in a constexpr context by constexprHashValue. | |
| template<typename Key> | |
| constexpr uint64_t | constexprHashValue (const Key &key) |
Compute a constexpr-friendly hash of key for supported key types. | |
| template<typename Key, std::size_t N, typename KeyEqual> | |
| constexpr bool | hasDuplicateKeys (const std::array< Key, N > &keys, KeyEqual keyEqual) |
| Returns true when the provided keys contain duplicates. | |
| auto | operator<=> (Entity lhs, Entity rhs) |
| Compare two Entity values. | |
| template<ElementLike T> | |
| ElementTraversalGenerator< T > | singleElementGenerator (T element) |
| A generator that yields a single element, if it exists. | |
| template<ElementLike T> | |
| ElementTraversalGenerator< T > | parentsGenerator (T element) |
| A generator that yields all parents of an element, repeatedly following parentElement() until reaching the root. | |
| template<ElementLike T> | |
| ElementTraversalGenerator< T > | previousSiblingsGenerator (T element) |
| A generator that yields all siblings of an element, in reverse order. | |
| template<ElementLike T> | |
| ElementTraversalGenerator< T > | allChildrenRecursiveGenerator (T element) |
| A generator that yields all children of an element recursively with pre-order traversal. | |
| ParseResult< std::vector< uint8_t > > | DecodeBase64Data (std::string_view base64String) |
| Decode a base64-encoded string into a byte array. | |
| std::string | EncodeBase64Data (std::span< const uint8_t > data) |
| Encode a byte array into a base64-encoded string. | |
| std::vector< uint8_t > | UrlDecode (std::string_view urlEncodedString) |
| Decode a URL-encoded string into a byte array, translating XX sequences into the corresponding byte value. | |
| void | InstallFailureSignalHandler () |
| Install signal handlers for crash signals (SIGSEGV, SIGABRT, SIGFPE, SIGILL, SIGBUS, SIGTRAP). | |
| FileReadResult | ReadFileBounded (const std::filesystem::path &path, size_t maximumSize) |
Open and read a regular file without allocating more than maximumSize bytes. | |
| const char * | FileReadErrorMessage (FileReadError error) |
Human-readable description for error. | |
| std::ostream & | operator<< (std::ostream &os, FillRule value) |
| Ostream output operator for FillRule enum, outputs the CSS value. | |
| const char * | AllocTagName (AllocTag tag) |
| Stable short names for AllocTag, indexed by the enum value. | |
| AllocTagTotals | SampleAllocTagTotals () |
| Read the per-tag live large-block totals. | |
| HeapSizeHistogram | SampleHeapSizeHistogram () |
| Read the histogram. Cheap: a load per bucket. | |
| bool | HeapSizeHistogramEnabled () |
| Whether the allocator wrappers are linked in. False in shipping builds. | |
| std::ostream & | operator<< (std::ostream &os, LengthUnit unit) |
| OStream output operator, writes the CSS unit identifier to the stream, e.g. % or px. | |
| float | NarrowToFloat (double from) |
| Semantically represent a narrowing conversion, such as converting a double to a float, to make the conversion more visible. | |
| template<typename T> | |
| const T & | Min (const T &a, const T &b) |
| Returns minimum of the provided values. | |
| template<typename T, typename... Args> | |
| const T & | Min (const T &a, const T &b, Args &&... args) |
| Returns minimum of the provided values. | |
| template<typename T> | |
| const T & | Max (const T &a, const T &b) |
| Returns maximum of the provided values. | |
| template<typename T, typename... Args> | |
| const T & | Max (const T &a, const T &b, Args &&... args) |
| Returns maximum of the provided values. | |
| float | Abs (float a) |
| Returns the absolute value of the number. | |
| double | Abs (double a) |
| Returns the absolute value of the number. | |
| template<typename T, typename = std::enable_if<std::is_integral<T>::value && std::is_signed<T>::value>> | |
| T | Abs (T a) |
| Returns the absolute value of the number. | |
| template<typename T, typename = std::enable_if<std::is_floating_point<T>::value>> | |
| T | Round (T orig) |
| Round a floating point value to an integer. | |
| template<typename T> | |
| T | Lerp (T a, T b, const float t) |
| Returns linear interpolation of a and b with ratio t. | |
| template<typename T> | |
| const T | Clamp (T value, T low, T high) |
| Clamps a value between low and high. | |
| template<typename T> | |
| bool | NearEquals (T a, T b, T tolerance=std::numeric_limits< T >::epsilon()) |
| Returns if a equals b, taking possible rounding errors into account. | |
| template<typename T> | |
| bool | NearZero (T a, T tolerance=std::numeric_limits< T >::epsilon()) |
| Returns if a equals zero, taking rounding errors into account. | |
| template<typename T, typename = std::enable_if<std::is_integral<T>::value>> | |
| bool | InRange (T var, T start, T end) |
| Test if a variable is in a specific range, using an optimized technique that requires only one branch. | |
| template<typename T> | |
| QuadraticSolution< T > | SolveQuadratic (T a, T b, T c) |
| Solve a quadratic equation. | |
| const char * | MemoryCategoryName (MemoryCategory category) |
| Stable short names for MemoryCategory, indexed by the enum value. Used as the key set of the published stats object so a reader does not have to keep an index table in sync. | |
| void | SetRetainedBytes (MemoryCategory category, std::uint64_t bytes) |
Publish bytes as the current retained total for category, replacing whatever the category last published. | |
| void | SetEntryCount (MemoryCategory category, std::uint64_t count) |
Publish count as the current live object count for category. | |
| void | AddTransientBytes (MemoryCategory category, std::uint64_t bytes) |
Add bytes to the frame's allocation flow for category. | |
| MemoryAttributionSample | SampleMemoryAttribution () |
| Read every counter, fold the per-frame flows into their high waters, and open a new frame window. Call once per frame from the publishing thread. | |
| MemoryAttributionSample | PeekMemoryAttribution () |
| Read every counter without closing the frame window. | |
| const char * | MemoryStageName (MemoryStage stage) |
| Stable short names for MemoryStage, indexed by the enum value. | |
| MemoryStageSample | SampleMemoryStages () |
| Read the stage counters and open a new frame window for them. | |
| AllocTag | AllocTagForStage (MemoryStage stage) |
The AllocTag that names the same part of the frame as stage, so a stage bracket and a large-block tag never disagree about what to call it. | |
| std::ostream & | operator<< (std::ostream &os, DiagnosticSeverity severity) |
| Ostream output operator for DiagnosticSeverity. | |
| std::ostream & | operator<< (std::ostream &os, LineCap cap) |
| Ostream output operator for LineCap. | |
| std::ostream & | operator<< (std::ostream &os, LineJoin join) |
| Ostream output operator for LineJoin. | |
| PathBooleanResult | ApplyPathBoolean (PathBooleanOp op, std::span< const PathBooleanInput > inputs, const PathBooleanOptions &options={}) |
| Apply a filled path boolean operation. | |
| std::string | EscapeTerminalText (std::string_view text, bool preserveNewlines=false) |
| Escape untrusted bytes and terminal format controls while preserving printable UTF-8. | |
| RcString | toSVGTransformString (const Transform2d &transform) |
| Serialize a Transform2d to its canonical SVG transform attribute text, decomposing to the simplest form when possible: | |
Variables | |
| constexpr std::size_t | kSuspendKindCount = 4 |
| Number of distinct SuspendKind values. | |
| constexpr std::size_t | kHeapSizeBucketCount = 32 |
| Number of power-of-two size buckets. Bucket k covers [2^k, 2^(k+1)) bytes, so 32 buckets reach 2 GiB, past anything a 512 MiB wasm heap can hold. | |
| constexpr std::size_t | kLargeAllocationBytes = 4u * 1024u * 1024u |
| Requested byte size at or above which an allocation is recorded in HeapSizeHistogram::recentLargeBytes. Chosen to catch anything canvas-scale while ignoring ordinary containers. | |
| constexpr std::size_t | kRecentLargeAllocationCount = 16 |
| Number of recent large allocation sizes retained. | |
| constexpr std::size_t | kLiveLargeBlockCount = 48 |
| Capacity of the live large-block table. | |
| constexpr std::size_t | kAllocTagCount = 14 |
| Number of distinct AllocTag values. | |
| constexpr std::size_t | kMemoryCategoryCount = 10 |
| Number of distinct MemoryCategory values. | |
| constexpr std::size_t | kMemoryStageCount = 8 |
| Number of distinct MemoryStage values. | |
Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.
| struct donner::FrameSuspendTotals |
Suspend totals accumulated between BeginSuspendFrame and EndSuspendFrame on the calling thread.
| Class Members | ||
|---|---|---|
| uint32_t | count = 0 | Suspend points entered during the frame. |
| uint32_t | countByKind[kSuspendKindCount] = {} | Per-kind entry counts, indexed by SuspendKind. |
| double | longestMs = 0.0 | Longest single suspend during the frame, in milliseconds. |
| double | msByKind[kSuspendKindCount] = {} | Per-kind wall time in milliseconds, indexed by SuspendKind. |
| double | totalMs = 0.0 | Summed wall time inside those suspend points, in milliseconds. |
| struct donner::CompileTimeMapTables |
Perfect-hash metadata used to resolve keys into storage slots.
| struct donner::CompileTimeMapDiagnostics |
Diagnostics describing how a CompileTimeMap was constructed.
| struct donner::AllocTagTotals |
Live large-block bytes attributed to each AllocTag.
| Class Members | ||
|---|---|---|
| int64_t | liveBlocks[kAllocTagCount] = {} | Live large blocks tagged with this value. |
| int64_t | liveBytes[kAllocTagCount] = {} | Bytes in live large blocks tagged with this value. |
| int64_t | peakLiveBytes[kAllocTagCount] = {} | Highest liveBytes seen for this tag. |
| int64_t | totalAllocations[kAllocTagCount] = {} | Large allocations ever made under this tag. |
| struct donner::HeapSizeHistogram |
Live allocation totals split by block size.
| Class Members | ||
|---|---|---|
| int64_t | largeAllocationCount = 0 | Total large allocations seen since boot. |
| int64_t | liveBlocks[kHeapSizeBucketCount] = {} | Currently allocated block count in each bucket. |
| int64_t | liveBytes[kHeapSizeBucketCount] = {} | Currently allocated bytes in each bucket, measured as usable size. |
| int64_t | liveLargeBytes[kLiveLargeBlockCount] = {} | Usable sizes of the large blocks that are live right now; zero entries are empty slots. |
| int64_t | liveLargeTags[kLiveLargeBlockCount] = {} | AllocTag in force when the corresponding liveLargeBytes entry was allocated, as its integer value. |
| int64_t | peakLiveBytes[kHeapSizeBucketCount] = {} | Highest liveBytes seen in each bucket. |
| int64_t | recentLargeBytes[kRecentLargeAllocationCount] = {} | Requested sizes of the most recent large allocations, newest last. A bucket says a block is "16 to 32 MiB"; this says it is exactly 19,120,128 bytes, which is a 2186-pixel-wide RGBA surface and therefore identifies its owner by arithmetic instead of by guesswork. |
| int64_t | tableOverflows = 0 | Large allocations that found the live-block table full. Non-zero means the per-tag totals under-count and kLiveLargeBlockCount needs raising. |
| struct donner::MathConstants |
Contains a set of math constants for the specified type (float or double).
| T |
| struct donner::QuadraticSolution |
Holds the solution of a quadratic equation, as returned by SolveQuadratic.
| T |
| Class Members | ||
|---|---|---|
| bool | hasSolution = false | True if the equation has solutions. |
| array< T, 2 > | solution | Solutions to the equation, valid if hasSolution is true. |
| struct donner::MemoryAttributionSample |
One frame's view of where the process's bytes are.
| Class Members | ||
|---|---|---|
| uint64_t | entryCounts[kMemoryCategoryCount] = {} | Live object count per category (textures, tiles), where the owner tracks one. |
| uint64_t | mallocArenaBytes = 0 | Total space the allocator has taken from the system, from mallinfo. |
| uint64_t | mallocFreeBytes = 0 | Bytes in the allocator's free lists, from mallinfo. |
| uint64_t | mallocLiveBytes = 0 | Bytes in allocated malloc blocks, from mallinfo; 0 where unavailable. |
| uint64_t | mallocLiveHighWaterBytes = 0 | Highest mallocLiveBytes seen since boot. |
| uint64_t | retainedBytes[kMemoryCategoryCount] = {} | Current retained bytes per category, indexed by MemoryCategory. |
| uint64_t | retainedHighWaterBytes[kMemoryCategoryCount] = {} | Highest retainedBytes seen since boot, per category. |
| uint64_t | totalRetainedBytes = 0 | Sum of retainedBytes across categories. |
| uint64_t | totalRetainedHighWaterBytes = 0 | Highest totalRetainedBytes seen since boot. |
| uint64_t | transientBytes[kMemoryCategoryCount] = {} | Bytes allocated during the frame just closed, per category. |
| uint64_t | transientHighWaterBytes[kMemoryCategoryCount] = {} | Highest single-frame transientBytes seen since boot, per category. |
| uint64_t | wasmHeapBytes = 0 | wasm linear memory size in bytes; 0 where the platform has no such notion. |
| uint64_t | wasmHeapHighWaterBytes = 0 | Highest wasmHeapBytes seen since boot. |
| struct donner::MemoryStageSample |
Net allocator movement attributed to each stage.
| Class Members | ||
|---|---|---|
| int64_t | cumulativeNetBytes[kMemoryStageCount] = {} | Net live-heap change since boot, per stage. A stage that is in balance hovers near zero however long the session runs; a stage that retains climbs without bound, and this is the number that names it. |
| uint64_t | entries[kMemoryStageCount] = {} | Times the stage was entered since boot. |
| int64_t | maxNetBytes[kMemoryStageCount] = {} | Largest single-entry net growth seen for the stage, in bytes. |
| int64_t | netBytes[kMemoryStageCount] = {} | Net live-heap change during the frame just closed, per stage. Negative means the stage freed more than it allocated. |
| struct donner::PathBooleanInput |
One filled path participating in a boolean operation.
| Class Members | ||
|---|---|---|
| FillRule | fillRule = FillRule::NonZero | Fill rule for path. |
| Transform2d | outputFromPath = Transform2d() | Transform into output coordinates. |
| Path | path | Source path geometry. |
| struct donner::PathBooleanOptions |
Limits and tolerances for bounded boolean operations.
| struct donner::PathBooleanResult |
Result of ApplyPathBoolean.
| Class Members | ||
|---|---|---|
| vector< string > | diagnostics | Compact diagnostic messages. |
| vector< Path > | paths | Output paths on success. |
| PathBooleanStatus | status = PathBooleanStatus::Ok | Operation status. |
| using donner::Entity = entt::entity |
| typedef entt::basic_handle< Registry > donner::EntityHandle = entt::basic_handle<Registry> |
Convenience handle for a Entity with an attached Registry.
Forward declaration of EntityHandle.
Allows calling functions typically on Registry without having to pass around two values.
| typedef entt::basic_registry< Entity > donner::Registry = entt::basic_registry<Entity> |
Registry type for the SVG ECS, which is the entry point for storing all data.
Forward declaration of Registry.
It is used to create new entities:
Attach or remove data classes to entities:
Store global objects (singleton-like):
|
strong |
Who was on the stack when a large block was allocated.
A size histogram says "four blocks of about 19 MiB are live"; it cannot say who holds them, and a category counter cannot either, because the whole point of an unattributed block is that no subsystem is counting it. This closes that gap without a backtrace: a thread-local tag, pushed by a scope guard around the candidate call sites and by the frame-stage brackets, is stored alongside every live large block. It costs one thread-local store per guard and one extra field per tracked block, and it works in an optimized wasm build where return addresses do not symbolize.
|
strong |
Indicates the result of building a CompileTimeMap.
|
strong |
|
strong |
The parsed result of the 'fill-rule' property, see: https://www.w3.org/TR/SVG2/painting.html#FillRuleProperty.
|
strong |
The unit identifier for a length, corresponding to CSS unit identifiers.
See https://www.w3.org/TR/css-values-3/#lengths for definitions.
|
strong |
|
strong |
|
strong |
A subsystem that retains or allocates pixel-scale memory. Kept small and stable: values are published to the stats surface as array indices.
|
strong |
A bracketed stage of the frame, measured by what it does to the allocator rather than by what a subsystem says it holds.
The category counters above only see memory a subsystem knows it owns. When live heap grows and no category moves, the bytes are somewhere no owner is reporting - a backend's staging buffer, a queue, a container nobody thought of - and the only way to find them is to ask which part of the frame the allocator grew during. These stages partition the frame so that question has an answer.
|
strong |
|
strong |
|
strong |
|
strong |
Why a call site can suspend. Kept small and stable: it is published to the stats surface as an array index.
| PathBooleanResult donner::ApplyPathBoolean | ( | PathBooleanOp | op, |
| std::span< const PathBooleanInput > | inputs, | ||
| const PathBooleanOptions & | options = {} ) |
Apply a filled path boolean operation.
The implementation is in-tree and preserves line, quadratic, and cubic segments for retained boundary spans. It is intentionally bounded: invalid inputs or operations exceeding configured caps return a non-PathBooleanStatus::Ok status instead of mutating caller state.
| op | Boolean operation to apply. |
| inputs | Filled path inputs in operation order. |
| options | Tolerances and complexity caps. |
|
constexpr |
Compute a constexpr-friendly hash of key for supported key types.
Returns uint64_t to ensure consistent hashing on both 32-bit and 64-bit platforms.
| ParseResult< std::vector< uint8_t > > donner::DecodeBase64Data | ( | std::string_view | base64String | ) |
Decode a base64-encoded string into a byte array.
If the string is not valid base64, an error is returned.
| base64String | The base64-encoded string to decode. |
| std::string donner::EncodeBase64Data | ( | std::span< const uint8_t > | data | ) |
Encode a byte array into a base64-encoded string.
| data | The byte array to encode. |
|
inline |
Test if a variable is in a specific range, using an optimized technique that requires only one branch.
Some compilers do this automatically.
Example:
| void donner::InstallFailureSignalHandler | ( | ) |
Install signal handlers for crash signals (SIGSEGV, SIGABRT, SIGFPE, SIGILL, SIGBUS, SIGTRAP).
When a crash signal is received, the handler prints a stack trace to stderr and then re-raises the signal so the default handler can produce a core dump.
|
inline |
Returns linear interpolation of a and b with ratio t.
|
constexpr |
Mix a base hash value with a seed to produce a new hash. Used to construct perfect-hash bucket seeds during CompileTimeMap construction.
Uses uint64_t explicitly to ensure correct behavior on 32-bit platforms (e.g., WASM) where std::size_t is 32 bits and the >> 33 shift would be undefined behavior.
|
inline |
Semantically represent a narrowing conversion, such as converting a double to a float, to make the conversion more visible.
For example: const float f = NarrowToFloat(1.0);
| ElementTraversalGenerator< T > donner::parentsGenerator | ( | T | element | ) |
A generator that yields all parents of an element, repeatedly following parentElement() until reaching the root.
| element | The element to start from, which is not yielded. |
| ElementTraversalGenerator< T > donner::previousSiblingsGenerator | ( | T | element | ) |
A generator that yields all siblings of an element, in reverse order.
This repeatedly follows previousSibling().
| element | The element to start from, which is not yielded. |
| FileReadResult donner::ReadFileBounded | ( | const std::filesystem::path & | path, |
| size_t | maximumSize ) |
Open and read a regular file without allocating more than maximumSize bytes.
The read uses a nonblocking descriptor or handle, follows the requested final symlink, and validates the opened object as a regular file. It fails closed for directories, FIFOs, devices, size changes, and data beyond the expected byte count.
| path | File to read. |
| maximumSize | Maximum accepted byte count. |
| ElementTraversalGenerator< T > donner::singleElementGenerator | ( | T | element | ) |
A generator that yields a single element, if it exists.
| element | The element to yield. If this is std::nullopt, the generator will yield nothing. |
| QuadraticSolution< T > donner::SolveQuadratic | ( | T | a, |
| T | b, | ||
| T | c ) |
Solve a quadratic equation.
\( a x^2 + b x + c = 0 \)
| a | First coefficient. |
| b | Second coefficient. |
| c | Third coefficient. |
| RcString donner::toSVGTransformString | ( | const Transform2d & | transform | ) |
Serialize a Transform2d to its canonical SVG transform attribute text, decomposing to the simplest form when possible:
Numbers are emitted via {} (integer-valued doubles) or {:g} (fractional) so the output is the shortest form that round-trips. Arguments are comma-separated with a space after the comma, matching the canonical CSS transform syntax.
Round-trips with donner::svg::parser::TransformParser::Parse for every shape above.
| transform | Transform to serialize. |
| std::vector< uint8_t > donner::UrlDecode | ( | std::string_view | urlEncodedString | ) |
Decode a URL-encoded string into a byte array, translating XX sequences into the corresponding byte value.
| urlEncodedString | The URL-encoded string to decode. |