9.3 · Offscreen passes, rasterization, blending, shadows and masks

Most smooth screens become janky because of a handful of innocent-looking effects. Each has a known cost model, so you can predict and fix it instead of guessing.

Mental model. An effect is cheap when the GPU can apply it as it draws each layer. It is expensive when the layer must first be rendered somewhere else and composed afterwards.

What makes a frame expensive

Offscreen rendering, rasterization, and blending.

  1. What is offscreen rendering, which properties cause it, and how do you avoid the cost? 9.3.1 · L3
    Normally the GPU draws each layer straight into the frame buffer in order. Offscreen rendering means a layer (and often its whole subtree) must first be…
  2. What are blending and overdraw, how do opaque views help, and what are dirty rectangles? 9.3.2 · L3
    When a layer is opaque (isOpaque true, its colour fully opaque, and its contents without alpha), the GPU can write its pixels directly. When it is translucent…

More in Layout, rendering & animation