CATransformLayer - Performance issues when setting frame of sublayers

148 views Asked by At

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);
0

There are 0 answers