mirror of
https://github.com/xiaoqidun/ofdgo.git
synced 2026-10-29 16:44:23 +08:00
perf(性能提升): 优化字体并发与复杂页渲染
This commit is contained in:
1 parent
15a532a1ca
commit
04d7d2d672
3 files changed
+53
-21
No files matched your search
@@ -337,9 +337,11 @@ async function handleMessage(engine, { id, name, args }) {
|
||||
if (!saving && args.some(value => value?.mode !== undefined)) args.push(done => finish(done));
|
||||
}
|
||||
}
|
||||
const started = name === "ofdgoOpen" || name === "ofdgoRenderPage" ? performance.now() : null;
|
||||
const payload = await globalThis.ofdgoEngineCall(engine.id, name, ...args);
|
||||
signal?.throwIfAborted();
|
||||
const result = typeof payload === "string" ? JSON.parse(payload) : payload;
|
||||
if (started !== null && result.ok) result.elapsed = performance.now() - started;
|
||||
if (cancellable && !importing && !converting && !resources && result.ok) {
|
||||
result.data.size = size;
|
||||
if (name !== "ofdgoExportMedia") postMessage({ id, type: "export", stage: "save" });
|
||||
|
||||
Reference in new issue
Block a user