gpucanvas 0.4.2 → 0.4.4
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/README.md +14 -16
- package/dist/{chunk-TC6XBFOY.js → chunk-IJ3R6X75.js} +568 -598
- package/dist/chunk-IJ3R6X75.js.map +1 -0
- package/dist/{editor-CuH4tLHg.d.ts → editor-B5nVs54L.d.ts} +7 -6
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +4 -4
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-TC6XBFOY.js.map +0 -1
package/README.md
CHANGED
|
@@ -55,16 +55,14 @@ later. Thirty agent cursors build the first view, then the camera pulls out to a
|
|
|
55
55
|
- Press `b` to run the benchmark tour, `f` to fit every screen in view, `t` to switch the theme.
|
|
56
56
|
- On a phone: pinch to zoom, drag to pan, tap to use a screen.
|
|
57
57
|
|
|
58
|
-
The GPU path needs HTML-in-Canvas
|
|
58
|
+
The GPU path needs WebGPU and HTML-in-Canvas. Chrome 157 and later on a computer has both on by
|
|
59
|
+
default, so the demo opens on the GPU path. On older Chrome or other Chromium builds, turn it on
|
|
60
|
+
with `chrome://flags/#canvas-draw-element` and relaunch.
|
|
59
61
|
|
|
60
|
-
1.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
Without the flag the demo runs the DOM fallback with 1,000 screens and says so. Phones start
|
|
65
|
-
smaller so the tab is not killed for memory: 1,000 screens on the GPU path (Chrome on Android with
|
|
66
|
-
the flag) and 250 as DOM. iPhone and iPad browsers have no HTML-in-Canvas yet, so they run the DOM
|
|
67
|
-
version and say so.
|
|
62
|
+
Without HTML-in-Canvas the demo runs the DOM fallback with 1,000 screens and says so. Phones start
|
|
63
|
+
smaller so the tab is not killed for memory: 1,000 screens on the GPU path and 250 as DOM. Firefox,
|
|
64
|
+
Safari and every iPhone or iPad browser have no HTML-in-Canvas yet, so they run the DOM version and
|
|
65
|
+
say so.
|
|
68
66
|
|
|
69
67
|
Status: early (0.4). The API can still change.
|
|
70
68
|
|
|
@@ -338,8 +336,8 @@ to npm from GitHub Actions, with provenance, through npm trusted publishing. See
|
|
|
338
336
|
6. **Live updates.** A MutationObserver marks a node dirty when its content changes, and
|
|
339
337
|
loading images, web fonts and CSS transitions trigger a redraw. Animated content on nodes
|
|
340
338
|
under 200 screen pixels refreshes at most four times a second.
|
|
341
|
-
7. **Input.** Only the page under the pointer is registered for hit testing, and
|
|
342
|
-
puts the node under the pointer exactly where the GPU drew it. Clicks, typing, selection and
|
|
339
|
+
7. **Input.** Only the page under the pointer is registered for hit testing, and its canvas
|
|
340
|
+
transform puts the node under the pointer exactly where the GPU drew it. Clicks, typing, selection and
|
|
343
341
|
hover all go to the real element. A focused node keeps its page live. Touch has no hover, so a
|
|
344
342
|
tap makes the node under the finger live and hands the click to the element it landed on. A
|
|
345
343
|
two-finger pinch zooms and pans the camera wherever the fingers land.
|
|
@@ -378,11 +376,11 @@ so a gap of a few percent, like frost above none, is noise rather than a speedup
|
|
|
378
376
|
## Chrome 157 findings (differ from the WICG explainer)
|
|
379
377
|
|
|
380
378
|
- **Hit-test registration.** A drawable is hit-tested only after
|
|
381
|
-
`canvas.updateElementGeometry(el,
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
`
|
|
385
|
-
|
|
379
|
+
`canvas.updateElementGeometry(el, options)` registers it.
|
|
380
|
+
- **Hit-test position.** Chrome 157 hit tests at `options.canvasTransform`, a matrix in CSS
|
|
381
|
+
pixels from the element's border box to the canvas, and `getElementTransform(el)` returns it.
|
|
382
|
+
Chrome 156 ignored `canvasTransform` and hit tested at the CSS box, positioned with
|
|
383
|
+
`el.style.transform = canvas.getElementTransform(el, drawMatrix)`. gpucanvas handles both.
|
|
386
384
|
- **Transform changes.** Changing a drawable's CSS transform or pointer-events reports it in
|
|
387
385
|
`changedElements`.
|
|
388
386
|
- **Newly drawable elements.** An element that just became drawable is not reported in
|