|
|
Donner SVG 0.8.0-pre
SVG editor and embeddable C++20 engine.
|
Stroke-slot cache. Holds both the Path::strokeToFill output path and its encoded form, keyed by the source StrokeStyle plus the device-derived curve-flattening tolerance. Invalidated whenever the fill slot is (geometry change, via the entt signal), on stroke-key mismatch (stroke width/dash/cap/ join change via CSS - the old key no longer matches the new one, so the next access regenerates), or on tolerance mismatch (the view scale crossed a flattening bucket). More...
#include "donner/svg/renderer/geode/GeodePathCacheComponent.h"
Public Member Functions | |
| std::optional< std::size_t > | retainedBytes () const |
| Exact dynamic capacity retained by this cached stroke entry. | |
Public Attributes | |
| StrokeStyle | strokeKey |
| Equality key. Compared against the caller's StrokeStyle to detect stroke-parameter changes. | |
| double | flattenTolerance = 0.0 |
| Second half of the equality key: the path-local curve-flattening tolerance this outline was built with, derived from the draw-time device transform (see GeodeStrokeTolerance.h). Without it in the key, zooming in would keep serving an outline tessellated for the old scale and curves would render as visible polygons. Quantized upstream to power-of-two scale buckets, so exact comparison is stable across a continuous zoom. | |
| Path | strokedPath |
| Cached Path::strokeToFill output. Reused across draws of the same entity + stroke-key combination. | |
| EncodedPath | strokedEncode |
| Cached encode of strokedPath. Produced by GeodePathEncoder::encode(strokedPath, strokeFillRule). | |
| FillRule | strokeFillRule = FillRule::NonZero |
| Fill rule the stroke was encoded with. strokeToFill picks NonZero vs EvenOdd based on subpath topology, so this is derived and cached alongside the encode. | |
Stroke-slot cache. Holds both the Path::strokeToFill output path and its encoded form, keyed by the source StrokeStyle plus the device-derived curve-flattening tolerance. Invalidated whenever the fill slot is (geometry change, via the entt signal), on stroke-key mismatch (stroke width/dash/cap/ join change via CSS - the old key no longer matches the new one, so the next access regenerates), or on tolerance mismatch (the view scale crossed a flattening bucket).