Re: maintaining alpha value for intersecting lines?
Re: maintaining alpha value for intersecting lines?
- Subject: Re: maintaining alpha value for intersecting lines?
- From: 👾 <email@hidden>
- Date: Fri, 14 Sep 2012 22:37:57 -0700
> 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@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