Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorSurfaceShaders Namespace Reference

Namespaces

namespace  SurfaceShaderContract
 Cross-runtime named-uniform contract for surface shaders.

Classes

class  DecorationProfile
 Per-surface decoration shader-pack chain and its per-pack parameters. More...
class  DecorationProfileTree
 Hierarchical DecorationProfile storage with walk-up inheritance. More...
struct  SurfaceShaderEffect
 Metadata for a single surface shader effect. More...
class  SurfaceShaderRegistry
 Registry of available surface shader effects. More...
struct  SurfaceUniforms
 C++ mirror of the SURFACE shader contract's daemon UBO block — the #else (non-PLASMAZONES_KWIN) branch of data/surface/shared/ surface_uniforms.glsl, a std140 layout(std140, binding = 0) uniform SurfaceUniforms { … }. More...
struct  SurfaceThemeColors
 Theme colours a host supplies to resolveThemeParamColors(). More...
class  SurfaceUniformProfile
 IUboProfile implementation for the surface-decoration runtime — the distinct 672-byte SurfaceUniforms layout, the same size as the overlay/animation BaseUniforms but not the same members. More...

Functions

PHOSPHORSURFACE_EXPORT DecorationProfile withPresetsResolved (const DecorationProfile &profile, const PhosphorShaders::ShaderPresetRegistry &presets, PhosphorShaders::ShaderFamily family)
 Flatten profile's per-pack preset references into its parameters.
QString decorationShellRootPath ()
 The root of the plasmashell surface subtree and its two leaves.
QString decorationShellPanelPath ()
QString decorationShellAppletPopupPath ()
QString decorationWindowTiledPath ()
 The three per-placement window decoration paths.
QString decorationWindowSnappedPath ()
QString decorationWindowFloatingPath ()
QString decorationOsdPath ()
 The OSD surface and the four transient overlays invoked by user action.
QString decorationPopupLayoutPickerPath ()
QString decorationPopupZoneSelectorPath ()
QString decorationPopupCheatsheetPath ()
QString decorationPopupSnapAssistPath ()
QString decorationShellPhosphorRootPath ()
 The Phosphor shell's own surfaces, a family under shell beside the plasmashell leaves.
QString decorationShellPhosphorBarPath ()
QString decorationShellPhosphorPopoutPath ()
QString decorationShellPhosphorOsdPath ()
QString decorationShellPhosphorNotificationPath ()
QString decorationShellPhosphorPickerPath ()
QString decorationShellPhosphorLockPath ()
QStringList decorationShellPhosphorLeafPaths ()
QString decorationPointerPath ()
 The mouse pointer.
QStringList decorationLeafSurfacePaths ()
 Leaf surface paths a per-surface decoration profile actually resolves against.
QString decorationParentPath (const QString &path)
 Walk path up one level in the dot-hierarchy ("window.floating" -> "window" -> "").
QStringList decorationSupportedSurfacePaths ()
 Single source of truth for "which surface paths can carry a decoration profile".
bool decorationPathIsBaselineIsolated (const QString &path)
 Roots whose subtree does NOT inherit the tree baseline.
bool decorationSurfaceSupported (const QString &path)
 Convenience predicate: does path name a surface that can carry a decoration profile (a leaf or an ancestor of one)?
PHOSPHORSURFACE_EXPORT double paddingRequest (const SurfaceShaderEffect &effect, const QVariantMap &friendlyParams)
 Resolve one pack's outer-margin request, in LOGICAL pixels.
PHOSPHORSURFACE_EXPORT QVariantMap composeStageMap (const SurfaceShaderEffect &effect, const QVariantMap &resolvedParams, qreal blurScaleMultiplier=1.0)
 Build the QML stage map for one surface-shader chain stage.
PHOSPHORSURFACE_EXPORT QVariant chainRoundBottomCorners (const SurfaceShaderRegistry &registry, const QStringList &chain, const QVariantMap &allPackParams)
 The bottom-corner answer every pack in one chain has to draw to.
PHOSPHORSURFACE_EXPORT QString roundBottomCornersParamId ()
 The parameter id chainRoundBottomCorners resolves and hosts inject under.
PHOSPHORSURFACE_EXPORT QVariant chainSquareWhenMaximized (const SurfaceShaderRegistry &registry, const QStringList &chain, const QVariantMap &allPackParams)
 Whether the chain squares its corners on a maximized (or fullscreen) window, resolved by exactly the rules of chainRoundBottomCorners for the squareWhenMaximized control.
PHOSPHORSURFACE_EXPORT QString squareWhenMaximizedParamId ()
 The parameter id chainSquareWhenMaximized resolves.
PHOSPHORSURFACE_EXPORT void setSurfacePackDataSubdir (const QString &subdir)
 Sets where the installed surface packs live, relative to each QStandardPaths::GenericDataLocation directory (no leading or trailing slash), for the whole process.
PHOSPHORSURFACE_EXPORT QString surfacePackDataSubdir ()
 The subdirectory setSurfacePackDataSubdir() last set.
PHOSPHORSURFACE_EXPORT void resolveThemeParamColors (const SurfaceShaderEffect &effect, QVariantMap &friendlyParams, const SurfaceThemeColors &theme)
 Synthesise theme-derived colours into a pack's friendly param map, in place, honouring the host-consumed flags a surface pack may declare.
PHOSPHORSURFACE_EXPORT bool resolveWindowStateParams (const SurfaceShaderEffect &effect, QVariantMap &friendlyParams, bool maximized, bool squareCorners)
 Resolve the opt-in window-state parameters for one pack of a chain, on a copy of its authored parameters.

Variables

constexpr int kMaxDecorationOuterPaddingPx = 128
 Hard cap on a decoration chain's outer padding, in device-independent px.

Function Documentation

◆ chainRoundBottomCorners()

PHOSPHORSURFACE_EXPORT QVariant PhosphorSurfaceShaders::chainRoundBottomCorners ( const SurfaceShaderRegistry & registry,
const QStringList & chain,
const QVariantMap & allPackParams )

The bottom-corner answer every pack in one chain has to draw to.

A pane's silhouette belongs to the CHAIN, not to any single pack. A backdrop pack rounds its slab, a border pack traces an outline around that slab, and a glow or shadow pack hugs the same outline from outside. Let them disagree about whether the bottom corners are round and the user gets a border curving through empty space over a squared-off pane, or a shadow rounding a corner the pane gave up. Per-pack defaults cannot prevent it, because the two packs are configured on separate pages and nothing there says they are describing one shape.

So the host resolves ONE answer for the whole chain and injects it into every stage, the way the daemon overlay path already injects its card corner radius. In order:

  1. the value stored against the FIRST pack in chain order that DECLARES the control and carries a USABLE one. The declaration is a precondition here as well as in step 2: a stored value on a pack that never declared the control is not that pack's opinion about it, and does not vote. Where two declaring packs both carry a stored value they disagree with no right answer, and chain order is what keeps the result deterministic rather than dependent on map iteration. An explicitly-null or absent entry is not a choice, so it falls through to that pack's own default.
  2. otherwise the declared default of the first pack that declares the control WITH a default, which is what settles a third-party pack shipping a different default from the bundled ones. A pack declaring the control and no default abstains rather than voting false.
  3. otherwise an invalid QVariant: no pack in this chain states a usable answer, and the host injects nothing. That is NOT the same as no pack declaring the control — a chain whose only declarer declares it with "default": null and stores nothing lands here while still drawing an outline, which is the case step 2's usability test exists for.

allPackParams is the post-flatten effectiveParameters() map, shaped { packId -> { paramId -> value } }. It carries whatever a user or a preset set, so a pack with nothing set never outvotes one that has. Two caveats a caller should not have to discover: a PRESET's value is indistinguishable here from a value the user typed, so a preset on a late pack can decide the whole chain's outline; and a host that rewrites a pack's entry before calling — the compositor does, both for a matched rule override and for its easy-mode layers — hands that pack's vote to whatever it wrote, because the tree's value for it is gone by then.

Injecting the result into a pack that does not declare the control is harmless. translateSurfaceParams and resolveSurfaceParamValues emit a lane only for declared parameters, so the key is dropped for any pack without it, and hosts need no per-pack test before inserting.

Packs the registry cannot resolve are skipped rather than treated as declaring nothing, so an uninstalled pack sitting in a stored chain does not get a vote.

Only the bottom-corner SWITCH is resolved chain-wide. edgeSoftness is deliberately left per-pack: a band's anti-alias feather and a backdrop slab's are different quantities on different geometry, which is why the two families declare different ranges for it, and unifying them would soften one to match the other rather than making them agree about a shape.

◆ chainSquareWhenMaximized()

PHOSPHORSURFACE_EXPORT QVariant PhosphorSurfaceShaders::chainSquareWhenMaximized ( const SurfaceShaderRegistry & registry,
const QStringList & chain,
const QVariantMap & allPackParams )

Whether the chain squares its corners on a maximized (or fullscreen) window, resolved by exactly the rules of chainRoundBottomCorners for the squareWhenMaximized control.

The same reasoning applies: a border that squares while the glow around it keeps tracing a radius is a halo curving through empty space, so the answer is the chain's, and a host passes it to resolveWindowStateParams for every pack. Invalid when no pack in the chain states a usable answer, which a host treats as false.

Host-optional: like resolveWindowStateParams it is for a host that knows whether its window is maximized, which in the tree is the PlasmaZones KWin effect's window decorations.

◆ composeStageMap()

PHOSPHORSURFACE_EXPORT QVariantMap PhosphorSurfaceShaders::composeStageMap ( const SurfaceShaderEffect & effect,
const QVariantMap & resolvedParams,
qreal blurScaleMultiplier = 1.0 )

Build the QML stage map for one surface-shader chain stage.

The shape phosphor-surface-quick's SurfaceDecoration.qml consumes, one entry per resolved pack: source / vertexSource (file:// urls), preamble (the generated #define p_<id> … block), params (the translated customParamsN_* / customColorN slot map), animated (gates that stage's per-frame iTime tick), and the multipass set.

resolvedParams is the pack's FRIENDLY parameter map after the host has applied its own resolutions — resolveThemeParamColors for theme-derived colours, resolveWindowStateParams for a host that knows its window's maximized state (host-optional, and no host wires it yet), plus any host-specific injection such as the card corner radius. Those stay at the call site because they are host state, not pack data.

Multipass fields are emitted only when the pack both opts into multipass and carries at least one resolved buffer path. The registry resolves builtin: tokens to absolute paths and clears the whole list fail-closed when one cannot be located, so that gate is also what keeps a pack with an unresolvable builtin on the single-pass path rather than handing empty paths to the shader item. Single-pass stages carry multipass: false and nothing further, leaving the item's own defaults untouched.

Used by the daemon overlay-decoration host, by the shell's own chrome, and by the settings app's decoration preview, all three of which must compose a stage identically or the preview stops predicting what the daemon draws. One deliberate exception: the two live hosts inject the chain's bottom-corner answer into every stage's params before calling this, and the preview does not, because it composes ONE pack at a time and so has no chain to reconcile. It injects no card corner radius either, but for a reason of its own rather than this one: its stand-in card is deliberately square-cornered so the pack owns the radius, and injecting one would show a rounding real windows will not get (see decorationpreviewcontroller.cpp). The consequence of the bottom-corner omission is worth knowing: previewing a pack that is not first in its chain shows that pack's own bottom-corner setting, while the real surface shows the chain's.

The kwin-effect compositor path builds GL uniform value arrays instead of a stage map, so it never calls this builder; it shares paddingRequest() above and chainRoundBottomCorners() below.

Returns an EMPTY map for an effect that is not isValid() (no id, or no fragment shader — which is also what the path-traversal guard leaves behind when it rejects a pack's declared shader). Hosts must treat that as "skip this stage" rather than appending it, or they add a stage with no source.

blurScaleMultiplier is the user's decoration blur-quality tier (Decorations.Performance.BlurScaleMultiplier). It multiplies every declared buffer scale, bufferScale and each entry of bufferScales, and the product is bounded into [kMinBufferScale, kMaxBufferScale] exactly as the compositor's clampedBufferScale() does. This is the daemon-side counterpart of that chokepoint, and the reason it belongs here rather than in each host is that the setting is a GLOBAL blur-quality tier. For a while the compositor honoured it while nothing on this path read it at all, so the same pack rendered at two densities depending on whether it decorated a window or an OSD.

Defaulted to 1.0, the identity, for a caller with no settings to offer.

◆ decorationLeafSurfacePaths()

QStringList PhosphorSurfaceShaders::decorationLeafSurfacePaths ( )
inline

Leaf surface paths a per-surface decoration profile actually resolves against.

Each names something PlasmaZones decorates through this tree, most of them surfaces: the three window placement states (tiled / snapped / floating), the OSD, the four transient popups, the foreign plasma-shell surfaces under shell.*, the Phosphor shell's own surfaces under shell.phosphor.*, and pointer, the mouse cursor, which is not a surface at all but a compositor pass keyed off the same tree. (The zone overlay is intentionally NOT a decoration target — it is a fullscreen, mostly-transparent zone canvas drawn by the separate overlay shader category, not a card to round/border.) When a future surface gains a decoration leg, append its leaf path here in lockstep.

Surface-state analogue of PlasmaZones::shaderConsumedLeafEventPaths() for the decoration concern: the SSOT for "which surfaces can carry a DecorationProfile override".

◆ decorationOsdPath()

QString PhosphorSurfaceShaders::decorationOsdPath ( )
inline

The OSD surface and the four transient overlays invoked by user action.

Accessors rather than literals because the seed tree in configdefaults_shaders.h writes overrides at these exact paths, and a typo there is a seed that silently decorates nothing.

◆ decorationParentPath()

QString PhosphorSurfaceShaders::decorationParentPath ( const QString & path)
inline

Walk path up one level in the dot-hierarchy ("window.floating" -> "window" -> "").

Single source of truth for the decoration ancestor-walk, shared by decorationSupportedSurfacePaths() below and DecorationProfileTree::resolve(), so the two cannot drift. Unlike the animation ProfilePaths::parentPath there is no synthetic "global" node: the tree's baseline IS the global default, so the chain terminates at "".

◆ decorationPathIsBaselineIsolated()

bool PhosphorSurfaceShaders::decorationPathIsBaselineIsolated ( const QString & path)
inline

Roots whose subtree does NOT inherit the tree baseline.

The shell.* family decorates FOREIGN plasmashell windows, and inheriting the baseline there would border every panel the instant the user configured a global decoration chain for their own windows — so a shell surface resolves only from overrides inside its own subtree, and an unconfigured shell surface resolves empty (undecorated). Consulted by DecorationProfileTree::resolve and withSeedDefaults so the two cannot disagree.

pointer is isolated for a stronger version of the same reason. It is not a window at all, and its chain is drawn from the POINTER pack family, not the surface family. If it inherited the baseline, a user who configured a global window decoration chain would have those surface packs resolve onto the cursor and be handed to the pointer pass, which cannot render them: the packs speak a different uniform contract entirely. Isolation is what keeps the cursor undecorated until the user engages a pointer chain at this exact path.

◆ decorationPointerPath()

QString PhosphorSurfaceShaders::decorationPointerPath ( )
inline

The mouse pointer.

Decorated by the compositor's pointer pass rather than by a window paint, and it takes pointer packs rather than surface packs, so it is baseline-isolated (see decorationPathIsBaselineIsolated below).

◆ decorationPopupCheatsheetPath()

QString PhosphorSurfaceShaders::decorationPopupCheatsheetPath ( )
inline

◆ decorationPopupLayoutPickerPath()

QString PhosphorSurfaceShaders::decorationPopupLayoutPickerPath ( )
inline

◆ decorationPopupSnapAssistPath()

QString PhosphorSurfaceShaders::decorationPopupSnapAssistPath ( )
inline

◆ decorationPopupZoneSelectorPath()

QString PhosphorSurfaceShaders::decorationPopupZoneSelectorPath ( )
inline

◆ decorationShellAppletPopupPath()

QString PhosphorSurfaceShaders::decorationShellAppletPopupPath ( )
inline

◆ decorationShellPanelPath()

QString PhosphorSurfaceShaders::decorationShellPanelPath ( )
inline

◆ decorationShellPhosphorBarPath()

QString PhosphorSurfaceShaders::decorationShellPhosphorBarPath ( )
inline

◆ decorationShellPhosphorLeafPaths()

QStringList PhosphorSurfaceShaders::decorationShellPhosphorLeafPaths ( )
inline

◆ decorationShellPhosphorLockPath()

QString PhosphorSurfaceShaders::decorationShellPhosphorLockPath ( )
inline

◆ decorationShellPhosphorNotificationPath()

QString PhosphorSurfaceShaders::decorationShellPhosphorNotificationPath ( )
inline

◆ decorationShellPhosphorOsdPath()

QString PhosphorSurfaceShaders::decorationShellPhosphorOsdPath ( )
inline

◆ decorationShellPhosphorPickerPath()

QString PhosphorSurfaceShaders::decorationShellPhosphorPickerPath ( )
inline

◆ decorationShellPhosphorPopoutPath()

QString PhosphorSurfaceShaders::decorationShellPhosphorPopoutPath ( )
inline

◆ decorationShellPhosphorRootPath()

QString PhosphorSurfaceShaders::decorationShellPhosphorRootPath ( )
inline

The Phosphor shell's own surfaces, a family under shell beside the plasmashell leaves.

The shell process resolves these itself (it hosts the chain in QML, the daemon's overlay pattern), so the same tree the Decoration pages edit styles the bar, the popouts, the OSD bands, the toasts, the wallpaper picker and the lock screen. Baseline-isolated like the rest of shell.*: a global window chain never leaks onto chrome, and the shell's defaults ride the seed tree.

◆ decorationShellRootPath()

QString PhosphorSurfaceShaders::decorationShellRootPath ( )
inline

The root of the plasmashell surface subtree and its two leaves.

Single spellings for the shell family: the leaf list, the baseline-isolation predicate, and the KWin effect's path producer all build from these, so renaming the root cannot silently un-isolate the subtree while leaving the paths decorable (which would fail OPEN — panels would start inheriting the baseline).

◆ decorationSupportedSurfacePaths()

QStringList PhosphorSurfaceShaders::decorationSupportedSurfacePaths ( )
inline

Single source of truth for "which surface paths can carry a decoration profile".

Includes every consumed leaf AND every ancestor of a consumed leaf — setting the decoration on an ancestor cascades to its descendants via DecorationProfileTree::resolve's chain walk (deeper-leaf-wins overlay merge), so e.g. window styles every window placement and window.floating overrides only the floating state.

Surface-state analogue of PlasmaZones::shaderSupportedEventPaths(). The de-duplicated result is consumed as a set (see decorationSurfaceSupported); no consumer relies on its order.

◆ decorationSurfaceSupported()

bool PhosphorSurfaceShaders::decorationSurfaceSupported ( const QString & path)
inline

Convenience predicate: does path name a surface that can carry a decoration profile (a leaf or an ancestor of one)?

Surface-state analogue of PlasmaZones::eventPathSupportsShaderLeg().

◆ decorationWindowFloatingPath()

QString PhosphorSurfaceShaders::decorationWindowFloatingPath ( )
inline

◆ decorationWindowSnappedPath()

QString PhosphorSurfaceShaders::decorationWindowSnappedPath ( )
inline

◆ decorationWindowTiledPath()

QString PhosphorSurfaceShaders::decorationWindowTiledPath ( )
inline

The three per-placement window decoration paths.

Accessors for the same reason as the leaves below, and because this header's own supported-paths list and the compositor's resolveSurfacePathFor each spelled them independently. Both now read from here. The settings page that EDITS them is QML and still carries its own literals, with no C++ bridge to reach these.

◆ paddingRequest()

PHOSPHORSURFACE_EXPORT double PhosphorSurfaceShaders::paddingRequest ( const SurfaceShaderEffect & effect,
const QVariantMap & friendlyParams )

Resolve one pack's outer-margin request, in LOGICAL pixels.

A pack declares an outer effect (the glow pack's glowSize, the shadow pack's spread) by naming one of its own float parameters in paddingParam. The host inflates its capture canvas by the chain's LARGEST request so that effect has real transparent room to draw into — the "extended FBO".

Resolution order is the per-surface override first, then the parameter's declared default. A pack with no paddingParam, or one naming a parameter it does not declare, requests 0.

This is deliberately the RAW request: callers clamp it themselves, because they need different types. The compositor's capture canvas is integer device pixels (qCeil then an int clamp); the daemon's QML host works in fractional logical px. Every caller bounds the result to [0, kMaxDecorationOuterPaddingPx] so a typo'd or hostile pack cannot demand an absurd canvas. The ZERO floor is a caller's job too: a declared default or a stored override may be negative, and this returns such a value verbatim rather than guessing which way a caller wants to interpret it.

Extracted because the identical resolution ran in three places and had already drifted in type between two of them.

◆ resolveThemeParamColors()

PHOSPHORSURFACE_EXPORT void PhosphorSurfaceShaders::resolveThemeParamColors ( const SurfaceShaderEffect & effect,
QVariantMap & friendlyParams,
const SurfaceThemeColors & theme )

Synthesise theme-derived colours into a pack's friendly param map, in place, honouring the host-consumed flags a surface pack may declare.

  • Border pack: useWindowAccent, when the host supplies a valid identity colour, gives active and inactive that RGB and keeps each declared colour's alpha, so focus contrast under identity comes ENTIRELY from the declared alpha pair (an opaque pair draws focused and unfocused alike). Otherwise useThemeNeutral (with frameContrast) fills both with a neutral frame-contrast colour (background lerped toward foreground), and failing that useSystemAccent fills them with the system accent / inactive. Both of those write opaque colours.
  • Glow / shadow pack: useThemeTint replaces the halo colour with the theme background, preserving the pack's own colour alpha (its intensity knob). useWindowAccent with an identity colour gives the GLOW that colour instead, whether or not useThemeTint is on, again keeping its alpha. The shadow is never identity-coloured.

Only a flag the pack declares (via effect.parameters) is read, so a pack without a given flag is left alone and a flag at its default (or off) leaves the caller's explicit colours in place. The identity and tint modes write only colours the pack declares; the neutral and system modes write both border keys regardless, and slot translation drops a key the pack does not declare. Call this on the friendly param map BEFORE translating it to slot-keyed uniforms (the flags are host-consumed and never reach the shader).

◆ resolveWindowStateParams()

PHOSPHORSURFACE_EXPORT bool PhosphorSurfaceShaders::resolveWindowStateParams ( const SurfaceShaderEffect & effect,
QVariantMap & friendlyParams,
bool maximized,
bool squareCorners )

Resolve the opt-in window-state parameters for one pack of a chain, on a copy of its authored parameters.

maximized is the caller's answer for "the window fills its output": a host passes true for a fullscreen window as well as a maximized one. When it is false the map is left untouched and the pack stays in the chain.

  • hideWhenMaximized, declared and enabled on THIS pack, drops the pack from the rendered chain: the function returns false and leaves the map alone. Dropping a pack changes what the rest of the chain is composed from, so the caller recomputes the chain's outer padding (paddingRequest) and its silhouette votes (chainRoundBottomCorners, chainSquareWhenMaximized) without the packs it dropped.
  • squareCorners is the CHAIN's answer from chainSquareWhenMaximized, not this pack's flag: a pane's silhouette belongs to the chain (see chainRoundBottomCorners), so when it is true every pack that declares cornerRadius gets 0, a halo that declares no square flag of its own included, and a border and the glow around it cannot disagree about the corners. Call this AFTER the host's own injection of cornerRadius, if it has one, or the injection undoes the squaring.

Without those flags a user-authored profile keeps its configured shape and layers. Returns true when the pack stays in the chain.

Host-optional: only a host that knows whether its window fills its output calls it. The PlasmaZones KWin effect's window decorations do, together with chainSquareWhenMaximized; the overlay and shell hosts decorate surfaces with no maximized state and do not. No bundled pack declares either flag.

◆ roundBottomCornersParamId()

PHOSPHORSURFACE_EXPORT QString PhosphorSurfaceShaders::roundBottomCornersParamId ( )

The parameter id chainRoundBottomCorners resolves and hosts inject under.

Shared so the three injecting hosts and the resolver cannot drift on the spelling. Spelled that way rather than as a count, because a count here has to be re-argued every time a test adds a use.

◆ setSurfacePackDataSubdir()

PHOSPHORSURFACE_EXPORT void PhosphorSurfaceShaders::setSurfacePackDataSubdir ( const QString & subdir)

Sets where the installed surface packs live, relative to each QStandardPaths::GenericDataLocation directory (no leading or trailing slash), for the whole process.

The library has no default of its own: the app names the directory its packs install to, normally the PHOSPHOR_SURFACE_PACKS_DATA_SUBDIR that phosphor-surface-packs' PhosphorSurfacePacks.cmake sets, passed in as a compile definition.

Call it once at startup, before QML loads and before any surface pack is resolved. Two lookups read it: SurfaceShaderItem::surfaceIncludePaths(), which a SurfaceShaderItem built from QML reaches with no C++ caller to hand it a path, and the installed-copy fallback of SurfaceShaderRegistry::resolveBuiltinBufferShader(). Packs reached through SurfaceShaderRegistry::addSearchPaths() do not depend on it: their shared helpers are found beside them.

Safe to call from any thread.

◆ squareWhenMaximizedParamId()

PHOSPHORSURFACE_EXPORT QString PhosphorSurfaceShaders::squareWhenMaximizedParamId ( )

The parameter id chainSquareWhenMaximized resolves.

◆ surfacePackDataSubdir()

PHOSPHORSURFACE_EXPORT QString PhosphorSurfaceShaders::surfacePackDataSubdir ( )

The subdirectory setSurfacePackDataSubdir() last set.

Empty until an app sets it, and while it is empty neither lookup above searches the XDG data directories at all.

◆ withPresetsResolved()

PHOSPHORSURFACE_EXPORT DecorationProfile PhosphorSurfaceShaders::withPresetsResolved ( const DecorationProfile & profile,
const PhosphorShaders::ShaderPresetRegistry & presets,
PhosphorShaders::ShaderFamily family )

Flatten profile's per-pack preset references into its parameters.

Returns a copy whose parameters hold, for every pack that named a preset, the preset's values overlaid with that pack's own edits — and whose presetIds is cleared to say the presets have already been applied. Consumers downstream therefore keep reading effectiveParameters() and never have to know a preset was involved.

family selects the preset namespace, because a decoration chain is resolved for two different pack families: surface for the window and popup surfaces, pointer for the cursor chain. Passing the wrong one resolves nothing rather than resolving the wrong thing, since the registry keys presets by (family, packId, presetId).

A pack whose preset id names no preset keeps its own parameters, which is the look it had before it pointed at one. That covers an assignment outliving its preset and a presetIds entry for a pack the resolved chain no longer contains.

Variable Documentation

◆ kMaxDecorationOuterPaddingPx

int PhosphorSurfaceShaders::kMaxDecorationOuterPaddingPx = 128
inlineconstexpr

Hard cap on a decoration chain's outer padding, in device-independent px.

EVERY consumer that composes a decoration chain clamps to this, so a runaway per-pack padding request cannot inflate the render canvas without bound. Shared here so they cannot drift onto different caps — and there are more of them than the two this used to name: the compositor's window-decoration builder, the daemon's overlay decoration builder, the settings app's decoration preview, and the shell's own chrome. No count is quoted on purpose; the set grows.