Re: Reordering CALayer sublayers without raping my performance?
Re: Reordering CALayer sublayers without raping my performance?
- Subject: Re: Reordering CALayer sublayers without raping my performance?
- From: David Duncan <email@hidden>
- Date: Mon, 19 Nov 2007 01:49:29 -0800
On Nov 19, 2007, at 1:09 AM, Jonathan del Strother wrote:
Would you run that past me again? Changing the zPosition re-sorts
the sibling layers? In which case, is there any point in re-sorting
the child array to specify render order?
Whenever the zPosition of a layer changes, you have to sort the layers
(internally) for presentation, otherwise you wouldn't get the correct
visual effect. It doesn't sort the sublayers array, just the visual
order that the layers are rendered in (which if all layers have the
same zPosition is just the order in the sublayers array).
I'll test it out later, but I assume that CA is using a depth buffer
to make sure that higher zPositioned objects appear in front of
others, in which case the only time you need to worry about the
order of the child array ought to be if you're dealing with
transparent elements.
CA has no guarantees of having or not having transparent content. In
fact, the most common use for it (Appkit's layer based views) involves
considerable amounts of transparency (mostly for antialiasing, but
since the entire drawing model is supported arbitrary transparency has
to be supported as well).
Is there any way of re-sorting the child element array that doesn't
incur a huge performance & memory hit?
The alternative is what I said last time, to use the current
transaction to disable creating implicit animations.
--
David Duncan
Apple DTS Animation and Printing
email@hidden
_______________________________________________
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