Re: Speed up drawing of View with multiple NSBezierPaths
Re: Speed up drawing of View with multiple NSBezierPaths
- Subject: Re: Speed up drawing of View with multiple NSBezierPaths
- From: Henry McGilton <email@hidden>
- Date: Sun, 6 Jul 2003 12:13:46 -0700
On Sunday, July 6, 2003, at 11:29 AM, Chuck Soper wrote:
"Cocoa Programming" (Anguish, Buck, and Yacktman) has a good
discussion on optimized drawing in Chapter 13, Custom Views and
graphics Part II. There are techniques to turn off caching or adjust
flatness to speed up drawing. I'm not sure where else a detailed
discussion of optimized drawing is. Anyone?
Depending on your application could you just reduce the number of
NSBezierPaths. For example, if you're drawing a thousand rectangles
with a thousand NSBezierPaths you should be able to draw a thousand
rectangles with one NSBezierPath. Yet, all of the rectangles will need
to have the same attributes (line width, color, etc.).
Not quite true. Check out the AppKit function
NSRectFillListWithColors and
NSRectFillListWithColorsUsingOperation (this second one for the
benefit of those who will not scroll down half a page)
Chuck
At 9:38 AM -0500 7/6/03, Jeff Skrysak wrote:
I'm working on some software that draws, in a small NSQuickDrawView, a
lot
of NSBezierPaths. So many, it gets quite slow.
Does anyone know of possible "generic" optimizations I can make to
speed
things up? Generic meaning things that don't have to do with making
the
algorithms
themselves, but with the paths or view(s). Settings, etc...
I guess it's kind of a hard question, but I do know that the function:
- (BOOL)isOpaque
{
return YES;
}
Is a good place to start, and is one example of the kind of thing I am
looking for.
(that function above goes in the view's code, and was mentioned in
Apple's
DotView example)
You might wish to describe in somewhat more detail what you are trying
to
achieve.
Best Wishes,
........ Henry
===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden |
http://www.trilithon.com
|
===============================+============================
_______________________________________________
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.