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

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