Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::view::win_input::SurfaceLifecycle Class Reference

Tracks whether the Windows editor host currently owns a GPU/Skia surface pair. More...

#include <win_surface_lifecycle.hpp>

Public Member Functions

constexpr bool surfaces_created () const noexcept
 True once note_attached() has asked for creation and no detach has reclaimed it.
constexpr bool note_attached () noexcept
 Call after the HWND's final parent, style, and size are in place.
constexpr bool note_detached () noexcept
 Call on detach, before the HWND leaves its parent.
constexpr void note_creation_failed () noexcept
 Surface creation is allowed to fail (no Dawn adapter, Skia surface creation returned null).

Detailed Description

Tracks whether the Windows editor host currently owns a GPU/Skia surface pair.

Dawn configures its presentation surface for the HWND's native-window shape at creation time. The editor HWND is created as a hidden top-level WS_POPUP and only becomes the DAW's WS_CHILD inside attach_to_parent(), so a surface created in the constructor presents against a window shape that no longer exists. The symptom is a black editor that only refreshes when something else forces the host to repaint (dragging the DAW's own scrollbar).

Encoding this as state rather than an inline if (!gpu_ || !skia_) is what keeps a PARTIALLY constructed pair — GPU surface created, Skia surface failed — from being mistaken for "already initialized" on the next attach.

Member Function Documentation

◆ note_attached()

bool pulp::view::win_input::SurfaceLifecycle::note_attached ( )
inlineconstexprnoexcept

Call after the HWND's final parent, style, and size are in place.

Returns true when the caller must create the GPU/Skia surfaces now.

◆ note_creation_failed()

void pulp::view::win_input::SurfaceLifecycle::note_creation_failed ( )
inlineconstexprnoexcept

Surface creation is allowed to fail (no Dawn adapter, Skia surface creation returned null).

Recording that keeps the next attach from assuming a live surface pair.

◆ note_detached()

bool pulp::view::win_input::SurfaceLifecycle::note_detached ( )
inlineconstexprnoexcept

Call on detach, before the HWND leaves its parent.

Returns true when the caller must tear the surfaces down so the next attach rebuilds them for the new native-window shape.

◆ surfaces_created()

bool pulp::view::win_input::SurfaceLifecycle::surfaces_created ( ) const
inlineconstexprnoexcept

True once note_attached() has asked for creation and no detach has reclaimed it.

Must be false on a freshly constructed host.


The documentation for this class was generated from the following file: