Blink's Layer Tree: Architecture, Rendering, and Performance
Blink2865 Syys 2025

Blink's Layer Tree: Architecture, Rendering, and Performance

The provided text offers an in-depth look into Blink's layer tree, a crucial component in Chromium's rendering engine responsible for transforming web pages into pixels. It explains the architecture of layers, detailing how the Document Object Model (DOM) is processed through various stages like style, layout, and paint, ultimately leading to the creation of layers that are then composited. The article also describes the rendering lifecycle, outlining the steps involved in updating and displaying frames, from initial layout to final GPU composition. Finally, it highlights performance considerations related to layer usage, emphasizing how layers enable hardware acceleration for smooth animations and scrolling, while also cautioning against their overuse and offering debugging tools for optimization.

Jaksot(391)

blink::PaintChunk and blink::DisplayItemList

blink::PaintChunk and blink::DisplayItemList

grouping and content. PaintChunk: groups sequential display items that share the same property‑tree state and cull/visibility; it’s the unit we layerize and invalidate.DisplayItemList: the recorded Sk...

10 Loka 202537min

blink::PaintArtifact

blink::PaintArtifact

the immutable “what to draw” package for this frame. A PaintArtifact is the product of Blink painting: a DisplayItemList plus an ordered vector of PaintChunks. It is immutable post‑creation and design...

10 Loka 202531min

blink::PaintController

blink::PaintController

builds the display list + paint chunks and manages caching. As painters call into GraphicsContext, they also drive a PaintController which groups drawing into display items and paint chunks (each keye...

10 Loka 202529min

blink::GraphicsContext

blink::GraphicsContext

immediate drawing API that records to a display list. Painters for layout objects use GraphicsContext to “draw”—but in modern Blink those calls get recorded into a display list (PaintRecord) backed by...

10 Loka 202544min

blink::TransformPaintPropertyNode / ClipPaintPropertyNode / EffectPaintPropertyNode / ScrollPaintPropertyNode

blink::TransformPaintPropertyNode / ClipPaintPropertyNode / EffectPaintPropertyNode / ScrollPaintPropertyNode

These are the nodes within those four trees. Every piece of painted content (a “paint chunk”) is associated with a tuple of (Transform, Clip, Effect, Scroll) nodes—its PropertyTreeState. This precisel...

10 Loka 202533min

blink::PaintPropertyTreeBuilder

blink::PaintPropertyTreeBuilder

builds/updates paint property trees.Consumes the layout/fragment data and produces the four paint property trees (Transform, Clip, Effect, Scroll) for the current frame. These trees encode coordinate ...

10 Loka 202547min

blink::PrePaintTreeWalk

blink::PrePaintTreeWalk

cross‑frame pre‑paint traversal. Runs in the InPrePaint lifecycle phase. Walks the entire layout tree starting at the root LocalFrameView, updating paint invalidation state and computing the context n...

10 Loka 202531min

blink::NGPhysicalFragment and friends

blink::NGPhysicalFragment and friends

Layout takes the styled DOM and produces a fragment tree of positioned boxes. In modern Blink this is LayoutNG; the core artifact is NGPhysicalFragment, which stores geometry and is used downstream fo...

10 Loka 202537min