Skip navigation.
 
mlRe: Reordering CALayer sublayers without raping my performance?
FROM : David Duncan
DATE : Fri Nov 16 19:48:12 2007

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

> I have a root CALayer with around 250 child layers.  Only 50 or so 
> are visible at a time, the rest have their opacity set to 0 (which 
> I've found to be far more performant that continuously removing and 
> adding child layers).
>
> Every 0.2 seconds, I want to move one of these child layers to be 
> drawn on the top of everything else.  I'm doing this by altering the 
> order of the root layer's sub layers.  I haven't been able to find 
> an acceptable way of doing this.  Everything I've tried will 
> continuously increase my virtual memory usage to ~3.5GB, before 
> dropping back to 1.1GB every 10 seconds or so.  While that drop 
> happens, my application performance drops massively, displaying a 
> frame a second at best, on a Mac Pro with 3GB RAM.



Use the zPosition property. All layers with a larger zPosition will be 
placed in front of those with a smaller one. The default value is 0.
--
David Duncan
Apple DTS Animation and Printing
david.<email_removed>

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