Table of Contents

Class MapsuiRenderAssetCache

Namespace
EncDotNet.S100.Renderers.Mapsui
Assembly
EncDotNet.S100.Renderers.Mapsui.dll

Per-palette cache of processed-SVG symbol entries and rasterised pattern tiles produced by MapsuiDisplayListRenderer.

public sealed class MapsuiRenderAssetCache
Inheritance
MapsuiRenderAssetCache
Inherited Members

Remarks

Both MapsuiDisplayListRenderer's processed-SVG ("data URI" string post SvgProcessor.Process) and rasterised pattern-tile PNG caches were originally instance-scoped. Because every dataset processor constructs a fresh renderer on each Render() call, every palette toggle / time-step scrub / mariner-setting change re-paid the full SVG processing + PNG rasterization cost.

Lifting these caches into a dataset-processor-owned MapsuiRenderAssetCache instance lets re-renders of the same dataset reuse that work. The cache is keyed by palette name (Day/Dusk/ Night) so flipping between palettes does not invalidate sibling-palette entries: each palette gets its own slot, populated lazily on first access.

Processed SVG output depends on the active ColorPalette (the processor recolours fills/strokes), so per-palette segmentation is required for correctness.

The dictionaries are ConcurrentDictionary<TKey, TValue> to allow safe sharing if a future caller renders concurrently.