Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
continuous_frames.hpp File Reference

Predicate that decides whether a view tree still needs per-vsync frames. More...

#include <cstdint>

Go to the source code of this file.

Namespaces

namespace  pulp
namespace  pulp::view
 Hover-cursor tracking for platform window hosts.

Typedefs

using pulp::view::ContinuousFramePredicate = bool (*)(const View*)

Functions

void pulp::view::register_continuous_frame_predicate (RuntimeViewKind kind, ContinuousFramePredicate predicate)
 Install the allocation-free predicate for a framework-owned runtime kind.
bool pulp::view::needs_continuous_frames (const View *view)
 True if view (or any descendant) needs continuous per-frame repaints.

Detailed Description

Predicate that decides whether a view tree still needs per-vsync frames.

A host render loop (native window, plugin-view host, or a foreign-host embed tick) should only invalidate/repaint when something is actually moving. This predicate walks the tree and reports whether any node is mid-animation — an opted-in continuous-repaint view, a widget with a running hover/thumb/scroll animation or a time-driven shader, or a live CSS animation. When it returns false and the FrameClock has no active subscribers, the loop can idle at 0 fps until the next input or state change, instead of compositing a static surface every tick.

The macOS window and plugin-view hosts' display-link repaint gate uses this predicate (together with FrameClock::has_active_subscribers()); it is public so a foreign-host embed layer can gate its own tick the same way rather than repainting unconditionally.

Thread affinity: call on the view-owning UI thread. The tree is walked without synchronization, so it must not run concurrently with mutation of the view hierarchy or its animation state.