On 11/12/2009, at 8:59 PM, Alastair Houghton wrote:

> Anyway, the thing to do is to draw what you want, and then *if* it's going 
> too slowly there are various things you can do to speed it up (like caching 
> any expensive rendering in an NSImage, doing reduced or simplified rendering 
> during live resize and so on).


It's also worth considering looking at Core Animation Layers, depending on what 
you're drawing. I have a custom view with several objects that are expensive to 
draw, and what I am now doing is drawing them into CALayers. Because these are 
cached to the GPU, there is virtually no cost to dragging the objects around as 
the only time they need to be redrawn is when the content of the objects 
changes.

Since my objects are overlaid on a large image background (at least 1000 x 
1000), drawing was very expensive before I did this as the image needed to be 
redrawn any time the view content changed. With CALayers it is only drawn once.

--
Rob Keniger



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to