问题
I have a CATransformLayer which has a couple of sublayers (CAShapeLayers).
I'm setting the frames of my CAShapeLayers to have a size of (512, 512). Their content is (slightly) smaller than this.
When rotating the whole scene in 3D it's slowing down the frame rate - but it renders everything correctly.
If I do not set the frame property of the CAShapeLayers, then it's rotating the scene in 3D super fast but there are rendering mistakes. These are:
- Layers disappear at certain angles
- Wrong z-ordering (some layers get rendered on top of each other that should be rendered the other way around)
What can I do to get a good performance and correct rendering?
I'm setting the frames of the shape layers like this:
shapeLayer.frame = CGRectMake(0, 0, 512.0, 512.0);
来源:https://stackoverflow.com/questions/23091663/catransformlayer-performance-issues-when-setting-frame-of-sublayers