fix(jassub): [PKG-JASSUB-08] transfer offscreen canvas before queued rendering

This commit is contained in:
Harvey Zhao committed 2026-09-14 02:29:12 +08:00
1 parent 0f3c068aae
commit b4b0276fe9
22 files changed
+9667 -29

No files matched your search

@@ -143,7 +143,7 @@ class o extends EventTarget {
// @ts-ignore
useLocalFonts: typeof queryLocalFonts < "u" && (e.useLocalFonts ?? !0),
hasBitmapBug: o._hasBitmapBug
}), this._offscreenRender === !0 && this.sendMessage("offscreenCanvas", null, [this._canvasctrl]);
});
}).catch((error) => {
if (!this._destroyed) this.destroy(error);
});
@@ -580,6 +580,10 @@ class o extends EventTarget {
}
_ready() {
if (this._destroyed) return;
if (this._offscreenRender === !0 && !this._initialOffscreenSent) {
this._initialOffscreenSent = true;
this._worker.postMessage({ target: "offscreenCanvas", transferable: [this._canvasctrl] }, [this._canvasctrl]);
}
this._init(), this.dispatchEvent(new CustomEvent("ready"));
}
/**