Re: Getting the best frame rate for NSView drawing
Re: Getting the best frame rate for NSView drawing
- Subject: Re: Getting the best frame rate for NSView drawing
- From: Kenneth Baxter <email@hidden>
- Date: Wed, 28 Mar 2012 12:45:21 +0000 (GMT)
Thanks for taking the time to put together these replies Graham and Uli.
Yes, I know it's a heavy load in my test case, but it is something that could happen from time to time in the real application.
The contents of about half the layers seldom change, so from that perspective, caching contents as either NSImages, CIImages, CGLayers or using CALayers would seem to be a good idea. The other half of the layers are simple, and just consist of some bezier curves, and change a bit more frequently.
The other day I wrote asking about technology choices and outlined why layer backed views didn't seem to be an option (can't guarantee z order), and why a CALayer hosting view didn't seem to be an option (show stopper drawing bug during animation of large layers, inability to add subviews leading to problems with overlay windows, problems with CAShapeLayers etc).
If I understand you correctly, you might be suggesting using CALayers purely for drawing and using my own animations for moving the layers around, and triggering layer redraws when necessary. That may avoid some of the bugs that I have run into with layer animations, but I would still have to use overlay windows instead of using subviews, and work out issues with the tiled background and zooming etc.
If I could find a way to guarantee the z order of layer backed views, then I would love to go that route, but I believe that's impossible based on my own and others' findings.
If I just can't get the performance I need by any means using an NSView, then it looks as if I will just have to tackle all the issues I have encountered trying to work with a layer hosting view and CALayers.
From what both of you are saying, it very much sounds as if I am just not going to be able to get the performance I need for decent animations by redrawing parts of an NSView when dealing with a large number of objects, and that the only solution is going to be the user of a layer hosting view and making things work with CALayer.
Ken
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden