Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::geode::GeodePathCacheComponent Struct Reference

Per-entity cache of Geode's encoded-path output (and strokeToFill result). Installed lazily by RendererGeode at the encode call sites via get_or_emplace; removed automatically when the source ComputedPathComponent updates or is destroyed. More...

#include "donner/svg/renderer/geode/GeodePathCacheComponent.h"

Classes

struct  StrokeSlot
 Stroke-slot cache. Holds both the Path::strokeToFill output path and its encoded form, keyed by the source StrokeStyle. Invalidated whenever the fill slot is (geometry change, via the entt signal), or 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). More...

Public Attributes

std::optional< EncodedPathfillEncode
 Fill-slot encode. Populated on first encode; reused on hit. Reset by the entt signal listener when geometry changes.
std::optional< StrokeSlotstrokeSlot

Detailed Description

Per-entity cache of Geode's encoded-path output (and strokeToFill result). Installed lazily by RendererGeode at the encode call sites via get_or_emplace; removed automatically when the source ComputedPathComponent updates or is destroyed.

Lives in donner::geode (not donner::svg::geode) to match the other Geode types (EncodedPath, LinearGradientParams, …) that RendererGeode.cc references unqualified via geode:: inside the donner::svg namespace.


Class Documentation

◆ donner::geode::GeodePathCacheComponent::StrokeSlot

struct donner::geode::GeodePathCacheComponent::StrokeSlot

Stroke-slot cache. Holds both the Path::strokeToFill output path and its encoded form, keyed by the source StrokeStyle. Invalidated whenever the fill slot is (geometry change, via the entt signal), or 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).

Collaboration diagram for donner::geode::GeodePathCacheComponent::StrokeSlot:
[legend]
Class Members
EncodedPath strokedEncode Cached encode of strokedPath. Produced by GeodePathEncoder::encode(strokedPath, strokeFillRule).
Path strokedPath Cached Path::strokeToFill output. Reused across draws of the same entity + stroke-key combination.
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.
StrokeStyle strokeKey Equality key. Compared against the caller's StrokeStyle to detect stroke-parameter changes.

Member Data Documentation

◆ fillEncode

std::optional<EncodedPath> donner::geode::GeodePathCacheComponent::fillEncode

Fill-slot encode. Populated on first encode; reused on hit. Reset by the entt signal listener when geometry changes.

◆ strokeSlot

std::optional<StrokeSlot> donner::geode::GeodePathCacheComponent::strokeSlot

The documentation for this struct was generated from the following file: