MCPcopy Create free account
hub / github.com/CapSoftware/Cap / startRenderLoop

Function startRenderLoop

apps/desktop/src/utils/frame-worker.ts:809–827  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

807}
808
809function startRenderLoop() {
810 if (rafRunning) return;
811
812 if (renderMode === "pending") {
813 rafRunning = true;
814 _rafId = requestAnimationFrame(renderLoop);
815 return;
816 }
817
818 const hasRenderer =
819 renderMode === "webgpu"
820 ? webgpuRenderer !== null
821 : offscreenCanvas !== null && offscreenCtx !== null;
822
823 if (!hasRenderer) return;
824
825 rafRunning = true;
826 _rafId = requestAnimationFrame(renderLoop);
827}
828
829function stopRenderLoop() {
830 if (_rafId !== null) {

Callers 4

initWorkerFunction · 0.85
doInitFunction · 0.85
processFrameBytesSyncFunction · 0.85
frame-worker.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected