Everything on screen is pixels; what differs is who decides them

What is a WebGL canvas, and how is it different from the rest of a web page? In the end it isn't: the words, the images and the shader are all pixels the GPU puts on screen. What differs is who decides each pixel's colour. For HTML and CSS the browser plans and paints them for you; in a canvas your own code does, through a graphics API the browser translates for each machine.

  1. 01The question
  2. 02Everything on screen is pixels
  3. 03The browser plans and paints the rest
  4. 04A canvas is painted through a graphics API
  5. 05Every machine has its own API, and the browser translates
  6. 06A browser inside the browser

01The question

A web page puts things on screen in two ways. Most of it is HTML and CSS: headings, links and images, laid out in boxes. Some of it can be a : a rectangle where code paints, such as a shader drifting behind a portfolio's heading, drawn with .

A post from a design tool mixes the two. Its canvas shows "~7,000 real HTML/CSS frames", two million elements in all, at 120 frames a second, and it calls what does it "a mini browser, in Rust, running inside your browser". With only those two ideas in hand the post makes no sense: HTML is one thing, a canvas is another. What joins them is underneath both, and once it is in place the rest stacks on it.

02Everything on screen is pixels

A pixel is one dot of colour, and everything on a screen is made of them: not only the shader, but the heading, the links and the photographs. All of it ends up as colours in the , and the fills it in. What differs is who decides what colour each pixel should be.

  • In a shader, you decide. Your code tells the GPU what colour to make each pixel. There is nothing to arrange first: you aren't saying "put a heading here", you're saying "make this pixel this colour".
  • In HTML and CSS, you describe. "A heading, this font, 48 px, centred, 24 px of space under it." A description isn't pixels. Something has to turn it into them, and that something is the browser.
Fig 01
One page, two ways to its pixels. Ink is whoever decides them: the browser's planner and painter for the heading, your shader for its own rectangle.

Every path ends in pixels on the GPU. The difference is whether the browser decides them or your code does.

03The browser plans and paints the rest

Turning a description into pixels is two jobs, and Chrome has a part for each; together they are its . Blink is the planner. It reads the HTML and CSS, works out where everything goes and how big it is ("the heading is 640 px wide and starts 120 px from the top"), and writes down what to draw. Skia is the painter. It turns that list into pixels, on the GPU. Safari's engine, WebKit, has parts that do the same.

The planner keeps every element as a live object in the : something a script can change at any moment, a screen reader can read, a person can select. That is what makes a page easy to build, since you only describe and the browser does the rest. It is also what each element costs, in memory and in planning time. A few thousand elements is an ordinary page. Two million is more than Blink is built to keep moving at 120 frames a second.

A canvas is the way round it. It is one element, <canvas>, a blank rectangle. Blink places the rectangle and stops there: what goes inside is left to your code. When you set one up you say how you'll paint into it: with a simple 2D API, with WebGL, or with . Chrome then puts what you painted into its place in the page with everything else, and the finished frame goes to the screen.

HTML is a description the browser turns into pixels. A canvas is a hole in the description, where your code paints.

04A canvas is painted through a graphics API

Your code doesn't hand the GPU pixels either. It goes through a : a set of functions the system gives you, the way localStorage and fetch are functions the browser gives you. The API is a contract ("here is a shape, here is a texture, use this shader, now draw"). Behind it, the driver, written by whoever made the chip, turns those calls into commands that chip understands.

Drawing one triangle takes three calls in any of them: copy its three corners into the GPU's memory, pick the shader, draw. In WebGL the last is gl.drawArrays. A frame of a game is thousands of these , about 30 or 60 times a second, and they are collected into a list and sent to the GPU in batches.

The isn't part of the API. It is a small program in a language of its own, GLSL for WebGL, and your JavaScript carries it as a string, the way fetch carries a JSON body without reading it. WebGL has it compiled for the GPU, which then runs it once for every corner of a shape, or once for every pixel.

WebGL is the delivery: functions your JavaScript calls on the CPU. The shader is the parcel: a program that runs on the GPU.

05Every machine has its own API, and the browser translates

Each platform has its own graphics API, mostly for reasons of history and politics: Metal on Apple's devices, DirectX on Windows and Xbox, Vulkan on Linux and Android, NVN on Nintendo's Switch. Each has its own shader language too: MSL for Metal, HLSL for DirectX.

A website can't call Metal: it would only work on a Mac, and a page reaching straight for the GPU would be a security risk. So the browser offers one API that is the same everywhere, and translates it into the machine's own as the page runs. In Chrome, a translator called ANGLE turns WebGL calls into Metal calls on a Mac and DirectX calls on Windows, and rewrites the GLSL into MSL or HLSL. Your page's code never changes.

Fig 02
Your page's codeThe same

On a Mac both translators write Metal, Apple's API, and both shaders are rewritten into MSL, Metal's shader language.

One page's calls on three machines, in Chrome. The page stays the same; what each translator writes changes.

WebGL is the older of the browser's two. It copies OpenGL, a cross-platform API from 1992, by way of OpenGL ES, its cut-down version for phones. WebGPU is its replacement: in Chrome since 2023, in every major browser by 2026. It copies the modern APIs (Metal, Vulkan, DirectX 12), has its own shader language (WGSL) and its own translator in Chrome (Dawn). What matters here is the cost of each draw. WebGL checks and sets things up again on every call; WebGPU has you prepare once and send whole batches, which is how GPUs work now, so far more can be drawn in each frame. It can also use the GPU for sums that aren't drawing at all.

Translation costs a moment, once. A shader has to be rewritten and compiled for the chip before it can run, which is why a shader-heavy page can take a beat before its first frame, and why some PC games show "compiling shaders" when they start. After that, the compiled version is reused.

Your page speaks one API. On each machine the browser translates it into that machine's own.

06A browser inside the browser

Now the post reads plainly. The tool's canvas shows thousands of app screens at once, and each is a real app made of HTML and CSS: content that normally goes down the browser's path. Left to Chrome, Blink would have to plan 7,000 pages and two million elements, and plan them again at every zoom, scroll and click.

So they kept the content and replaced the planner and the painter. Their own, written in Rust, reads the HTML and CSS and works out the layout as Blink would, then paints the result through WebGPU into one canvas, the way a shader does. As far as Chrome can tell, the page is mostly one canvas, and Chrome only shows its pixels. "A mini browser inside your browser" is meant literally: planning and painting HTML is most of what a browser does.

Rust doesn't run in a page by itself. It is compiled to , a second kind of code browsers run besides JavaScript, at close to the machine's own speed. The engine does the working out on the CPU and hands batches of draw calls to WebGPU for the GPU.

Their engine can be faster than Chrome's because it does less. Chrome's planner keeps every element live, ready to be changed, read aloud or selected; theirs does only what a design canvas needs. It can skip what is off-screen or too small to see when zoomed out, and paint what is left in one batch, which is the cost WebGPU keeps low.

Fig 03
The design is the code
YesNoYes
Thousands of frames
NoYesYes
Three ways to build a design tool's canvas, read top down. Ink is whoever plans and paints the frames.

Figma made the same trade years ago: a C++ engine compiled to WebAssembly paints its whole canvas, through WebGL and now WebGPU. The difference is what is painted. A Figma frame is Figma's own drawing, so getting from a design to code is a translation. This tool's frames are your app's own HTML and CSS, so the design is the code, and its engine has to match Chrome's for every CSS property, which Chrome's teams have worked at for well over a decade. Expect gaps a demo doesn't show.

The same move works outside a browser. Raea, a tool for making video from code, pairs a small HTML and CSS renderer with a game engine, both drawing through a Rust library that implements WebGPU, so a page's captions and a 3D scene land in one frame on the GPU, ready for the video encoder.

They took content made for the browser's path and gave it a planner and painter of their own, painting into a canvas the way a shader does.

Connected

Side threads

Questions that came up once the main idea began to hold, kept as they were asked. Each opens beside the paragraph it grew from.

Terms

Checked

What the chat had wrong or only half right, against sources. The note above already says the corrected thing.

  1. Blink is the planner and Skia the painter.Blink also writes the list of what to draw (Chrome's paint step); Skia turns the list into pixels in Chrome's GPU process (raster). Planner and painter is the right split, with the list made on the planner's side.Chrome for Developers, RenderingNG architecture
  2. Firefox 145 brought WebGPU to macOS in November 2025.Only to Apple Silicon Macs on macOS Tahoe. Firefox 147, in January 2026, brought it to Apple Silicon on every supported macOS; Intel Macs were still waiting.Mozilla Bugzilla, bug 1992212
  3. OpenGL, from 1992, isn't owned by one company: Khronos runs it.Silicon Graphics released it in 1992, and an industry board steered it until Khronos took it over in 2006.Khronos Group, OpenGL
  4. Blitz is the Blink part of a browser on its own: it reads HTML and CSS and works out layout.It has a painter too, drawing through Vello on wgpu, and its CSS is read by Stylo, Firefox's style engine. It is a small renderer, planner and painter, without the rest of a browser.DioxusLabs/blitz, README