Chains multiple effects in sequence. More...
#include <view_effect.hpp>
Public Member Functions | |
| void | add (std::shared_ptr< ViewEffect > effect) |
| void | configure_layer (Canvas &canvas, float x, float y, float w, float h) override |
| Push the compositing layer(s) this effect needs, configured with its opacity, image filters, blend mode, etc. | |
| int | layer_count () const override |
| One layer per child, summed — a chain pushes as many layers as it has effects. | |
| bool | needs_layer () const override |
| Whether this effect requires a compositing layer (most do). | |
| void | paint_overlay (Canvas &canvas, float x, float y, float w, float h) override |
| Forward the overlay to every child (in order). | |
| const std::vector< std::shared_ptr< ViewEffect > > & | effects () const |
Chains multiple effects in sequence.
|
inline |
|
inlineoverridevirtual |
Push the compositing layer(s) this effect needs, configured with its opacity, image filters, blend mode, etc.
The subtree paints into the layer(s); the caller pops them once the subtree is done.
An implementation MUST push exactly layer_count() layers. The caller (View::paint_all) pops that many, so an effect that saves a different number than it reports unbalances the canvas save stack for the rest of the frame.
Implements pulp::canvas::ViewEffect.
|
inline |
|
inlineoverridevirtual |
One layer per child, summed — a chain pushes as many layers as it has effects.
Reporting 1 here (the base default) would leak every layer past the first on every paint.
Reimplemented from pulp::canvas::ViewEffect.
|
inlineoverridevirtual |
Whether this effect requires a compositing layer (most do).
Reimplemented from pulp::canvas::ViewEffect.
|
inlineoverridevirtual |
Forward the overlay to every child (in order).
Non-overlay effects have an empty paint_overlay, so only the overlay-drawing ones (vignette) act.
Reimplemented from pulp::canvas::ViewEffect.