• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Reordering CALayer sublayers without raping my performance?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reordering CALayer sublayers without raping my performance?


  • Subject: Re: Reordering CALayer sublayers without raping my performance?
  • From: Chris Ryland <email@hidden>
  • Date: Mon, 19 Nov 2007 13:56:42 -0500

So, just to clarify for posterity, if you had turned off animation by using a transaction, it would have mostly or completely removed your slowdown?

On Nov 19, 2007, at 5:02 AM, Jonathan del Strother wrote:

On 19 Nov 2007, at 09:49, David Duncan wrote:

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.

Oooh, it's finally clicked that re-sorting the sublayers is an animated process. That would explain the memory usage pattern I was seeing, since I would have been created a lot of overlapping animations...


Thanks for clarifying that

Jon

_______________________________________________

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


Cheers! --Chris Ryland / Em Software, Inc. / www.emsoftware.com

_______________________________________________

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


  • Follow-Ups:
    • Re: Reordering CALayer sublayers without raping my performance?
      • From: Jonathan del Strother <email@hidden>
References: 
 >Reordering CALayer sublayers without raping my performance? (From: Jonathan del Strother <email@hidden>)
 >Re: Reordering CALayer sublayers without raping my performance? (From: David Duncan <email@hidden>)
 >Re: Reordering CALayer sublayers without raping my performance? (From: Jonathan del Strother <email@hidden>)
 >Re: Reordering CALayer sublayers without raping my performance? (From: David Duncan <email@hidden>)
 >Re: Reordering CALayer sublayers without raping my performance? (From: Jonathan del Strother <email@hidden>)
 >Re: Reordering CALayer sublayers without raping my performance? (From: David Duncan <email@hidden>)
 >Re: Reordering CALayer sublayers without raping my performance? (From: Jonathan del Strother <email@hidden>)

  • Prev by Date: Re: CTFrame and drawing text + layers.
  • Next by Date: Re: Custom text via Core Text in a layer.
  • Previous by thread: Re: Reordering CALayer sublayers without raping my performance?
  • Next by thread: Re: Reordering CALayer sublayers without raping my performance?
  • Index(es):
    • Date
    • Thread