liveBook · Manning

Composite

As explained in CSS in Depth, Second Edition

Composite is the rendering stage that combines painted layers into the final displayed image in stacking order.

Composite is the third rendering stage, after layout and paint. It combines painted layers into the displayed image after the browser has calculated styles, positions, sizes, and pixels. section 16.3.1

The rendering pipeline separates three kinds of work:

  • Layout calculates each element’s space and position, reflowing related content when geometry changes. section 16.3.1
  • Paint fills pixels for text, images, borders, shadows, and backgrounds, storing portions of the page in layers. section 16.3.1
  • Composite combines the painted layers into the final displayed image. section 16.3.1

Why the stages matter

Changing an element’s width, height, or position can require layout and reflow. Changing its background color requires repainting but not layout, because the color does not affect sizing or position. Both changes eventually contribute to the composited result. section 16.3.1

Figure 16.12 The three stages of the rendering pipeline
figure

Use the rendering-pipeline diagram to compare layout, paint, and composite as successive stages. section 16.3.1

How CSS in Depth, Second Edition covers it

How deep it goes
Defines compositing within the three-stage pipeline but does not detail its implementation or layer-stacking algorithm.
Examples
Contrasts width, height, position, and background-color changes by their layout, reflow, and repaint consequences.
What it assumes
Assumes familiarity with computed styles and pixels while explaining the browser’s three-stage rendering sequence.
What you can do after
Evaluate how changes to geometry and appearance progress through layout, paint, and composite.
How it connects
Connects compositing with layout, paint, rendering pipeline, layers, and GPU rendering.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of CSS in Depth, Second Edition. The section links point to the parts of the book it draws on.