On Jul 26, 2011, at 7:13 AM, Graham Cox <graham....@bigpond.com> wrote:

> Anyway, what I've learned is that the z values need to be big, and probably 
> not terribly precise.

David Duncan's post in this thread seems relevant: 
http://www.cocoabuilder.com/archive/cocoa/193266-reordering-calayer-sublayers-without-raping-my-performance.html

>From the description given in the documentation, I would think that because CA 
>is sorting the layers based on sibling order and zPosition that it would be 
>possible to render a layer of zPosition=0 atop a nephew layer with 
>zPosition=1000.

But I can see why this would be difficult: Core Animation apparently applies 
the zPosition to the layer's GL quad. In order to support rendering zPosition=0 
atop zPosition=1000, it would need to maintain a copy of the depth buffer at 
each level of the layer. Rendering a layer would involve a depth test, then 
copying the depth buffer to be used when rendering the sublayers and discarding 
that depth buffer when done.

That's a *ton* of time- and memory-intensive copies.

This is a place where the abstraction leaks. I think the documentation should 
be updated to make it clearer that zPosition can't be used for general Quartz 
Transparency Layer type effects, which it seems to imply. We should also 
probably get a CALayerGroup layer class that *does* render all of its sublayers 
into a quad whose z position is equal to that of the CALayerGroup's zPosition 
property.

--Kyle Sluder_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to