mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 16:11:20 -08:00
fix(jassub): [PKG-JASSUB-08] transfer offscreen canvas before queued rendering
This commit is contained in:
1 parent
0f3c068aae
commit
b4b0276fe9
22 files changed
+9667
-29
No files matched your search
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"task": "PKG-JASSUB-08",
|
||||
"baselineCommit": "0f3c068aae1415c2d40ede8708f02f4c5864fe7a",
|
||||
"file": "packages/artplayer-plugin-jassub/src/jassub.es.js",
|
||||
"originalSha256LF": "1fdcf24d206e8711348dddcb5fe7b656007a9b1d81a992bb497c6d10bd0a2cdb",
|
||||
"patchedSha256LF": "6a96af7914f702eb7d6303b466cbe16abddd278040f60cd29f153cdf60e92cb2",
|
||||
"patchFile": "refactor/baselines/jassub-offscreen.patch",
|
||||
"patchSha256LF": "b6cb5c4cb3c9fab920724fa7ddfe7a6b58db68d177f720231f5823fc5bfd6dac",
|
||||
"predecessor": "refactor/baselines/jassub-vendor-patch.json",
|
||||
"purpose": "Transfer the initial offscreen canvas on Worker readiness before releasing queued resize/render messages; keep later reattachment behavior unchanged."
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,24 @@
|
||||
diff --git a/packages/artplayer-plugin-jassub/src/jassub.es.js b/packages/artplayer-plugin-jassub/src/jassub.es.js
|
||||
index 904b40888..6bd2bc2c6 100644
|
||||
--- a/packages/artplayer-plugin-jassub/src/jassub.es.js
|
||||
+++ b/packages/artplayer-plugin-jassub/src/jassub.es.js
|
||||
@@ -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"));
|
||||
}
|
||||
/**
|
||||
Reference in new issue
Block a user