Hi,

are you drawing ALL of your paths whenever the user scrolls or only the ones 
that are within the visible rect? If the first, you may try to change that to 
the second and gain lots of performance. I draw a sound wave view and when 
drawing all of it while zoomed into it, it is sllllooowww. But when I only draw 
what actually needs to be drawn, it is lightning fast.

With CoreAnimation: As soon as you have the image, you get fast drawing. 
Zooming, Size changes etc. may need a redraw of the image. Also, if the image 
is rather large, you'll need CATiledLayers otherwise your gpu memory may not be 
big enough to hold the image for the CALayer.

Volker

Am 10.03.2010 um 18:13 schrieb Mazen M. Abdel-Rahman:

> Hi All,
> 
> I was able to write a simple calendar view that uses basic cocoa graphics to 
> draw directly on the view (NSBezierPath, etc.).  I actually use several 
> different paths for drawing the calendar (it's a weekly calendar) to allow 
> different horizontal line widths (hour, half hour, etc.).  The calendar view 
> is inside a scroll view - and is actually about 3 times longer than the view 
> window.   The main problem is that the scrolling is not smooth - and my 
> assumption is that it's because the NSBezier stroke functions  have to be 
> constantly called to render the calendar.
> 
> For something as relatively simple as this would moving to core animation - 
> i.e. trying to render the calendar on a layer instead (I am still trying to 
> learn core animation) add performance benefits?  And would it allow for 
> smoother scrolling?
> 
_______________________________________________

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

Reply via email to