On 11 Dec 2009, at 09:10, Michael Abendroth wrote:

> when drawing custom buttons, should you use NSBezierPath or NSImage instances?

Yes.

> Which is more efficient, performance-wise / memory-wise?

You probably don't need to worry too much about this on modern systems.  In 
fact, I'll go further than that: worrying too much about it is a mistake; 
caching and hardware acceleration make it quite difficult to state 
categorically that one is faster than the other, and changes in either of those 
areas at any point in the future may significantly alter the balance.  (e.g. 
Right now, enabling QuartzGL for your app is probably going to make quite a 
significant difference one way or another... see 
<http://developer.apple.com/mac/library/qa/qa2007/qa1536.html>.  Apple might 
even make that the default some day.)

The time to worry is if you discover that it's a performance problem in your 
application.  Then you can use Instruments et al to see where the bottleneck is 
and then decide what to do about it.

I'll add one more thing: using NSBezierPath means it's much easier to be 
resolution independent, but at the cost of making it slightly harder to achieve 
certain special effects.  There's been less talk about resolution independence 
recently, but high DPI displays are pretty much inevitable...

Kind regards,

Alastair.

-- 
http://alastairs-place.net



_______________________________________________

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