CGLayer and cached views
CGLayer and cached views
- Subject: CGLayer and cached views
- From: Scott Ellsworth <email@hidden>
- Date: Fri, 28 Apr 2006 15:11:28 -0700
If I have two NSView subclasses in the same window, will a CGLayerRef
from one NSView work as a source for the other?
My current design has a three by three matrix of colored thingies in
each NSView, with between three and 400 NSView subclasses on the
screen at once. (Depends on monitor size, and other stuff.) Thus, I
may have between 27 and 1200 thingies on the screen at once. All of
those thingies, though, are chosen from just five or six tiles.
I want to cache the five or so different tiles, so I can draw them
quickly. I have done this with an NSImage, and it is roughly twice
as fast as drawing it by hand. I am now trying out CGLayers, to see
how they perform in the same setup.
Ideally, I would create my five CGLayerRefs the first time I draw,
then re-use them.
According to Programming With Quartz, I should 'create my CGLayerRef
from the destination context'. If the context from one view will
work for another, then this can be done the first time through the
loop, and can be set up in a lazy fashion. Is this ok? (Doc ref
would be fine.)
Scott
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden