Paint and Composite
You'll learn: How browsers actually draw pixels and stack layers to display the final page on your screen.
From Blueprint to Pixels
After the browser completes the Layout step (calculating where every element should be positioned), it's time to actually draw something visible. This happens in two final stages: Paint and Composite.
Paint: Filling in the Colors
Think of Paint like coloring in a coloring book. The browser now knows the outline and position of every box from Layout—now it needs to fill them in with actual colors, text, images, borders, and shadows.
The browser goes through the Render Tree and creates paint records—instructions like "draw red text here," "fill this background blue," "render this image at these coordinates." It's converting abstract boxes into actual pixel data.
This can be broken into multiple layers (like transparent sheets stacked on top of each other). Elements with certain CSS properties—like transparency, 3D transforms, or animations—often get their own layer.
Composite: Stacking the Layers
After painting individual layers, the browser needs to composite them—combining all those transparent sheets in the correct order to create the final image you see.
The compositor takes all the painted layers and merges them together, respecting which elements should appear on top of others (z-index, stacking contexts). This step is handled by the GPU (graphics processor) for better performance.
Modern browsers are smart: if only one layer changes (like an animated element), they can repaint just that layer and re-composite, without redoing everything.
Key Takeaway: Paint converts layout boxes into pixel instructions for each layer, then Composite stacks those layers together to create the final image displayed on your screen—completing the Critical Rendering Path.