CALayer renderInContext not rendering all sublayers
CALayer renderInContext not rendering all sublayers
- Subject: CALayer renderInContext not rendering all sublayers
- From: Christopher J Kemsley <email@hidden>
- Date: Sun, 13 Sep 2009 14:10:51 -0700
Hi all,
I've been unable to find anything on this through Google searches...
I'm building for x86_64 on Snow Leopard.
I have a window containing a view whose layer has two sublayers, set
up like this:
- (void) awakeFromNib {
[self setWantsLayer:YES] ;
points = [ [CALayer layer] retain ] ;
bindings = [ [CALayer layer] retain ] ;
[self.layer addSublayer:bindings] ;
[self.layer addSublayer:points] ;
}
Later, I add sublayers (sent via NSNotificationCenter) like this:
if ( [object isMemberOfClass:[TSBinding class]] )
{
[self.bindings addSublayer:object] ;
}
else
{
[self.points addSublayer:object] ;
}
Some time later, just after (also tried just before) the animations
start, I do this:
recorder = [CARecorder recorderWithLayer:self.layer destination:path
duration:[GSVariable cgfloatForKey:@"Duration"] frameRate:15.
delegate:self] ;
"CARecorder" is a class I made which spawns a thread and, at a regular
interval, tells the given layer's "presentationLayer" to render in a
local context, using the following code:
[self.layer.presentationLayer renderInContext:self.context];
(Note that the CARecorder has iVars "layer" and "context" that are set
during initialization. 'layer' corresponds to the layer sent to it in
initialization. Also note that it is not a problem of the context
being over-written repeatedly, as putting the context creation in the
thread's loop instead of initialization doesn't change anything)
However, when it draws, it only draws the top CALayer who's a subclass
of the main layer.
I recorded, using CaptureMe.app, the view as displayed on screen. I
put that video, the video produced by the code as well as the
CARecorder code online here: http://www.kd7qis.com/CARecorder_Help
Please take a look.
I'd greatly appreciate any help anyone could provide on how to get
this to draw/record/save both sublayers of this layer...
- Christopher
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden