A canvas that moves itself to the GPU
Canvas games and busy drawing pages now run on the GPU: 1500 turning sprites went from 38 to 62 frames a second at the same memory, with every pixel the same bytes as the software canvas on Apple Silicon and DirectX 12. A canvas shadow drawn again is about five times faster too. 8 changes, each with its own off switch or a law in the test gate. The GPU row holds at 65 and the overall score at 74: shapes and text on a canvas still run in software.
A canvas that moves itself to the GPU
A canvas page can read its own pixels at any moment, so the GPU's answer has to match the software's exactly, or a script sees something different depending on which one drew. That is why we rewrote image sampling in whole numbers first. Then came the part a page should never notice. Draws now wait in a list. A canvas that draws many images moves to the GPU, and a canvas that turns to shapes moves back, because software still draws those faster. Anything that reads the canvas finishes the list first. A law runs random drawing on both and compares the bytes every round, on Apple Silicon and on DirectX 12. In the app, 1500 turning sprites went from 38 to 62 frames a second at the same memory.
Faster, and why we are not done
Against the reference browser this is a mixed result, so here it is plainly. On the benchmark's 11 rows, the same bytes come out of our GPU and our software on every row. We are ahead on fullscreen fills and on reading pixels back. The reference's GPU is still ahead on scaled and rotated sprites, and its software is ahead on shapes, lines, gradients, text and shadows. Moving shapes and text over is next, and the GPU row of the score stays at 65 until that work is measured.
The same shadow, once
Blurring a shadow is the slow part of drawing it, and a page often draws the same one many times. A canvas now keeps its last 8 finished shadows, up to 1 MB each, and compares the whole shape before reusing one. We kept this per canvas on purpose. A cache shared across pages would let one page time what another has drawn, and the speed is not worth that.