Skip to content

Effects

Source: Effects.h

Effects

class Effects
src/light/layers/Effects.h:29

Inherits: MoonModule

The container holding every rendering layer, which Drivers composites into one output.

Each child layer renders independently into its own buffer. The shared Layouts describing the physical topology is wired into all of them.

Effects card

Public Methods

virtual inline const char * acceptsChildRoles() const override : The child role this container accepts, which is layers alone.

inline void setLayouts(Layouts * l) : Wire the shared Layouts into every child layer, so each can size its buffer.

inline Layouts * layouts() const : The shared Layouts this container hands to its children.

virtual inline void prepare() override : Re-wire the children before they build, so a layer added through the API is wired too.

virtual inline void tick() override : Tick every enabled layer child, in container order.

inline Layer * activeLayer() const : The first enabled layer, which Drivers reads for the physical dimensions.

inline Layer * firstEnabledLayer() const : The first enabled layer, or null when none is enabled.

inline uint8_t enabledLayerCount() const : How many layer children are enabled, which chooses the fast or the composite path.

template<typename Fn> inline void forEachEnabledLayer(Fn cb) const : Walk the enabled layers in composition order, bottom to top.

More info

Why a container

Multi-layer composition needs one place that walks every layer in order. With a single child this is a pass-through, matching the one-layer pipeline exactly.

It owns no buffer

Each layer owns its buffer, and Drivers owns the composited output. Three queries serve the compositor: the active layer, the enabled count, and a walk in order. The count is what lets Drivers choose between handing one buffer over and blending several.