The shouldRasterize property of a CALayer is a hint to the system that this element and its sublayers are:
- Going to need offscreen rendering.
- Won't have sublayers that change at any point.
If this is actually the case and you set shouldRasterize to YES then the system will composite your view to an image once with the GPU.
The cache size for these rasterized views is 2.5x the screen size.
The rasterized images are evicted from the cache if they're unused for more than 100ms.
Any time the necessary image isn't in the cache an offscreen render pass occurs.
The catch: If you enable this property on a layer that won't actually benefit from rasterization or fit these requirements, you could unknowingly introduce an offscreen render pass on every frame, hurting performance dramatically.
A solution: When you profile your app with the Core Animation instrument, if you check the Color Hits Green and Misses Red option on the right side you'll be alerted to any cache misses that would result in an offscreen pass.