On Oct 25, 2009, at 17:00, Graham Cox wrote:
I've found that caching to a PDF doesn't gain much performance wise - a little, but not that significant. Since a PDF essentially records whatever paths you create and rasterizes them, that's no surprise
Could well be, though it depends on whether PDF creation or rendering has any path optimizations built in.
I'm still guessing, but I think the big win in terms of performance -- before going to something like image caching -- is going to be:
a. Use NSBezierPath immutably. (Mutating NSBezierPath objects seems a *much* less common case, so I suspect the immutable cases are likely better optimized in the frameworks.)
b. Coalesce paths with the same drawing characteristics into a single NSBezierPath object, and keep such objects around (regenerating them only when edits are made). Unfortunately, the desired drawing order makes this a bit more complicated and less effective, but if we're talking about representing stitches made with a continuous length of thread, then it's likely that drawing order and drawing characteristics are fairly tightly linked. Also, it's really triple NSBezierPath objects, not single ones, because the whole point is to draw each thread with 3 paths, and that has drawing-order implications as well.
_______________________________________________ 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