Skip navigation.
 
mlRe: Reordering CALayer sublayers without raping my performance?
FROM : Jonathan del Strother
DATE : Mon Nov 19 10:09:28 2007

On 16 Nov 2007, at 19:08, David Duncan wrote:

> On Nov 16, 2007, at 10:54 AM, Jonathan del Strother wrote:
>

>> Hmm, you're right.
>>
>> Am I misreading this, or does the "Layer Geometry and Transforms" 
>> page tell me something completely different :
>> "The zPosition is intended to be used to set the visual position of 
>> the layer relative to its sibling layers. It should not be used to 
>> specify the order of layer siblings, instead reorder the layer in 
>> the sublayer array."

>
>
> Well, it is performing a sort when you set zPosition :). So it can 
> be more expensive than just reordering the sublayers array, 
> certainly so if you only have a 2D presentation.


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?

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.

Is there any way of re-sorting the child element array that doesn't 
incur a huge performance & memory hit?


Jonathan del Strother

Related mailsAuthorDate
mlReordering CALayer sublayers without raping my performance? Jonathan del Strot… Nov 16, 19:41
mlRe: Reordering CALayer sublayers without raping my performance? David Duncan Nov 16, 19:48
mlRe: Reordering CALayer sublayers without raping my performance? Jonathan del Strot… Nov 16, 19:54
mlRe: Reordering CALayer sublayers without raping my performance? David Duncan Nov 16, 20:08
mlRe: Reordering CALayer sublayers without raping my performance? Jonathan del Strot… Nov 19, 10:09
mlRe: Reordering CALayer sublayers without raping my performance? David Duncan Nov 19, 10:49
mlRe: Reordering CALayer sublayers without raping my performance? Jonathan del Strot… Nov 19, 11:02
mlRe: Reordering CALayer sublayers without raping my performance? Chris Ryland Nov 19, 19:56
mlRe: Reordering CALayer sublayers without raping my performance? Jonathan del Strot… Nov 22, 13:24