Re: Cocoa graphics speed
Re: Cocoa graphics speed
- Subject: Re: Cocoa graphics speed
- From: Douglas Davidson <email@hidden>
- Date: Mon, 29 Sep 2003 16:26:48 -0700
On Monday, September 29, 2003, at 03:54 PM, Alastair J.Houghton wrote:
One way to speed up your code would be to create a real NSBezierPath
for the rectangle, and keep the path itself around.
Are you sure? I'm pretty certain that NSRectFill() is faster than
using an NSBezierPath to draw the same rectangle, even if you don't
create the NSBezierPath every time.
You can get quite a good performance increase (about 10 times) by
using NSRectFillList() rather than NSRectFill(), assuming that it's
possible to sort the rectangles by colour. If it isn't possible to do
that, then NSRectFillListWithColors() is still faster than
NSRectFill() by a fair margin.
At this level of optimization it might also be worthwhile to consider
using CG operations directly.
Douglas Davidson
_______________________________________________
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.