On 11/29/05 5:10 PM, Mike Kluev didst favor us with:
>>> The system caches the CGContextRef between calls to
>>> QDBeginCGContext. Calling it repeatedly on the same port is a low-
>>> overhead operation.
>>
>> No, I haven't profiled it, but I'm pretty sure that not calling this code at
>> all is more efficient than calling it repeatedly. Is that an evil
>> assumption?
>
> It's not calling it repeatedly vs. not calling it at all. It is
> either calling QDBeginCGContext/QDEndCGContext repeatedly vs.
> calling CGContextSaveGState/ClipContextToCurrentClipRect/
> CGContextRestoreGState repeatedly. I assume the latter is less
> overhead, and this is assumption (evil or not) - I haven't
> profiled it.
True, although in many of my drawing callbacks I'm doing other stuff that
requires the calls to CGContextSaveGState/CGContextRestoreGState anyway, so
the difference would then just be the clipping call. FWIW, I just did some
testing and in the DataBrowser where I just tried this, eliminating the
CGContextSaveGState/CGContextRestoreGState had no effect, so I don't appear
to even need those at all in some cases. Interesting.
Most important though, is the fact that the clipping stuff isn't needed in
Tiger as they fixed the problem in Tiger. So if you require Tiger it really
is as I said: get the context once or get it in every call to your callback.
Larry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden