Rasterization in Browser Rendering

Rasterization converts the browser's painted drawing instructions into pixel data that a graphics system can display. It is the stage where abstract visual content becomes concrete pixels for rendering.

After layout determines geometry and painting determines what visual content should be drawn, rasterization turns that painted content into pixel data. The rasterizer processes drawing operations such as shapes, text, images, borders, and shadows into rasterized regions, often called tiles.

Modern browsers commonly divide rendering work into tiles so that only the portions that need updating have to be rasterized again. This can reduce the amount of work required when a small part of a page changes.

Rasterization is distinct from compositing. Rasterization produces pixel content for drawing operations, while compositing combines already-rasterized layers or surfaces into the final displayed image. Depending on the browser and graphics architecture, rasterization work may use CPU or GPU resources.

A change that requires new pixels to be generated can trigger rasterization even when layout does not change. For example, changing a painted background or certain visual effects may require affected regions to be repainted and rasterized, whereas a transform can sometimes be handled primarily during compositing.

Key points

Interview questions

What is the difference between rasterization and compositing?

Rasterization converts drawing instructions into pixel content. Compositing takes rendered surfaces or layers and combines them according to their stacking, transforms, opacity, and other compositing properties. A compositor can sometimes move or transform already-rasterized content without generating those pixels again. This distinction is important when diagnosing rendering performance.

Can a CSS change require rasterization without triggering layout?

Yes. Not every visual change affects element geometry, so layout may remain unchanged while painting and rasterization still need to occur. For example, changing a painted background can require affected pixels to be regenerated. By contrast, some transform changes can be handled mainly by the compositor when the relevant content is already available as a composited surface.

What is rasterization in the browser rendering pipeline?

Rasterization is the process of converting painted drawing instructions into pixel data. The renderer takes things such as text, shapes, images, and visual effects and produces pixels that can be used for display. It happens after the browser has determined what needs to be painted. The resulting pixel content can then participate in compositing.

Why do browsers rasterize content in tiles?

Tiling divides rendered content into smaller regions instead of requiring one large rasterization operation for an entire page or surface. When only a small region changes, the renderer can often focus work on affected tiles. This can reduce unnecessary rasterization work and improve responsiveness. The exact tiling strategy depends on the browser's rendering architecture.

How would you investigate a page that is spending too much time rasterizing?

I would first profile the rendering workload rather than assuming that one particular CSS property is responsible. I would look for large or frequently invalidated painted regions, expensive visual effects, excessive raster work during scrolling or animation, and whether updates are affecting many tiles. Browser performance tooling can help correlate paint, raster, and compositing activity with specific elements and frames. The optimization should then target the actual invalidation or rendering cost rather than blindly adding layers.