Re: optimization time !
Re: optimization time !
- Subject: Re: optimization time !
- From: Enrique Zamudio <email@hidden>
- Date: Fri, 06 Jul 2001 21:07:29 -0500
- Organization: Nasoft
Are you paying attention to the rectangles passed to you in the
-drawRect: method of your view?
I think for better performance, you have to check if the rect passed is
the same as the bounds rect of your view, and then draw the whole thing;
if the rect is smaller, you only need to draw whatever will be visible
inside that rect.
I don't know if you are using NSBezierPath (my guess is that you are).
Are you using the class methods to draw lines, or are you using a
bezierpath instance and adding lines to it? That might slow things down,
since the bezierpath gets redrawn completely (that is, if you add a line
and then tell the path to draw, it will draw ALL the lines it has
instead of just the last one).
I'm not an expert but I've used the NSBezierPath a couple of times. I
don't even know if there is another interface to Quartz so you can draw
faster (I did some code in PostScript a while ago, back in the NextStep
days, and it was FAST).
eZL