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). | |
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.
|
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.
|
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.
|
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.
|
inlineconstexprnoexcept |
True once note_attached() has asked for creation and no detach has reclaimed it.
Must be false on a freshly constructed host.