FROM : Scott Anguish
DATE : Wed Nov 28 19:43:03 2007
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?
DATE : Wed Nov 28 19:43:03 2007
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?
| Related mails | Author | Date |
|---|---|---|
| Neil Clayton | Nov 27, 23:39 | |
| Paul Goracke | Nov 28, 07:12 | |
| stephen joseph but… | Nov 28, 07:18 | |
| Paul Goracke | Nov 28, 08:02 | |
| stephen joseph but… | Nov 28, 08:33 | |
| Scott Anguish | Nov 28, 09:16 | |
| John Clayton | Nov 28, 11:21 | |
| Bill Dudney | Nov 28, 12:48 | |
| Paul Goracke | Nov 28, 16:34 | |
| Scott Anguish | Nov 28, 19:43 | |
| John Clayton | Nov 28, 22:33 | |
| Neil Clayton | Nov 29, 01:55 |






Cocoa mail archive

