> Combining paths into a single NSBezierPath means those paths are treated as a 
> single object for a drawing operation, and intersections are rendered 
> accordingly. However, this behaviour doesn't come at no cost - the code has 
> to find those intersections and deal with them by ensuring that the same 
> pixels are not rendered twice. While usually faster than looping over 
> separate paths, this intersection finding can potentially slows things down a 
> lot.

I'd be surprised if any non-trivial cases were faster as a single NSBezierPath, 
than multiple.  The cost of determining those intersections (or that there 
aren't any intersections) is quite high.  If your lines are 1.0 pixel or less 
wide, though, it uses a separate algorithm which is an order of magnitude or 
more faster.  Or at least it used to, at least up until Snow Leopard.

Keep in mind though that a lot of this cost is "once off", when you first draw 
a given NSBezierPath.  If you keep the NSBezierPath and draw with it multiple 
times, the subsequent renderings are much, much faster.  So do that if it makes 
sense for you.
_______________________________________________

Cocoa-dev mailing list ([email protected])

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

This email sent to [email protected]

Reply via email to