Scaling performance issues with multiple CALayers

I have two CALayer subclasses, each with its own drawLayer: (CALayer *) inContext: (CGContextRef) ctx delegate. They are both simple layers (some separate color shapes drawn with CG paths), but I need to scale around 12 instances at a time and am having some frame rate issues. I noted that all layers are opaque to try and free some of the loops, and tried to use implicit and explicit base animations (directly in the bounds property) and also assign the CA3DTransform matrices to the transform property.

Does anyone know of a good way to quickly resize objects while maintaining a good frame rate?

0


a source to share


2 answers


It's not like the iPhone's capabilities.

One solution might be to display them on the image and scale them? This is (more or less) what CoreAnimation will do. It sounds like you have a flaw - maybe you should post your code and people can look at it.



Where do you redraw and what do you redraw?

+1


a source


I agree with Roger.

Check how often you call methods drawLayer:inContext:

(or whatever you use to paint). A simple NSLog can do this. If they keep getting called, consider Roger's idea of ​​image rendering and scaling.



You may have to run productivity tools to find the bottleneck.

0


a source







All Articles