Search code examples
objective-ccocoacore-animationcalayershadow

CALayer shadow performance


I have a grid CALayer (with a parent NSView, enclosed by an NSScrollView) that contains a bunch of sublayers, each sublayer drawing an image. When I disable the shadows for the sublayers, the performance is great. However, as soon as I enable them, drawing starts to lag badly.

Are there any things I can do to improve this? I've heard of using shouldRasterize on iOS to improve shadow performance, but that property is not available on OS X.


Solution

  • Have you turned on layer-backing? Then the drawing contents would be cached and that might improve performance.