Per-surface decoration shader-pack chain and its per-pack parameters.
Parallel to PhosphorAnimationShaders::ShaderProfile which configures a single transition effect per event, DecorationProfile configures the persistent decoration of a surface: an ordered chain of surface shader packs (border, glow, …) plus the per-pack parameters that style them. Border width, radius and colour are NOT decoration fields of their own — they are the border pack's parameters, carried in parameters. Both are resolved through a separate tree (DecorationProfileTree) over a dot-path surface namespace (window.tiled, popup.snapAssist, …) so the two concerns evolve independently.
"Set" vs "unset" semantics
Same contract as ShaderProfile: std::optional fields distinguish "inherit from parent" (nullopt) from "I explicitly chose this value" (engaged). A leaf with an engaged chain wins over a category that sets one. A leaf with chain = std::nullopt inherits whatever the category or baseline says.
An explicitly-empty chain (engaged optional containing an empty list) means "no decoration shader packs for this surface" — the surface runs no surface shader. This lets a child disable a parent's pack chain.
| QVariantMap PhosphorSurfaceShaders::DecorationProfile::effectiveParameters |
( |
| ) |
const |
|
inline |
The parameter map a RENDERER should consume.
Identical to storedParameters() once the presets have been applied, and a loud warning when they have not. "Flattened" is a convention here rather than a type — the only marker is that the consumed presetIds entries were cleared — so nothing in the type system stops a consumer from reading this on a RAW profile, where the answer is plausible and wrong because the presets' values are simply missing and the pack's declared min/max is unenforced.
The animation twin grew this warning first, and its absence here is exactly why the shell's chrome went unflattened unnoticed: every OTHER surface consumer happened to flatten, so nothing pointed at the one that did not.
In BOTH builds, for the reason the twin gives: a debug-only assert would have caught none of those sites in a user session. It warns rather than refusing because the result is degraded, not dangerous.
Only a NON-EMPTY preset id counts as unapplied. An empty-string entry is the blocking sentinel ("this pack follows no preset"), which the flatten deliberately PRESERVES, so warning on it would fire on every correctly flattened profile that carries one.
| QString PhosphorSurfaceShaders::DecorationProfile::presetIdFor |
( |
const QString & | packId | ) |
const |
|
inline |
The preset chosen for packId, or an empty string when that layer uses none.
Only tests call this today, and it stays anyway: it is one of the effective* family every field on this value type carries, and the alternative is tests reading presetIds->value(...).toString() by hand, which re-spells the nullopt case at each site. Not dead code to prune.
| QVariantMap PhosphorSurfaceShaders::DecorationProfile::storedParameters |
( |
| ) |
const |
|
inline |
The stored per-pack parameter map, without judgement.
For a caller that legitimately wants the RAW values while a preset is still engaged: the flatten itself, which needs them as the delta set, and the settings controller's edit-facing reads, which show and write what this node stores of its own. Named so those reads state their intent instead of sharing a spelling with the reads that want the effective answer. Mirrors the animation twin's storedParameters().
| std::optional<QVariantMap> PhosphorSurfaceShaders::DecorationProfile::presetIds |
Per-pack preset selection.
Shape: { packId -> presetId }, resolved by id from PhosphorShaders::ShaderPresetRegistry against that pack. std::nullopt = inherit. Engaged-but-empty map = explicitly no presets, so parameters is the whole tuning for every layer.
Naturally pack-keyed, like parameters, so a chain can carry a preset on one layer and hand-tuned values on the next. Where a pack appears here, its entry in parameters holds DELTAS on top of the preset: a parameter present there overrides the preset's value, and every parameter absent follows the preset. An entry naming a pack the resolved chain does not contain is inert, the same as a parameters entry for such a pack.