Daily iOS
UIKit

Offscreen rendering and the render pipeline

In a UIKit list, you applied layer.cornerRadius plus masksToBounds plus shadow to cells with profile images and the scroll frame rate dropped. From the render pipeline's point of view, why is this expensive?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

Masks and shadows force an offscreen pass where the compositor draws the layer into a separate buffer first and then composites it again, so the GPU pays a context switch for every cell.

Share a question