9.2 · From layout to the GPU, and the two layer trees

Your app does not draw to the screen. It builds a tree of layers and hands it to another process, which composites it with the GPU. Knowing the stages tells you where a slow frame was lost.

Mental model. A frame is a pipeline across two processes: your app prepares the description of the frame, and the render server draws it. You can be slow in either half.

The pipeline

The stages of one frame and who does what.

  1. Walk through how a frame gets from your code to the screen. 9.2.1 · L5
    A frame has two halves. In your process, the Core Animation commit happens at the end of the current run-loop turn (a run-loop observer drives it). It has four…

Layer trees

Model tree, presentation tree and backing stores.

  1. What are the model, presentation and render layer trees, and how do the layer geometry properties relate? 9.2.2 · L5
    Core Animation keeps three trees. The model tree is the layers you create and configure; reading layer.opacity gives the target value as you last set it. The…

More in Layout, rendering & animation