M13.30: Content-Aware Fill in a job worker on its GPU

contentFill.generate sends its plan (FillPlan) to a browser job worker:
the layer's frames render in passes on the worker's WebGPU device, the PNG
sequence goes back to browser storage (Services::store_file), and the page
adds the fill layer when the plan returns (WorkerReply::Fill). The smoke
test checks it; docs updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-04 03:15:54 -04:00
co-authored by Claude Opus 5.5
parent 91f4a603a9
commit 3921e6c680
10 changed files with 350 additions and 71 deletions
+4 -1
View File
@@ -311,7 +311,8 @@ function spawn(base) {
}
/// Run a job in a worker. `files`: [[path, Uint8Array]] the job reads; `onMessage(type, json,
/// path, bytes)` receives "reply" (json), "file" (path, bytes) and "error" (json = message).
/// path, bytes)` receives "reply" (json), "file" (path, bytes: a rendered file to download),
/// "store" (path, bytes: a file to keep in browser storage) and "error" (json = message).
export function workerRun(id, json, files, base, onMessage) {
const w = idle.pop() ?? spawn(base);
running.set(id, w);
@@ -326,6 +327,8 @@ export function workerRun(id, json, files, base, onMessage) {
}
} else if (m.type === "file") {
onMessage("file", null, m.path, new Uint8Array(m.bytes));
} else if (m.type === "store") {
onMessage("store", null, m.path, new Uint8Array(m.bytes));
} else if (m.type === "stats") {
jobStats.push({ kind: m.kind, gpu: m.gpu, passes: m.passes, readbacks: m.readbacks, ms: m.ms });
if (jobStats.length > 16) jobStats.shift();