Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CALayer - delegate not being called?



THAT is a nice explanation Scott. That particular separation between layer compositing attributes and the actual 'contents' itself wasn't something that was really at the forefront of my thought there... thanks for that.

Now it makes more sense... the delegates are *only* used when getting the contents property - and thats it. Specifically, they are not called when any animation properties are being interpolated or compositing is being performed.

Enlightenment... the 'bing' feeling... aaaahhhhhhhhh euphoria.  Ta

--
john

On 28/11/2007, at 7:43 PM, Scott Anguish wrote:

Well, it isn't quite the same.. not drawing, but compositing.

The border is a style attribute (and is an animatable property). All animatable properties are applied by the render-tree when the layer is displayed in the UI. So they get composited when you change the values via the implied animation (unless of course that has been disabled for the transaction in which case they still will update and draw, but without interpolating the values from the current value to the new value).

You can imagine that if the content was redrawn (by the delegate) every time a value changed and animated (so potentially hundreds of times for a single animation) that you'd lose most of the advantages of Core Animation.

Regardless, animatable properties are not aren't cached and are separate from the content caching process.

You don't have to, and should not, call setNeedsDisplay for any layers that do not have a delegate that provides the content. This will create a content cache and cause more memory to be used for the cached content. For larger empty layers that are used only to contain other layers it is unnecessary.

I'll spend some time clarifying this in the Core Animation Programming Guide in both the Providing Layer Content and Layer Style Properties chapters.


On Nov 28, 2007, at 5:21 AM, John Clayton wrote:

Hi Scott,

But Neil is saying that the border of the layer is visible, thus the layer must be drawing itself at some point already, right?


_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >CALayer - delegate not being called? (From: Neil Clayton <email@hidden>)
 >Re: CALayer - delegate not being called? (From: Paul Goracke <email@hidden>)
 >Re: CALayer - delegate not being called? (From: "stephen joseph butler" <email@hidden>)
 >Re: CALayer - delegate not being called? (From: Scott Anguish <email@hidden>)
 >Re: CALayer - delegate not being called? (From: John Clayton <email@hidden>)
 >Re: CALayer - delegate not being called? (From: Scott Anguish <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.