|
|
Donner SVG 0.8.0-pre
SVG editor and embeddable C++20 engine.
|
Per-shape retained rasterization for the tiny-skia backend. More...
#include <cstdint>#include <optional>#include "donner/base/EcsRegistry.h"#include "donner/base/FillRule.h"#include "donner/base/Transform.h"#include "tiny_skia/Geom.h"#include "tiny_skia/Paint.h"#include "tiny_skia/SpanCapture.h"#include "tiny_skia/Stroke.h"Classes | |
| struct | donner::svg::RetainedSpanKey |
| Everything a captured blit sequence depends on, besides the shape's geometry. More... | |
| struct | donner::svg::RetainedSpanSlot |
| One retained fill or stroke pass of one shape. More... | |
| struct | donner::svg::RetainedSpansComponent |
| Retained rasterization output for one shape, attached to the entity its geometry came from. More... | |
| struct | donner::svg::RetainedSpanDocumentState |
| Document-wide state for retained coverage, stored in the registry context. More... | |
| struct | donner::svg::RetainedSpanStats |
| Counters describing what a renderer's retained coverage did, for tests and benchmarks. 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. | |
Functions | |
| std::size_t | donner::svg::RetainedEntryBytes (const RetainedSpansComponent &entry) |
| Returns everything an entry holds: recorded coverage, the paints kept beside it, and the entry itself. | |
| void | donner::svg::EnsureRetainedSpanInvalidationWired (Registry ®istry) |
| Connects the resolved-path invalidation listener to registry, once per registry. | |
| RetainedSpanDocumentState & | donner::svg::RetainedSpanStateFor (Registry ®istry, std::size_t budgetBytes) |
| Returns the document's retained-coverage state, creating it if needed. | |
| void | donner::svg::ClearRetainedSpans (Registry ®istry) |
| Drops every retained entry in registry and resets its accounting. | |
| void | donner::svg::EvictRetainedSpansToBudget (Registry ®istry, std::uint64_t currentFrame) |
| Evicts the coldest entries until the document is under budget. | |
Per-shape retained rasterization for the tiny-skia backend.
Scan conversion is the expensive half of a shape draw, and its whole pixel effect is the sequence of blit calls it makes. Recording that sequence once and replaying it on later frames turns an unchanged shape into a blit-only draw. This file owns the storage for those recordings, the key that decides whether a recording still describes the draw the renderer is about to make, and the memory bound on how much a document may keep.
The correctness rule is one-directional: a recording may be discarded for any reason, but it may only be replayed when every input the recorded coverage depended on is unchanged. Keys therefore compare conservatively (bitwise float equality, patterns never equal), and every input that is re-supplied at replay rather than baked into the coverage (the paint the draw built its blitter from, the clip mask) is either part of the key or reproduced exactly.
| struct donner::svg::RetainedSpanStats |
Counters describing what a renderer's retained coverage did, for tests and benchmarks.
Counts are per fill or stroke pass of a shape draw, and cover the frame most recently drawn. Draw kinds retention does not reach at all (text, images, layer composites) are not counted here at all, not even as bypassed.