• 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: David Duncan <email@hidden>
  • Date: Fri, 16 Nov 2007 11:08:16 -0800

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. An alternative to try is disabling transactions while your rearranging the sublayers array, like this

[CATransaction begin];
[CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions];
// do your sublayer rearrangement here
[CATransaction commit];


Of course, if you ever plan to go for a 2.5D scene (ala Coverflow) then you will need to deal with zPosition, as the layer order isn't enough to get the correct appearance in that situation.
--
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


  • 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>)

  • Prev by Date: Re: IS-A relationships in core data
  • Next by Date: Re: IS-A relationships in core data
  • 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