@oh-just-another/renderer-canvas 0.58.1 → 0.60.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +78 -0
- package/README.md +63 -15
- package/dist/.tsbuildinfo +1 -1
- package/dist/canvas-target.d.ts +6 -1
- package/dist/canvas-target.d.ts.map +1 -1
- package/dist/canvas-target.js +18 -5
- package/dist/canvas-target.js.map +1 -1
- package/dist/constants.d.ts +81 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +81 -0
- package/dist/constants.js.map +1 -1
- package/dist/hi-dpi.d.ts +21 -13
- package/dist/hi-dpi.d.ts.map +1 -1
- package/dist/hi-dpi.js +28 -33
- package/dist/hi-dpi.js.map +1 -1
- package/dist/image-source.d.ts +11 -0
- package/dist/image-source.d.ts.map +1 -1
- package/dist/image-source.js +20 -0
- package/dist/image-source.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -12
- package/dist/index.js.map +1 -1
- package/dist/layered-canvas.d.ts +7 -1
- package/dist/layered-canvas.d.ts.map +1 -1
- package/dist/layered-canvas.js +6 -3
- package/dist/layered-canvas.js.map +1 -1
- package/dist/layered-surface.d.ts +16 -0
- package/dist/layered-surface.d.ts.map +1 -1
- package/dist/layered-surface.js +53 -15
- package/dist/layered-surface.js.map +1 -1
- package/dist/recording-target.d.ts +85 -25
- package/dist/recording-target.d.ts.map +1 -1
- package/dist/recording-target.js +250 -50
- package/dist/recording-target.js.map +1 -1
- package/dist/render-worker.js +16 -3
- package/dist/render-worker.js.map +1 -1
- package/dist/tile-compositor.d.ts +43 -1
- package/dist/tile-compositor.d.ts.map +1 -1
- package/dist/tile-compositor.js +48 -5
- package/dist/tile-compositor.js.map +1 -1
- package/dist/webgl-helpers.d.ts +7 -0
- package/dist/webgl-helpers.d.ts.map +1 -0
- package/dist/webgl-helpers.js +32 -0
- package/dist/webgl-helpers.js.map +1 -0
- package/dist/webgl2-curve.d.ts +11 -0
- package/dist/webgl2-curve.d.ts.map +1 -1
- package/dist/webgl2-curve.js +151 -68
- package/dist/webgl2-curve.js.map +1 -1
- package/dist/webgl2-ellipse.d.ts +0 -27
- package/dist/webgl2-ellipse.d.ts.map +1 -1
- package/dist/webgl2-ellipse.js +21 -47
- package/dist/webgl2-ellipse.js.map +1 -1
- package/dist/webgl2-msdf-text.d.ts +14 -0
- package/dist/webgl2-msdf-text.d.ts.map +1 -1
- package/dist/webgl2-msdf-text.js +84 -36
- package/dist/webgl2-msdf-text.js.map +1 -1
- package/dist/webgl2-rect-batch.d.ts +81 -0
- package/dist/webgl2-rect-batch.d.ts.map +1 -0
- package/dist/webgl2-rect-batch.js +201 -0
- package/dist/webgl2-rect-batch.js.map +1 -0
- package/dist/webgl2-stroke.d.ts +6 -30
- package/dist/webgl2-stroke.d.ts.map +1 -1
- package/dist/webgl2-stroke.js +17 -30
- package/dist/webgl2-stroke.js.map +1 -1
- package/dist/webgl2-target.d.ts +74 -8
- package/dist/webgl2-target.d.ts.map +1 -1
- package/dist/webgl2-target.js +356 -257
- package/dist/webgl2-target.js.map +1 -1
- package/package.json +10 -8
package/dist/layered-canvas.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { LAYER_ORDER } from "@oh-just-another/renderer-core";
|
|
2
2
|
import { Canvas2DTarget } from "./canvas-target.js";
|
|
3
|
-
import { setupHiDpi } from "./hi-dpi.js";
|
|
3
|
+
import { cappedDpr, setupHiDpi } from "./hi-dpi.js";
|
|
4
|
+
import { MAX_DEVICE_PIXEL_RATIO } from "./constants.js";
|
|
4
5
|
/**
|
|
5
6
|
* Manages one stacked `<canvas>` per layer. The background canvas sits at the
|
|
6
7
|
* bottom of the DOM stack and the overlay at the top, so drawing onto `main`
|
|
@@ -17,11 +18,13 @@ export class LayeredCanvas {
|
|
|
17
18
|
width;
|
|
18
19
|
height;
|
|
19
20
|
dprOverride;
|
|
21
|
+
maxDpr;
|
|
20
22
|
constructor(host, width, height, options = {}) {
|
|
21
23
|
this.host = host;
|
|
22
24
|
this.width = width;
|
|
23
25
|
this.height = height;
|
|
24
26
|
this.dprOverride = options.dpr;
|
|
27
|
+
this.maxDpr = options.maxDpr ?? MAX_DEVICE_PIXEL_RATIO;
|
|
25
28
|
if (getComputedStyle(host).position === "static") {
|
|
26
29
|
host.style.position = "relative";
|
|
27
30
|
}
|
|
@@ -37,7 +40,7 @@ export class LayeredCanvas {
|
|
|
37
40
|
canvas.style.inset = "0";
|
|
38
41
|
canvas.style.pointerEvents = name === "overlay" ? "auto" : "none";
|
|
39
42
|
host.appendChild(canvas);
|
|
40
|
-
const dpr = setupHiDpi(canvas, width, height, this.dprOverride);
|
|
43
|
+
const dpr = setupHiDpi(canvas, width, height, this.dprOverride ?? cappedDpr(this.maxDpr));
|
|
41
44
|
const ctx = canvas.getContext("2d");
|
|
42
45
|
if (!ctx)
|
|
43
46
|
throw new Error("Failed to obtain 2D context");
|
|
@@ -75,7 +78,7 @@ export class LayeredCanvas {
|
|
|
75
78
|
this.width = width;
|
|
76
79
|
this.height = height;
|
|
77
80
|
for (const [name, canvas] of this.canvases) {
|
|
78
|
-
const dpr = setupHiDpi(canvas, width, height, this.dprOverride);
|
|
81
|
+
const dpr = setupHiDpi(canvas, width, height, this.dprOverride ?? cappedDpr(this.maxDpr));
|
|
79
82
|
const layer = this.layers.get(name);
|
|
80
83
|
if (layer === undefined)
|
|
81
84
|
continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layered-canvas.js","sourceRoot":"","sources":["../src/layered-canvas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"layered-canvas.js","sourceRoot":"","sources":["../src/layered-canvas.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*/
|
|
56
56
|
readonly onWorkerError?: (error: unknown) => void;
|
|
57
|
+
/**
|
|
58
|
+
* Cap applied to `window.devicePixelRatio` when sizing layer bitmaps.
|
|
59
|
+
* Defaults to `MAX_DEVICE_PIXEL_RATIO` (2). Raise it for hosts that
|
|
60
|
+
* need native sharpness on DPR-3+ displays at the cost of 2–4× the
|
|
61
|
+
* raster work per layer.
|
|
62
|
+
*/
|
|
63
|
+
readonly maxDpr?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Forwarded to the `webgl2` backend's main-layer context. Defaults to
|
|
66
|
+
* `true`, which the incremental dirty-rect renderer requires (the rest
|
|
67
|
+
* of the previous frame must survive between composites). Set `false`
|
|
68
|
+
* only when the host redraws the whole frame every time — it removes a
|
|
69
|
+
* Safari/iOS full-recomposite-per-swap cost. Ignored by the `canvas2d`
|
|
70
|
+
* and `offscreen` backends. Does not affect PNG export / screenshots.
|
|
71
|
+
*/
|
|
72
|
+
readonly preserveDrawingBuffer?: boolean;
|
|
57
73
|
}
|
|
58
74
|
/**
|
|
59
75
|
* Factory entry point. Picks the right backend implementation, builds
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layered-surface.d.ts","sourceRoot":"","sources":["../src/layered-surface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"layered-surface.d.ts","sourceRoot":"","sources":["../src/layered-surface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAOhG;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,GAAG,CAAC,IAAI,EAAE,SAAS,G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ORDER } from "@oh-just-another/renderer-core";
|
|
|
2
2
|
import { LayeredCanvas } from "./layered-canvas.js";
|
|
3
3
|
import { WebGL2Target } from "./webgl2-target.js";
|
|
4
4
|
import { RecordingTarget } from "./recording-target.js";
|
|
5
|
-
import {
|
|
5
|
+
import { cappedDpr, setupHiDpi } from "./hi-dpi.js";
|
|
6
|
+
import { MAX_DEVICE_PIXEL_RATIO } from "./constants.js";
|
|
6
7
|
/**
|
|
7
8
|
* Factory entry point. Picks the right backend implementation, builds
|
|
8
9
|
* it, and returns the common `LayeredSurface` interface. Canvas2D is
|
|
@@ -15,16 +16,21 @@ import { setupHiDpiNoContext } from "./hi-dpi.js";
|
|
|
15
16
|
*/
|
|
16
17
|
export const createLayeredSurface = (host, width, height, options = {}) => {
|
|
17
18
|
const backend = options.backend ?? "canvas2d";
|
|
19
|
+
const maxDpr = options.maxDpr ?? MAX_DEVICE_PIXEL_RATIO;
|
|
18
20
|
switch (backend) {
|
|
19
21
|
case "canvas2d":
|
|
20
|
-
return new Canvas2DLayeredSurface(host, width, height);
|
|
22
|
+
return new Canvas2DLayeredSurface(host, width, height, maxDpr);
|
|
21
23
|
case "webgl2":
|
|
22
|
-
return new WebGL2LayeredSurface(host, width, height
|
|
24
|
+
return new WebGL2LayeredSurface(host, width, height, maxDpr, {
|
|
25
|
+
...(options.preserveDrawingBuffer !== undefined
|
|
26
|
+
? { preserveDrawingBuffer: options.preserveDrawingBuffer }
|
|
27
|
+
: {}),
|
|
28
|
+
});
|
|
23
29
|
case "offscreen":
|
|
24
30
|
if (!options.workerFactory) {
|
|
25
31
|
throw new Error("createLayeredSurface: workerFactory is required for the offscreen backend");
|
|
26
32
|
}
|
|
27
|
-
return new OffscreenLayeredSurface(host, width, height, options.workerFactory, options.onWorkerError);
|
|
33
|
+
return new OffscreenLayeredSurface(host, width, height, options.workerFactory, options.onWorkerError, maxDpr);
|
|
28
34
|
}
|
|
29
35
|
};
|
|
30
36
|
/**
|
|
@@ -60,8 +66,8 @@ export const createLayeredSurfaceWithFallback = (host, width, height, options =
|
|
|
60
66
|
class Canvas2DLayeredSurface {
|
|
61
67
|
backend = "canvas2d";
|
|
62
68
|
inner;
|
|
63
|
-
constructor(host, width, height) {
|
|
64
|
-
this.inner = new LayeredCanvas(host, width, height);
|
|
69
|
+
constructor(host, width, height, maxDpr) {
|
|
70
|
+
this.inner = new LayeredCanvas(host, width, height, { maxDpr });
|
|
65
71
|
}
|
|
66
72
|
get(name) {
|
|
67
73
|
return this.inner.get(name);
|
|
@@ -102,13 +108,16 @@ class WebGL2LayeredSurface {
|
|
|
102
108
|
mainTarget;
|
|
103
109
|
_width;
|
|
104
110
|
_height;
|
|
105
|
-
|
|
111
|
+
maxDpr;
|
|
112
|
+
constructor(host, width, height, maxDpr, options = {}) {
|
|
106
113
|
this._width = width;
|
|
107
114
|
this._height = height;
|
|
115
|
+
this.maxDpr = maxDpr;
|
|
108
116
|
// Build the Canvas2D layers first; the WebGL2 main canvas is
|
|
109
117
|
// spliced into the same stack between background and overlay.
|
|
110
118
|
this.base = new LayeredCanvas(host, width, height, {
|
|
111
119
|
layers: LAYER_ORDER.filter((name) => name !== "main"),
|
|
120
|
+
maxDpr,
|
|
112
121
|
});
|
|
113
122
|
const overlay = this.base.getCanvas("overlay");
|
|
114
123
|
const canvas = host.ownerDocument.createElement("canvas");
|
|
@@ -121,12 +130,16 @@ class WebGL2LayeredSurface {
|
|
|
121
130
|
host.insertBefore(canvas, overlay);
|
|
122
131
|
// Never call `getContext("2d")` on this canvas: the WebGL2 slot is
|
|
123
132
|
// exclusive — one canvas, one context kind, for the life of the
|
|
124
|
-
// element. `
|
|
133
|
+
// element. `setupContext: false` sizes the bitmap without touching
|
|
125
134
|
// the context.
|
|
126
|
-
|
|
135
|
+
setupHiDpi(canvas, width, height, cappedDpr(maxDpr), false);
|
|
127
136
|
try {
|
|
128
137
|
this.mainCanvas = canvas;
|
|
129
|
-
this.mainTarget = new WebGL2Target(canvas, width, height
|
|
138
|
+
this.mainTarget = new WebGL2Target(canvas, width, height, {
|
|
139
|
+
...(options.preserveDrawingBuffer !== undefined
|
|
140
|
+
? { preserveDrawingBuffer: options.preserveDrawingBuffer }
|
|
141
|
+
: {}),
|
|
142
|
+
});
|
|
130
143
|
}
|
|
131
144
|
catch (err) {
|
|
132
145
|
canvas.remove();
|
|
@@ -150,14 +163,17 @@ class WebGL2LayeredSurface {
|
|
|
150
163
|
this._width = width;
|
|
151
164
|
this._height = height;
|
|
152
165
|
this.base.resize(width, height);
|
|
153
|
-
|
|
166
|
+
setupHiDpi(this.mainCanvas, width, height, cappedDpr(this.maxDpr), false);
|
|
154
167
|
this.mainTarget.resize(width, height);
|
|
155
168
|
}
|
|
156
169
|
get size() {
|
|
157
170
|
return { width: this._width, height: this._height };
|
|
158
171
|
}
|
|
159
172
|
present() {
|
|
160
|
-
// Canvas2D
|
|
173
|
+
// Canvas2D paints synchronously; the WebGL2 main layer defers
|
|
174
|
+
// same-style sharp-rect fills into an instanced batch, so drain it
|
|
175
|
+
// here so trailing rects reach the framebuffer within this frame.
|
|
176
|
+
this.mainTarget.flushBatch();
|
|
161
177
|
}
|
|
162
178
|
dispose() {
|
|
163
179
|
this.mainTarget.dispose();
|
|
@@ -176,20 +192,29 @@ class WebGL2LayeredSurface {
|
|
|
176
192
|
* overlay (pointer-following handles) sees one rAF of delay
|
|
177
193
|
* because the worker draws after the main thread yields.
|
|
178
194
|
* • Memory: 3× workers, each owning a DPR-sized OffscreenCanvas.
|
|
179
|
-
* • drawImage
|
|
195
|
+
* • drawImage records `ImageBitmap` sources; other source types are
|
|
196
|
+
* skipped and counted on the `RecordingTarget`.
|
|
180
197
|
*/
|
|
181
198
|
class OffscreenLayeredSurface {
|
|
182
199
|
backend = "offscreen";
|
|
183
200
|
canvases = new Map();
|
|
184
201
|
targets = new Map();
|
|
185
202
|
workers = new Map();
|
|
203
|
+
/**
|
|
204
|
+
* Content signature of the command stream last posted to each layer's
|
|
205
|
+
* worker. A frame whose flushed buffer matches its layer's entry replays
|
|
206
|
+
* to the same pixels the worker already shows, so `present()` skips the
|
|
207
|
+
* postMessage (clone) + replay entirely — e.g. a static grid / overlay
|
|
208
|
+
* while only the main layer's GIF advances.
|
|
209
|
+
*/
|
|
210
|
+
lastSentSig = new Map();
|
|
186
211
|
_width;
|
|
187
212
|
_height;
|
|
188
213
|
dpr;
|
|
189
|
-
constructor(host, width, height, workerFactory, onWorkerError) {
|
|
214
|
+
constructor(host, width, height, workerFactory, onWorkerError, maxDpr = MAX_DEVICE_PIXEL_RATIO) {
|
|
190
215
|
this._width = width;
|
|
191
216
|
this._height = height;
|
|
192
|
-
this.dpr =
|
|
217
|
+
this.dpr = cappedDpr(maxDpr);
|
|
193
218
|
if (getComputedStyle(host).position === "static") {
|
|
194
219
|
host.style.position = "relative";
|
|
195
220
|
}
|
|
@@ -257,6 +282,10 @@ class OffscreenLayeredSurface {
|
|
|
257
282
|
this.targets.get(name)?.resize(width, height);
|
|
258
283
|
this.workers.get(name)?.postMessage({ type: "resize", width, height });
|
|
259
284
|
}
|
|
285
|
+
// A resize clears each worker's OffscreenCanvas (its bitmap is re-sized),
|
|
286
|
+
// so the next frame must repost even if its content signature is
|
|
287
|
+
// unchanged — drop the cached signatures to force it.
|
|
288
|
+
this.lastSentSig.clear();
|
|
260
289
|
}
|
|
261
290
|
get size() {
|
|
262
291
|
return { width: this._width, height: this._height };
|
|
@@ -266,6 +295,15 @@ class OffscreenLayeredSurface {
|
|
|
266
295
|
const cmds = target.flush();
|
|
267
296
|
if (cmds.length === 0)
|
|
268
297
|
continue;
|
|
298
|
+
// Skip layers whose command stream is identical to the one already
|
|
299
|
+
// shipped: the worker retains its last frame between replays, so not
|
|
300
|
+
// reposting leaves the correct pixels in place and saves the clone +
|
|
301
|
+
// worker redraw. `defineImage` (first bitmap ship) and `resize` change
|
|
302
|
+
// the stream, so image / size updates never get skipped.
|
|
303
|
+
const sig = target.lastSignature;
|
|
304
|
+
if (this.lastSentSig.get(name) === sig)
|
|
305
|
+
continue;
|
|
306
|
+
this.lastSentSig.set(name, sig);
|
|
269
307
|
this.workers.get(name)?.postMessage({ type: "replay", commands: cmds });
|
|
270
308
|
}
|
|
271
309
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layered-surface.js","sourceRoot":"","sources":["../src/layered-surface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAqC,MAAM,gCAAgC,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"layered-surface.js","sourceRoot":"","sources":["../src/layered-surface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAqC,MAAM,gCAAgC,CAAC;AAChG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AA0ExD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,IAAiB,EACjB,KAAa,EACb,MAAc,EACd,UAAuC,EAAE,EACzB,EAAE;IAClB,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,UAAU,CAAC;IAC9C,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,sBAAsB,CAAC;IACxD,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,UAAU;YACb,OAAO,IAAI,sBAAsB,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACjE,K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B,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;CACF"}
|
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
import type { Bounds, Color, Transform } from "@oh-just-another/types";
|
|
2
|
-
import type
|
|
3
|
-
/**
|
|
4
|
-
* Backend-agnostic RenderTarget that captures every method call as a
|
|
5
|
-
* structured command. Powers the "offscreen" pipeline: the main thread
|
|
6
|
-
* renders into a RecordingTarget, the resulting buffer is shipped to a
|
|
7
|
-
* worker via postMessage, and the worker replays the commands onto its
|
|
8
|
-
* OffscreenCanvas.
|
|
9
|
-
*
|
|
10
|
-
* Commands are a tagged union of primitive payloads (no class
|
|
11
|
-
* instances) so they survive `structuredClone` cleanly across the
|
|
12
|
-
* worker boundary. `flush()` returns the buffered commands and resets
|
|
13
|
-
* the internal log.
|
|
14
|
-
*/
|
|
2
|
+
import { LruCache, type FillRule, type LineCap, type LineJoin, type RenderTarget, type TextAlign, type TextBaseline } from "@oh-just-another/renderer-core";
|
|
15
3
|
export type RenderCommand = {
|
|
16
4
|
readonly k: "setFill";
|
|
17
5
|
readonly color: Color | null;
|
|
@@ -126,19 +114,35 @@ export type RenderCommand = {
|
|
|
126
114
|
readonly k: "resize";
|
|
127
115
|
readonly w: number;
|
|
128
116
|
readonly h: number;
|
|
117
|
+
} | {
|
|
118
|
+
readonly k: "defineImage";
|
|
119
|
+
readonly id: number;
|
|
120
|
+
readonly bitmap: ImageBitmap;
|
|
121
|
+
} | {
|
|
122
|
+
readonly k: "drawImage";
|
|
123
|
+
readonly id: number;
|
|
124
|
+
readonly dx: number;
|
|
125
|
+
readonly dy: number;
|
|
126
|
+
readonly dw: number;
|
|
127
|
+
readonly dh: number;
|
|
129
128
|
};
|
|
130
129
|
/**
|
|
131
|
-
* `drawImage`
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
130
|
+
* `drawImage` records `ImageBitmap` sources — they survive the
|
|
131
|
+
* postMessage boundary and are replayed onto the worker's canvas. Other
|
|
132
|
+
* source types (HTMLImageElement, HTMLCanvasElement) are skipped and
|
|
133
|
+
* counted in `skippedImageDraws` so the host UI can warn (or fall back
|
|
134
|
+
* to main-thread compositing for image-heavy scenes).
|
|
135
|
+
*
|
|
136
|
+
* To avoid re-shipping the same bitmap every frame (the offscreen path
|
|
137
|
+
* re-renders each frame so GIF / video advance), bitmaps are interned by
|
|
138
|
+
* identity to a stable numeric id: the first draw emits a `defineImage`
|
|
139
|
+
* carrying the bitmap, later draws of the same bitmap emit only a tiny
|
|
140
|
+
* `drawImage` referencing the id. An LRU bounds the live set; the worker
|
|
141
|
+
* mirrors the same-capacity LRU, so both evict the same id in lockstep.
|
|
137
142
|
*
|
|
138
|
-
* `measureText`
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
* pre-measure on a sidecar text shaper.
|
|
143
|
+
* `measureText` measures on a hidden 2D context with the active font, so
|
|
144
|
+
* caret / selection geometry lines up with the text the worker draws —
|
|
145
|
+
* without routing each call across the worker boundary.
|
|
142
146
|
*/
|
|
143
147
|
export declare class RecordingTarget implements RenderTarget {
|
|
144
148
|
private commands;
|
|
@@ -146,12 +150,61 @@ export declare class RecordingTarget implements RenderTarget {
|
|
|
146
150
|
private _height;
|
|
147
151
|
/** Counter so hosts can warn when images are silently skipped. */
|
|
148
152
|
skippedImageDraws: number;
|
|
153
|
+
/** Current font as a CSS shorthand, mirrored from `setFont` for `measureText`. */
|
|
154
|
+
private fontSpec;
|
|
155
|
+
/** Hidden 2D context used to measure text with the active font. */
|
|
156
|
+
private measureCtx;
|
|
157
|
+
/**
|
|
158
|
+
* Identity → id intern table for shipped bitmaps. Persists across
|
|
159
|
+
* `flush()` (the worker keeps its mirror across replays); bounded by an
|
|
160
|
+
* LRU of {@link OFFSCREEN_IMAGE_CACHE_CAP} so a long animation can't grow
|
|
161
|
+
* it without bound. Ids are monotonic and never reused, so an evicted
|
|
162
|
+
* bitmap that reappears is simply re-defined under a fresh id.
|
|
163
|
+
*/
|
|
164
|
+
private readonly imageIds;
|
|
165
|
+
private nextImageId;
|
|
166
|
+
/**
|
|
167
|
+
* Rolling 64-bit content signature (two 32-bit halves) of the commands
|
|
168
|
+
* accumulated since the last {@link flush}. Every {@link emit} folds the
|
|
169
|
+
* command's tag and primitive fields in, so two frames that record a
|
|
170
|
+
* byte-identical stream produce the same signature — letting the
|
|
171
|
+
* offscreen surface skip re-posting a layer whose replay would reproduce
|
|
172
|
+
* the pixels the worker already shows. Reset to the seeds on `flush`.
|
|
173
|
+
*/
|
|
174
|
+
private sigA;
|
|
175
|
+
private sigB;
|
|
176
|
+
private cmdCount;
|
|
177
|
+
/** Signature of the buffer returned by the most recent {@link flush}. */
|
|
178
|
+
private _lastSignature;
|
|
149
179
|
constructor(width: number, height: number);
|
|
150
180
|
get size(): {
|
|
151
181
|
readonly width: number;
|
|
152
182
|
readonly height: number;
|
|
153
183
|
};
|
|
154
184
|
resize(width: number, height: number): void;
|
|
185
|
+
/** Buffer one command and fold it into the rolling content signature. */
|
|
186
|
+
private emit;
|
|
187
|
+
/** Fold one 32-bit word into both signature halves (Murmur-style mix). */
|
|
188
|
+
private mix32;
|
|
189
|
+
/** Fold a number by its exact 64-bit IEEE-754 bit pattern. */
|
|
190
|
+
private mixNumber;
|
|
191
|
+
private mixString;
|
|
192
|
+
/**
|
|
193
|
+
* Fold an arbitrary command-field value: numbers by bits, strings by
|
|
194
|
+
* chars, nested `Transform` / bounds / options objects field-by-field,
|
|
195
|
+
* dash arrays element-by-element. `ImageBitmap` pixels are NOT hashed —
|
|
196
|
+
* a bitmap only ever appears in a `defineImage`, whose presence (and the
|
|
197
|
+
* accompanying numeric `id`) already differentiates the stream, so the
|
|
198
|
+
* per-frame `drawImage`-by-id path stays exact without touching pixels.
|
|
199
|
+
*/
|
|
200
|
+
private mixValue;
|
|
201
|
+
/**
|
|
202
|
+
* Content signature of the buffer returned by the most recent
|
|
203
|
+
* {@link flush}. Stable across frames that record an identical command
|
|
204
|
+
* stream; used by the offscreen surface to skip re-posting unchanged
|
|
205
|
+
* layers. Empty string before the first flush.
|
|
206
|
+
*/
|
|
207
|
+
get lastSignature(): string;
|
|
155
208
|
/** Pop the buffered commands and clear the internal log. */
|
|
156
209
|
flush(): readonly RenderCommand[];
|
|
157
210
|
/** Snapshot of the buffered commands without clearing. */
|
|
@@ -190,7 +243,8 @@ export declare class RecordingTarget implements RenderTarget {
|
|
|
190
243
|
measureText(text: string): {
|
|
191
244
|
width: number;
|
|
192
245
|
};
|
|
193
|
-
|
|
246
|
+
private ensureMeasureCtx;
|
|
247
|
+
drawImage(image: unknown, dx: number, dy: number, dw: number, dh: number, _dynamic?: boolean): void;
|
|
194
248
|
clear(bounds?: Bounds): void;
|
|
195
249
|
markDirty(bounds: Bounds): void;
|
|
196
250
|
}
|
|
@@ -198,6 +252,12 @@ export declare class RecordingTarget implements RenderTarget {
|
|
|
198
252
|
* Replay a previously-flushed command buffer onto a real RenderTarget.
|
|
199
253
|
* Used by the worker entry point to apply commands shipped from the
|
|
200
254
|
* main thread.
|
|
255
|
+
*
|
|
256
|
+
* `images` holds the bitmaps interned by {@link RecordingTarget}: a
|
|
257
|
+
* `defineImage` stores one under its id, a `drawImage` looks it up. The
|
|
258
|
+
* caller (worker) owns this cache so it survives across replays and
|
|
259
|
+
* mirrors the recorder's same-capacity LRU. When omitted (callers with
|
|
260
|
+
* no image commands) a throwaway cache is used.
|
|
201
261
|
*/
|
|
202
|
-
export declare const replayCommands: (target: RenderTarget, commands: readonly RenderCommand[]) => void;
|
|
262
|
+
export declare const replayCommands: (target: RenderTarget, commands: readonly RenderCommand[], images?: LruCache<number, ImageBitmap>) => void;
|
|
203
263
|
//# sourceMappingURL=recording-target.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recording-target.d.ts","sourceRoot":"","sources":["../src/recording-target.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,E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