On 24/02/2008, at 5:14 AM, maxclass@... wrote: > Is it unreasonable to possibly Begin a CGContext for a window, > possibly the only one your app will have, and leave it in place for > all drawing and text until the window is closed or the app quits? I think it is probably a little risky (if not exactly unreasonable)... 1) All QuickDraw drawing is disabled when you call QDBeginCGContext. Can you guarantee that your not using any QD during the lifetime of your application? Can you guarantee none of the OS APIs you are calling do? (e.g. QuickTime uses lots of QuickDraw) 2) You can't nest calls to QDBeginCGContext on the same port. Can you guarantee that QDBeginCGContext is never being called on this GrafPort again by any of your or Apple's code? 3) The doco states that after you have finished drawing you should call QDEndCGContext. They probably don't mean just before you quit either. :-) By not following Apples usage pattern (which is really really simple) you risk possible pain, suffering and breakage in future OS releases. It may actually all work fine but it seems a little scary to me. > It seems that constantly beginning and ending CGContexts every > time you draw something or print text, etc. seems a little > redundant when you don't have to do that. That is definitely how Apple wants you to use the APIs. Are you seeing performance problems with the QDBeginCGContext/ QDEndCGContext calls? I used these calls a few years ago and from what I recall they were really really really fast (I could step over them in the blink of an eye inside the debugger). The doco states that QDBeginCGContext does internally cache the CGContext for the port so it certainly should be quick after the first call. Ross.