Lookup function — the SceneManager calls
setupContextLossHandling() BEFORE setupScene(), so capturing
this.scene at construction would close over undefined. The
getter is invoked at restore time, by which point the scene is
fully initialized.
Lookup function rather than a direct reference — the post-processing
manager IS preserved across rebuilds (its identity is stable so
downstream caches stay valid), but the host SceneManager initializes
it asynchronously after setupContextLossHandling runs. The
function returns null until init completes.
Resize the renderer / DPR after restoration; identical to the
SceneManager's updateRendererSize() private. Wired in via this
callback rather than being re-implemented here because it touches
SceneManager-only resize-debouncing state.
Notify subscribers (SceneLoader, NodeFactory, etc.) that the
context has been restored. The SceneManager forwards this onto
its own webgl-context-restored event — the recovery instance
doesn't need to know about EventDispatcher subscribers itself.
Notify the SceneManager to dispatch a change event so a frame
renders. Same forwarding pattern as onContextRestored.
OptionalonOptional hook fired when the context is LOST. Used to shrink the adaptive GPU byte budget (context loss is a strong out-of-VRAM signal), so the post-restore scene holds less and doesn't lose the context again. Forwarded via a callback rather than importing the budget module here, keeping this concern dependency-free + testable.
Side-effects the recovery class needs from the host scene. Passed once at construction; the recovery class never reads SceneManager fields directly, only this surface.