|
|
Donner SVG 0.8.0-pre
SVG editor and embeddable C++20 engine.
|
Main-thread bridges for the single-canvas architecture whole-app-worker build. More...
Main-thread bridges for the single-canvas architecture whole-app-worker build.
In that build main() runs on a pthread (Emscripten PROXY_TO_PTHREAD) and the single #canvas is transferred to it as an OffscreenCanvas. EM_JS bodies run in the JS context of the calling thread, so every window, document, and navigator reference in the shipping editor's EM_JS probes evaluates in a DedicatedWorkerGlobalScope where those globals do not exist. This header owns the replacements.
Two mechanisms, chosen per seam by how often it is read:
Nothing here is compiled unless DONNER_EDITOR_WHOLE_APP_WORKER is defined, so the shipping package is unaffected.