On Sep 10, 2008, at 2:49 AM, Niels Bogaards wrote:
In my app, I use Cocoa as application framework, Quartz as drawing
library and C++ for my general infrastructure and the app's specific
functionality. The three come together in this class :
Why do you feel the need to cache this context? Compared to drawing
its fairly cheap to refetch it every time your -drawRect: is called.
As an expression of the API, there is no guarantee that the context
you get is the same for every invocation of -drawRect:.
In the -(void)drawRect:(NSRect)aRect function of my NSViews, I get
this stored nativecontext and draw on it, doing a
CGContextSaveGState first, and a CGContextRestoreGState when I'm
done. Inside the drawRect, I clip to the aRect, using
CGContextClipToRect.
The drawing should already be clipped to the area of aRect, so you
shouldn't have to clip it yourself.
--
David Duncan
Apple DTS Animation and Printing
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden