开发者

Mixing CGLayers and CALayers

Here's the setup:

I have a NSView which is a CALayer-backed view, and contains many CALayers. I have a CALayer for the 'background' of the view, and many small CALayers which are sublayers. Sometimes this view can be very big (as large as 2560x1400), and when it does there is a very noticeable lag in the CALayers. My guess is that Core Animation has some trouble with very large CALayers.

So, I would like to change this 'background' layer from being a CALayer开发者_如何学运维 to maybe a CGLayer or something, where it would be rendered like a normal CGLayer into the view. However, on top of it, the small CALayers would still operate just as they do now. That way I only have small CALayers, the 'background' layer can be cached in a CGLayer, and hopefully the performance will significantly increase.

Anyone know how this could be accomplished?


After researching more, it doesn't look like this can be accomplished. An NSView is either CALayer-backed, or it's not.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜