Re: performance of NSBezierPath
Re: performance of NSBezierPath
- Subject: Re: performance of NSBezierPath
- From: Shawn Erickson <email@hidden>
- Date: Sun, 7 Apr 2002 09:17:55 -0700
On Sunday, April 7, 2002, at 08:30 AM, ruediger schmidt wrote:
Hi,
just tested the performance of NSBezierPath because I'm thinking about a
graphic app where polygons with a lot of points ( up to 20000 ) will be
common.
I did the testing with a NSBezierPaths with random points in the rang
0,200,0,300.
For paths with more then 1500 I had to wait more then 1 minute (G4, 400
MHz) and
even on a new dual G4 it was slow.
My question is: Did some one else had same results? Is there a pitfall
witch causes
this poor performance? Is there a easy way to improve performance
significantly beside using OpenGL witch gives good results?
If it's not my fault is there a chance that apple will fix this (bug)?
When you say "polygons" are you meaning shapes with straight lines
between an array of points? Or something more complex?
NSBezierPath is a very capable class (lines, curves, rounding, etc.) and
this may be causing the slow down you are seeing. It wouldn't be very
hard to define you own polygon class that keeps a ordered collection of
points and uses Quartz to draw them. This could skip some of the
overhead in NSBezierPath (not that someone might know how to better
utilize it).
Look up...
CGContextBeginPath
CGContextMoveToPoint
CGContextAddLineToPoint or CGContextAddLines
CGContextFillPath or CGContextStrokePath
<
http://developer.apple.com/techpubs/macosx/CoreTechnologies/graphics/Quartz2D/
quartz2d.html>
If the above doesn't improve things much then OpenGL may make sense.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.