CATransformLayer - Performance issues when setting frame of sublayers

无人久伴 提交于 2019-12-10 10:35:54

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!