|
|
Donner SVG Editor & Engine
SVG-native editor and embeddable SVG2 + CSS3 engine in C++20, with GPU (WebGPU) and compact CPU renderers, built for correctness, security, and performance.
|
Lifetime helpers for asynchronous WebGPU callback userdata. More...
#include <memory>#include <utility>Namespaces | |
| namespace | donner |
| Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css. | |
Functions | |
| template<typename State> | |
| void * | donner::geode::retainWgpuCallbackState (const std::shared_ptr< State > &state) |
| Retains callback state independently of the initiating stack frame. | |
| template<typename State> | |
| std::shared_ptr< State > | donner::geode::takeWgpuCallbackState (void *userdata) |
| Transfers ownership retained by retainWgpuCallbackState into the callback. | |
Lifetime helpers for asynchronous WebGPU callback userdata.
| void * donner::geode::retainWgpuCallbackState | ( | const std::shared_ptr< State > & | state | ) |
Retains callback state independently of the initiating stack frame.
WebGPU callbacks may run after a bounded wait returns. The callback owns the returned userdata until it calls takeWgpuCallbackState, so releasing the initiating frame cannot leave WebGPU with a dangling pointer.
| state | Shared callback state to retain. |
| std::shared_ptr< State > donner::geode::takeWgpuCallbackState | ( | void * | userdata | ) |
Transfers ownership retained by retainWgpuCallbackState into the callback.
| userdata | Opaque userdata returned by retainWgpuCallbackState. |